Merge pull request 'demand: 根据输入单号、主单号自动完成虚拟单、主单的绑定 新增员工提成方案时选择多个线路无法获取对应产品bug修复 TMS系统 - 提成管理 - 销售计提比例配置 - 增加开始时间、结束时间…' (#134) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/134
This commit is contained in:
commit
009c183351
@ -772,6 +772,30 @@ public class EmisCommonController extends EmisBaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理输入的历史虚拟单
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/handleInputVirtualWaybill")
|
||||
public AjaxResult handleInputVirtualWaybill(@RequestBody List<EmisWaybill> emisWaybills){
|
||||
String lockKey="handleInputVirtualWaybill";
|
||||
log.info("handleHistoryVirtualWaybill start");
|
||||
|
||||
// 加锁查询
|
||||
redissonService.lock(lockKey,300);
|
||||
try{
|
||||
emisWaybillService.handleInputVirtualWaybill(emisWaybills);
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("handleInputVirtualWaybill exception:"+ex.getMessage());
|
||||
}
|
||||
log.info("handleInputVirtualWaybill end");
|
||||
|
||||
redissonService.unlock(lockKey);
|
||||
return AjaxResult.success("发送成功");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动出账触发
|
||||
* @return
|
||||
|
||||
@ -26,9 +26,18 @@ public class EmisSalesCommissionRatioController extends BaseController {
|
||||
/**
|
||||
* 查询销售计提比例配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:salesCommissionRatio:list')")
|
||||
@PreAuthorize("@ss.hasPermi('emis:salesCommissionRatio:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(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);
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.xdadan.erp.emis.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import com.xdadan.erp.common.core.domain.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 销售计提比例配置实体类
|
||||
@ -24,6 +26,12 @@ public class EmisSalesCommissionRatio extends BaseEntity {
|
||||
private String salesSupport;
|
||||
/** 销售支持占比 */
|
||||
private BigDecimal salesSupportRatio;
|
||||
/** 启用状态 1-启用 0-未启用 **/
|
||||
/** 启用状态 1-启用 0-未启用 2-启用已过期 3-启用未过期 **/
|
||||
private String status;
|
||||
/* 开始日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startDate;
|
||||
/* 结束日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endDate;
|
||||
}
|
||||
|
||||
@ -306,4 +306,10 @@ public interface IEmisWaybillService extends IDataAuditService
|
||||
*
|
||||
*/
|
||||
void handleHistoryVirtualWaybill();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param emisWaybills
|
||||
*/
|
||||
void handleInputVirtualWaybill(List<EmisWaybill> emisWaybills);
|
||||
}
|
||||
|
||||
@ -6044,6 +6044,16 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleInputVirtualWaybill(List<EmisWaybill> emisWaybills) {
|
||||
for (EmisWaybill emisWaybill : emisWaybills) {
|
||||
EmisWaybill oldWaybill = emisWaybillMapper
|
||||
.selectMasterWaybillByBillCode(emisWaybill.getBillCode());
|
||||
emisWaybill.setId(oldWaybill.getId());
|
||||
updateWaybill(emisWaybill);
|
||||
}
|
||||
}
|
||||
|
||||
// 新增内部类用于返回统计结果
|
||||
private static class ProblemHandleResult {
|
||||
int successCount;
|
||||
|
||||
@ -11,10 +11,12 @@
|
||||
<result property="salesSupport" column="sales_support" />
|
||||
<result property="salesSupportRatio" column="sales_support_ratio" />
|
||||
<result property="status" column="status" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisSalesCommissionRatioVo">
|
||||
select id, sales_executive, sales_executive_ratio, salesmen, salesmen_ratio, sales_support, sales_support_ratio, status, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_sales_commission_ratio
|
||||
select id, sales_executive, sales_executive_ratio, salesmen, salesmen_ratio, sales_support, sales_support_ratio, status, start_date, end_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_sales_commission_ratio
|
||||
</sql>
|
||||
|
||||
<!-- 查询列表 -->
|
||||
@ -27,6 +29,15 @@
|
||||
<if test="salesSupport != null and salesSupport != ''">AND sales_support like concat('%', #{salesSupport}, '%')</if>
|
||||
<if test="status != null and status != ''">AND status = #{status}</if>
|
||||
<if test="delFlag != null and delFlag != ''">AND del_flag = #{delFlag}</if>
|
||||
<if test="startDate != null">AND start_date = #{startDate}</if>
|
||||
<if test="endDate != null">AND end_date = #{endDate}</if>
|
||||
<!-- 处理status=2/3的特殊逻辑 -->
|
||||
<if test="params.endDateBeforeNow != null and params.endDateBeforeNow == true">
|
||||
and end_date < NOW()
|
||||
</if>
|
||||
<if test="params.endDateAfterNow != null and params.endDateAfterNow == true">
|
||||
and end_date >= NOW()
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
@ -48,6 +59,8 @@
|
||||
<if test="salesSupport != null and salesSupport != ''">sales_support,</if>
|
||||
<if test="salesSupportRatio != null">sales_support_ratio,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="startDate != null">start_date,</if>
|
||||
<if test="endDate != null">end_date,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
@ -65,6 +78,8 @@
|
||||
<if test="salesSupport != null and salesSupport != ''">#{salesSupport},</if>
|
||||
<if test="salesSupportRatio != null">#{salesSupportRatio},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="startDate != null">#{startDate},</if>
|
||||
<if test="endDate != null">#{endDate},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
@ -87,6 +102,8 @@
|
||||
<if test="salesSupport != null">sales_support = #{salesSupport},</if>
|
||||
<if test="salesSupportRatio != null">sales_support_ratio = #{salesSupportRatio},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="startDate != null">start_date = #{startDate},</if>
|
||||
<if test="endDate != null">end_date = #{endDate},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
@ -113,16 +130,19 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 验重:salesExecutive、salesmen、salesSupport、status都相同视为重复 -->
|
||||
<!-- 验重:salesExecutive、salesmen、salesSupport、status、startDate、endDate都相同视为重复 -->
|
||||
<select id="checkUnique" parameterType="com.xdadan.erp.emis.domain.EmisSalesCommissionRatio" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM emis_sales_commission_ratio
|
||||
WHERE sales_executive = #{salesExecutive}
|
||||
AND salesmen = #{salesmen}
|
||||
AND sales_support = #{salesSupport}
|
||||
AND status = #{status}
|
||||
AND del_flag = '0'
|
||||
<if test="id != null">AND id != #{id}</if>
|
||||
AND salesmen = #{salesmen}
|
||||
AND sales_support = #{salesSupport}
|
||||
AND status = #{status}
|
||||
AND (
|
||||
start_date <= #{endDate} and end_date >= #{startDate}
|
||||
)
|
||||
AND del_flag = '0'
|
||||
<if test="id != null">AND id != #{id}</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -40,7 +40,12 @@
|
||||
<if test="prodNameEn != null and prodNameEn != ''"> and prod_name_en like concat('%', #{prodNameEn}, '%')</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="country != null and country != ''"> and country=#{country}</if>
|
||||
<if test="transLineCode != null and transLineCode != ''"> and trans_line_code=#{transLineCode}</if>
|
||||
<if test="transLineCode != null and transLineCode != ''">
|
||||
and trans_line_code in
|
||||
<foreach collection="transLineCode.split(',')" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="transLine != null and transLine != ''"> and trans_line like concat('%', #{transLine}, '%')</if>
|
||||
<if test="carryType != null and carryType != ''"> and carry_type=#{carryType}</if>
|
||||
<if test="transType != null and transType != ''"> and trans_type= #{transType}</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user