Merge pull request 'develop' (#238) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/238
This commit is contained in:
heyu 2025-11-24 15:38:11 +08:00
commit 5d4ccb7460
9 changed files with 328 additions and 12 deletions

View File

@ -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)
{

View File

@ -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<EmisSalesCommissionRatio> list = emisSalesCommissionRatioService.selectEmisSalesCommissionRatioList(query);
return getDataTable(list);
}
/**
* 根据ID获取配置
*/
@ -101,4 +120,4 @@ public class EmisSalesCommissionRatioController extends BaseController {
ExcelUtil<EmisSalesCommissionRatio> util = new ExcelUtil<>(EmisSalesCommissionRatio.class);
util.exportExcel(response, list, "销售计提比例配置数据");
}
}
}

View File

@ -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: <p> 运单其他信息副表 实体类 </p>
*/
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;
}

View File

@ -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());

View File

@ -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: <p> 运单其他信息副表 Mapper 接口 </p>
*/
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 <p> 运单其他信息副表 Mapper 接口 </p>
* @author system
* @date 2025-01-XX
*/
public interface EmisWaybillOtherMapper extends BaseMapper<EmisWaybillOther> {
/**
* 主键查询
* @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);
}

View File

@ -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(),

View File

@ -42,6 +42,13 @@
<if test="params.sendDate != null">
and start_date &lt;= #{params.sendDate} and end_date &gt;= #{params.sendDate}
</if>
<!-- 根据销售支持人员对应的用户状态过滤 -->
<if test="params.userStatus != null and params.userStatus != ''">
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})
</if>
</where>
ORDER BY id DESC
</select>
@ -149,4 +156,4 @@
<if test="id != null">AND id != #{id}</if>
</select>
</mapper>
</mapper>

View File

@ -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'
</sql>
<sql id="salesSupportFilter">
<!-- 销售支持筛选:优先匹配运单其他信息中的配置 -->
<if test="salesSupport != null and salesSupport != ''">
AND COALESCE(wss.sales_support, a4.sales_support) LIKE CONCAT('%', #{salesSupport}, '%')
</if>
</sql>
<!--根据运单号获取运单信息 or FIND_IN_SET(#{billCode},bill_code_sub)-->
<select id="selectEmisWaybillByBillCode" parameterType="String" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillDetailVo"/>
<where>
bill_code = #{billCode}
a.bill_code = #{billCode}
</where>
limit 1
</select>
@ -527,7 +538,7 @@
<select id="selectWaybillBaseInfoByBillCode" parameterType="String" resultMap="BaseEmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
<where>
bill_code = #{billCode}
a.bill_code = #{billCode}
</where>
limit 1
</select>
@ -562,6 +573,7 @@
#{item}
</foreach>
</if>
<include refid="salesSupportFilter"/>
<if test="params.orderSnSortList != null and params.orderSnSortList.size >0 ">
ORDER BY FIELD
@ -571,7 +583,7 @@
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 1 ">
ORDER BY FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
<foreach collection="params.billCodeSortList" item="item" open="(a.bill_code," separator="," close=")">
#{item}
</foreach>
</if>
@ -602,6 +614,7 @@
</if>
and a.order_status != '0'
and a.order_status != '2'
<include refid="salesSupportFilter"/>
<!-- <if test="params.privSiteCode != null and params.privSiteCode != '88888'">-->
<!-- and (-->
<!-- a.send_site_code=#{params.privSiteCode}-->
@ -690,6 +703,7 @@
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
<include refid="salesSupportFilter"/>
<if test="transLineType != null and transLineType != ''"> and trans_line_type=#{transLineType}</if>
<if test="productType != null and productType != ''"> and product_type=#{productType}</if>
<if test="timeType != null and timeType != ''"> and time_type like concat('%', #{timeType}, '%')</if>
@ -876,7 +890,7 @@
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 0 ">
ORDER BY FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
<foreach collection="params.billCodeSortList" item="item" open="(a.bill_code," separator="," close=")">
#{item}
</foreach>
</if>
@ -945,6 +959,7 @@
<if test="calcFeeType != null and calcFeeType != ''"> and a.calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and a.cust_no like concat('%', #{custNo}, '%')</if>
<if test="custName != null and custName != ''"> and a.cust_name like concat('%', #{custName}, '%')</if>
<include refid="salesSupportFilter"/>
<if test="transLineType != null and transLineType != ''"> and a.trans_line_type=#{transLineType}</if>
<if test="productType != null and productType != ''"> and a.product_type=#{productType}</if>
<if test="timeType != null and timeType != ''"> and a.time_type like concat('%', #{timeType}, '%')</if>
@ -1176,7 +1191,7 @@
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 0 ">
ORDER BY FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
<foreach collection="params.billCodeSortList" item="item" open="(a.bill_code," separator="," close=")">
#{item}
</foreach>
</if>
@ -1244,6 +1259,7 @@
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
<include refid="salesSupportFilter"/>
<if test="transLineType != null and transLineType != ''"> and trans_line_type=#{transLineType}</if>
<if test="productType != null and productType != ''"> and FIND_IN_SET(product_type,#{productType})</if>
<if test="timeType != null and timeType != ''"> and time_type like concat('%', #{timeType}, '%')</if>
@ -1540,7 +1556,7 @@
</if>
<if test="params.billCodeSortList != null ">
ORDER BY FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
<foreach collection="params.billCodeSortList" item="item" open="(a.bill_code," separator="," close=")">
#{item}
</foreach>
@ -1649,6 +1665,7 @@
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
<include refid="salesSupportFilter"/>
<if test="transLineType != null and transLineType != ''"> and trans_line_type=#{transLineType}</if>
<if test="productType != null and productType != ''"> and product_type=#{productType}</if>
<if test="timeType != null and timeType != ''"> and time_type like concat('%', #{timeType}, '%')</if>
@ -1941,7 +1958,7 @@
</if>
<if test="params.billCodeSortList != null ">
ORDER BY FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
<foreach collection="params.billCodeSortList" item="item" open="(a.bill_code," separator="," close=")">
#{item}
</foreach>
@ -2551,6 +2568,7 @@
<if test="startSiteCode != null and startSiteCode != ''"> and a.start_site_code= #{startSiteCode}</if>
<if test="custNo != null and custNo != ''"> and a.cust_no=#{custNo}</if>
<include refid="salesSupportFilter"/>
<if test="transLineType != null and transLineType != ''"> and a.trans_line_type=#{transLineType}</if>
<if test="productType != null and productType != ''"> and a.product_type=#{productType}</if>
@ -2607,7 +2625,7 @@
</if>
<if test="params.billCodeSortList != null ">
ORDER BY FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
<foreach collection="params.billCodeSortList" item="item" open="(a.bill_code," separator="," close=")">
#{item}
</foreach>
@ -3958,6 +3976,7 @@
<if test="billCode != null and billCode != ''">
and a.bill_code=#{billCode}
</if>
<include refid="salesSupportFilter"/>
limit 1
</select>
@ -3987,6 +4006,7 @@
and p.del_flag = '0'
)
</if>
<include refid="salesSupportFilter"/>
</where>
order by a.order_date desc

View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisWaybillOtherMapper">
<resultMap type="EmisWaybillOther" id="EmisWaybillOtherResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="waybillId" column="waybill_id" />
<result property="billCode" column="bill_code" />
<result property="salesSupport" column="sales_support" />
</resultMap>
<sql id="selectEmisWaybillOtherVo">
select id, waybill_id, bill_code, sales_support, del_flag, create_by, create_time, update_by, update_time, remark
from emis_waybill_other
</sql>
<select id="selectEmisWaybillOtherById" parameterType="Long" resultMap="EmisWaybillOtherResult">
<include refid="selectEmisWaybillOtherVo"/>
where id = #{id} and del_flag = '0'
</select>
<select id="selectEmisWaybillOtherByWaybillId" parameterType="Long" resultMap="EmisWaybillOtherResult">
<include refid="selectEmisWaybillOtherVo"/>
where waybill_id = #{waybillId} and del_flag = '0'
limit 1
</select>
<select id="selectEmisWaybillOtherByBillCode" parameterType="String" resultMap="EmisWaybillOtherResult">
<include refid="selectEmisWaybillOtherVo"/>
where bill_code = #{billCode} and del_flag = '0'
limit 1
</select>
<insert id="insertEmisWaybillOther" parameterType="EmisWaybillOther" useGeneratedKeys="true" keyProperty="id">
insert into emis_waybill_other
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="waybillId != null">waybill_id,</if>
<if test="billCode != null and billCode != ''">bill_code,</if>
<if test="salesSupport != null and salesSupport != ''">sales_support,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="waybillId != null">#{waybillId},</if>
<if test="billCode != null and billCode != ''">#{billCode},</if>
<if test="salesSupport != null and salesSupport != ''">#{salesSupport},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateEmisWaybillOther" parameterType="EmisWaybillOther">
update emis_waybill_other
<trim prefix="SET" suffixOverrides=",">
<if test="waybillId != null">waybill_id = #{waybillId},</if>
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="salesSupport != null">sales_support = #{salesSupport},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisWaybillOtherById" parameterType="Long">
update emis_waybill_other set del_flag = '1' where id = #{id}
</delete>
<delete id="deleteEmisWaybillOtherByWaybillId" parameterType="Long">
update emis_waybill_other set del_flag = '1' where waybill_id = #{waybillId}
</delete>
<delete id="deleteEmisWaybillOtherByBillCode" parameterType="String">
update emis_waybill_other set del_flag = '1' where bill_code = #{billCode}
</delete>
</mapper>