Browse Source

feat: pc端结算相关的渠道类型修改

lixuesong 3 years ago
parent
commit
a489b777c0

+ 14 - 6
db/v2.0/220720.sql

@@ -26,15 +26,23 @@ create table sys_user_ext_record
     comment '用户认证相关的扩展信息';
 
 
--- 新增字段
+-- deptSub表新增字段
 alter table sys_dept_sub
-    add subject_location varchar(20) null comment '税源地' after subject_channel;
+    add subject_location varchar(64) null comment '税源地' after subject_channel;
 
--- 新增字段
+-- userSub表新增字段
 alter table sys_user_sub
-    add subject_location varchar(20) null comment '税源地' after gig_channel;
+    add subject_location varchar(64) null comment '税源地' after gig_channel;
 
--- 新增字段
+-- 结算表新增字段
 alter table wm_score_package_settle_note
-    add subject_location varchar(20) null comment '税源地';
+    add subject_location varchar(64) null comment '税源地';
+
+-- 积分包表新增字段
+alter table wm_score_package
+    add subject_location varchar(64) null comment '税源地';
+
+-- 平台限额表新增字段
+alter table monitoring_indicator
+    add subject_location varchar(64) null comment '税源地';
 

+ 2 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmPayOffController.java

@@ -340,7 +340,7 @@ public class WmPayOffController {
 		if (StringUtils.isEmpty(input.getId())) {
 			return R.failed("数据异常");
 		}
-		if (StringUtils.isEmpty(input.getSubType())) {
+		if (input.getSubjectLocation() == null) {
 			return R.failed("数据异常");
 		}
 		if (CollectionUtils.isEmpty(input.getNotes())) {
@@ -371,7 +371,7 @@ public class WmPayOffController {
 		}
 		List<Map<String, String>> msgList = new ArrayList<>();
 		for (WmScorePackageSettleInput input : inputList) {
-			if (StringUtils.isEmpty(input.getId()) || StringUtils.isEmpty(input.getSubType())
+			if (StringUtils.isEmpty(input.getId()) || null == input.getSubjectLocation()
 					|| null == input.getInvoiceCategory() || StringUtils.isEmpty(input.getScorePackageName())) {
 				return R.failed("数据异常");
 			}

+ 5 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/MonitoringIndicator.java

@@ -66,4 +66,9 @@ public class MonitoringIndicator extends Model<MonitoringIndicator> {
 	private BigDecimal yaoyiLimitAmount;
 
 	private String subType;
+
+	/**
+	 * 税源地
+	 */
+	private String subjectLocation;
 }

+ 6 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmScorePackage.java

@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmReportOpt;
+import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -462,6 +463,11 @@ public class WmScorePackage extends Model<WmScorePackage> {
 	@ApiModelProperty(value = "结算渠道")
 	private String subType;
 
+	/**
+	 * 税源地
+	 */
+	private SubjectLocation subjectLocation;
+
 	/**
 	 * 数据来源类型(0:手动上传,1:系统对接)
 	 */

+ 7 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/input/SettleAmountMonitorInput.java

@@ -1,5 +1,6 @@
 package com.qunzhixinxi.hnqz.admin.entity.input;
 
+import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import lombok.Data;
 
 import java.time.LocalDate;
@@ -30,7 +31,9 @@ public class SettleAmountMonitorInput {
 
 	private String subType;
 
-	public static SettleAmountMonitorInput fromIdCard(List<String> idCard, List<Integer> ids, String subType) {
+	private SubjectLocation subjectLocation;
+
+	public static SettleAmountMonitorInput fromIdCard(List<String> idCard, List<Integer> ids, String subType, SubjectLocation subjectLocation) {
 		SettleAmountMonitorInput input = new SettleAmountMonitorInput();
 
 		input.idCard = idCard;
@@ -40,11 +43,12 @@ public class SettleAmountMonitorInput {
 		input.startTime = now.withDayOfMonth(1);
 		input.endTime = now.plusMonths(1L).withDayOfMonth(1);
 		input.subType = subType;
+		input.subjectLocation = subjectLocation;
 
 		return input;
 	}
 
-	public static SettleAmountMonitorInput fromUserId(List<String> userIds, List<Integer> ids, String subType) {
+	public static SettleAmountMonitorInput fromUserId(List<String> userIds, List<Integer> ids, String subType, SubjectLocation subjectLocation) {
 		SettleAmountMonitorInput input = new SettleAmountMonitorInput();
 
 		input.userIds = userIds;
@@ -54,6 +58,7 @@ public class SettleAmountMonitorInput {
 		input.startTime = now.withDayOfMonth(1);
 		input.endTime = now.plusMonths(1L).withDayOfMonth(1);
 		input.subType = subType;
+		input.subjectLocation = subjectLocation;
 
 		return input;
 	}

+ 2 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/enums/SubjectTypeEnum.java

@@ -14,8 +14,8 @@ public enum SubjectTypeEnum {
 	TYPE_SHUIBANGYUN("1", "税邦云"),
 	TYPE_OLADING("2", "自由职家"),
 	TYPE_YEE("3", "易联数科"),
-	TYPE_JIN_YUAN("4", "金园数科"),
-	TYPE_XIN_TAI_ZI("5", "薪泰梓"),
+//	TYPE_JIN_YUAN("4", "金园数科"),
+//	TYPE_XIN_TAI_ZI("5", "薪泰梓"),
 
 
 	ENABLE_FLAG_FALSE("0", "无效"),

+ 2 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/MonitoringIndicatorService.java

@@ -19,6 +19,7 @@ package com.qunzhixinxi.hnqz.admin.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qunzhixinxi.hnqz.admin.entity.MonitoringIndicator;
+import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 
 /**
  * 风险监控
@@ -28,5 +29,5 @@ import com.qunzhixinxi.hnqz.admin.entity.MonitoringIndicator;
  */
 public interface MonitoringIndicatorService extends IService<MonitoringIndicator> {
 
-	MonitoringIndicator getBySubType(String subType);
+	MonitoringIndicator getBySubType(String subType, SubjectLocation subjectLocation);
 }

+ 12 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/MonitoringIndicatorServiceImpl.java

@@ -19,6 +19,7 @@ package com.qunzhixinxi.hnqz.admin.service.impl;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qunzhixinxi.hnqz.admin.entity.MonitoringIndicator;
+import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.MonitoringIndicatorMapper;
 import com.qunzhixinxi.hnqz.admin.service.MonitoringIndicatorService;
@@ -36,11 +37,20 @@ import static com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants.MONITORING_
 @Service
 public class MonitoringIndicatorServiceImpl extends ServiceImpl<MonitoringIndicatorMapper, MonitoringIndicator> implements MonitoringIndicatorService {
 
+	/**
+	 * 查询平台限额
+	 *
+	 * @param subType 渠道类型
+	 * @param subjectLocation 税源地
+	 * @return
+	 */
 	// @Cacheable(value = MONITORING_INDICATOR)
 	@Override
-	public MonitoringIndicator getBySubType(String subType) {
+	public MonitoringIndicator getBySubType(String subType, SubjectLocation subjectLocation) {
 
-		return this.getOne(Wrappers.<MonitoringIndicator>lambdaQuery().eq(MonitoringIndicator::getSubType, subType));
+		return this.getOne(Wrappers.<MonitoringIndicator>lambdaQuery()
+				.eq(MonitoringIndicator::getSubType, subType)
+				.eq(MonitoringIndicator::getSubjectLocation, subjectLocation));
 		// if(SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(subType)){
 		// 	return baseMapper.selectById(1);
 		// }else if(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode().equals(subType)){

+ 27 - 12
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/PartyAServiceImpl.java

@@ -48,6 +48,7 @@ import com.qunzhixinxi.hnqz.admin.enums.GigTypeEnum;
 import com.qunzhixinxi.hnqz.admin.enums.LockEnum;
 import com.qunzhixinxi.hnqz.admin.enums.PackageFinishStatusEnum;
 import com.qunzhixinxi.hnqz.admin.enums.ScorePackageStatusEnum;
+import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.SysCertResultRecordMapper;
 import com.qunzhixinxi.hnqz.admin.mapper.UserAgreementSignatureRecordMapper;
@@ -227,6 +228,7 @@ public class PartyAServiceImpl implements PartyAService {
 		SysDeptSub query = new SysDeptSub();
 		query.setDeptId(dept.getDeptId());
 		query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+		query.setSubjectLocation(SubjectLocation.LUO_SHU_YUN);
 		query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 		SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
 		info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, String.valueOf(taxHelperAddMemberDTO.getType()));
@@ -1051,6 +1053,7 @@ public class PartyAServiceImpl implements PartyAService {
 
 					note.setUserId(String.valueOf(user.getUserId()));
 					note.setSubType("1");
+					note.setSubjectLocation(SubjectLocation.LUO_SHU_YUN);
 
 					Map<String, Object> saveMap = new HashMap<>(3);
 					saveMap.put("task", task);
@@ -1156,19 +1159,29 @@ public class PartyAServiceImpl implements PartyAService {
 			return getResultMap("4000", "结算金额不正确");
 		}
 
+		// 设置税源地
+		SubjectLocation subjectLocation = SubjectLocation.LUO_SHU_YUN;
+		if (scorePackageSettleNoteDTO.getChannel().equals(ChannelEnum.TAX_HELPER)) {
+			subjectLocation = SubjectLocation.LUO_SHU_YUN;
+		} else if (scorePackageSettleNoteDTO.getChannel().equals(ChannelEnum.DING)) {
+			subjectLocation = SubjectLocation.REN_LI_JIA;
+		}
+
+		String subType = String.valueOf(subjectLocation.getGigType().getCode());
+
 		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, scorePackageSettleNoteDTO
 				.getChannel()
-				.val());
+				.val(), subjectLocation);
 		List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
 
 		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, scorePackageSettleNoteDTO
 				.getChannel()
-				.val());
+				.val(), subjectLocation);
 		List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
 
 		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, scorePackageSettleNoteDTO
 				.getChannel()
-				.val());
+				.val(), subjectLocation);
 		List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
 
 		SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
@@ -1180,10 +1193,11 @@ public class PartyAServiceImpl implements PartyAService {
 		SettleAmountMonitorOutput yaoyiMonitorOutput = yaoyiAmountMonitor.stream().filter(item -> item.getIdCardNumber()
 				.equals(member.getIdCardNumber())).findFirst().orElse(null);
 
-		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(note.getSubType());
+		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(subType, subjectLocation);
 		SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
 				.eq(SysDeptSub::getDeptId, dept.getDeptId())
 				.eq(SysDeptSub::getSubjectType, note.getSubType())
+				.eq(SysDeptSub::getSubjectLocation, note.getSubjectLocation())
 		);
 		BigDecimal deptLimit = sysDeptSub.getLimitAmount();
 		BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
@@ -1225,7 +1239,7 @@ public class PartyAServiceImpl implements PartyAService {
 			}
 			updateEntity = new WmScorePackageSettleNote();
 			updateEntity.setId(note.getId());
-			updateEntity.setSubType(note.getSubType());
+			updateEntity.setSubType(subType);
 			updateEntity.setInvoiceType(note.getInvoiceType());
 			updateEntity.setCategoryName(scorePackageSettleNoteDTO.getInvoiceCategory());
 			updateEntity.setSettleAmount(note.getSettleAmount());
@@ -1252,7 +1266,7 @@ public class PartyAServiceImpl implements PartyAService {
 			}
 		} else {
 			WmScorePackageSettleNote entity = new WmScorePackageSettleNote();
-			entity.setSubType(note.getSubType());
+			entity.setSubType(subType);
 			entity.setInvoiceType(note.getInvoiceType());
 			entity.setCategoryName(note.toCategoryName());
 			entity.setSettleAmount(note.getSettleAmount());
@@ -1309,7 +1323,7 @@ public class PartyAServiceImpl implements PartyAService {
 		SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
 				.eq(SysDeptSub::getDeptId, execSettlementDTO.getDeptId())
 				.eq(SysDeptSub::getEnableFlag, SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode())
-				.eq(SysDeptSub::getSubjectType, execSettlementDTO.getSubjectType())
+				.eq(SysDeptSub::getSubjectLocation, SubjectLocation.LUO_SHU_YUN)
 		);
 
 		info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, null);
@@ -1389,15 +1403,15 @@ public class PartyAServiceImpl implements PartyAService {
 		String info = null;
 
 		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(Collections.singletonList(user
-				.getIdCardNumber()), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				.getIdCardNumber()), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
 
 		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(Collections.singletonList(String
-				.valueOf(user.getUserId())), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				.valueOf(user.getUserId())), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
 
 		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(Collections.singletonList(user
-				.getIdCardNumber()), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				.getIdCardNumber()), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
 
 		SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
@@ -1410,7 +1424,7 @@ public class PartyAServiceImpl implements PartyAService {
 				.equals(user.getIdCardNumber())).findFirst().orElse(null);
 
 		MonitoringIndicator monitoringIndicator =
-				monitoringIndicatorService.getBySubType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				monitoringIndicatorService.getBySubType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
 		BigDecimal yaoyiMonitoringLimit = monitoringIndicator.getYaoyiLimitAmount();
 		BigDecimal monitorAmount = settleAmount;
@@ -1575,7 +1589,8 @@ public class PartyAServiceImpl implements PartyAService {
 		SysUserSub userSub = sysUserSubService.getOne(Wrappers.<SysUserSub>lambdaQuery()
 				.eq(SysUserSub::getUserId, updateUser.getUserId())
 				.eq(SysUserSub::getDeptId, updateUser.getDeptId())
-				.eq(SysUserSub::getGigType, GigTypeEnum.TAX_HELPOR));
+				.eq(SysUserSub::getGigType, GigTypeEnum.TAX_HELPOR)
+				.eq(SysUserSub::getSubjectLocation, SubjectLocation.LUO_SHU_YUN));
 		LocalDateTime now = LocalDateTime.now();
 
 		Integer certStatus = response.success() ? TaxHelperCertStatus.ADD_MEMBER.getCode() : TaxHelperCertStatus.UN_CERT.getCode();

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

@@ -289,12 +289,13 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 				return R.failed(user.getRealname() + "未认证,不能发起结算");
 			}
 
-			// 获取结算零工
-			GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(input.getSubType()));
-			if (gigTypeEnum == null) {
+			if (input.getSubjectLocation() == null) {
 				return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
 			}
 
+			// 获取结算零工
+			GigTypeEnum gigTypeEnum = input.getSubjectLocation().getGigType();
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, gigTypeEnum)
 					.eq(SysUserSub::getUserId, user.getUserId())
 			);
@@ -323,18 +324,20 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 			note.setCategoryName(input.getCategoryName());
 		}
 
+		String subType = String.valueOf(input.getSubjectLocation().getGigType().getCode());
+
 		// 校验当月结算额度
 		List<String> idCard = notes.stream().map(WmScorePackageSettleNote::getIdCardNumber).collect(Collectors.toList());
 		List<Integer> ids = notes.stream().filter(item -> null != item.getId()).map(WmScorePackageSettleNote::getId).collect(Collectors.toList());
 		List<String> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toList());
 
-		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, input.getSubType());
+		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, input.getSubjectLocation());
 		List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
 
-		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, input.getSubType());
+		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, subType, input.getSubjectLocation());
 		List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
 
-		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, input.getSubType());
+		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, input.getSubjectLocation());
 		List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
 
 		// 结算渠道
@@ -348,7 +351,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		}
 
 		// 限额
-		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(input.getSubType());
+		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(subType, input.getSubjectLocation());
 
 		BigDecimal deptLimit = sysDeptSub.getLimitAmount();
 		BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
@@ -397,7 +400,8 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 
 			note.setUpdateTime(now);
 			note.setSubTime(now);
-			note.setSubType(input.getSubType());
+			note.setSubType(subType);
+			note.setSubjectLocation(input.getSubjectLocation());
 			note.setInvoiceType(input.getInvoiceCategory());
 			note.setCategoryName(input.getCategoryName());
 			if (null == note.getId()) {
@@ -412,7 +416,8 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		updateEntity.setScorePackageStatus("5");
 		updateEntity.setSettleFlag("1");
 		updateEntity.setDescription(input.getDescription());
-		updateEntity.setSubType(input.getSubType());
+		updateEntity.setSubType(subType);
+		updateEntity.setSubjectLocation(input.getSubjectLocation());
 		updateEntity.setSettlementDate(LocalDateTime.now());
 
 		if ("2".equals(wmScorePackage.getPackageType2())) {
@@ -443,14 +448,16 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 				return R.failed(user.getRealname() + "未认证,不能发起结算");
 			}
 
-			// 获取结算零工
-			GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(input.getSubType()));
-
-			if (gigTypeEnum == null) {
+			if (input.getSubjectLocation() == null) {
 				return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
 			}
 
-			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, gigTypeEnum)
+			// 获取结算零工
+			GigTypeEnum gigTypeEnum = input.getSubjectLocation().getGigType();
+
+			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
+					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
+					.eq(SysUserSub::getDeptId, user.getDeptId())
 					.eq(SysUserSub::getUserId, user.getUserId())
 			);
 
@@ -478,24 +485,26 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 			note.setCategoryName(input.getCategoryName());
 		}
 
+		String subType = String.valueOf(input.getSubjectLocation().getGigType().getCode());
+
 		// 校验当月结算额度
 		List<String> idCard = notes.stream().map(WmScorePackageSettleNote::getIdCardNumber).collect(Collectors.toList());
 		List<Integer> ids = notes.stream().filter(item -> null != item.getId()).map(WmScorePackageSettleNote::getId).collect(Collectors.toList());
 		List<String> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toList());
 
-		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, input.getSubType());
+		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, input.getSubjectLocation());
 		List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
 
-		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, input.getSubType());
+		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, subType, input.getSubjectLocation());
 		List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
 
-		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, input.getSubType());
+		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, input.getSubjectLocation());
 		List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
 
 		// 结算渠道
 		SysDeptSub condition = new SysDeptSub();
 		condition.setDeptId(SecurityUtils.getUser().getDeptId());
-		condition.setSubjectType(input.getSubType());
+		condition.setSubjectLocation(input.getSubjectLocation());
 		condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 		SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.query(condition));
 		if (null == sysDeptSub || StringUtils.isBlank(sysDeptSub.getAppId())) {
@@ -503,7 +512,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		}
 
 		// 限额
-		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(input.getSubType());
+		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(subType, input.getSubjectLocation());
 
 		BigDecimal deptLimit = sysDeptSub.getLimitAmount();
 		BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
@@ -552,7 +561,8 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 
 			note.setUpdateTime(now);
 			note.setSubTime(now);
-			note.setSubType(input.getSubType());
+			note.setSubType(subType);
+			note.setSubjectLocation(input.getSubjectLocation());
 			note.setInvoiceType(input.getInvoiceCategory());
 			// note.setCategoryName(input.toCategoryName());
 			note.setCategoryName(input.getCategoryName());
@@ -565,7 +575,8 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		updateEntity.setSettleAmount(total);
 		updateEntity.setId(input.getId());
 		updateEntity.setDescription(input.getDescription());
-		updateEntity.setSubType(input.getSubType());
+		updateEntity.setSubType(subType);
+		updateEntity.setSubjectLocation(input.getSubjectLocation());
 
 //		updateEntity.setSettleStatus(DingEnum.SETTLE_STATUS_WAIT.getType());
 
@@ -655,15 +666,14 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 
 		String taxCode = sysDept.getTaxCode();
 
+		String subType = String.valueOf(input.getSubjectLocation().getGigType().getCode());
+
 		// 人力家
-		if (SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(input.getSubType())) {
+		if (SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(subType)) {
 			return settleByRenLiJia(input, sysDeptSub, wmScorePackage);
 		}
 		// 自由职家
-		else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(input.getSubType())
-			|| SubjectTypeEnum.TYPE_JIN_YUAN.getCode().equals(input.getSubType())
-			|| SubjectTypeEnum.TYPE_XIN_TAI_ZI.getCode().equals(input.getSubType())
-		) {
+		else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(subType)) {
 			return settleByOlading(input, sysDeptSub, wmScorePackage, taxCode);
 		}
 		// 税邦云
@@ -1247,7 +1257,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		 * 发起结算
 		 */
 		log.info("结算包ID: {} 开始结算-----------", input.getId());
-		log.info("结算渠道: {} ", input.getSubType());
+		log.info("结算渠道(税源地): {} ", input.getSubjectLocation());
 		/**
 		 * 1.校验身份证信息
 		 */

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

@@ -167,6 +167,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 					.divide(new BigDecimal(wmScorePackage.getTaskNum()), 2, BigDecimal.ROUND_HALF_UP);
 			query.setSettleAmount(amount);
 			query.setSubType(wmScorePackage.getSubType());
+			query.setSubjectLocation(wmScorePackage.getSubjectLocation());
 		}
 		query.setRealName(user.getRealname());
 		query.setIdCardNumber(user.getIdCardNumber());
@@ -183,20 +184,26 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		if (StringUtils.isEmpty(user.getIdCardNumber())) {
 			return R.failed(user.getRealname() + "未认证,不能发起结算");
 		}
-		if ("0".equals(note.getSubType())) {
-			if (!Objects.equals(user.getRljCertStatus(), DingEnum.CER_STATUS_1.getType())) {
-				return R.failed(user.getRealname() + "未认证,不能发起结算");
-			}
+
+		if (note.getSubjectLocation() == null) {
+			return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
 		}
-		if ("1".equals(note.getSubType())) {
-			if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
-				return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
-			}
+
+		String subType = String.valueOf(note.getSubjectLocation().getGigType().getCode());
+
+		SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
+				.eq(SysUserSub::getSubjectLocation, note.getSubjectLocation())
+				.eq(SysUserSub::getDeptId, user.getDeptId())
+				.eq(SysUserSub::getUserId, user.getUserId())
+		);
+		if (userSub == null) {
+			return R.failed(user.getRealname() + "人员认证信息不存在,不能结算");
 		}
 
 		SysDeptSub condition = new SysDeptSub();
 		condition.setDeptId(user.getDeptId());
-		condition.setSubjectType(note.getSubType());
+		condition.setSubjectType(subType);
+		condition.setSubjectLocation(note.getSubjectLocation());
 		condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 		SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.query(condition));
 
@@ -212,13 +219,13 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		if (null != note.getId()) {
 			ids.add(note.getId());
 		}
-		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, note.getSubType());
+		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, note.getSubjectLocation());
 		List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
 
-		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, note.getSubType());
+		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, subType, note.getSubjectLocation());
 		List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
 
-		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, note.getSubType());
+		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, note.getSubjectLocation());
 		List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
 
 		SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
@@ -230,7 +237,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		SettleAmountMonitorOutput yaoyiMonitorOutput = yaoyiAmountMonitor.stream().filter(item -> item.getIdCardNumber()
 				.equals(user.getIdCardNumber())).findFirst().orElse(null);
 
-		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(note.getSubType());
+		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(subType, note.getSubjectLocation());
 		BigDecimal deptLimit = sysDeptSub.getLimitAmount();
 		BigDecimal yaoyiLimit = monitoringIndicator.getYaoyiLimitAmount();
 		BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
@@ -266,7 +273,8 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		if (null == note.getId()) {
 
 			WmScorePackageSettleNote entity = new WmScorePackageSettleNote();
-			entity.setSubType(note.getSubType());
+			entity.setSubType(subType);
+			entity.setSubjectLocation(note.getSubjectLocation());
 			entity.setInvoiceType(note.getInvoiceType());
 			entity.setCategoryName(note.toCategoryName());
 			entity.setSettleAmount(note.getSettleAmount());
@@ -290,7 +298,8 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			}
 			WmScorePackageSettleNote updateEntity = new WmScorePackageSettleNote();
 			updateEntity.setId(note.getId());
-			updateEntity.setSubType(note.getSubType());
+			updateEntity.setSubType(subType);
+			updateEntity.setSubjectLocation(note.getSubjectLocation());
 			updateEntity.setInvoiceType(note.getInvoiceType());
 			updateEntity.setCategoryName(note.getCategoryName());
 			updateEntity.setSettleAmount(note.getSettleAmount());
@@ -310,20 +319,26 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		if (StringUtils.isEmpty(user.getIdCardNumber())) {
 			return R.failed(user.getRealname() + "未认证,不能发起结算");
 		}
-		if ("0".equals(note.getSubType())) {
-			if (!Objects.equals(user.getRljCertStatus(), DingEnum.CER_STATUS_1.getType())) {
-				return R.failed(user.getRealname() + "未认证,不能发起结算");
-			}
+
+		if (note.getSubjectLocation() == null) {
+			return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
 		}
-		if ("1".equals(note.getSubType())) {
-			if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
-				return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
-			}
+
+		String subType = String.valueOf(note.getSubjectLocation().getGigType().getCode());
+
+		SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
+				.eq(SysUserSub::getSubjectLocation, note.getSubjectLocation())
+				.eq(SysUserSub::getDeptId, user.getDeptId())
+				.eq(SysUserSub::getUserId, user.getUserId())
+		);
+		if (userSub == null) {
+			return R.failed(user.getRealname() + "人员认证信息不存在,不能结算");
 		}
 
 		SysDeptSub condition = new SysDeptSub();
 		condition.setDeptId(user.getDeptId());
-		condition.setSubjectType(note.getSubType());
+		condition.setSubjectType(subType);
+		condition.setSubjectLocation(note.getSubjectLocation());
 		condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 		SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.query(condition));
 
@@ -339,13 +354,13 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		if (null != note.getId()) {
 			ids.add(note.getId());
 		}
-		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, note.getSubType());
+		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, note.getSubjectLocation());
 		List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
 
-		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, note.getSubType());
+		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, subType, note.getSubjectLocation());
 		List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
 
-		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, note.getSubType());
+		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, subType, note.getSubjectLocation());
 		List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
 
 		SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
@@ -357,7 +372,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		SettleAmountMonitorOutput yaoyiMonitorOutput = yaoyiAmountMonitor.stream().filter(item -> item.getIdCardNumber()
 				.equals(user.getIdCardNumber())).findFirst().orElse(null);
 
-		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(note.getSubType());
+		MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(subType, note.getSubjectLocation());
 		BigDecimal deptLimit = sysDeptSub.getLimitAmount();
 		BigDecimal yaoyiLimit = monitoringIndicator.getYaoyiLimitAmount();
 		BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
@@ -399,7 +414,8 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			}
 			updateEntity = new WmScorePackageSettleNote();
 			updateEntity.setId(note.getId());
-			updateEntity.setSubType(note.getSubType());
+			updateEntity.setSubType(subType);
+			updateEntity.setSubjectLocation(note.getSubjectLocation());
 			updateEntity.setInvoiceType(note.getInvoiceType());
 			updateEntity.setCategoryName(note.toCategoryName());
 			updateEntity.setSettleAmount(note.getSettleAmount());
@@ -416,7 +432,8 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			return R.ok();
 		} else {
 			WmScorePackageSettleNote entity = new WmScorePackageSettleNote();
-			entity.setSubType(note.getSubType());
+			entity.setSubType(subType);
+			entity.setSubjectLocation(note.getSubjectLocation());
 			entity.setInvoiceType(note.getInvoiceType());
 			entity.setCategoryName(note.toCategoryName());
 			entity.setSettleAmount(note.getSettleAmount());
@@ -488,12 +505,22 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			return R.failed("数据异常,不能结算");
 		}
 
+		SysUser sysUser = sysUserService.getById(note.getUserId());
+
+		if (input.getSubjectLocation() == null) {
+			return R.failed(sysUser.getRealname() + "人员结算渠道不存在,不能结算");
+		}
+
+		// 获取结算零工
+		GigTypeEnum gigTypeEnum = input.getSubjectLocation().getGigType();
+		String subType = String.valueOf(input.getSubjectLocation().getGigType().getCode());
+
 		/**
 		 * 结算配置信息
 		 */
 		SysDeptSub condition = new SysDeptSub();
 		condition.setDeptId(sysDept.getDeptId());
-		condition.setSubjectType(note.getSubType());
+		condition.setSubjectType(subType);
 		condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 		SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.query(condition));
 
@@ -501,16 +528,9 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			return R.failed("机构appId未维护");
 		}
 
-		SysUser sysUser = sysUserService.getById(note.getUserId());
-
-		// 获取结算零工
-		GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(note.getSubType()));
-
-		if (gigTypeEnum == null) {
-			return R.failed(sysUser.getRealname() + "人员结算渠道不存在,不能结算");
-		}
-
-		SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, gigTypeEnum)
+		SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
+				.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
+				.eq(SysUserSub::getDeptId, sysUser.getDeptId())
 				.eq(SysUserSub::getUserId, sysUser.getUserId())
 		);
 
@@ -554,9 +574,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		}
 		// 自由职家
-		else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(note.getSubType())
-				|| SubjectTypeEnum.TYPE_JIN_YUAN.getCode().equals(note.getSubType())
-			|| SubjectTypeEnum.TYPE_XIN_TAI_ZI.getCode().equals(note.getSubType())
+		else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(subType)
 		) {
 			String taxCode = sysDept.getTaxCode();
 			return settleByOlading(note, wmScorePackage, sysUser, taxCode);
@@ -591,7 +609,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		List<SysDeptSub> subList = sysDeptSubService.list(Wrappers.query(condition));
 		Map<String, SysDeptSub> subMap = new HashMap<>();
 
-		subList.forEach(item -> subMap.put(item.getSubjectType(), item));
+		subList.forEach(item -> subMap.put(item.getSubjectLocation().name(), item));
 
 		String[] ids = input.getIdStr().split(",");
 		List<WmScorePackageSettleNote> noteList = new ArrayList<>(ids.length);
@@ -611,7 +629,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			/**
 			 * 结算配置信息
 			 */
-			SysDeptSub sysDeptSub = subMap.get(note.getSubType());
+			SysDeptSub sysDeptSub = subMap.get(note.getSubjectLocation().name());
 
 			if (null == sysDeptSub || StringUtils.isEmpty(sysDeptSub.getAppId())) {
 				return R.failed("机构appId未维护");
@@ -619,14 +637,17 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 			SysUser sysUser = sysUserService.getById(note.getUserId());
 
-			// 获取结算零工
-			GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(note.getSubType()));
-
-			if (gigTypeEnum == null) {
+			if (input.getSubjectLocation() == null) {
 				return R.failed(sysUser.getRealname() + "人员结算渠道不存在,不能结算");
 			}
 
-			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, gigTypeEnum)
+			// 获取结算零工
+			GigTypeEnum gigTypeEnum = input.getSubjectLocation().getGigType();
+			String subType = String.valueOf(input.getSubjectLocation().getGigType().getCode());
+
+			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
+					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
+					.eq(SysUserSub::getDeptId, sysUser.getDeptId())
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 			);
 
@@ -660,7 +681,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			log.info("结算明细noteId: {} 开始结算-----------", note.getId());
 			log.info("结算渠道: {} ", note.getSubType());
 
-			if (SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(input.getSubType())) {
+			if (SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(subType)) {
 				DingConfig config = new DingConfig();
 				config.setAppId(sysDeptSub.getAppId());
 				config.setAppSecret(sysDeptSub.getAppSecret());
@@ -670,8 +691,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 			}
 			// 自由职家
-			else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(note.getSubType()) || SubjectTypeEnum.TYPE_JIN_YUAN.getCode().equals(note.getSubType())
-				|| SubjectTypeEnum.TYPE_XIN_TAI_ZI.getCode().equals(note.getSubType())) {
+			else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(subType)) {
 				oladingNoteList.add(note);
 			}
 			// 税邦云

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

@@ -57,6 +57,7 @@ import com.qunzhixinxi.hnqz.admin.enums.PackageFinishStatusEnum;
 import com.qunzhixinxi.hnqz.admin.enums.PackageStatusEnum;
 import com.qunzhixinxi.hnqz.admin.enums.PackageTypeEnum;
 import com.qunzhixinxi.hnqz.admin.enums.ScorePackageStatusEnum;
+import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
 import com.qunzhixinxi.hnqz.admin.enums.TaskStatusEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.WmReportMapper;
@@ -2222,15 +2223,15 @@ public class WmTaskServiceImpl extends ServiceImpl<WmTaskMapper, WmTask> impleme
 		String info = null;
 
 		SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(Collections.singletonList(user
-				.getIdCardNumber()), null, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				.getIdCardNumber()), null, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
 
 		SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(Collections.singletonList(String
-				.valueOf(user.getUserId())), null, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				.valueOf(user.getUserId())), null, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
 
 		SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(Collections.singletonList(user
-				.getIdCardNumber()), null, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				.getIdCardNumber()), null, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
 
 		SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
@@ -2244,7 +2245,7 @@ public class WmTaskServiceImpl extends ServiceImpl<WmTaskMapper, WmTask> impleme
 
 
 		MonitoringIndicator monitoringIndicator =
-				monitoringIndicatorService.getBySubType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
+				monitoringIndicatorService.getBySubType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
 		BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
 		BigDecimal yaoyiMonitoringLimit = monitoringIndicator.getYaoyiLimitAmount();
 		BigDecimal monitorAmount = settleAmount;

+ 3 - 0
hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/SysDeptSubMapper.xml

@@ -21,6 +21,7 @@
 			sum(t.settle_amount) AS totalAmount
 		FROM wm_score_package_settle_note t
 		WHERE t.sub_type = #{query.subType,jdbcType=VARCHAR}
+	    AND t.subject_location = #{query.subjectLocation, jdbcType=VARCHAR}
 		AND t.create_time &gt; #{query.startTime,jdbcType=TIMESTAMP}
 		AND t.create_time &lt; #{query.endTime,jdbcType=TIMESTAMP}
 		AND t.id_card_number IN
@@ -42,6 +43,7 @@
 		sum(t.settle_amount) AS totalAmount
 		FROM wm_score_package_settle_note t
 		WHERE t.sub_type = #{query.subType,jdbcType=VARCHAR}
+		AND t.subject_location = #{query.subjectLocation, jdbcType=VARCHAR}
 		AND t.create_time &gt; #{query.startTime,jdbcType=TIMESTAMP}
 		AND t.create_time &lt; #{query.endTime,jdbcType=TIMESTAMP}
 		AND t.user_id IN
@@ -62,6 +64,7 @@
 		sum(t.settle_amount) AS totalAmount
 		FROM wm_score_package_settle_note t
 		WHERE t.create_time &gt; #{query.startTime,jdbcType=TIMESTAMP}
+		AND t.subject_location = #{query.subjectLocation, jdbcType=VARCHAR}
 		AND t.create_time &lt; #{query.endTime,jdbcType=TIMESTAMP}
 		AND t.id_card_number IN
 		<foreach item="item" index="index" collection="query.idCard" open="(" separator="," close=")">