Kaynağa Gözat

Merge branch 'feature/1.0.0' of github.com:ab-inbev-apac/abi-cloud-qr-platform into feature/1.0.0

tanzhongran 3 yıl önce
ebeveyn
işleme
3235a22518

+ 6 - 6
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/controller/console/BaseSapImportController.java

@@ -8,11 +8,13 @@ import com.abi.qms.platform.dto.req.BatchImportOrganizationReq;
 import com.abi.qms.platform.dto.req.BatchImportPackageSapOrderItemReq;
 import com.abi.qms.platform.dto.req.BatchImportPackageSapOrderReq;
 import com.abi.qms.platform.dto.req.BatchImportSapBeerFactoryReq;
+import com.abi.qms.platform.dto.req.BatchImportSkuReq;
 import com.abi.qms.platform.service.BaseSapBeerFactoryService;
 import com.abi.qms.platform.service.BaseSapBrandService;
 import com.abi.qms.platform.service.BaseSapCoverFactoryService;
 import com.abi.qms.platform.service.BaseSapMaterialService;
 import com.abi.qms.platform.service.BaseSapOrganizationService;
+import com.abi.qms.platform.service.BaseSapSkuService;
 import com.abi.qms.platform.service.QrPackageSapOrderItemService;
 import com.abi.qms.platform.service.QrPackageSapOrderService;
 import com.abi.task.common.api.base.BaseResponse;
@@ -39,9 +41,8 @@ public class BaseSapImportController {
     @Autowired
     private BaseSapOrganizationService baseSapOrganizationService;
 
-    //603版 已作废
-    /*@Autowired
-    private BaseSapSkuService baseSapSkuService;*/
+    @Autowired
+    private BaseSapSkuService baseSapSkuService;
 
     @Autowired
     private BaseSapBrandService baseSapBrandService;
@@ -73,8 +74,7 @@ public class BaseSapImportController {
     }
 
 
-    //603版 已作废
-    /*@ApiOperation("批量导入SKU数据")
+    @ApiOperation("批量导入SKU数据")
     @PostMapping("batchImportSku")
     @PassToken
     public BaseResponse batchImportSku(@RequestBody BatchImportSkuReq batchImportSkuReq) {
@@ -82,7 +82,7 @@ public class BaseSapImportController {
         baseSapSkuService.batchImportSku(batchImportSkuReq);
         //包装出参
         return BaseResponse.create();
-    }*/
+    }
 
     @ApiOperation("批量导入品牌数据")
     @PostMapping("batchImportBrand")

+ 3 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/entity/BaseSapSku.java

@@ -58,4 +58,7 @@ public class BaseSapSku {
     @Schema(name = "是否删除")
     private Integer isDelete;
 
+    @Schema(name = "类型")
+    private String skuType;
+
 }

+ 5 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/mapper/BaseSapBrandMapper.java

@@ -9,4 +9,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @description:
  */
 public interface BaseSapBrandMapper extends BaseMapper<BaseSapBrand> {
+
+    /**
+     * 删除sap品牌所有数据
+     */
+    void deleteTable();
 }

+ 5 - 3
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/req/BatchImportSkuReq.java

@@ -14,13 +14,12 @@ import java.util.List;
  * @author: fangxinjian
  * @date: 2021/06/02 09:42
  * @description:
- * 603版 已作废
  */
 @Data
 @ApiModel
 public class BatchImportSkuReq implements Serializable {
 
-    /*@ApiModelProperty("sku List")
+    @ApiModelProperty("sku List")
     private List<SapSkuBean> sapSkuBeanList;
 
 
@@ -46,8 +45,11 @@ public class BatchImportSkuReq implements Serializable {
         @ApiModelProperty(value = "子品牌code")
         private String subBrandCode;
 
+        @ApiModelProperty(value = "类型")
+        private String skuType;
 
-    }*/
+
+    }
 
 
 }

+ 1 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/BaseSapSkuService.java

@@ -6,7 +6,6 @@ import com.abi.qms.platform.dto.req.BatchImportSkuReq;
  * @author: fangxinjian
  * @date: 2021/06/02 09:37
  * @description:
- * 603版 已作废
  */
 public interface BaseSapSkuService {
 
@@ -15,5 +14,5 @@ public interface BaseSapSkuService {
      *
      * @param batchImportSkuReq
      */
-    //void batchImportSku(BatchImportSkuReq batchImportSkuReq);
+    void batchImportSku(BatchImportSkuReq batchImportSkuReq);
 }

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

@@ -29,6 +29,8 @@ public class BaseSapBrandServiceImpl implements BaseSapBrandService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void batchImportBrand(BatchImportBrandReq req) {
+        //sap品牌数据是全量数据,先删除品牌数据
+        baseSapBrandMapper.deleteTable();
         List<BatchImportBrandReq.SapBrandBean> brandBeanList = req.getSapBrandBeanList();
 
         for (BatchImportBrandReq.SapBrandBean brand : brandBeanList) {

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

@@ -19,19 +19,18 @@ import java.util.List;
  * @author: fangxinjian
  * @date: 2021/06/02 09:38
  * @description:
- * 603版 已作废
  */
 @Service
 public class BaseSapSkuServiceImpl implements BaseSapSkuService {
 
-    /*@Autowired
-        private BaseSapSkuMapper baseSapSkuMapper;
+    @Autowired
+    private BaseSapSkuMapper baseSapSkuMapper;
 
 
-        @Override
-        @Transactional(rollbackFor = Exception.class)
-        public void batchImportSku(BatchImportSkuReq req) {
-            List<BatchImportSkuReq.SapSkuBean> sapSkuBeanList = req.getSapSkuBeanList();
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void batchImportSku(BatchImportSkuReq req) {
+        List<BatchImportSkuReq.SapSkuBean> sapSkuBeanList = req.getSapSkuBeanList();
 
         for (BatchImportSkuReq.SapSkuBean sku : sapSkuBeanList) {
 
@@ -42,6 +41,7 @@ public class BaseSapSkuServiceImpl implements BaseSapSkuService {
             sapSku.setSubBrandCode(sku.getSubBrandCode());
             sapSku.setSkuCode(sku.getSkuCode());
             sapSku.setSkuName(sku.getSkuName());
+            sapSku.setSkuType(sku.getSkuType());
 
             saveBaseSapSku(sapSku);
         }
@@ -72,6 +72,6 @@ public class BaseSapSkuServiceImpl implements BaseSapSkuService {
             baseSapSkuMapper.insert(bss);
         }
 
-    }*/
+    }
 
 }

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

@@ -583,7 +583,7 @@ public class GenerateCodeServiceImpl implements GenerateCodeService {
         fileList.add(new File(file.getPath()+"/"+ batchNumber + ".txt"));
 
         //生成md5(用于前端校验是否被替换)
-        String fileVerifyMd5 = DigestUtils.md5DigestAsHex(content.toString().getBytes(StandardCharsets.UTF_8));
+        String fileVerifyMd5 = DigestUtils.md5DigestAsHex(contentText.toString().getBytes(StandardCharsets.UTF_8));
         return fileVerifyMd5;
     }
 

+ 7 - 14
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/QrBoxMappingServiceImpl.java

@@ -84,17 +84,17 @@ public class QrBoxMappingServiceImpl implements QrBoxMappingService {
         UserInfo user = userUtil.getUser();
 
         //获取起始序号和结束序号
-        Long indexBeagin = getCodeIndex(req.getBeginQrCode());
+        Long indexBegin = getCodeIndex(req.getBeginQrCode());
         Long indexEnd = getCodeIndex(req.getEndQrCode());
         //条数
-        Long qrCodeCount = indexEnd - indexBeagin;
+        Long qrCodeCount = indexEnd - indexBegin;
         if (qrCodeCount < 0) {
             throw new BusinessException("起始序号大于结束序号,无法生成条形码");
         }
 
         QrBoxMapping qbm = new QrBoxMapping();
         qbm.setBoxCode(String.valueOf(IdWorker.getId()));
-        qbm.setIndexBegin(indexBeagin);
+        qbm.setIndexBegin(indexBegin);
         qbm.setIndexEnd(indexEnd);
         qbm.setBeginQrCode(req.getBeginQrCode());
         qbm.setEndQrCode(req.getEndQrCode());
@@ -177,13 +177,12 @@ public class QrBoxMappingServiceImpl implements QrBoxMappingService {
 
     @Override
     public PrintingDetailRes getPrintingDetail(PrintingDetailReq req) {
-
-
         PrintingDetailVO printingDetail = qrBoxMappingMapper.getPrintingDetail(req.getBoxCode());
         PrintingDetailRes res = PojoConverterUtils.copy(printingDetail, PrintingDetailRes.class);
-        res.setFactoryCoverName(null == printingDetail.getFactoryCoverLevelTwoId() ? "" : getFactoryName(printingDetail.getFactoryCoverLevelTwoId()));
-        res.setFactoryBeerName(null == printingDetail.getFactoryBeerId() ? "" : getFactoryName(printingDetail.getFactoryBeerId()));
-
+        res.setFactoryCoverName(null == printingDetail.getFactoryCoverLevelTwoId() ?
+                "" : getFactoryName(printingDetail.getFactoryCoverLevelTwoId()));
+        res.setFactoryBeerName(null == printingDetail.getFactoryBeerId() ?
+                "" : getFactoryName(printingDetail.getFactoryBeerId()));
         return res;
     }
 
@@ -220,7 +219,6 @@ public class QrBoxMappingServiceImpl implements QrBoxMappingService {
 
     @Override
     public void replenishActivation(ReplenishActivationReq req) {
-
         QrBoxMapping qrBoxMapping = getActiveQrBoxMapping(req.getBoxCode());
         qrBoxMapping.setRemark(req.getReason());
 
@@ -245,18 +243,13 @@ public class QrBoxMappingServiceImpl implements QrBoxMappingService {
 
     @Override
     public void activateNow(ActivateNowReq req) {
-
         List<String> boxCodeList = req.getBoxCodeList();
         for (String boxCode : boxCodeList) {
-
             QrBoxMapping qrBoxMapping = getActiveQrBoxMapping(boxCode);
             qrBoxMapping.setProductionLineName(req.getProductionLineName());
             qrBoxMapping.setProductionTime(LocalDateTime.parse(req.getProductionTime()));
-
             qrBoxMappingMapper.updateById(qrBoxMapping);
-
         }
-
     }
 
     @Override

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

@@ -167,6 +167,9 @@ public class ReportServiceImpl implements ReportService {
             Map<String, String> timestamp = getTimestamp(reportReq.getValue());
             reportReq.setBeginTime( timestamp.get("beginDate"));
             reportReq.setEndTime( timestamp.get("endDate"));
+        }else {
+            reportReq.setBeginTime(reportReq.getBeginTime() + " 00:00:00");
+            reportReq.setEndTime(reportReq.getEndTime() + " 23:59:59");
         }
     }
 

+ 4 - 0
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/BaseSapBrandMapper.xml

@@ -22,4 +22,8 @@
         ID, BRAND_CODE, BRAND_NAME, BRAND_LEVEL, PARENT_BRAND_CODE, PARENT_BRAND_NAME, CREATE_TIME, CREATE_BY, UPDATE_TIME, UPDATE_BY, IS_DELETE
     </sql>
 
+    <delete id="deleteTable">
+        delete from base_sap_brand
+    </delete>
+
 </mapper>

+ 18 - 19
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/BaseSapSkuMapper.xml

@@ -2,26 +2,25 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.abi.qms.platform.dao.mapper.BaseSapSkuMapper">
 
-    <!--603版 已作废-->
-    <!-- 通用查询映射结果 -->
-<!--    <resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.BaseSapSku">-->
-<!--        <id column="id" property="id"/>-->
-<!--        <result column="sku_code" property="skuCode"/>-->
-<!--        <result column="sku_name" property="skuName"/>-->
-<!--        <result column="brand_code" property="brandCode"/>-->
-<!--        <result column="sub_brand_code" property="subBrandCode"/>-->
-<!--        <result column="valid" property="valid"/>-->
-<!--        <result column="create_time" property="createTime"/>-->
-<!--        <result column="create_by" property="createBy"/>-->
-<!--        <result column="update_time" property="updateTime"/>-->
-<!--        <result column="update_by" property="updateBy"/>-->
-<!--        <result column="is_delete" property="isDelete"/>-->
-<!--    </resultMap>-->
+    <resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.BaseSapSku">
+        <id column="id" property="id"/>
+        <result column="sku_code" property="skuCode"/>
+        <result column="sku_name" property="skuName"/>
+        <result column="brand_code" property="brandCode"/>
+        <result column="sub_brand_code" property="subBrandCode"/>
+        <result column="valid" property="valid"/>
+        <result column="create_time" property="createTime"/>
+        <result column="create_by" property="createBy"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="update_by" property="updateBy"/>
+        <result column="is_delete" property="isDelete"/>
+        <result column="sku_type" property="skuType"/>
+    </resultMap>
 
-<!--    &lt;!&ndash; 通用查询结果列 &ndash;&gt;-->
-<!--    <sql id="Base_Column_List">-->
-<!--        id, sku_code, sku_name, brand_code, sub_brand_code, valid, create_time, create_by, update_time, update_by, is_delete-->
-<!--    </sql>-->
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, sku_code, sku_name, brand_code, sub_brand_code, valid, create_time, create_by, update_time, update_by, is_delete,sku_type
+    </sql>
 
 
 </mapper>

+ 7 - 0
deployment.yaml

@@ -24,6 +24,13 @@ spec:
           image: registry-vpc.cn-shanghai.aliyuncs.com/ab-inbev-apac/abi-cloud-qr-platform:#version_num#
           #image: ${image_tag}
           imagePullPolicy: Always
+          resources:
+            limits:
+              cpu: 512m
+              memory: 1024Mi
+            requests:
+              cpu: 128m
+              memory: 512Mi
           env:
             - name: SPRING_PROFILES_ACTIVE
               valueFrom: