demand: TMS系统 - 运单管理 - 运单签收图片上传 - 界面调整 TMS系统 - 运单管理 - 运单批量录入 - 缅甸虚拟单 逻辑优化 TMS/APP系统 - 接单/运单录入/运单修改 / 网点费用申请/批量录入 - 支付方式:到付/现金/其他 判断回款联系人/销售联系人/销售支持 逻辑调整

This commit is contained in:
aike 2026-04-10 11:14:49 +08:00
parent 8f8ae2a54c
commit 601b81b140
4 changed files with 88 additions and 2 deletions

View File

@ -57,6 +57,11 @@ public class EmisWaybill extends BaseEntity {
private String billCodeSub;
/* 订单状态 字典 */
private String orderStatus;
/**
* 正式运单标识
*/
@TableField(exist = false)
private String blFormalWaybill;
/* 组批次状态 */
private String siteBatchStatus;
/* 运单状态 字典 */

View File

@ -6,7 +6,6 @@ import com.xdadan.erp.common.annotation.audit.DataAuditField;
import com.xdadan.erp.emis.domain.*;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
@ -48,6 +47,8 @@ public class WaybillOrder implements Serializable {
/* 运单状态 字典 */
private String waybillStatus;
private String blFormalWaybill;
/* 运单号 */
@Size(min = 0, max = 20, message = "运单号长度不能超过20个字符")
private String billCode;
@ -519,6 +520,7 @@ public class WaybillOrder implements Serializable {
voItem.setOrderStatus(dbWaybill.getOrderStatus());
voItem.setWaybillStatus(dbWaybill.getWaybillStatus());
voItem.setBlFormalWaybill(dbWaybill.getBlFormalWaybill());
// voItem.setOrderType(dbWaybill.getOrderType());
voItem.setOrderDate(dbWaybill.getOrderDate());

View File

@ -586,6 +586,11 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
emisWaybillSave.setBillCode(waybillNo);
}
if(StringUtils.isNotBlank(emisWaybillSave.getMasterBillCode())){
if(!"1".equals(emisWaybillSave.getBlVirtual())){
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "是否虚拟单信息填写错误");
}
}
// 开始下单
addNewWaybill(emisWaybillSave);
@ -1257,6 +1262,64 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
return users;
}
private void validatePayeeSalesmenSalesSupport(EmisWaybill wb) throws EmisBizError {
if (wb == null) {
return;
}
String payee = wb.getPayee();
if (StringUtils.isNotBlank(payee)) {
String payeeName = payee.trim();
SysUser payeeUser = getEmisStaffByEmpName(payeeName);
if (payeeUser == null) {
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "回款联系人" + payeeName + "不存在");
}
if (!"1".equals(payeeUser.getBlPayeeRemark())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "回款联系人" + payeeName + "无回款权限");
}
if (!"1".equals(payeeUser.getBlOpen())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "回款联系人" + payeeName + "未启用");
}
}
String salesmen = wb.getSalesmen();
if (StringUtils.isNotBlank(salesmen)) {
String salesmenName = salesmen.trim();
SysUser salesUser = getEmisStaffByEmpName(salesmenName);
if (salesUser == null) {
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "销售联系人" + salesmenName + "不存在");
}
if (!"1".equals(salesUser.getBlPayeeRemark())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "销售联系人" + salesmenName + "无回款权限");
}
if (!"1".equals(salesUser.getBlOpen())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "销售联系人" + salesmenName + "未启用");
}
}
String salesSupportRaw = null;
if (wb.getWaybillOther() != null) {
salesSupportRaw = wb.getWaybillOther().getSalesSupport();
}
if (StringUtils.isBlank(salesSupportRaw)) {
salesSupportRaw = wb.getSalesSupport();
}
String salesSupportToCheck = StringUtils.trimToEmpty(salesSupportRaw);
if (StringUtils.isNotBlank(salesSupportToCheck)) {
String[] supports = salesSupportToCheck.split("[,,]");
for (String support : supports) {
if (StringUtils.isBlank(support)) {
continue;
}
String supportName = support.trim();
SysUser supportUser = getEmisStaffByEmpName(supportName);
if (supportUser == null) {
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "销售支持" + supportName + "不存在");
}
if (!"1".equals(supportUser.getBlOpen())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "销售支持" + supportName + "未启用");
}
}
}
}
private void cvtWaybillDraftToRealByOms(EmisWaybill emisWaybillSave) throws EmisBizError {
@ -1816,6 +1879,8 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
throw new EmisBizError(EmisBizErrorType.FAIL,"非当前网点运单,请先指派到当前网点!");
}
validatePayeeSalesmenSalesSupport(emisWaybillSave);
// 子单号做扣减
if ("1".equals(emisWaybillSave.getBlGenSubbill())) {
@ -3348,6 +3413,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 公共计算部分
calcWayBillCommonInfo(emisWaybillSave,null,true);
validatePayeeSalesmenSalesSupport(emisWaybillSave);
// 图片标识
String goodsPicsStr=emisWaybillSave.getGoodsPics();
@ -3880,6 +3946,8 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 校验产品类型与线路是否匹配
checkLineWithProd(emisWaybillSave);
validatePayeeSalesmenSalesSupport(emisWaybillSave);
calcWayBillCommonInfo(emisWaybillSave,oldEmisWaybill,false);
emisWaybillSave.preUpdate();

View File

@ -11,6 +11,7 @@
<result property="billCode" column="bill_code" />
<result property="billCodeSub" column="bill_code_sub" />
<result property="orderStatus" column="order_status" />
<result property="blFormalWaybill" column="bl_formal_waybill" />
<result property="waybillStatus" column="waybill_status" />
<result property="startSiteCode" column="start_site_code" />
<result property="startSiteName" column="start_site_name" />
@ -499,7 +500,17 @@
z.type_name as problem_type_name,
start.site_name as start_site_name,
k.trans_type as trans_type
k.trans_type as trans_type,
CASE
WHEN a.order_status = '1'
AND NOT EXISTS (
SELECT 1 FROM emis_waybill_problem_info ewpi
WHERE ewpi.bill_code = a.bill_code
AND ewpi.del_flag = '0'
AND ewpi.problem_type IN (151, 170, 173)
)
THEN '1' ELSE '0'
END AS bl_formal_waybill
from emis_waybill a