Selaa lähdekoodia

feat: 初始化数据调整

lixuesong 3 vuotta sitten
vanhempi
commit
c800f5cd43

+ 13 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/InitController.java

@@ -19,8 +19,10 @@ import org.springframework.http.MediaType;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -34,6 +36,7 @@ import java.util.stream.Collectors;
  */
 @Slf4j
 @AllArgsConstructor
+@RestController
 @RequestMapping(value = "/init", produces = MediaType.APPLICATION_JSON_VALUE)
 public class InitController {
 
@@ -90,6 +93,13 @@ public class InitController {
 						GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(subjectType);
 
 						Integer subjectChannel = deptSub.getSubjectChannel();
+
+						if (subjectChannel != null && GigTypeEnum.TAX_HELPOR.equals(gigTypeEnum)) {
+							// 税邦云原0-中金、1-平安,转换为新1-中金、2-平安
+							subjectChannel = subjectChannel == 0 ? 1 : subjectChannel == 1 ? 2 : 0;
+						} else {
+							subjectChannel = 0;
+						}
 						GigChannelEnum gigChannelEnum = GigChannelEnum.resolve(subjectChannel);
 
 						if (gigChannelEnum == null) {
@@ -110,9 +120,10 @@ public class InitController {
 									userSub.setUserId(sysUser.getUserId());
 									userSub.setDeptId(sysUser.getDeptId());
 									userSub.setBankCardNumber(sysUser.getBankCardNumber());
-									userSub.setCertStatus(GigTypeEnum.REN_LI_JIA.equals(gigTypeEnum) ? sysUser.getCertStatus() : sysUser.getRljCertStatus());
+									userSub.setCertStatus(GigTypeEnum.REN_LI_JIA.equals(gigTypeEnum) ? sysUser.getRljCertStatus() : sysUser.getCertStatus());
 									userSub.setGigType(gigTypeEnum);
 									userSub.setGigChannel(gigChannelEnum);
+									userSub.setCertRemark("init from sys_user");
 									return userSub;
 
 								}).collect(Collectors.toList());
@@ -126,6 +137,7 @@ public class InitController {
 		List<SysUserSub> currSub = userSubService.list();
 		Set<Integer> currIds = currSub.stream().mapToInt(SysUserSub::getUserId).boxed().collect(Collectors.toSet());
 		List<SysUserSub> pureNew = initUserSubList.stream().filter(sysUserSub -> !currIds.contains(sysUserSub.getUserId())).collect(Collectors.toList());
+		pureNew.sort(Comparator.comparing(SysUserSub::getUserId));
 
 
 		// 初始化user_sub