diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java index 349379fdc..54f9575fb 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java @@ -93,7 +93,7 @@ public class EmisMonthpayAccountController extends EmisBaseController * @param emisCustomerUser * @return */ - @JacksonFilter(include= {"customerCode","custNo","custName","payee","salesmen","payeeName","salesmenName","enterpriseName","enterpriseTaxId"},value= EmisCustomerUser.class,type= JacksonFilter.JscksonFilterType.RESPONSE) + @JacksonFilter(include= {"customerCode","custNo","custName","payee","salesmen","payeeName","salesmenName","enterpriseName","enterpriseTaxId","salesSupport","salesExecutive"},value= EmisCustomerUser.class,type= JacksonFilter.JscksonFilterType.RESPONSE) @GetMapping("/listSimple") public TableDataInfo listSimple(EmisCustomerUser emisCustomerUser) { diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSalesCommissionRatioController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSalesCommissionRatioController.java index c4b78a96f..7ea5563f8 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSalesCommissionRatioController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisSalesCommissionRatioController.java @@ -43,6 +43,25 @@ public class EmisSalesCommissionRatioController extends BaseController { return getDataTable(list); } + /** + * 查询销售计提比例配置列表 + */ + @GetMapping("/listSimple") + public TableDataInfo listSimple(EmisSalesCommissionRatio query) { + if ("2".equals(query.getStatus())) { + // status=2: 启用且已过期,修改为查询启用状态且结束日期早于当前日期 + query.setStatus("1"); + query.getParams().put("endDateBeforeNow", true); + } else if ("3".equals(query.getStatus())) { + // status=3: 启用且未过期,修改为查询启用状态且结束日期晚于等于当前日期 + query.setStatus("1"); + query.getParams().put("endDateAfterNow", true); + } + startPage(); + List list = emisSalesCommissionRatioService.selectEmisSalesCommissionRatioList(query); + return getDataTable(list); + } + /** * 根据ID获取配置 */ @@ -101,4 +120,4 @@ public class EmisSalesCommissionRatioController extends BaseController { ExcelUtil util = new ExcelUtil<>(EmisSalesCommissionRatio.class); util.exportExcel(response, list, "销售计提比例配置数据"); } -} \ No newline at end of file +} diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisWaybillOther.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisWaybillOther.java new file mode 100644 index 000000000..291b72b36 --- /dev/null +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisWaybillOther.java @@ -0,0 +1,51 @@ +/** + * @Project: emis + * @Title: EmisWaybillOther.java + * @author system + * @date 2025-01-XX + * @Copyright: ShangHai Duta 2022 All rights reserved. + * @version v1.0 + * @Description:

运单其他信息副表 实体类

+ */ + +package com.xdadan.erp.emis.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.xdadan.erp.common.annotation.audit.DataAuditField; +import com.xdadan.erp.common.annotation.audit.DataAuditTable; +import com.xdadan.erp.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @ClassName EmisWaybillOther + * @Description 运单其他信息副表 + * @author system + * @date 2025-01-XX + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("emis_waybill_other") +@DataAuditTable(tableName = "emis_waybill_other", tableComment = "运单其他信息副表") +public class EmisWaybillOther extends BaseEntity { + private static final long serialVersionUID = 1L; + + /* id */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /* 运单id */ + @DataAuditField(fieldComment = "运单ID") + private Long waybillId; + + /* 运单号 */ + @DataAuditField(fieldComment = "运单号") + private String billCode; + + /* 销售支持 */ + @DataAuditField(fieldComment = "销售支持") + private String salesSupport; +} + diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/WaybillOrder.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/WaybillOrder.java index 0cf79b80c..cb7e43564 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/WaybillOrder.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/WaybillOrder.java @@ -251,6 +251,8 @@ public class WaybillOrder implements Serializable { private String payee; /* 销售联系人 */ private String salesmen; + /* 销售支持 */ + private String salesSupport; /* 操作员代码 */ private String operateEmployeeCode; @@ -670,6 +672,8 @@ public class WaybillOrder implements Serializable { voItem.setMarketManCode(dbWaybill.getMarketManCode()); voItem.setPayee(dbWaybill.getPayee()); voItem.setSalesmen(dbWaybill.getSalesmen()); + voItem.setSalesSupport(dbWaybill.getSalesSupport()); + voItem.setOperateEmployeeCode(dbWaybill.getOperateEmployeeCode()); voItem.setBlIsQuestion(dbWaybill.getBlIsQuestion()); @@ -916,6 +920,7 @@ public class WaybillOrder implements Serializable { dbWaybill.setMarketManCode(this.getMarketManCode()); dbWaybill.setPayee(this.getPayee()); dbWaybill.setSalesmen(this.getSalesmen()); + dbWaybill.setSalesSupport(this.getSalesSupport()); dbWaybill.setOperateEmployeeCode(this.getOperateEmployeeCode()); // dbWaybill.setBlIsQuestion(this.getBlIsQuestion()); // dbWaybill.setProblemCause(this.getProblemCause()); diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisWaybillOtherMapper.java b/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisWaybillOtherMapper.java new file mode 100644 index 000000000..d8be31ddf --- /dev/null +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisWaybillOtherMapper.java @@ -0,0 +1,80 @@ +/** + * @Project: emis + * @Title: EmisWaybillOtherMapper.java + * @author system + * @date 2025-01-XX + * @Copyright: ShangHai Doitinfo 2022 All rights reserved. + * @version v1.0 + * @Description:

运单其他信息副表 Mapper 接口

+ */ +package com.xdadan.erp.emis.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.xdadan.erp.emis.domain.EmisWaybillOther; +import org.apache.ibatis.annotations.Param; + +/** + * @ClassName EmisWaybillOtherMapper + * @Description

运单其他信息副表 Mapper 接口

+ * @author system + * @date 2025-01-XX + */ +public interface EmisWaybillOtherMapper extends BaseMapper { + + /** + * 主键查询 + * @param id + * @return + */ + public EmisWaybillOther selectEmisWaybillOtherById(Long id); + + /** + * 根据运单ID查询 + * @param waybillId + * @return + */ + public EmisWaybillOther selectEmisWaybillOtherByWaybillId(@Param("waybillId") Long waybillId); + + /** + * 根据运单号查询 + * @param billCode + * @return + */ + public EmisWaybillOther selectEmisWaybillOtherByBillCode(@Param("billCode") String billCode); + + /** + * 新增 + * @param emisWaybillOther + * @return + */ + public int insertEmisWaybillOther(EmisWaybillOther emisWaybillOther); + + /** + * 修改 + * @param emisWaybillOther + * @return + */ + public int updateEmisWaybillOther(EmisWaybillOther emisWaybillOther); + + /** + * 删除 + * @param id 主键 + * @return 结果 + */ + public int deleteEmisWaybillOtherById(Long id); + + /** + * 根据运单ID删除 + * @param waybillId + * @return + */ + public int deleteEmisWaybillOtherByWaybillId(@Param("waybillId") Long waybillId); + + /** + * 根据运单号删除 + * @param billCode + * @return + */ + public int deleteEmisWaybillOtherByBillCode(@Param("billCode") String billCode); +} + diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java index 62b933ce8..8827a3f1d 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java @@ -149,6 +149,42 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb @Autowired private EmisTmsCostFeeMapper emisTmsCostFeeMapper; + @Autowired + private EmisWaybillOtherMapper emisWaybillOtherMapper; + + /** + * 保存或更新运单其他信息副表 + * @param emisWaybillSave + */ + private void saveOrUpdateWaybillOther(EmisWaybill emisWaybillSave) { + if (emisWaybillSave == null || emisWaybillSave.getId() == null) { + return; + } + + String salesSupport = emisWaybillSave.getSalesSupport(); + String billCode = emisWaybillSave.getBillCode(); + Long waybillId = emisWaybillSave.getId(); + + // 查询是否已存在 + EmisWaybillOther existing = emisWaybillOtherMapper.selectEmisWaybillOtherByWaybillId(waybillId); + + if (existing != null) { + // 更新 + existing.setSalesSupport(salesSupport); + existing.setBillCode(billCode); + existing.preUpdate(); + emisWaybillOtherMapper.updateEmisWaybillOther(existing); + } else { + // 新增 + EmisWaybillOther waybillOtherEntity = new EmisWaybillOther(); + waybillOtherEntity.setWaybillId(waybillId); + waybillOtherEntity.setBillCode(billCode); + waybillOtherEntity.setSalesSupport(salesSupport); + waybillOtherEntity.preInsert(); + emisWaybillOtherMapper.insertEmisWaybillOther(waybillOtherEntity); + } + } + /** * 获取稽核数据 * @param id @@ -1773,6 +1809,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb // 基础信息更新 emisWaybillMapper.updateEmisWaybill(emisWaybillSave); + // 保存或更新运单其他信息副表 + saveOrUpdateWaybillOther(emisWaybillSave); + // 运单日志记录 recordWaybillOperLog( emisWaybillSave.getBillCode(), @@ -3278,6 +3317,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb //插入新单 emisWaybillMapper.insertEmisWaybill(emisWaybillSave); + // 保存或更新运单其他信息副表 + saveOrUpdateWaybillOther(emisWaybillSave); + // 运单日志记录 recordWaybillOperLog( emisWaybillSave.getBillCode(), @@ -3793,6 +3835,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb // 基础信息更新 emisWaybillMapper.updateEmisWaybill(emisWaybillSave); + // 保存或更新运单其他信息副表 + saveOrUpdateWaybillOther(emisWaybillSave); + // 运单日志记录 recordWaybillOperLog( emisWaybillSave.getBillCode(), diff --git a/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml b/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml index 748dce7b9..fb1f6e10b 100644 --- a/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSalesCommissionRatioMapper.xml @@ -42,6 +42,13 @@ and start_date <= #{params.sendDate} and end_date >= #{params.sendDate} + + + and exists(select 1 from sys_user + where emp_name = emis_sales_commission_ratio.sales_support + and del_flag='0' + and bl_open=#{params.userStatus}) + ORDER BY id DESC @@ -149,4 +156,4 @@ AND id != #{id} - \ No newline at end of file + diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index a656e54f1..5446dc83d 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -341,6 +341,7 @@ a3.phone as customer_phone, a3.nick_name as customer_nick_name, a3.avatar as customer_avatar, + COALESCE(wss.sales_support, a4.sales_support) as sales_support, p.emp_name as dispatch_man_name,q.site_name as print_site_name, r.emp_name as print_man_name, @@ -392,6 +393,7 @@ left join emis_site start on a.start_site_code=start.site_code and start.del_flag='0' left join emis_customer_user a3 on a.customer_code=a3.customer_code and a3.del_flag='0' left join emis_customer_user a4 on a.cust_no=a4.monthly_pay_code and a4.del_flag='0' + left join emis_waybill_other wss on a.id=wss.waybill_id and wss.del_flag='0' left join emis_site seaway1 on a.departure_port=seaway1.site_code and seaway1.del_flag='0' left join emis_site seaway2 on a.destination_port=seaway2.site_code and seaway2.del_flag='0' @@ -443,7 +445,7 @@ a3.phone as customer_phone, a3.nick_name as customer_nick_name, a3.avatar as customer_avatar, - a3.sales_support , + COALESCE(wss.sales_support, a4.sales_support) as sales_support , a3.sales_executive , a3.customer_type as customer_type, a3.main_user_id , @@ -497,18 +499,27 @@ left join emis_site a1 on a.send_center_code=a1.site_code and a1.del_flag='0' left join emis_site a2 on a.destination_center_code=a2.site_code and a2.del_flag='0' left join emis_customer_user a3 on a.customer_code=a3.customer_code and a3.del_flag='0' + left join emis_customer_user a4 on a.cust_no=a4.monthly_pay_code and a4.del_flag='0' + left join emis_waybill_other wss on a.id=wss.waybill_id and wss.del_flag='0' left join emis_site seaway1 on a.departure_port=seaway1.site_code and seaway1.del_flag='0' left join emis_site seaway2 on a.destination_port=seaway2.site_code and seaway2.del_flag='0' left join emis_site start on a.start_site_code=start.site_code and start.del_flag='0' + + + + AND COALESCE(wss.sales_support, a4.sales_support) LIKE CONCAT('%', #{salesSupport}, '%') + + + @@ -527,7 +538,7 @@ @@ -562,6 +573,7 @@ #{item} + ORDER BY FIELD @@ -571,7 +583,7 @@ ORDER BY FIELD - + #{item} @@ -602,6 +614,7 @@ and a.order_status != '0' and a.order_status != '2' + @@ -690,6 +703,7 @@ and calc_fee_type=#{calcFeeType} and cust_no like concat('%', #{custNo}, '%') and cust_name like concat('%', #{custName}, '%') + and trans_line_type=#{transLineType} and product_type=#{productType} and time_type like concat('%', #{timeType}, '%') @@ -876,7 +890,7 @@ ORDER BY FIELD - + #{item} @@ -945,6 +959,7 @@ and a.calc_fee_type=#{calcFeeType} and a.cust_no like concat('%', #{custNo}, '%') and a.cust_name like concat('%', #{custName}, '%') + and a.trans_line_type=#{transLineType} and a.product_type=#{productType} and a.time_type like concat('%', #{timeType}, '%') @@ -1176,7 +1191,7 @@ ORDER BY FIELD - + #{item} @@ -1244,6 +1259,7 @@ and calc_fee_type=#{calcFeeType} and cust_no like concat('%', #{custNo}, '%') and cust_name like concat('%', #{custName}, '%') + and trans_line_type=#{transLineType} and FIND_IN_SET(product_type,#{productType}) and time_type like concat('%', #{timeType}, '%') @@ -1540,7 +1556,7 @@ ORDER BY FIELD - + #{item} @@ -1649,6 +1665,7 @@ and calc_fee_type=#{calcFeeType} and cust_no like concat('%', #{custNo}, '%') and cust_name like concat('%', #{custName}, '%') + and trans_line_type=#{transLineType} and product_type=#{productType} and time_type like concat('%', #{timeType}, '%') @@ -1941,7 +1958,7 @@ ORDER BY FIELD - + #{item} @@ -2551,6 +2568,7 @@ and a.start_site_code= #{startSiteCode} and a.cust_no=#{custNo} + and a.trans_line_type=#{transLineType} and a.product_type=#{productType} @@ -2607,7 +2625,7 @@ ORDER BY FIELD - + #{item} @@ -3958,6 +3976,7 @@ and a.bill_code=#{billCode} + limit 1 @@ -3987,6 +4006,7 @@ and p.del_flag = '0' ) + order by a.order_date desc diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillOtherMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillOtherMapper.xml new file mode 100644 index 000000000..a93013296 --- /dev/null +++ b/emis-biz/src/main/resources/mapper/EmisWaybillOtherMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + select id, waybill_id, bill_code, sales_support, del_flag, create_by, create_time, update_by, update_time, remark + from emis_waybill_other + + + + + + + + + + insert into emis_waybill_other + + waybill_id, + bill_code, + sales_support, + del_flag, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{waybillId}, + #{billCode}, + #{salesSupport}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update emis_waybill_other + + waybill_id = #{waybillId}, + bill_code = #{billCode}, + sales_support = #{salesSupport}, + del_flag = #{delFlag}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + update emis_waybill_other set del_flag = '1' where id = #{id} + + + + update emis_waybill_other set del_flag = '1' where waybill_id = #{waybillId} + + + + update emis_waybill_other set del_flag = '1' where bill_code = #{billCode} + + + +