Browse Source

酒厂小程序查询子账号详情添加啤酒厂id的返回

v_HuilingDeng 3 years ago
parent
commit
ea4616d283

+ 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/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;
 }

+ 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;
+    }
+}

+ 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);
 }

+ 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;
     }
 
 

+ 3 - 0
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">
@@ -121,6 +123,7 @@
         ui.EMPLOYEE_NO,
         ui.PHONE,
         ui.EMAIL,
+        ui.factory_id,
         bpl.id as production_line_id,
         bpl.production_line_name
         from user_info ui