浏览代码

色标量改面标量
自动审核逻辑变更
如果需要url则生成的码文件会带有url

tanzhongran 4 年之前
父节点
当前提交
404be6c967

+ 1 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/entity/QrBoxCodeFormat.java

@@ -37,7 +37,7 @@ public class QrBoxCodeFormat {
     @ApiModelProperty(value = "供应商id")
     private Long factoryId;
 
-    @ApiModelProperty(value = "每卷标量")
+    @ApiModelProperty(value = "每卷标量")
     private Integer colorPerRollScalar;
 
     @ApiModelProperty(value = "幅面数量")

+ 1 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/QrBoxCodeFormatVO.java

@@ -35,7 +35,7 @@ public class QrBoxCodeFormatVO implements Serializable {
     @ApiModelProperty(value = "供应商名称")
     private String factoryName;
 
-    @ApiModelProperty(value = "每卷标量")
+    @ApiModelProperty(value = "每卷标量")
     private Integer colorPerRollScalar;
 
     @ApiModelProperty(value = "幅面数量")

+ 1 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/QrRepertoryColumnVO.java

@@ -36,7 +36,7 @@ public class QrRepertoryColumnVO {
     @ApiModelProperty("别名")
     private String alias;
 
-    @ApiModelProperty("url格式类型 0-非URL 1-系统URL 2-部门URL")
+    @ApiModelProperty("url格式类型 0-非URL 1-系统URL ")
     private Integer urlType;
 
     @ApiModelProperty("备注")

+ 2 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/req/SaveBoxCodeFormatReq.java

@@ -36,8 +36,8 @@ public class SaveBoxCodeFormatReq implements Serializable {
     @ApiModelProperty(value = "包材厂id")
     private Long factoryId;
 
-    @NotNull(message = "每卷标量不能为空")
-    @ApiModelProperty(value = "每卷标量")
+    @NotNull(message = "每卷标量不能为空")
+    @ApiModelProperty(value = "每卷标量")
     private Integer colorPerRollScalar;
 
     @NotNull(message = "幅面数量不能为空")

+ 1 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/ListBoxCodeFormatRes.java

@@ -47,7 +47,7 @@ public class ListBoxCodeFormatRes extends PageResp implements Serializable {
         @ApiModelProperty(value = "包材厂名称")
         private String factoryName;
 
-        @ApiModelProperty(value = "每卷标量")
+        @ApiModelProperty(value = "每卷标量")
         private Integer colorPerRollScalar;
 
         @ApiModelProperty(value = "幅面数量")

+ 1 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/QrBoxCodeFormatDetailRes.java

@@ -37,7 +37,7 @@ public class QrBoxCodeFormatDetailRes implements Serializable {
     @ApiModelProperty(value = "包材厂名称")
     private String factoryName;
 
-    @ApiModelProperty(value = "每卷标量")
+    @ApiModelProperty(value = "每卷标量")
     private Integer colorPerRollScalar;
 
     @ApiModelProperty(value = "幅面数量")

+ 18 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/GenerateCodeServiceImpl.java

@@ -27,6 +27,7 @@ import net.lingala.zip4j.core.ZipFile;
 import net.lingala.zip4j.exception.ZipException;
 import net.lingala.zip4j.model.ZipParameters;
 import net.lingala.zip4j.util.Zip4jConstants;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.fileupload.FileItemFactory;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@@ -103,6 +104,9 @@ public class GenerateCodeServiceImpl implements GenerateCodeService {
     @Value("${qms.encode.key}")
     private String encodeKey;
 
+    @Value("${qms.route.url}")
+    private String qmsRouteUrl;
+
     /** 允许单个码生成重复的次数 */
     private static final int REPEAT_BUILD_CODE_TIMES = 10;
 
@@ -504,6 +508,15 @@ public class GenerateCodeServiceImpl implements GenerateCodeService {
         List<QrRepertoryColumnVO> qrRepertoryColumnList = qrRepertory.getQrRepertoryColumnList();
         List<String> columnNameList = new ArrayList<>();
         StringBuilder content = new StringBuilder();
+        //文件是否需要输出系统url(只有当码库只有一列)
+        boolean isSystemUrl = false;
+        if(CollectionUtils.isNotEmpty(qrRepertoryColumnList) && qrRepertoryColumnList.size()==1){
+            QrRepertoryColumnVO qrRepertoryColumnVO = qrRepertoryColumnList.get(0);
+            isSystemUrl = QrFormatUrlEnum.SYSTEM_URL.is(qrRepertoryColumnVO.getUrlType());
+        }
+        Map<Long, Integer> colUrlTypeMap = qrRepertoryColumnList.stream().collect(Collectors.toMap(QrRepertoryColumnVO::getId, QrRepertoryColumnVO::getUrlType));
+
+
         // 第一行为每列的名称,用“,”分隔
         for(QrRepertoryColumnVO colVO:qrRepertoryColumnList){
             int splitNum = splitCache.containsKey(colVO.getId()) ? splitCache.get(colVO.getId()).getSplitNum() : 0;
@@ -537,10 +550,15 @@ public class GenerateCodeServiceImpl implements GenerateCodeService {
                         codeTextList.add(String.valueOf(chars));
                     }
                 } else {
+                    //如果需要系统url则拼上(有拆分的列就不给url了,没有意义)
+                    if(QrFormatUrlEnum.SYSTEM_URL.is(colUrlTypeMap.get(qrInnerData.getQrRepertoryColumnId()))){
+                        code = String.format("%s/%s",qmsRouteUrl,code);
+                    }
                     codeTextList.add(code);
                 }
             }
             String innerData = String.join(",",codeTextList);
+            //拼上码
             content.append(innerData).append("\r\n");
         }
         //如果文件不存在,创建一个文件

+ 8 - 6
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/QrPackageServiceImpl.java

@@ -175,9 +175,6 @@ public class QrPackageServiceImpl implements QrPackageService {
     @Autowired
     private QrBoxMappingService qrBoxMappingService;
 
-//    @Autowired
-//    private SendMqUtil sendMqUtil;
-
     /**
      * 保存码包
      */
@@ -214,9 +211,14 @@ public class QrPackageServiceImpl implements QrPackageService {
      * @param qrPackage
      */
     private void autoPass(QrPackage qrPackage){
-        // 如果是sap单号,且额外申请原因为空,则自动通过(因为原因为空的肯定是不超过的)
-        if(CodePackageOrderTypeEnum.SAP_ORDER.is(qrPackage.getOrderType())
-            && StringUtils.isBlank(qrPackage.getReasonApply())){
+        // 如果是Sap订单类型:
+        //  如果是箱码,无论如何搜直接通过自动审核
+        //  如果是盖码,且额外申请原因为空,则自动通过(因为原因为空的肯定是不超过的)
+        boolean isAutoPass = false;
+        if(CodePackageOrderTypeEnum.SAP_ORDER.is(qrPackage.getOrderType())){
+            isAutoPass = QrTypeEnum.CARTON.is(qrPackage.getQrType()) || StringUtils.isBlank(qrPackage.getReasonApply());
+        }
+        if(isAutoPass){
             // 符合条件、通过
             PassQrPackageReq req = new PassQrPackageReq();
             req.setId(qrPackage.getId());