wangxichen 2 veckor sedan
förälder
incheckning
8dd1d8718e

+ 1 - 1
src/main/java/com/jeesite/modules/mes/service/MesProductGummingService.java

@@ -171,7 +171,7 @@ public class MesProductGummingService extends CrudService<MesProductGummingDao,
 			//获取当前日
 			int currentDay = LocalDate.now().getDayOfMonth();
 
-			String uploadDir = "E:/mescloud/userfiles/gumming"+"/"+currentYear+"-"+currentMonth+"-"+currentDay;
+			String uploadDir = "D:/mescloud/userfiles/gumming"+"/"+currentYear+"-"+currentMonth+"-"+currentDay;
 //			String uploadUrl = "/js/userfiles/mpp"+"/"+currentYear+"-"+currentMonth+"-"+currentDay;
 			File directory = new File(uploadDir);
 			if (!directory.exists()) {

+ 1 - 1
src/main/java/com/jeesite/modules/mes/service/MesProductMppService.java

@@ -181,7 +181,7 @@ public class MesProductMppService extends CrudService<MesProductMppDao, MesProdu
 			//获取当前日
 			int currentDay = LocalDate.now().getDayOfMonth();
 
-			String uploadDir = "E:/mescloud/userfiles/mpp"+"/"+currentYear+"-"+currentMonth+"-"+currentDay;
+			String uploadDir = "D:/mescloud/userfiles/mpp"+"/"+currentYear+"-"+currentMonth+"-"+currentDay;
 //			String uploadUrl = "/js/userfiles/mpp"+"/"+currentYear+"-"+currentMonth+"-"+currentDay;
 			File directory = new File(uploadDir);
 			if (!directory.exists()) {

+ 58 - 1
src/main/java/com/jeesite/modules/mes/util/CommonUitl.java

@@ -239,7 +239,64 @@ public class CommonUitl {
     public static Boolean checkProductSn(String sn,String cateSn){
         switch (cateSn){
             case "ZHXT":
-                if(sn.length() != 32 && sn.length() != 24){
+                // 21位流水码验证
+                if(sn.length() == 21){
+                    // 21位流水码格式:+KA99IS3031 + 生产日期(4位) + 生产流水号(4位) + 原材料追溯码(2位,01)
+                    // 例如:+KA99IS3031RA1800A201
+
+                    // 1. 验证固定前缀:+KA99IS3031 或 +KA64IS3031
+                    List<String> prefixList = Arrays.asList("+KA99IS3031", "+KA64IS3031","+KB23IS3031","+KB24IS3031","+KA93IS3031");
+                    String snPrefix = sn.substring(0, 11);
+                    if(!prefixList.contains(snPrefix)){
+                        return false;
+                    }
+
+//                    // 2. 验证生产日期部分(第12-15位,共4位)
+//                    String dateCode = sn.substring(11, 15);
+//                    // 年份字母(1位) + 月份(1位) + 日期(2位)
+//                    if(dateCode.length() != 4){
+//                        return false;
+//                    }
+//
+//                    // 验证年份字母(第1位)
+//                    char yearChar = dateCode.charAt(0);
+//                    if(!Character.isLetter(yearChar) || !Character.isUpperCase(yearChar)){
+//                        return false;
+//                    }
+//
+//                    // 验证月份(第2位):1-9或A、B、C
+//                    char monthChar = dateCode.charAt(1);
+//                    if(!(Character.isDigit(monthChar) && monthChar >= '1' && monthChar <= '9')
+//                        && !(monthChar == 'A' || monthChar == 'B' || monthChar == 'C')){
+//                        return false;
+//                    }
+//
+//                    // 验证日期(第3-4位)
+//                    String dayStr = dateCode.substring(2, 4);
+//                    if(!dayStr.matches("\\d{2}")){
+//                        return false;
+//                    }
+//                    int day = Integer.parseInt(dayStr);
+//                    if(day < 1 || day > 31){
+//                        return false;
+//                    }
+//
+//                    // 3. 验证生产流水号(第16-19位,共4位,应为数字)
+//                    String serialNumber = sn.substring(15, 19);
+//                    if(!serialNumber.matches("\\d{4}")){
+//                        return false;
+//                    }
+//
+//                    // 4. 验证原材料追溯码(第20-21位,固定为01)
+//                    String traceCode = sn.substring(19, 21);
+//                    if(!traceCode.equals("01")){
+//                        return false;
+//                    }
+
+                    return true;
+                }
+                // 原有的32位和24位工件码验证
+                else if(sn.length() != 32 && sn.length() != 24){
                     return false;
                 }
                 //	000020015305-0100101425011400038   0000+10位料号+7位供应商代码+6位生产日期+5位序列号

+ 6 - 4
src/main/resources/config/application.yml

@@ -59,8 +59,10 @@ jdbc:
 #  url: jdbc:mysql://39.106.12.131:3306/mes_cloud_610?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
 #  username: mes_cloud_610
 #  password: wrBrhmpBDxkATCLa
-  username: root
-  password: 123456
+#  username: root
+#  password: 123456
+  username: mes_cloud
+  password: RTCk7KxGPAPyy7pJ
   testSql: SELECT 1
 
 #  # Oracle 数据库配置(若使用 12c,请修改 /modules/core/pom.xml 文件,打开 12c 依赖,去掉 11g 依赖)
@@ -882,8 +884,8 @@ file:
   enabled: true
 
 #  # 文件上传根路径,设置路径中不允许包含“userfiles”,在指定目录中系统会自动创建userfiles目录,如果不设置默认为contextPath路径
-#  baseDir: D:/mescloud
-  baseDir: /www/wwwroot/mes_cloud_610
+  baseDir: D:/mescloud
+#  baseDir: /www/wwwroot/mes_cloud_610
 #
 #  # 上传文件的相对路径(支持:yyyy, MM, dd, HH, mm, ss, E)
   uploadPath: 'files1/{yyyy}{MM}/'