赵冬冬 4 éve
szülő
commit
c42e8e01b4

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 341 - 279
api/林产品信息发布平台.postman_collection.json


+ 18 - 9
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/controller/UploadCompanyInfoAndProductController.java

@@ -166,23 +166,27 @@ public class UploadCompanyInfoAndProductController {
             infoFile.setUpdateTime(new Date());
             infoFile.setCompId(companyId(companyName));
             infoFile.setFileStatus(0);
-            infoFile.setFileUrl(url+br+s);
+            String imgName = br + s;
             str = str.toLowerCase();
+            String[] split = str.split("\\.");
+            imgName=imgName+"."+split[1];
+            String filePath = path + "\\" + str;
+            infoFile.setFileUrl(url+imgName);
             if (str.contains("公众号二维码")){
                 infoFile.setFileType("qrl");
-                uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
+                uploadFileUtil.uploadLocalFile(filePath,imgName);
             }else if (str.contains("logo")){
                 infoFile.setFileType("logo");
-                uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
+                uploadFileUtil.uploadLocalFile(filePath,imgName);
 
             }else if (str.contains("供应商资质")){
                 infoFile.setFileType("cert");
-                uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
+                uploadFileUtil.uploadLocalFile(filePath,imgName);
 
 
             }else if (str.contains("供应商图片")){
                 infoFile.setFileType("company");
-                uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
+                uploadFileUtil.uploadLocalFile(filePath,imgName);
             }else{
                 i=1;
                 System.err.println("没有对应的照片");
@@ -255,19 +259,22 @@ public class UploadCompanyInfoAndProductController {
 
 
     }
-
+    //生产地图片
     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++){
+            String oldFileName = file.get(i);
             String s = OrderNo.NextOrderNo();
-            uploadFileUtil.uploadLocalFile(path+"\\"+file.get(i),br+s);
+            String[] split = oldFileName.split("\\.");
+            String fileName = br + s+split[1];
+            uploadFileUtil.uploadLocalFile(path + "\\"+oldFileName,fileName);
             if (i>0){
-                bu.append(","+url+br+s);
+                bu.append(","+url+fileName);
             }else {
-                bu.append(url+br+s);
+                bu.append(url+fileName);
             }
         }
         u.setImgUrl(bu.toString());
@@ -360,6 +367,8 @@ public class UploadCompanyInfoAndProductController {
             StringBuilder builder = new StringBuilder();
             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);

+ 1 - 1
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/dao/PmsProductCategoryDao.java

@@ -17,5 +17,5 @@ public interface PmsProductCategoryDao {
 
     long deleteCheck(Long id);
 
-    Integer ProductNum(@Param("parentId") Long parentId,@Param("id") Long id);
+    Integer productNum(@Param("parentId") Long parentId,@Param("id") Long id);
 }

+ 1 - 1
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/service/impl/PmsProductCategoryServiceImpl.java

@@ -106,7 +106,7 @@ public class PmsProductCategoryServiceImpl implements PmsProductCategoryService
         List<PmsProductCategory> list = pageInfo.getList();
         for (PmsProductCategory pmsProductCategory : list) {
 
-            Integer productNum =  productCategoryDao.ProductNum(parentId,pmsProductCategory.getId());
+            Integer productNum =  productCategoryDao.productNum(parentId,pmsProductCategory.getId());
             pmsProductCategory.setProductCount(productNum);
         }
         return  pageInfo;

+ 2 - 1
forest-admin/admin-server/src/main/resources/dao/PmsProductCategoryDao.xml

@@ -53,12 +53,13 @@
                     )
             ) tmp
     </select>
-    <select id="ProductNum" resultType="java.lang.Integer">
+    <select id="productNum" resultType="java.lang.Integer">
         SELECT
             COUNT(0)
         FROM
             pms_product a
         WHERE 1=1
+            and delete_status = 0
             <choose>
                 <when test="parentId ==0 or parentId =='0'">
                     and a.product_big_category_id = #{id}