Browse Source

chore: 增加k8s 资源配置

Marko552 3 years ago
parent
commit
953dd78812

+ 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

+ 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: