Ver código fonte

Merge remote-tracking branch 'origin/master'

周箭河 4 anos atrás
pai
commit
1870fbc7bd

+ 8 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -945,6 +945,14 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 	public boolean transferProduceContract(Integer userId,String musicGroupId) {
 		SysUser user = studentDao.lockUserReturnInfo(userId);
 
+		if (user == null) {
+			throw new BizException("用户不存在");
+		}
+
+		if(StringUtils.isBlank(user.getRealName())||StringUtils.isBlank(user.getIdCardNo())){
+			throw new BizException("身份信息不全");
+		}
+
 		List<SysUserContracts> userContracts = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT);
 		if(!CollectionUtils.isEmpty(userContracts)){
 			return true;
@@ -952,9 +960,6 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 
 		SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
 		if (sysUserTsign == null) {
-			if (user == null) {
-				throw new BizException("用户信息查询失败");
-			}
 			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 		Date date = new Date();

+ 1 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java

@@ -78,9 +78,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
         map.put(userId, userId.toString());
         if (studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS) {
             try {
-                if(Objects.isNull(info.getUserId())){
-                    contractService.transferProduceContract(userId, null);
-                }
+                contractService.transferProduceContract(userId, null);
             } catch (Exception e) {
                 logger.error("产品协议生成失败", e);
             }

+ 4 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -660,12 +660,10 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         map.put(userId, userId.toString());
 
         if (studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS) {
-            if(repairInfo.getType()==1){
-                try {
-                    contractService.transferProduceContract(userId, null);
-                } catch (Exception e) {
-                    logger.error("产品协议生成失败", e);
-                }
+            try {
+                contractService.transferProduceContract(userId, null);
+            } catch (Exception e) {
+                logger.error("产品协议生成失败", e);
             }
 
             repairInfo.setPayStatus(2);