Jelajahi Sumber

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

tanzhongran 4 tahun lalu
induk
melakukan
37e6b79a67
18 mengubah file dengan 124 tambahan dan 26 penghapusan
  1. 3 2
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/controller/wx/WxUserInfoController.java
  2. 3 0
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/ActivateDetailVo.java
  3. 3 0
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/ListSubAccountVO.java
  4. 1 1
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/QueryWxFactoryVO.java
  5. 5 0
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/req/ListQrBoxCodeMappingReq.java
  6. 3 0
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/ActivateDetailRes.java
  7. 58 0
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/GetSubAccountWxRes.java
  8. 3 0
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/ListQrPackageRes.java
  9. 1 1
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/QueryWxFactoryRes.java
  10. 1 1
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/UserManagerService.java
  11. 4 4
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/ReportServiceImpl.java
  12. 6 6
      abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/UserManagerServiceImpl.java
  13. 5 2
      abi-cloud-qr-platform-server/src/main/resources/dao/mapper/QrBoxMappingMapper.xml
  14. 1 0
      abi-cloud-qr-platform-server/src/main/resources/dao/mapper/QrPackageMapper.xml
  15. 6 4
      abi-cloud-qr-platform-server/src/main/resources/dao/mapper/ReportServiceMapper.xml
  16. 5 2
      abi-cloud-qr-platform-server/src/main/resources/dao/mapper/UserInfoMapper.xml
  17. 10 0
      deployment-dev.yaml
  18. 6 3
      deployment.yaml

+ 3 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/controller/wx/WxUserInfoController.java

@@ -1,6 +1,7 @@
 package com.abi.qms.platform.controller.wx;
 
 import com.abi.qms.platform.dto.req.UpdatePhoneEmailWxReq;
+import com.abi.qms.platform.dto.res.GetSubAccountWxRes;
 import com.abi.qms.platform.dto.res.GetUserInfoWxRes;
 import com.abi.qms.platform.dto.res.ListSubAccountWxRes;
 import com.abi.qms.platform.service.UserManagerService;
@@ -54,8 +55,8 @@ public class WxUserInfoController {
 
     @ApiOperation("查询子账号详情")
     @GetMapping("subAccountDetailWx/{subUserInfoId}")
-    public BaseResponse<ListSubAccountWxRes.SubAccount> subAccountDetailWx(@PathVariable("subUserInfoId") Long subUserInfoId){
-        ListSubAccountWxRes.SubAccount result = userManagerService.subAccountDetailWx(subUserInfoId);
+    public BaseResponse<GetSubAccountWxRes> subAccountDetailWx(@PathVariable("subUserInfoId") Long subUserInfoId){
+        GetSubAccountWxRes result = userManagerService.subAccountDetailWx(subUserInfoId);
         //包装出参
         return BaseResponse.create(result);
     }

+ 3 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/ActivateDetailVo.java

@@ -26,4 +26,7 @@ public class ActivateDetailVo implements Serializable {
 
     @ApiModelProperty(value = "盖码数量")
     private Integer capNum;
+
+    @ApiModelProperty(value = "激活状态 0-未激活 1-已激活")
+    private Integer activeStatus;
 }

+ 3 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/ListSubAccountVO.java

@@ -31,6 +31,9 @@ public class ListSubAccountVO implements Serializable {
     @ApiModelProperty(value = "邮箱")
     private String email;
 
+    @ApiModelProperty(value = "供应商id")
+    private Long factoryId;
+
     @ApiModelProperty(value = "产线名称列表")
     private List<ListProductionLineNameVO> productionLineNameList;
 }

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

@@ -22,6 +22,6 @@ public class QueryWxFactoryVO implements Serializable {
     private Long activation;
 
     @ApiModelProperty(value = "月")
-    private String march;
+    private String month;
 
 }

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

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 
 /**
@@ -16,6 +17,10 @@ import java.io.Serializable;
 @ApiModel
 public class ListQrBoxCodeMappingReq extends PageReq implements Serializable {
 
+    @ApiModelProperty(value = "码包ID")
+    @NotNull(message = "码包ID不能为空")
+    private Long packageId;
+
     @ApiModelProperty(value = "激活状态 0-未激活 1-已激活 9-已作废")
     private Integer activeStatus;
 

+ 3 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/ActivateDetailRes.java

@@ -26,4 +26,7 @@ public class ActivateDetailRes implements Serializable {
 
     @ApiModelProperty(value = "盖码数量")
     private Integer capNum;
+
+    @ApiModelProperty(value = "激活状态 0-未激活 1-已激活")
+    private Integer activeStatus;
 }

+ 58 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/GetSubAccountWxRes.java

@@ -0,0 +1,58 @@
+package com.abi.qms.platform.dto.res;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author Eurus
+ * @date 2021/6/24 14:14
+ * @Description: 查询子账号详情(小程序) 出参
+ */
+@Data
+@ApiModel
+public class GetSubAccountWxRes implements Serializable {
+
+    @ApiModelProperty(value = "用户id")
+    private Long id;
+
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+    @ApiModelProperty(value = "工号")
+    private String employeeNo;
+
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "供应商id")
+    private Long factoryId;
+
+    @ApiModelProperty(value = "产线名称列表")
+    private List<ProductionLineName> productionLineNameList;
+
+    /**
+     * 产线bean
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ToString
+    @ApiModel(value = "GetSubAccountWxRes_ProductionLineName")
+    public static class ProductionLineName implements Serializable {
+        @ApiModelProperty(value = "啤酒厂员工产线关联id")
+        private Long id;
+
+        @ApiModelProperty(value = "产线名称")
+        private String productionLineName;
+    }
+}

+ 3 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/ListQrPackageRes.java

@@ -55,6 +55,9 @@ public class ListQrPackageRes extends PageResp implements Serializable {
         @ApiModelProperty(value = "包材厂id")
         private Long factoryCoverId;
 
+        @ApiModelProperty(value = "二级包材厂id")
+        private Long factoryCoverLevelTwoId;
+
         @ApiModelProperty("包材厂名称")
         private String factoryCoverName;
 

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

@@ -38,7 +38,7 @@ public class QueryWxFactoryRes implements Serializable {
         private Long inStock;
 
         @ApiModelProperty(value = "月")
-        private String march;
+        private String month;
     }
 
 }

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

@@ -93,5 +93,5 @@ public interface UserManagerService {
      * @param subUserInfoId
      * @return
      */
-    ListSubAccountWxRes.SubAccount subAccountDetailWx(Long subUserInfoId);
+    GetSubAccountWxRes subAccountDetailWx(Long subUserInfoId);
 }

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

@@ -133,9 +133,9 @@ public class ReportServiceImpl implements ReportService {
             AssertUtil.isNull(queryWxFactorySumNumber,"查询为空!");
             //激活量
             List<QueryWxFactoryVO> queryWxFactoryActivationNumber = reportServiceMapper.queryWxFactoryActivationNumber(queryWxFactoryReq,getMonth());
-            Map<String, Long> activationNumberMap = queryWxFactoryActivationNumber.stream().collect(Collectors.toMap(QueryWxFactoryVO::getMarch, QueryWxFactoryVO::getActivation));
+            Map<String, Long> activationNumberMap = queryWxFactoryActivationNumber.stream().collect(Collectors.toMap(QueryWxFactoryVO::getMonth, QueryWxFactoryVO::getActivation));
             queryWxFactorySumNumber.forEach(factorySumNumber->{
-                Long aLong = (null == activationNumberMap.get(factorySumNumber.getMarch()) ? 0L : activationNumberMap.get(factorySumNumber.getMarch()));
+                Long aLong = (null == activationNumberMap.get(factorySumNumber.getMonth()) ? 0L : activationNumberMap.get(factorySumNumber.getMonth()));
                 factorySumNumber.setActivation(aLong);
             });
             List<QueryWxFactoryRes.QueryWxFactoryBean> queryWxFactoryBeans = PojoConverterUtils.copyList(queryWxFactorySumNumber, QueryWxFactoryRes.QueryWxFactoryBean.class);
@@ -151,9 +151,9 @@ public class ReportServiceImpl implements ReportService {
         AssertUtil.isNull(queryWxFactorySumNumber,"查询为空!");
         //激活量
         List<QueryWxFactoryVO> queryWxFactoryActivationNumber = reportServiceMapper.queryWxFactoryActivationNumber(queryWxFactoryReq,null);
-        Map<String, Long> activationNumberMap = queryWxFactoryActivationNumber.stream().collect(Collectors.toMap(QueryWxFactoryVO::getMarch, QueryWxFactoryVO::getActivation));
+        Map<String, Long> activationNumberMap = queryWxFactoryActivationNumber.stream().collect(Collectors.toMap(QueryWxFactoryVO::getMonth, QueryWxFactoryVO::getActivation));
         queryWxFactorySumNumber.forEach(factorySumNumber->{
-            Long aLong = (null == activationNumberMap.get(factorySumNumber.getMarch()) ? 0L : activationNumberMap.get(factorySumNumber.getMarch()));
+            Long aLong = (null == activationNumberMap.get(factorySumNumber.getMonth()) ? 0L : activationNumberMap.get(factorySumNumber.getMonth()));
             factorySumNumber.setActivation(aLong);
         });
         List<QueryWxFactoryRes.QueryWxFactoryBean> queryWxFactoryBeans = PojoConverterUtils.copyList(queryWxFactorySumNumber, QueryWxFactoryRes.QueryWxFactoryBean.class);

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

@@ -303,15 +303,15 @@ public class UserManagerServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo
     }
 
     @Override
-    public ListSubAccountWxRes.SubAccount subAccountDetailWx(Long subUserInfoId) {
+    public GetSubAccountWxRes subAccountDetailWx(Long subUserInfoId) {
         ListSubAccountVO listSubAccountVO = userInfoMapper.selectSubAccountDetail(subUserInfoId);
+        GetSubAccountWxRes getSubAccountWxRes = new GetSubAccountWxRes();
         if(Objects.nonNull(listSubAccountVO)){
-            ListSubAccountWxRes.SubAccount subAccount = PojoConverterUtils.copy(listSubAccountVO, ListSubAccountWxRes.SubAccount.class);
-            List<ListSubAccountWxRes.ProductionLineName> productionLineNames = PojoConverterUtils.copyList(listSubAccountVO.getProductionLineNameList(), ListSubAccountWxRes.ProductionLineName.class);
-            subAccount.setProductionLineNameList(productionLineNames);
-            return subAccount;
+            getSubAccountWxRes = PojoConverterUtils.copy(listSubAccountVO, GetSubAccountWxRes.class);
+            List<GetSubAccountWxRes.ProductionLineName> productionLineNames = PojoConverterUtils.copyList(listSubAccountVO.getProductionLineNameList(), GetSubAccountWxRes.ProductionLineName.class);
+            getSubAccountWxRes.setProductionLineNameList(productionLineNames);
         }
-        return null;
+        return getSubAccountWxRes;
     }
 
 

+ 5 - 2
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/QrBoxMappingMapper.xml

@@ -50,6 +50,9 @@
             <if test="req.activeStatus != null ">
                 AND qbm.active_status = #{req.activeStatus}
             </if>
+            <if test="req.packageId != null ">
+                AND qbm.package_id = #{req.packageId}
+            </if>
         </where>
         order by qbm.create_time
     </select>
@@ -67,7 +70,7 @@
                 AND qbm.active_status = #{activeStatus}
             </if>
             <if test="packageId !=null">
-                AND qbm.packageId = #{packageId}
+                AND qbm.package_id = #{packageId}
             </if>
             and qbm.is_delete = 0
         </where>
@@ -141,7 +144,7 @@
     </select>
 
     <select id="getActivateDetail" resultType="com.abi.qms.platform.dao.vo.result.ActivateDetailVo">
-        select qbm.box_code,ba.active_name,bm.material_name,
+        select qbm.box_code,ba.active_name,bm.material_name,qbm.active_status,
             case when qp.qr_type = 2 then qp.qr_number else 0 end as capNum
         from qr_box_mapping qbm
             left join qr_package qp on qbm.package_id=qp.id

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

@@ -40,6 +40,7 @@
             qp.id,
             qp.material_id,
             qp.factory_cover_id,
+            qp.factory_cover_level_two_id,
             qp.box_code_format_id,
             qp.sap_order_no,
             qp.booking_order,

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

@@ -101,7 +101,7 @@
 
         SELECT
             SUM( mapping.qr_code_count ) activation,
-            DATE_FORMAT( qpackage.create_time, "%Y-%m" ) march
+            DATE_FORMAT( qpackage.create_time, "%Y-%m" ) `month`
         FROM
             qr_package AS qpackage
             LEFT JOIN qr_box_mapping AS mapping ON qpackage.id = mapping.package_id
@@ -114,14 +114,15 @@
                 AND #{month} <![CDATA[<=]]> qpackage.create_time
             </if>
         </where>
-        GROUP BY march
+        GROUP BY `month`
+        ORDER BY `month`
     </select>
 
 
     <select id="queryWxFactorySumNumber" resultType="com.abi.qms.platform.dao.vo.result.QueryWxFactoryVO">
         SELECT
         sum( qpackage.qr_number ) total,
-        DATE_FORMAT( qpackage.create_time, "%Y-%m" ) march
+        DATE_FORMAT( qpackage.create_time, "%Y-%m" ) `month`
         FROM
         qr_package qpackage
         <where>
@@ -133,7 +134,8 @@
                 AND #{month} <![CDATA[<=]]> qpackage.create_time
             </if>
         </where>
-        GROUP BY march
+        GROUP BY `month`
+        ORDER BY `month`
     </select>
 
 

+ 5 - 2
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/UserInfoMapper.xml

@@ -31,6 +31,8 @@
         <result column="EMPLOYEE_NO" property="employeeNo"/>
         <result column="PHONE" property="phone"/>
         <result column="EMAIL" property="email"/>
+        <result column="factory_id" property="factoryId"/>
+
 
         <collection property="productionLineNameList" javaType="java.util.List"
                     ofType="com.abi.qms.platform.dao.vo.result.ListProductionLineNameVO">
@@ -106,7 +108,7 @@
         bpl.production_line_name
         from user_info ui
         inner JOIN user_role_detail urd ON ui.role_code = urd.role_code
-        LEFT JOIN brewery_production_line bpl ON ui.id = bpl.user_name
+        LEFT JOIN brewery_production_line bpl ON ui.id = bpl.user_id and bpl.is_delete = 0
         WHERE  ui.factory_id = #{factoryId}
         and ui.is_enable = 1 and ui.is_delete = 0
         and urd.is_activate_mini_app_main_account = 0
@@ -121,11 +123,12 @@
         ui.EMPLOYEE_NO,
         ui.PHONE,
         ui.EMAIL,
+        ui.factory_id,
         bpl.id as production_line_id,
         bpl.production_line_name
         from user_info ui
         inner JOIN user_role_detail urd ON ui.role_code = urd.role_code
-        LEFT JOIN brewery_production_line bpl ON ui.id = bpl.user_name
+        LEFT JOIN brewery_production_line bpl ON ui.id = bpl.user_id and bpl.is_delete = 0
         WHERE  ui.id = #{userId}
     </select>
 </mapper>

+ 10 - 0
deployment-dev.yaml

@@ -16,6 +16,9 @@ spec:
       app: abi-cloud-qr-platform-service
   template:
     metadata:
+      annotations:
+        armsPilotAutoEnable: "on"
+        armsPilotCreateAppName: abi-cloud-qr-platform
       labels:
         app: abi-cloud-qr-platform-service
     spec:
@@ -24,6 +27,13 @@ spec:
           image: registry-vpc.cn-shanghai.aliyuncs.com/ab-inbev-apac/abi-cloud-qr-platform-service:${currentVersion}
           #image: ${image_tag}
           imagePullPolicy: Always
+          resources:
+            limits:
+              cpu: 2048m
+              memory: 4096Mi
+            requests:
+              cpu: 512m
+              memory: 1048Mi
           env:
             - name: SPRING_PROFILES_ACTIVE
               valueFrom:

+ 6 - 3
deployment.yaml

@@ -16,6 +16,9 @@ spec:
       app: abi-cloud-qr-platform-service
   template:
     metadata:
+      annotations:
+        armsPilotAutoEnable: "on"
+        armsPilotCreateAppName: abi-cloud-qr-platform
       labels:
         app: abi-cloud-qr-platform-service
     spec:
@@ -26,10 +29,10 @@ spec:
           imagePullPolicy: Always
           resources:
             limits:
-              cpu: 512m
-              memory: 1024Mi
+              cpu: 1024m
+              memory: 2048Mi
             requests:
-              cpu: 128m
+              cpu: 256m
               memory: 512Mi
           env:
             - name: SPRING_PROFILES_ACTIVE