赵冬冬 4 年 前
コミット
92b3a604c9

+ 148 - 150
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/controller/UploadCompanyInfoAndProductController.java

@@ -59,7 +59,6 @@ public class UploadCompanyInfoAndProductController {
     private UploadFileUtil uploadFileUtil;
 
 
-
     @Value("${qiniu.path}")
     private String url;
 
@@ -68,38 +67,38 @@ public class UploadCompanyInfoAndProductController {
 
     @ApiOperation("上传文件")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "paths",value = "文件路径",required = true),
-            @ApiImplicitParam(name = "type",value = "上传类型",required = true,allowableValues = "1,2,3"),
-            @ApiImplicitParam(name = "compName",value = "公司名称",required = false)
+            @ApiImplicitParam(name = "paths", value = "文件路径", required = true),
+            @ApiImplicitParam(name = "type", value = "上传类型", required = true, allowableValues = "1,2,3"),
+            @ApiImplicitParam(name = "compName", value = "公司名称", required = false)
     })
     @PostMapping("/upload")
-    public CommonResult readFile(@RequestParam(value = "paths")String paths, @RequestParam(value = "type")String type, @RequestParam(value = "compName",required = false)String compName){
+    public CommonResult readFile(@RequestParam(value = "paths") String paths, @RequestParam(value = "type") String type, @RequestParam(value = "compName", required = false) String compName) {
 
-        if ("1".equals(type)){
+        if ("1".equals(type)) {
             String filepath = paths;//D盘下的file文件夹的目录
             List<String> file = getDirectory(filepath);
             List<ForestPath> list = new ArrayList<>();
-            file.stream().forEach(item->{
+            file.stream().forEach(item -> {
                 ForestPath forestPath = new ForestPath();
                 forestPath.setCompanyName(item);
-                forestPath.setPath(filepath+"\\"+item);
+                forestPath.setPath(filepath + "\\" + item);
                 forestPath.setType("1");
                 System.out.println(item);
                 list.add(forestPath);
             });
-            for (ForestPath path:list){
+            for (ForestPath path : list) {
                 return excelPut(path);
             }
-        }else if ("2".equals(type)){
+        } else if ("2".equals(type)) {
             ForestPath fs = new ForestPath();
             fs.setCompanyName(compName);
             fs.setPath(paths);
-            return  excelPut(fs);
-        }else if ("3".equals(type)){
+            return excelPut(fs);
+        } else if ("3".equals(type)) {
             ForestPath fs = new ForestPath();
-            fs.setPath(paths+"\\"+compName);
+            fs.setPath(paths + "\\" + compName);
             fs.setCompanyName(compName);
-            return  excelPut(fs);
+            return excelPut(fs);
         }
 
         return CommonResult.success();
@@ -108,43 +107,43 @@ public class UploadCompanyInfoAndProductController {
 
     /**
      * 上传公司的excel
+     *
      * @param forestPath
      */
-    public CommonResult excelPut(ForestPath forestPath){
+    public CommonResult excelPut(ForestPath forestPath) {
         String company = forestPath.getCompanyName();
 
 
         List<String> strings = getDirectory(forestPath.getPath());
         List<String> excel = getFile(forestPath.getPath());
-        for (String path:excel) {
-            if (path.endsWith(".xlsx")){
-                company = addCompanyInfo(new File(forestPath.getPath()+"\\"+path),company);
-                System.out.println("供应商导入表格--"+path);
+        for (String path : excel) {
+            if (path.endsWith(".xlsx")) {
+                company = addCompanyInfo(new File(forestPath.getPath() + "\\" + path), company);
+                System.out.println("供应商导入表格--" + path);
             }
         }
-        if (StringUtils.isEmpty(company)){
+        if (StringUtils.isEmpty(company)) {
             return CommonResult.failed("导表失败");
         }
         Long companyId = companyId(company);
         List<ForestPath> list = new ArrayList<>();
-        for (String str:strings) {
+        for (String str : strings) {
             ForestPath forestPath1 = new ForestPath();
             forestPath1.setType("2");
-            forestPath1.setPath(forestPath.getPath()+"\\"+str);
+            forestPath1.setPath(forestPath.getPath() + "\\" + str);
             forestPath1.setCompanyName(str);
             list.add(forestPath1);
 
         }
-        for (ForestPath p:list) {
-            if ("产品".equals(p.getCompanyName())){
-                addProductImg(p,company,companyId);
-            }else if ("供应商".equals(p.getCompanyName())){
-                addCompanyImg(p,company,companyId);
-            }
-            else if ("生产地".equals(p.getCompanyName())){
-                addOriginImg(p,company,companyId);
-            }else {
-                System.out.println("没有对应文件夹的处理方式---"+p.getCompanyName());
+        for (ForestPath p : list) {
+            if ("产品".equals(p.getCompanyName())) {
+                addProductImg(p, company, companyId);
+            } else if ("供应商".equals(p.getCompanyName())) {
+                addCompanyImg(p, company, companyId);
+            } else if ("生产地".equals(p.getCompanyName())) {
+                addOriginImg(p, company, companyId);
+            } else {
+                System.out.println("没有对应文件夹的处理方式---" + p.getCompanyName());
             }
         }
         return CommonResult.success();
@@ -154,13 +153,14 @@ public class UploadCompanyInfoAndProductController {
 
     @Autowired
     private UmsCompanyFileMapper umsCompanyFileMapper;
-    public void addCompanyImg(ForestPath forestPath,String companyName,Long companyId){
+
+    public void addCompanyImg(ForestPath forestPath, String companyName, Long companyId) {
         String path = forestPath.getPath();
         List<String> file = getFile(path);
-        String br = "0/3/"+companyId+"/";
+        String br = "0/3/" + companyId + "/";
         int i = 0;
         List<UmsCompanyFile> files = new ArrayList<>();
-        for (String str:file){
+        for (String str : file) {
             String s = OrderNo.NextOrderNo();
             UmsCompanyFile infoFile = new UmsCompanyFile();
             infoFile.setUpdateTime(new Date());
@@ -169,34 +169,34 @@ public class UploadCompanyInfoAndProductController {
             String imgName = br + s;
             str = str.toLowerCase();
             String[] split = str.split("\\.");
-            imgName=imgName+"."+split[1];
+            imgName = imgName + "." + split[1];
             String filePath = path + "\\" + str;
-            infoFile.setFileUrl(url+imgName);
-            if (str.contains("公众号二维码")){
+            infoFile.setFileUrl(url + imgName);
+            if (str.contains("公众号二维码")) {
                 infoFile.setFileType("qrl");
-                uploadFileUtil.uploadLocalFile(filePath,imgName);
-            }else if (str.contains("logo")){
+                uploadFileUtil.uploadLocalFile(filePath, imgName);
+            } else if (str.contains("logo")) {
                 infoFile.setFileType("logo");
-                uploadFileUtil.uploadLocalFile(filePath,imgName);
+                uploadFileUtil.uploadLocalFile(filePath, imgName);
 
-            }else if (str.contains("供应商资质")){
+            } else if (str.contains("供应商资质")) {
                 infoFile.setFileType("cert");
-                uploadFileUtil.uploadLocalFile(filePath,imgName);
+                uploadFileUtil.uploadLocalFile(filePath, imgName);
 
 
-            }else if (str.contains("供应商图片")){
+            } else if (str.contains("供应商图片")) {
                 infoFile.setFileType("company");
-                uploadFileUtil.uploadLocalFile(filePath,imgName);
-            }else{
-                i=1;
+                uploadFileUtil.uploadLocalFile(filePath, imgName);
+            } else {
+                i = 1;
                 System.err.println("没有对应的照片");
             }
 
-            if (i==0){
+            if (i == 0) {
                 infoFile.setCreateTime(new Date());
                 umsCompanyFileMapper.insertSelective(infoFile);
             }
-            i=0;
+            i = 0;
         }
 
     }
@@ -204,8 +204,9 @@ public class UploadCompanyInfoAndProductController {
 
     @Autowired
     private UmsCompanyInfoMapper umsCompanyInfoMapper;
-    public Long companyId(String compName){
-        if (StringUtils.isEmpty(compName)){
+
+    public Long companyId(String compName) {
+        if (StringUtils.isEmpty(compName)) {
             return null;
         }
         UmsCompanyInfoExample example = new UmsCompanyInfoExample();
@@ -213,45 +214,45 @@ public class UploadCompanyInfoAndProductController {
         criteria.andCompNameEqualTo(compName);
         example.setOrderByClause("create_time desc");
         List<UmsCompanyInfo> umsCompanyInfos = umsCompanyInfoMapper.selectByExample(example);
-        if (umsCompanyInfos != null && umsCompanyInfos.size()>0){
+        if (umsCompanyInfos != null && umsCompanyInfos.size() > 0) {
             return umsCompanyInfos.get(0).getId();
-        }else {
+        } else {
             return null;
         }
     }
 
-    public void addOriginImg(ForestPath forestPath,String companyName,Long companyId){
+    public void addOriginImg(ForestPath forestPath, String companyName, Long companyId) {
 
         List<String> file = getFile(forestPath.getPath());
 
-        if (file != null &&file.size()>0){
+        if (file != null && file.size() > 0) {
 
             Long aLong = originId(companyName, null);
-            if (aLong == null){
-                System.err.println("添加图片失败--"+forestPath.getPath());
+            if (aLong == null) {
+                System.err.println("添加图片失败--" + forestPath.getPath());
                 return;
-            }else {
-                addImg(file,forestPath.getPath() ,aLong);
+            } else {
+                addImg(file, forestPath.getPath(), aLong);
 
             }
             return;
         }
         List<String> list = getDirectory(forestPath.getPath());
         List<UmsMemberOrigin> origin = origin(companyName);
-        if (list == null ||origin == null || origin.size()<list.size()){
+        if (list == null || origin == null || origin.size() < list.size()) {
             return;
         }
-        if (list != null && list.size()>0){
-            for (int i =0;i<list.size();i++) {
+        if (list != null && list.size() > 0) {
+            for (int i = 0; i < list.size(); i++) {
                 Long aLong = origin.get(i).getId();
-                String str= list.get(i);
-                if (aLong != null){
+                String str = list.get(i);
+                if (aLong != null) {
                     List<String> file1 = getFile(forestPath.getPath() + "\\" + str);
-                    if (file1 != null&&file1.size()>0){
-                        addImg(file1,forestPath.getPath() + "\\" + str,aLong);
+                    if (file1 != null && file1.size() > 0) {
+                        addImg(file1, forestPath.getPath() + "\\" + str, aLong);
                     }
-                }else {
-                    System.err.println("找不到对应的文件--"+str);
+                } else {
+                    System.err.println("找不到对应的文件--" + str);
 
                 }
             }
@@ -259,22 +260,23 @@ public class UploadCompanyInfoAndProductController {
 
 
     }
+
     //生产地图片
-    public void addImg(List<String> file,String path,Long aLong){
-        String br = "0/1/"+aLong+"/";
+    public void addImg(List<String> file, String path, Long aLong) {
+        String br = "0/1/" + aLong + "/";
         UmsMemberOrigin u = new UmsMemberOrigin();
         u.setId(aLong);
         StringBuffer bu = new StringBuffer();
-        for(int i=0;i<file.size();i++){
+        for (int i = 0; i < file.size(); i++) {
             String oldFileName = file.get(i);
             String s = OrderNo.NextOrderNo();
             String[] split = oldFileName.split("\\.");
-            String fileName = br + s+split[1];
-            uploadFileUtil.uploadLocalFile(path + "\\"+oldFileName,fileName);
-            if (i>0){
-                bu.append(","+url+fileName);
-            }else {
-                bu.append(url+fileName);
+            String fileName = br + s + "." + split[1];
+            uploadFileUtil.uploadLocalFile(path + "\\" + oldFileName, fileName);
+            if (i > 0) {
+                bu.append("," + url + fileName);
+            } else {
+                bu.append(url + fileName);
             }
         }
         u.setImgUrl(bu.toString());
@@ -282,28 +284,29 @@ public class UploadCompanyInfoAndProductController {
     }
 
     @Autowired
-    private UmsMemberOriginMapper  umsMemberOriginMapper;
-    public Long originId(String compName,String originName){
-        if (StringUtils.isEmpty(compName)){
+    private UmsMemberOriginMapper umsMemberOriginMapper;
+
+    public Long originId(String compName, String originName) {
+        if (StringUtils.isEmpty(compName)) {
             return null;
         }
         UmsMemberOriginExample example = new UmsMemberOriginExample();
         UmsMemberOriginExample.Criteria criteria = example.createCriteria();
         criteria.andCompNameEqualTo(compName);
-        if (!StringUtils.isEmpty(originName)){
+        if (!StringUtils.isEmpty(originName)) {
             criteria.andOriginNameEqualTo(originName);
         }
 
         example.setOrderByClause("id desc");
         List<UmsMemberOrigin> umsMemberOrigins = umsMemberOriginMapper.selectByExample(example);
-        if (umsMemberOrigins != null&&umsMemberOrigins.size()>0){
+        if (umsMemberOrigins != null && umsMemberOrigins.size() > 0) {
             return umsMemberOrigins.get(0).getId();
         }
         return null;
     }
 
-    public List<UmsMemberOrigin> origin(String compName){
-        if (StringUtils.isEmpty(compName)){
+    public List<UmsMemberOrigin> origin(String compName) {
+        if (StringUtils.isEmpty(compName)) {
             return null;
         }
         UmsMemberOriginExample example = new UmsMemberOriginExample();
@@ -317,14 +320,14 @@ public class UploadCompanyInfoAndProductController {
     }
 
 
-    public void addProductImg(ForestPath forestPath,String companyName,Long companyId){
+    public void addProductImg(ForestPath forestPath, String companyName, Long companyId) {
         List<String> directory = getDirectory(forestPath.getPath());
-        if (listAll != null || listAll.size()<1){
+        if (listAll != null || listAll.size() < 1) {
             log.info("好像没有数据哦");
         }
-        for (PmsProductParam  pms:listAll) {
-            if (directory.contains(pms.getProductNo())){
-                updateFile(forestPath.getPath(),pms.getId(),pms.getProductNo());
+        for (PmsProductParam pms : listAll) {
+            if (directory.contains(pms.getProductNo())) {
+                updateFile(forestPath.getPath(), pms.getId(), pms.getProductNo());
             }
         }
 //        List<PmsProduct> products = selectProduct(companyName);
@@ -335,51 +338,47 @@ public class UploadCompanyInfoAndProductController {
 //        }
 
 
-
-
     }
 
     @Test
-    public void productImg(){
+    public void productImg() {
 //        List<String> directory = getDirectory(forestPath.getPath());
 //        Long aLong = companyId(companyName);
         List<String> directory = getDirectory("D:\\developerUtil\\code\\hwrj\\forest\\到数据\\上传\\石阡县猫寨农林专业合作社\\产品");
         List<PmsProduct> products = selectProduct("石阡县猫寨农林专业合作");
-        if (products != null&&directory != null&& products.size()>0&&directory.size()>0&&products.size()==directory.size()){
-            for (int i = 0;i<directory.size();i++){
-                updateFile("D:\\developerUtil\\code\\hwrj\\forest\\到数据\\上传\\石阡县猫寨农林专业合作社\\产品",products.get(i).getId(),directory.get(i));
+        if (products != null && directory != null && products.size() > 0 && directory.size() > 0 && products.size() == directory.size()) {
+            for (int i = 0; i < directory.size(); i++) {
+                updateFile("D:\\developerUtil\\code\\hwrj\\forest\\到数据\\上传\\石阡县猫寨农林专业合作社\\产品", products.get(i).getId(), directory.get(i));
             }
         }
 
 
-
-
     }
 
 
-    public void updateFile(String path,Long along,String str){
+    public void updateFile(String path, Long along, String str) {
         String upPath = path + "\\" + str;
-        String br = "0/2/"+along+"/";
+        String br = "0/2/" + along + "/";
         List<String> file = getFile(upPath);
-        if (file != null && file.size()>0){
+        if (file != null && file.size() > 0) {
             PmsProduct p = new PmsProduct();
             p.setId(along);
             StringBuilder builder = new StringBuilder();
-            for (String s:file) {
-                String fs = br+OrderNo.NextOrderNo();
+            for (String s : file) {
+                String fs = br + OrderNo.NextOrderNo();
                 String[] split = s.split("\\.");
                 fs = fs + "." + split[1];
-                uploadFileUtil.uploadLocalFile(upPath+"\\"+s,fs);
-                if (s.contains("首图")){
-                    p.setPic(url+fs);
-                }else {
-                    builder.append(url+fs+",");
+                uploadFileUtil.uploadLocalFile(upPath + "\\" + s, fs);
+                if (s.contains("首图")) {
+                    p.setPic(url + fs);
+                } else {
+                    builder.append(url + fs + ",");
                 }
             }
             String st = null;
-            if (!StringUtils.isEmpty(builder.toString())){
-                String s =builder.toString();
-                st = s.substring(0,s.lastIndexOf(","));
+            if (!StringUtils.isEmpty(builder.toString())) {
+                String s = builder.toString();
+                st = s.substring(0, s.lastIndexOf(","));
             }
             p.setAlbumPics(st);
             pmsProductMapper.updateByPrimaryKeySelective(p);
@@ -390,7 +389,8 @@ public class UploadCompanyInfoAndProductController {
 
     @Autowired
     private PmsProductMapper pmsProductMapper;
-    public List<PmsProduct> selectProduct(String companyName){
+
+    public List<PmsProduct> selectProduct(String companyName) {
         PmsProductExample pms = new PmsProductExample();
         PmsProductExample.Criteria criteria = pms.createCriteria();
 
@@ -402,13 +402,13 @@ public class UploadCompanyInfoAndProductController {
         return pmsProducts;
     }
 
-    public List<String> getDirectory(String path){
+    public List<String> getDirectory(String path) {
         List<String> paths = new ArrayList<>();
         File file = new File(path);//File类型可以是文件也可以是文件夹
         File[] fileList = file.listFiles();//将该目录下的所有文件放置在一个File类型的数组中
         for (int j = 0; j < fileList.length; j++) {
             File f = fileList[j];
-            if (f.isDirectory()){
+            if (f.isDirectory()) {
                 paths.add(f.getName());
             }
         }
@@ -416,20 +416,20 @@ public class UploadCompanyInfoAndProductController {
 
     }
 
-    public List<String> getFile(String path){
+    public List<String> getFile(String path) {
         List<String> paths = new ArrayList<>();
         File file = new File(path);//File类型可以是文件也可以是文件夹
         File[] fileList = file.listFiles();//将该目录下的所有文件放置在一个File类型的数组中
         for (int j = 0; j < fileList.length; j++) {
             File f = fileList[j];
-            if (f.isFile()){
+            if (f.isFile()) {
                 paths.add(f.getName());
             }
         }
         return paths;
     }
 
-    public String addCompanyInfo(File pdf,String companyName){
+    public String addCompanyInfo(File pdf, String companyName) {
         try {
 //                    File pdf = fileList[i];
             System.out.println(pdf.getPath());
@@ -438,13 +438,13 @@ public class UploadCompanyInfoAndProductController {
             MultipartFile multipartFile = new MockMultipartFile(pdf.getName(), pdf.getName(),
                     ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
 //                        String url = ossFileUtils.upload(multipartFile.getOriginalFilename(), multipartFile);
-            String name = importExcel(multipartFile,companyName);
+            String name = importExcel(multipartFile, companyName);
             return name;
         } catch (Exception e) {
             System.out.println(e.getMessage());
 
         }
-        return  null;
+        return null;
 
     }
 
@@ -455,16 +455,15 @@ public class UploadCompanyInfoAndProductController {
     private UmsMemberOriginService umsMemberOriginService;
 
 
-
     @Transactional(rollbackFor = Exception.class)
-    public String importExcel(MultipartFile file,String companyName)throws Exception{
+    public String importExcel(MultipartFile file, String companyName) throws Exception {
 
         //导入公司
         String companyId = null;
         List<UmsCompanyInfoExcel> listAll = new ArrayList<>();
-        List<Object> list = EasyExcelUtil.readExcel(file, new UmsCompanyInfoExcel(),1,2);
-        if(list != null && list.size() > 0){
-            for(Object o : list){
+        List<Object> list = EasyExcelUtil.readExcel(file, new UmsCompanyInfoExcel(), 1, 2);
+        if (list != null && list.size() > 0) {
+            for (Object o : list) {
                 UmsCompanyInfoExcel umsCompanyInfoExcel = (UmsCompanyInfoExcel) o;
                 umsCompanyInfoExcel.setCreateId(0l);
                 companyId = umsCompanyInfoExcel.getCompName();
@@ -473,11 +472,11 @@ public class UploadCompanyInfoAndProductController {
         }
         umsCompanyService.importExcel(listAll);
 
-        if (StringUtils.isEmpty(companyId)){
+        if (StringUtils.isEmpty(companyId)) {
             return null;
         }
         //导入生产地
-        importOriginExcel(file,companyId);
+        importOriginExcel(file, companyId);
 
         //导入商品
         importBasic(file);
@@ -489,18 +488,18 @@ public class UploadCompanyInfoAndProductController {
     @Autowired
     private ImportExcelEventListener importExcelEventListener;
 
-    public void importOriginExcel(MultipartFile file,String companyName){
+    public void importOriginExcel(MultipartFile file, String companyName) {
         List<UmsMemberOriginExcel> listAll = new ArrayList<>();
-        if(file != null){
+        if (file != null) {
             List<Object> list = null;
             try {
-                list = EasyExcelUtil.readExcel(file, new UmsMemberOriginExcel(),2,2);
+                list = EasyExcelUtil.readExcel(file, new UmsMemberOriginExcel(), 2, 2);
             } catch (IOException e) {
                 //e.printStackTrace();
-                throw new GlobalException(1,"上传文件错误!");
+                throw new GlobalException(1, "上传文件错误!");
             }
-            if(list != null && list.size() > 0){
-                for(Object obj : list){
+            if (list != null && list.size() > 0) {
+                for (Object obj : list) {
                     UmsMemberOriginExcel excel = (UmsMemberOriginExcel) obj;
                     excel.setCreateId(1);
                     excel.setState(0);
@@ -510,20 +509,20 @@ public class UploadCompanyInfoAndProductController {
             }
         }
         int saveNum = 0;
-        if (listAll != null && listAll.size() > 0){
+        if (listAll != null && listAll.size() > 0) {
             int batchNum = 500;
-            if (listAll.size() > batchNum){
-                List<UmsMemberOriginExcel> list = listAll.subList(0,batchNum);
+            if (listAll.size() > batchNum) {
+                List<UmsMemberOriginExcel> list = listAll.subList(0, batchNum);
                 saveNum = umsMemberOriginService.batchSave(list);
                 //if (saveNum > 0){ //存在前面数据已存在情况
                 //异步导入
-                importExcelEventListener.batchSaveOriginExcel(listAll.subList(batchNum,listAll.size()));
+                importExcelEventListener.batchSaveOriginExcel(listAll.subList(batchNum, listAll.size()));
                 log.info("正在导入数据,请稍后刷新!");
                 //}
             }
             saveNum = umsMemberOriginService.batchSave(listAll);
-            if (saveNum < 1){
-                log.info ("导入数据已存在,请勿重复导入");
+            if (saveNum < 1) {
+                log.info("导入数据已存在,请勿重复导入");
             }
         }
 
@@ -553,27 +552,27 @@ public class UploadCompanyInfoAndProductController {
 
 
         listAll = new ArrayList<>();
-        if(file != null){
+        if (file != null) {
             List<Object> list = null;
             try {
-                list = EasyExcelUtil.readExcel(file, new PmsProductExcel(),3,2);
+                list = EasyExcelUtil.readExcel(file, new PmsProductExcel(), 3, 2);
             } catch (IOException e) {
                 //e.printStackTrace();
-                throw new GlobalException(1,"上传文件错误!");
+                throw new GlobalException(1, "上传文件错误!");
             }
-            if(list != null && list.size() > 0){
-                for(Object obj : list){
+            if (list != null && list.size() > 0) {
+                for (Object obj : list) {
                     PmsProductExcel excel = (PmsProductExcel) obj;
                     PmsProductParam pmsProductParam = addData(excel);
                     listAll.add(pmsProductParam);
                 }
             }
         }
-        List<PmsBrand> bandlist=new ArrayList<>();
+        List<PmsBrand> bandlist = new ArrayList<>();
         log.info("开始插入品牌数据");
         List<String> BandNames = listAll.stream().map(PmsProductParam::getBrandName).distinct().collect(Collectors.toList());
         for (String bandName : BandNames) {
-            PmsBrand pmsBrand =new PmsBrand();
+            PmsBrand pmsBrand = new PmsBrand();
             pmsBrand.setName(bandName);
             pmsBrand.setFirstLetter(ChineseCharToEn.getAllFirstLetter(bandName));
             pmsBrand.setShowStatus(1);
@@ -584,23 +583,24 @@ public class UploadCompanyInfoAndProductController {
             pmsBrand.setCreateTime(new Date());
             bandlist.add(pmsBrand);
         }
-        if(BandNames.size()>0){
+        if (BandNames.size() > 0) {
             productExcelDao.saveBrandData(bandlist);
         }
         log.info("开始插入商品数据");
-        if(listAll.size()>0){
+        if (listAll.size() > 0) {
             log.info(JSONObject.toJSONString(listAll));
             productExcelDao.saveData(listAll);
         }
         List<String> compNames = listAll.stream().map(PmsProductParam::getUmsCompanyInfo).distinct().collect(Collectors.toList());
-        if(compNames.size()>0){
+        if (compNames.size() > 0) {
             //更新大小类以及品牌生产地
             updateProductType(compNames);
         }
 
     }
+
     //更新大小类
-    public void updateProductType(List<String> compName){
+    public void updateProductType(List<String> compName) {
         productExcelDao.updateBrand(compName);
         productExcelDao.updateBigType(compName);
         productExcelDao.updateSimType(compName);
@@ -609,8 +609,6 @@ public class UploadCompanyInfoAndProductController {
     }
 
 
-
-
     private PmsProductParam addData(PmsProductExcel pmsProductExcel) {
 
         PmsProductParam pmsProductParam = new PmsProductParam();