Explorar o código

feat: 提交结算校验是否配置了结算启用

李学松 %!s(int64=2) %!d(string=hai) anos
pai
achega
628382d50e

+ 5 - 0
db/v2.0/230110.sql

@@ -0,0 +1,5 @@
+-- deptSub新增字段
+alter table sys_dept_sub
+    add cert_enable tinyint default 1 null comment '认证是否启用:1:启用,0:停用';
+alter table sys_dept_sub
+    add settle_enable tinyint default 1 null comment '结算是否启用:1:启用,0:停用';

+ 4 - 4
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/SysDeptSub.java

@@ -83,13 +83,13 @@ public class SysDeptSub extends Model<SysDeptSub> {
 	private String[] pathNo;
 
 	/**
-	 * 认证限制:1:限制认证,0:可以认证
+	 * 认证是否启用:1:启用,0:停用
 	 */
-	private Boolean certLimit;
+	private Boolean certEnable;
 
 	/**
-	 * 结算限制:1:限制结算,0:可以结算
+	 * 结算是否启用:1:启用,0:停用
 	 */
-	private Boolean settleLimit;
+	private Boolean settleEnable;
 
 }

+ 4 - 5
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/SysDeptSubServiceImpl.java

@@ -35,7 +35,6 @@ import com.qunzhixinxi.hnqz.admin.mapper.WmDaAgentMapper;
 import com.qunzhixinxi.hnqz.admin.mapper.WmDaDrugEntMapper;
 import com.qunzhixinxi.hnqz.admin.service.SysDeptSubService;
 import com.qunzhixinxi.hnqz.common.core.util.R;
-import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
@@ -169,8 +168,8 @@ public class SysDeptSubServiceImpl extends ServiceImpl<SysDeptSubMapper, SysDept
 				updateDeptSub.setSubjectLocation(sysDeptSub.getSubjectLocation());
 				updateDeptSub.setSubjectInvoiceCategory(sysDeptSub.getSubjectInvoiceCategory());
 				updateDeptSub.setLimitAmount(sysDeptSub.getLimitAmount());
-				updateDeptSub.setCertLimit(sysDeptSub.getCertLimit());
-				updateDeptSub.setSettleLimit(sysDeptSub.getSettleLimit());
+				updateDeptSub.setCertEnable(sysDeptSub.getCertEnable());
+				updateDeptSub.setSettleEnable(sysDeptSub.getSettleEnable());
 				updateDeptSub.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 				updateDeptSub.setUpdateTime(LocalDateTime.now());
 				sysDeptSubMapper.updateById(updateDeptSub);
@@ -183,8 +182,8 @@ public class SysDeptSubServiceImpl extends ServiceImpl<SysDeptSubMapper, SysDept
 				insertDeptSub.setSubjectLocation(sysDeptSub.getSubjectLocation());
 				insertDeptSub.setSubjectInvoiceCategory(sysDeptSub.getSubjectInvoiceCategory());
 				insertDeptSub.setLimitAmount(sysDeptSub.getLimitAmount());
-				insertDeptSub.setCertLimit(sysDeptSub.getCertLimit());
-				insertDeptSub.setSettleLimit(sysDeptSub.getSettleLimit());
+				insertDeptSub.setCertEnable(sysDeptSub.getCertEnable());
+				insertDeptSub.setSettleEnable(sysDeptSub.getSettleEnable());
 				insertDeptSub.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 				sysDeptSubMapper.insert(insertDeptSub);
 			}

+ 11 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/SysUserServiceImpl.java

@@ -42,7 +42,6 @@ import com.qunzhixinxi.hnqz.admin.api.vo.UserVO;
 import com.qunzhixinxi.hnqz.admin.entity.SysCertResultRecord;
 import com.qunzhixinxi.hnqz.admin.entity.SysDeptSub;
 import com.qunzhixinxi.hnqz.admin.entity.SysUserSub;
-import com.qunzhixinxi.hnqz.admin.entity.WmScorePackageSettleNote;
 import com.qunzhixinxi.hnqz.admin.entity.dto.CommonUserDTO;
 import com.qunzhixinxi.hnqz.admin.entity.input.UserCertificationInput;
 import com.qunzhixinxi.hnqz.admin.entity.output.UserCertificationOutput;
@@ -645,6 +644,17 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 		StringBuilder msg = new StringBuilder();
 
 		for (String subjectLocation : input.getSubList()) {
+			// 校验是否配置了结算限制
+			Integer deptId = SecurityUtils.getUser().getDeptId();
+			SysDeptSub queryDeptSub = sysDeptSubMapper.selectOne(Wrappers.<SysDeptSub>lambdaQuery()
+					.eq(SysDeptSub::getDeptId, SecurityUtils.getUser().getDeptId())
+					.eq(SysDeptSub::getSubjectLocation, subjectLocation)
+					.eq(SysDeptSub::getEnableFlag, SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode()));
+			if (!queryDeptSub.getSettleEnable()) {
+				log.info("{}企业配置了结算限制", deptId);
+				return R.failed(null, "系统维护中,请联系管理员");
+			}
+
 			//人力家
 			if (SubjectLocation.REN_LI_JIA.getType().equals(subjectLocation)) {
 				Map<String, String> resultMap = certByRenLiJia(sysUser, sysDept);

+ 11 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmPayOffServiceImpl.java

@@ -252,6 +252,17 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		List<WmScorePackageSettleNote> notes = input.getNotes();
 		SubjectLocation location = input.getSubjectLocation();
 
+		// 校验是否配置了结算限制
+		Integer deptId = SecurityUtils.getUser().getDeptId();
+		SysDeptSub queryDeptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
+				.eq(SysDeptSub::getDeptId, SecurityUtils.getUser().getDeptId())
+				.eq(SysDeptSub::getSubjectLocation, location)
+				.eq(SysDeptSub::getEnableFlag, SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode()));
+		if (!queryDeptSub.getSettleEnable()) {
+			log.info("{}企业配置了结算限制", deptId);
+			throw new RuntimeException("系统维护中,请联系管理员");
+		}
+
 		// 校验人员信息
 		Set<Integer> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).map(Integer::valueOf).collect(Collectors.toSet());
 		userService.checkUserInfoToSettle(userIds, location);

+ 6 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageSettleNoteServiceImpl.java

@@ -342,6 +342,12 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 		SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.query(condition));
 
+		// 校验是否配置了结算限制
+		if (!sysDeptSub.getSettleEnable()) {
+			log.info("{}企业配置了结算限制", user.getDeptId());
+			throw new RuntimeException("系统维护中,请联系管理员");
+		}
+
 		if (null == sysDeptSub || StringUtils.isBlank(sysDeptSub.getAppId())) {
 			return R.failed("人员所在机构未配置结算信息");
 		}