Jelajahi Sumber

用户新增+企业新增添加业务归属

LiFei 4 tahun lalu
induk
melakukan
d834684410

+ 2 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/hwuser/entity/HwUser.java

@@ -173,5 +173,7 @@ public class HwUser implements Serializable{
 
 	@TableField(exist = false)
 	private Integer idcardPictureType;  //(1:未上传  2:已上传) 用于查询
+
+	private Integer businessBelongId; //业务归属
 }
 

+ 7 - 3
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/hwuser/mapper/xml/HwUserMapper.xml

@@ -22,6 +22,7 @@
 		a.platform_id as "platformId",
 		a.user_code as "userCode",
 		a.is_demonstrate as "isDemonstrate",
+		a.business_belong_id as "businessBelongId",
 		bank.card_number AS "hwBankAccount.cardNumber",
 		bank.id AS "hwBankAccount.id",
 		bank.bnkflg as "hwBankAccount.bnkflg",
@@ -108,7 +109,8 @@
 			idcard_back,
 			account_id,
 			platform_id,
-			user_code
+			user_code,
+			business_belong_id
 		) VALUES (
 			#{hwUser.name},
 			#{hwUser.phone},
@@ -126,7 +128,8 @@
 			#{hwUser.idcardBack},
 			#{hwUser.accountId},
 			#{hwUser.platformId},
-			#{hwUser.userCode}
+			#{hwUser.userCode},
+			#{hwUser.businessBelongId}
 		)
 	</insert>
 
@@ -146,7 +149,8 @@
 			idcard_front = #{hwUser.idcardFront},
 			idcard_back = #{hwUser.idcardBack},
 			account_id = #{hwUser.accountId},
-			platform_id = #{hwUser.platformId}
+			platform_id = #{hwUser.platformId},
+			business_belong_id = #{hwUser.businessBelongId}
 		WHERE id = #{id}
 	</update>
 

+ 8 - 4
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/hwuser/service/impl/HwUserServiceImpl.java

@@ -397,12 +397,12 @@ public class HwUserServiceImpl extends ServiceImpl<HwUserMapper, HwUser> impleme
     @Override
     public void saveUser(List<HwUserExport> hwUserExportList) {
         List<HwUser>  list=new ArrayList();
+        //获取当前登录用户
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        HwPlatformCompany hwPlatformCompany=hwPlatformCompanyService.getByOrgCode(sysUser.getOrgCode());
+        HwPlatform hwPlatform = hwPlatformService.getById(hwPlatformCompany.getPlatformId());
         for (int i = 0; i < hwUserExportList.size(); i++) {
-            //获取当前登录用户
-            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             HwUser hwUser = new HwUser();
-            HwPlatformCompany hwPlatformCompany=hwPlatformCompanyService.getByOrgCode(sysUser.getOrgCode());
-            HwPlatform hwPlatform = hwPlatformService.getById(hwPlatformCompany.getPlatformId());
             hwUser.setPlatformId(hwPlatform.getId());
             hwUser.setName(hwUserExportList.get(i).getName());
             hwUser.setPhone(hwUserExportList.get(i).getPhone());
@@ -418,6 +418,7 @@ public class HwUserServiceImpl extends ServiceImpl<HwUserMapper, HwUser> impleme
             hwUser.setRegisterTime(new Date());
             hwUser.setRegisterFrom(2);
             hwUser.setCreateBy(sysUser.getUsername());
+            hwUser.setBusinessBelongId(hwPlatform.getBusinessBelongId());
             hwUserMapper.saveHwUser(hwUser);
             if (StringUtils.isNotBlank(hwUserExportList.get(i).getCardNumber())) {
                 HwBankAccount hwBankAccount = new HwBankAccount();
@@ -444,6 +445,7 @@ public class HwUserServiceImpl extends ServiceImpl<HwUserMapper, HwUser> impleme
         String requestUrl = OauthApi.USER_ADD;
         JSONObject jsonObject1=new JSONObject();
         jsonObject1.put("list",list);
+        jsonObject1.put("businessBelongId", hwPlatform.getBusinessBelongId());
         log.info("param============{}", JSONObject.toJSONString(jsonObject1));
         //数据加密
         String biz_content = CryptTool.encode(JSONObject.toJSONString(jsonObject1));
@@ -719,6 +721,7 @@ public class HwUserServiceImpl extends ServiceImpl<HwUserMapper, HwUser> impleme
         hwUser.setSysOrgCode(sysUser.getOrgCode());
         hwUser.setRegisterTime(new Date());
         hwUser.setRegisterFrom(2);
+        hwUser.setBusinessBelongId(hwPlatform.getBusinessBelongId());
         hwUserMapper.saveHwUser(hwUser);
         if (StringUtils.isNotBlank(hwUser.getCardNumber())) {
             HwBankAccount hwBankAccount = new HwBankAccount();
@@ -754,6 +757,7 @@ public class HwUserServiceImpl extends ServiceImpl<HwUserMapper, HwUser> impleme
         list.add(hwUser);
         JSONObject jsonObject1=new JSONObject();
         jsonObject1.put("list",list);
+        jsonObject1.put("businessBelongId",hwPlatform.getBusinessBelongId());
         log.info("param============{}", JSONObject.toJSONString(jsonObject1));
         //数据加密
         String biz_content = CryptTool.encode(JSONObject.toJSONString(jsonObject1));

+ 4 - 1
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/requiremanager/service/impl/HwRequirementServiceImpl.java

@@ -481,6 +481,7 @@ public class HwRequirementServiceImpl extends ServiceImpl<HwRequirementMapper, H
         //获取当前登录用户
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         HwPlatformCompany hwPlatformCompany=hwPlatformCompanyService.getByOrgCode(sysUser.getOrgCode());
+        HwPlatform hwPlatform = hwPlatformService.getById(hwPlatformCompany.getPlatformId());
         for (int i = 0; i < hwUserExportList.size(); i++) {
             HwCompanyUser hwCompanyUser1=hwCompanyUserService.getByCompanyIdAndUserId(hwPlatformCompany.getId(),hwUserExportList.get(i).getId());
             if(hwUserExportList.get(i).getId()!=null){
@@ -497,7 +498,7 @@ public class HwRequirementServiceImpl extends ServiceImpl<HwRequirementMapper, H
                 continue;
             }else{
                 HwUser hwUser = new HwUser();
-                HwPlatform hwPlatform = hwPlatformService.getById(hwPlatformCompany.getPlatformId());
+
                 hwUser.setPlatformId(hwPlatform.getId());
                 hwUser.setName(hwUserExportList.get(i).getName());
                 hwUser.setPhone(hwUserExportList.get(i).getPhone());
@@ -513,6 +514,7 @@ public class HwRequirementServiceImpl extends ServiceImpl<HwRequirementMapper, H
                 hwUser.setRegisterTime(new Date());
                 hwUser.setRegisterFrom(2);
                 hwUser.setCreateBy(sysUser.getUsername());
+                hwUser.setBusinessBelongId(hwPlatform.getBusinessBelongId());
                 hwUserMapper.saveHwUser(hwUser);
                 //存放用户id
                 hwUserIdList.add(hwUser.getId());
@@ -542,6 +544,7 @@ public class HwRequirementServiceImpl extends ServiceImpl<HwRequirementMapper, H
         String requestUrl = OauthApi.USER_ADD;
         JSONObject jsonObject1=new JSONObject();
         jsonObject1.put("list",list);
+        jsonObject1.put("businessBelongId",hwPlatform.getBusinessBelongId());
         log.info("param============{}", JSONObject.toJSONString(jsonObject1));
         //数据加密
         String biz_content = CryptTool.encode(JSONObject.toJSONString(jsonObject1));

+ 2 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/service/impl/HwPlatformCompanyServiceImpl.java

@@ -340,6 +340,7 @@ public class HwPlatformCompanyServiceImpl extends ServiceImpl<HwPlatformCompanyM
         hwPlatformCompany.setPlatformId(hwPlatform.getId());
         hwPlatformCompany.setUpdateTime(new Date());
         hwPlatformCompany.setSysOrgCode(sysDepart.getOrgCode());
+        hwPlatformCompany.setBusinessBelongId(hwPlatform.getBusinessBelongId());
         this.save(hwPlatformCompany);
         //同步慧盈
         String accessToken = OauthTokenUtils.getDayAccessToken();
@@ -359,6 +360,7 @@ public class HwPlatformCompanyServiceImpl extends ServiceImpl<HwPlatformCompanyM
         parameters.put("createBy", sysUser.getUsername());
         parameters.put("updateBy", sysUser.getUsername());
         parameters.put("paymentType", 1);
+        parameters.put("businessBelongId", hwPlatform.getBusinessBelongId());
         log.info("param============{}", JSONObject.toJSONString(parameters));
         //数据加密
         String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));