Selaa lähdekoodia

fix: MAH支付-结算包结算

李学松 2 vuotta sitten
vanhempi
commit
c1ad4082f9

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

@@ -35,6 +35,7 @@ import com.qunzhixinxi.hnqz.admin.entity.*;
 import com.qunzhixinxi.hnqz.admin.entity.input.SettleNoteStatusOutput;
 import com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput;
 import com.qunzhixinxi.hnqz.admin.entity.output.WmTaskSettleNoteOutput;
+import com.qunzhixinxi.hnqz.admin.enums.DelEnum;
 import com.qunzhixinxi.hnqz.admin.enums.GigTypeEnum;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
@@ -374,7 +375,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			location = deptSubs.get(0).getSubjectLocation();
 		}
 
-		String subType = String.valueOf(note.getSubjectLocation().getGigType().getCode());
+		String subType = String.valueOf(location.getGigType().getCode());
 
 		SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 				.eq(SysUserSub::getSubjectLocation, location)
@@ -648,6 +649,19 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				return R.failed(sysUser.getRealname() + "人员结算渠道不存在,不能结算");
 		}
 
+		if (SubjectLocation.MAH_SETTLE.equals(wmScorePackage.getLocation())) {
+			// MAH结算的发票类目 暂默认选一个 TODO
+			String invoiceType = sysDeptSub.getSubjectLocation().getInvoiceType();
+			// 查询发票类目对应的字典
+			List<SysDictItem> invoices = sysDictItemMapper.selectList(Wrappers.<SysDictItem>lambdaQuery()
+					.eq(SysDictItem::getType, invoiceType)
+					.eq(SysDictItem::getDelFlag, DelEnum.NOT_DEL.val()));
+			if (CollUtil.isEmpty(invoices)) {
+				return R.failed(sysUser.getRealname() + "发票类目不存在,不能结算");
+			}
+			note.setInvoiceType(Integer.valueOf(invoices.get(0).getValue()));
+		}
+
 		/**
 		 * 发起结算
 		 */