From e7bd820e8cba0dc8503a4f66e61753c58279b364 Mon Sep 17 00:00:00 2001
From: aike <17730485278@139.com>
Date: Fri, 28 Nov 2025 11:19:24 +0800
Subject: [PATCH 1/3] =?UTF-8?q?demand:=20=20TMS=E7=B3=BB=E7=BB=9F=20-=20?=
=?UTF-8?q?=E6=8F=90=E6=88=90=E7=AE=A1=E7=90=86=20-=20=E9=94=80=E5=94=AE?=
=?UTF-8?q?=E8=AE=A1=E6=8F=90=E6=AF=94=E4=BE=8B=E9=85=8D=E7=BD=AE=20-=20?=
=?UTF-8?q?=E9=94=80=E5=94=AE=E9=A1=BE=E9=97=AE=E4=B8=8E=E9=94=80=E5=94=AE?=
=?UTF-8?q?=E4=B8=BB=E7=AE=A1=20=E5=85=B3=E7=B3=BB=E9=80=BB=E8=BE=91?=
=?UTF-8?q?=E8=B0=83=E6=95=B4=20committer:=20heyu?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../EmisSalesCommissionRatioMapper.java | 24 ++++++++++
.../impl/EmisCommissionProfitServiceImpl.java | 37 +++++++-------
.../EmisSalesCommissionRatioServiceImpl.java | 48 +++++++++++++++++++
.../mapper/EmisSalesCommissionRatioMapper.xml | 48 +++++++++++++++++++
4 files changed, 139 insertions(+), 18 deletions(-)
diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisSalesCommissionRatioMapper.java b/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisSalesCommissionRatioMapper.java
index 319705e05..3293e2cb1 100644
--- a/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisSalesCommissionRatioMapper.java
+++ b/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisSalesCommissionRatioMapper.java
@@ -80,4 +80,28 @@ public interface EmisSalesCommissionRatioMapper extends BaseMapper 员工提成表 实体类
*/
@@ -28,6 +28,7 @@ import com.xdadan.erp.emis.domain.enumtype.ProfitPostType;
import com.xdadan.erp.emis.mapper.*;
import com.xdadan.erp.emis.service.EmisBaseService;
import com.xdadan.erp.emis.utils.WaybillHelper;
+import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
@@ -39,7 +40,7 @@ import org.springframework.util.CollectionUtils;
/**
* 员工提成表Service业务层处理
- *
+ *
* @author linfso
* @date 2024-10-24 01:46:36
*/
@@ -1346,14 +1347,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
if (BigDecimal.valueOf(profitMoney).compareTo(BigDecimal.ZERO) > 0) {
// 新增:按销售分成配置插入多岗位提成
String salesSupport = waybill.getSalesSupport();
- String salesExecutive = waybill.getSalesExecutive();
+// String salesExecutive = waybill.getSalesExecutive();
boolean hasRatioInsert = false;
- if (StringUtils.isNotEmpty(salesmen) && StringUtils.isNotEmpty(salesSupport)
- && StringUtils.isNotEmpty(salesExecutive)) {
+ if (StringUtils.isNotEmpty(salesmen)) {
EmisSalesCommissionRatio ratioQuery = new EmisSalesCommissionRatio();
ratioQuery.setSalesmen(salesmen);
- ratioQuery.setSalesSupport(salesSupport);
- ratioQuery.setSalesExecutive(salesExecutive);
+ if(StringUtil.isNotEmpty(salesSupport)){
+ ratioQuery.setSalesSupport(salesSupport);
+ }
ratioQuery.setStatus("1");
// 添加运单寄件日期条件,查询运单寄件日期在计提表有效期内的比例配置
if (waybill.getSendDate() != null) {
@@ -1386,13 +1387,13 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
hasRatioInsert = true;
}
// 销售主管
- if (StringUtils.isNotEmpty(salesExecutive) && ratio.getSalesExecutiveRatio() != null
+ if (StringUtils.isNotEmpty(ratio.getSalesExecutive()) && ratio.getSalesExecutiveRatio() != null
&& ratio.getSalesExecutiveRatio().compareTo(BigDecimal.ZERO) > 0) {
insertCommissionDtl(
waybill.getBillCode(), quoteItem.getFeeType(), "1", billMonth,
BigDecimal.valueOf(profitMoney).multiply(ratio.getSalesExecutiveRatio())
.divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP),
- salesExecutive, calcExprStr, exprItem.getQuoteId(),
+ ratio.getSalesExecutive(), calcExprStr, exprItem.getQuoteId(),
quoteItem.getQuoteName(), exprItem.getId(), calcExprStr);
hasRatioInsert = true;
}
@@ -1726,7 +1727,7 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
/**
* 查询员工提成表
- *
+ *
* @param id 员工提成表主键
* @return 员工提成表
*/
@@ -1739,7 +1740,7 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
/**
* 查询员工提成表列表
- *
+ *
* @param emisCommissionProfit 员工提成表
* @return 员工提成表
*/
@@ -1751,8 +1752,8 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
/**
* 检查是否重复
- *
- * @param emisCommissionProfit
+ *
+ * @param emisCommissionProfit
* @return 数量
*/
@Override
@@ -1763,7 +1764,7 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
/**
* 新增员工提成表
- *
+ *
* @param emisCommissionProfit 员工提成表
* @return 结果
*/
@@ -1775,7 +1776,7 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
/**
* 修改员工提成表
- *
+ *
* @param emisCommissionProfit 员工提成表
* @return 结果
*/
@@ -1787,7 +1788,7 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
/**
* 批量删除员工提成表
- *
+ *
* @param ids 需要删除的员工提成表主键
* @return 结果
*/
@@ -1799,7 +1800,7 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
/**
* 删除员工提成表信息
- *
+ *
* @param id 员工提成表主键
* @return 结果
*/
diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSalesCommissionRatioServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSalesCommissionRatioServiceImpl.java
index 9e3771ead..ce73dc52c 100644
--- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSalesCommissionRatioServiceImpl.java
+++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSalesCommissionRatioServiceImpl.java
@@ -58,6 +58,10 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
if (!checkRatioValid(entity)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "占比总和必须小于等于100%");
}
+ // 验证一个销售联系人只能对应一个销售主管
+ validateSalesmenToExecutive(entity);
+ // 验证一个销售支持只能对应一个销售联系人、只能对应一个销售主管
+ validateSalesSupport(entity);
return emisSalesCommissionRatioMapper.insertEmisSalesCommissionRatio(entity);
}
@@ -76,6 +80,10 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
if (!checkRatioValid(entity)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "占比总和必须小于等于100%");
}
+ // 验证一个销售联系人只能对应一个销售主管
+ validateSalesmenToExecutive(entity);
+ // 验证一个销售支持只能对应一个销售联系人、只能对应一个销售主管
+ validateSalesSupport(entity);
return emisSalesCommissionRatioMapper.updateEmisSalesCommissionRatio(entity);
}
@@ -122,4 +130,44 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
BigDecimal sum = executiveRatio.add(salesmenRatio).add(supportRatio);
return sum.compareTo(new BigDecimal("100.00")) <= 0;
}
+
+ /**
+ * 验证一个销售联系人只能对应一个销售主管
+ *
+ * @param entity 配置实体
+ * @throws EmisBizError 如果销售联系人已经对应了其他销售主管
+ */
+ private void validateSalesmenToExecutive(EmisSalesCommissionRatio entity) throws EmisBizError {
+ if (entity.getSalesmen() != null && !entity.getSalesmen().trim().isEmpty()
+ && entity.getSalesExecutive() != null && !entity.getSalesExecutive().trim().isEmpty()) {
+ int count = emisSalesCommissionRatioMapper.countBySalesmenAndDifferentExecutive(entity);
+ if (count > 0) {
+ throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
+ "销售联系人[" + entity.getSalesmen() + "]已经对应了其他销售主管,一个销售联系人只能对应一个销售主管");
+ }
+ }
+ }
+
+ /**
+ * 验证一个销售支持只能对应一个销售联系人、只能对应一个销售主管
+ *
+ * @param entity 配置实体
+ * @throws EmisBizError 如果销售支持已经对应了其他销售联系人或销售主管
+ */
+ private void validateSalesSupport(EmisSalesCommissionRatio entity) throws EmisBizError {
+ if (entity.getSalesSupport() != null && !entity.getSalesSupport().trim().isEmpty()) {
+ // 检查销售支持是否已经对应了其他销售联系人
+ int countSalesmen = emisSalesCommissionRatioMapper.countBySalesSupportAndDifferentSalesmen(entity);
+ if (countSalesmen > 0) {
+ throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
+ "销售支持[" + entity.getSalesSupport() + "]已经对应了其他销售联系人,一个销售支持只能对应一个销售联系人");
+ }
+ // 检查销售支持是否已经对应了其他销售主管
+ int countExecutive = emisSalesCommissionRatioMapper.countBySalesSupportAndDifferentExecutive(entity);
+ if (countExecutive > 0) {
+ throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
+ "销售支持[" + entity.getSalesSupport() + "]已经对应了其他销售主管,一个销售支持只能对应一个销售主管");
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml b/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml
index fb1f6e10b..ca4ff3c2c 100644
--- a/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml
+++ b/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml
@@ -156,4 +156,52 @@
AND id != #{id}
+
+
+
+
+
+
+
+
+
From 1c267a8d610d51ce932683e605cf66530c03fcc2 Mon Sep 17 00:00:00 2001
From: aike <17730485278@139.com>
Date: Fri, 28 Nov 2025 13:35:22 +0800
Subject: [PATCH 2/3] =?UTF-8?q?demand:=20=20=20TMS=E7=B3=BB=E7=BB=9F=20-?=
=?UTF-8?q?=20=E6=BC=8F=E7=BB=84=E6=89=B9=E6=AC=A1=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=20-=20=E5=8E=BB=E9=99=A4=E5=8F=AA=E5=88=A4?=
=?UTF-8?q?=E6=96=AD=E5=89=8D=E4=BA=94=E5=A4=A9=E7=9A=84=E7=BB=84=E6=89=B9?=
=?UTF-8?q?=E6=AC=A1=E7=9A=84=E6=95=B0=E6=8D=AE=20committer:=20heyu?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
index e34b1075e..03a2ba25b 100644
--- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
+++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
@@ -3933,9 +3933,9 @@
and a.trans_line_type = #{lineCode}
- and DATE_FORMAT(a.send_date, '%Y-%m-%d') = ]]> '2025-01-01'
- and DATE_FORMAT(a.send_date, '%Y-%m-%d') DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 7 DAY),
- '%Y-%m-%d')
+-- and DATE_FORMAT(a.send_date, '%Y-%m-%d') = ]]> '2025-01-01'
+-- and DATE_FORMAT(a.send_date, '%Y-%m-%d') DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 7 DAY),
+-- '%Y-%m-%d')
and ((a.virtual_remark is null or a.virtual_remark = '' or a.virtual_remark = ' ')or a.receive_country !=
'0095')
and a.order_status not in ('0','2')
From 1ec77676ae087b0f51d0936fbfa2c7d2c4953421 Mon Sep 17 00:00:00 2001
From: aike <17730485278@139.com>
Date: Fri, 28 Nov 2025 14:58:07 +0800
Subject: [PATCH 3/3] =?UTF-8?q?demand:=20=20=20TMS=E7=B3=BB=E7=BB=9F=20-?=
=?UTF-8?q?=20=E5=AE=A2=E6=88=B7=E8=B4=A6=E5=8D=95=E7=AE=A1=E7=90=86=20-?=
=?UTF-8?q?=20=E8=B4=A2=E5=8A=A1=E5=BC=80=E7=A5=A8=E5=A4=84=E7=90=86-?=
=?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87=E5=9B=9E=E9=80=80=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=20committer:=20heyu?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../EmisSettleInvoiceRecordController.java | 26 ++++++++++++
.../mapper/EmisSettleInvoiceRecordMapper.java | 2 +
.../IEmisSettleInvoiceRecordService.java | 9 ++++
.../EmisSettleInvoiceRecordServiceImpl.java | 42 ++++++++++++++++++-
.../mapper/EmisSettleInvoiceRecordMapper.xml | 11 +++++
5 files changed, 89 insertions(+), 1 deletion(-)
diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSettleInvoiceRecordController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSettleInvoiceRecordController.java
index a713815d0..ab6e6c609 100644
--- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSettleInvoiceRecordController.java
+++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSettleInvoiceRecordController.java
@@ -330,6 +330,32 @@ public class EmisSettleInvoiceRecordController extends BaseController {
return AjaxResult.success("操作成功");
}
+ @Log(title = "发票申请审核回退", businessType = BusinessType.UPDATE)
+ @PostMapping("/auditCenterPassRollback/{ids}")
+ public AjaxResult auditCenterPassRollback(@PathVariable Long[] ids)
+ {
+ if(ids!=null && ids.length>0){
+ for(int i=0;i
+
+ update emis_settle_invoice_record
+ set bl_audit='0',
+ invoice_status='0',
+ audit_date = null,
+ audit_man_code = null,
+ audit_site_code = null,
+ audit_note = null
+ where id = #{id}
+
+
update emis_settle_invoice_record
set payment_status='1'