This commit is contained in:
linfso 2025-01-05 18:51:57 +08:00
parent 1e6b30752b
commit 39d5f6e8ff
8 changed files with 501 additions and 25 deletions

View File

@ -89,6 +89,9 @@ public class EmisWaybillController extends EmisBaseController
@Autowired
private IEmisTmsScanRecordService emisTmsScanRecordService;
@Autowired
private IEmisWaybillChangeToService emisWaybillChangeToService;
@Autowired
RedissonService redissonService;
@ -315,11 +318,22 @@ public class EmisWaybillController extends EmisBaseController
return AjaxResult.error("取件员不能为空");
}
EmisWaybill oldWayBill=emisWaybillService.selectEmisWaybillByOrderSn(waybillOrder.getOrderSn());
if(oldWayBill==null){
return AjaxResult.error("订单不存在");
}
EmisWaybill emisWaybill = new EmisWaybill();
emisWaybill.setOrderSn(waybillOrder.getOrderSn());
emisWaybill.setTakePieceEmployeeCode(waybillOrder.getTakePieceEmployeeCode());
emisWaybillService.assignTakeMan(emisWaybill);
// 记录转单信息
EmisWaybillChangeTo emisWaybillChangeTo=new EmisWaybillChangeTo();
emisWaybillChangeTo.setChangeFrom(oldWayBill.getTakePieceEmployeeCode());
emisWaybillChangeTo.setChangeTo(waybillOrder.getTakePieceEmployeeCode());
emisWaybillChangeToService.insertEmisWaybillChangeTo(emisWaybillChangeTo);
return AjaxResult.success("指派成功");
}catch(EmisBizError ex){
ex.printStackTrace();

View File

@ -0,0 +1,47 @@
/**
* @Project: emis
* @Title: EmisWaybillChangeTo.java
* @author linfso
* @date 2025-01-05 10:15:43
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 转单记录表 实体类 </p>
*/
package com.xdadan.erp.emis.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.xdadan.erp.common.annotation.Excel;
import com.xdadan.erp.common.core.domain.BaseEntity;
import com.xdadan.erp.common.core.domain.TreeEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* @ClassName EmisWaybillChangeTo
* @Description 转单记录表
* @author linfso
* @date 2025-01-05 10:15:43
*/
@Data
public class EmisWaybillChangeTo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 运单号 */
private String billCode;
/* 改变来源 */
private String changeFrom;
/* 改到目标 */
private String changeTo;
/* 数据来源 */
private String dataFrom;
}

View File

@ -0,0 +1,80 @@
/**
* @Project: emis
* @Title: EmisWaybillChangeToMapper.java
* @author linfso
* @date 2025-01-05 10:15:43
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
* @version v1.0
* @Description: <p> 转单记录表 Mapper 接口 </p>
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
*/
package com.xdadan.erp.emis.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.emis.domain.EmisWaybillChangeTo;
/**
* @ClassName EmisWaybillChangeToMapper
* @Description <p> 转单记录表 Mapper 接口 </p>
* @author linfso
* @date 2025-01-05 10:15:43
*/
public interface EmisWaybillChangeToMapper extends BaseMapper<EmisWaybillChangeTo>
{
/**
* 主键查询
* @param id
* @return
*/
public EmisWaybillChangeTo selectEmisWaybillChangeToById(Long id);
/**
* 查询列表
*
* @param emisWaybillChangeTo
* @return 集合
*/
public List<EmisWaybillChangeTo> selectEmisWaybillChangeToList(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 检查是否重复
*
* @param emisWaybillChangeTo
* @return 数量
*/
public int checkUnique(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 新增
*
* @param emisWaybillChangeTo
* @return
*/
public int insertEmisWaybillChangeTo(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 修改
*
* @param emisWaybillChangeTo
* @return
*/
public int updateEmisWaybillChangeTo(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 删除
*
* @param id 主键
* @return 结果
*/
public int deleteEmisWaybillChangeToById(Long id);
/**
* 批量删除
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteEmisWaybillChangeToByIds(Long[] ids);
}

View File

@ -362,6 +362,7 @@ public class EmisBaseService {
int waitDoNum=0;
int hasDoNum=0;
int hasCancelNum=0;
int hasChangeToCount=0;
int statType_1_num=0;
int statType_2_num=0;
@ -374,10 +375,12 @@ public class EmisBaseService {
waitDoNum=MapUtils.getIntValue(item0,"waitGotCount",0);
hasDoNum=MapUtils.getIntValue(item0,"hasDoCount",0);
hasCancelNum=MapUtils.getIntValue(item0,"hasCancelCount",0);
hasChangeToCount=MapUtils.getIntValue(item0,"hasChangeToCount",0);
statType_1_num=waitDoNum;
statType_2_num=hasDoNum;
statType_3_num=hasCancelNum;
statType_4_num=hasChangeToCount;
}
List<Map> statNumList = new ArrayList<>();

View File

@ -0,0 +1,78 @@
/**
* @Project: emis
* @Title: EmisWaybillChangeToService.java
* @author linfso
* @date 2025-01-05 10:15:43
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 转单记录表 服务类接口 </p>
*/
package com.xdadan.erp.emis.service;
import java.util.List;
import com.xdadan.erp.emis.domain.EmisWaybillChangeTo;
/**
* @ClassName EmisWaybillChangeToService
* @Description 转单记录表
* @author linfso
* @date 2025-01-05 10:15:43
*/
public interface IEmisWaybillChangeToService
{
/**
* 主键查询
* @param id
* @return
*/
public EmisWaybillChangeTo selectEmisWaybillChangeToById(Long id);
/**
* 查询转单记录表列表
*
* @param emisWaybillChangeTo 转单记录表
* @return 转单记录表集合
*/
public List<EmisWaybillChangeTo> selectEmisWaybillChangeToList(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 检查是否重复
*
* @param emisWaybillChangeTo
* @return 数量
*/
public int checkUnique(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 新增转单记录表
*
* @param emisWaybillChangeTo 转单记录表
* @return 结果
*/
public int insertEmisWaybillChangeTo(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 修改转单记录表
*
* @param emisWaybillChangeTo 转单记录表
* @return 结果
*/
public int updateEmisWaybillChangeTo(EmisWaybillChangeTo emisWaybillChangeTo);
/**
* 批量删除转单记录表
*
* @param ids 需要删除的转单记录表主键集合
* @return 结果
*/
public int deleteEmisWaybillChangeToByIds(Long[] ids);
/**
* 删除转单记录表信息
*
* @param id 转单记录表主键
* @return 结果
*/
public int deleteEmisWaybillChangeToById(Long id);
}

View File

@ -0,0 +1,117 @@
/**
* @Project: emis
* @Title: EmisWaybillChangeToServiceImpl.java
* @author linfso
* @date 2025-01-05 10:15:43
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 转单记录表 实体类 </p>
*/
package com.xdadan.erp.emis.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xdadan.erp.emis.domain.EmisWaybillChangeTo;
import com.xdadan.erp.emis.mapper.EmisWaybillChangeToMapper;
import com.xdadan.erp.emis.service.IEmisWaybillChangeToService;
/**
* 转单记录表Service业务层处理
*
* @author linfso
* @date 2025-01-05 10:15:43
*/
@Service
public class EmisWaybillChangeToServiceImpl implements IEmisWaybillChangeToService
{
@Autowired
private EmisWaybillChangeToMapper emisWaybillChangeToMapper;
/**
* 查询转单记录表
*
* @param id 转单记录表主键
* @return 转单记录表
*/
@Override
public EmisWaybillChangeTo selectEmisWaybillChangeToById(Long id)
{
return emisWaybillChangeToMapper.selectEmisWaybillChangeToById(id);
}
/**
* 查询转单记录表列表
*
* @param emisWaybillChangeTo 转单记录表
* @return 转单记录表
*/
@Override
public List<EmisWaybillChangeTo> selectEmisWaybillChangeToList(EmisWaybillChangeTo emisWaybillChangeTo)
{
return emisWaybillChangeToMapper.selectEmisWaybillChangeToList(emisWaybillChangeTo);
}
/**
* 检查是否重复
*
* @param emisWaybillChangeTo
* @return 数量
*/
@Override
public int checkUnique(EmisWaybillChangeTo emisWaybillChangeTo)
{
return emisWaybillChangeToMapper.checkUnique(emisWaybillChangeTo);
}
/**
* 新增转单记录表
*
* @param emisWaybillChangeTo 转单记录表
* @return 结果
*/
@Override
public int insertEmisWaybillChangeTo(EmisWaybillChangeTo emisWaybillChangeTo)
{
return emisWaybillChangeToMapper.insertEmisWaybillChangeTo(emisWaybillChangeTo);
}
/**
* 修改转单记录表
*
* @param emisWaybillChangeTo 转单记录表
* @return 结果
*/
@Override
public int updateEmisWaybillChangeTo(EmisWaybillChangeTo emisWaybillChangeTo)
{
return emisWaybillChangeToMapper.updateEmisWaybillChangeTo(emisWaybillChangeTo);
}
/**
* 批量删除转单记录表
*
* @param ids 需要删除的转单记录表主键
* @return 结果
*/
@Override
public int deleteEmisWaybillChangeToByIds(Long[] ids)
{
return emisWaybillChangeToMapper.deleteEmisWaybillChangeToByIds(ids);
}
/**
* 删除转单记录表信息
*
* @param id 转单记录表主键
* @return 结果
*/
@Override
public int deleteEmisWaybillChangeToById(Long id)
{
return emisWaybillChangeToMapper.deleteEmisWaybillChangeToById(id);
}
}

View File

@ -0,0 +1,128 @@
<?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.EmisWaybillChangeToMapper">
<resultMap type="EmisWaybillChangeTo" id="EmisWaybillChangeToResult">
<result property="id" column="id" />
<result property="billCode" column="bill_code" />
<result property="changeFrom" column="change_from" />
<result property="changeTo" column="change_to" />
<result property="dataFrom" column="data_from" />
</resultMap>
<sql id="selectEmisWaybillChangeToVo">
select id, bill_code, change_from, change_to, data_from, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_waybill_change_to
</sql>
<select id="selectEmisWaybillChangeToList" parameterType="EmisWaybillChangeTo" resultMap="EmisWaybillChangeToResult">
<include refid="selectEmisWaybillChangeToVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="billCode != null and billCode != ''"> and bill_code like concat('%', #{billCode}, '%')</if>
<if test="changeFrom != null and changeFrom != ''"> and change_from like concat('%', #{changeFrom}, '%')</if>
<if test="changeTo != null and changeTo != ''"> and change_to like concat('%', #{changeTo}, '%')</if>
<if test="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
</where>
order by create_time desc
</select>
<select id="checkUnique" parameterType="EmisWaybillChangeTo" resultType="int">
select count(1) from emis_waybill_change_to
where del_flag='0'
and id = #{id}
and bill_code = #{billCode}
and change_from = #{changeFrom}
and change_to = #{changeTo}
and data_from = #{dataFrom}
and remark = #{remark}
and del_flag = #{delFlag}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
and create_site = #{createSite}
and update_site = #{updateSite}
limit 1
</select>
<select id="selectEmisWaybillChangeToById" parameterType="Long" resultMap="EmisWaybillChangeToResult">
select id, bill_code, change_from, change_to, data_from, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_waybill_change_to a
where a.id = #{id}
</select>
<insert id="insertEmisWaybillChangeTo" parameterType="EmisWaybillChangeTo" useGeneratedKeys="true" keyProperty="id">
insert into emis_waybill_change_to
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="billCode != null and billCode != ''">bill_code,</if>
<if test="changeFrom != null and changeFrom != ''">change_from,</if>
<if test="changeTo != null and changeTo != ''">change_to,</if>
<if test="dataFrom != null and dataFrom != ''">data_from,</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>
<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="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="billCode != null and billCode != ''">#{billCode},</if>
<if test="changeFrom != null and changeFrom != ''">#{changeFrom},</if>
<if test="changeTo != null and changeTo != ''">#{changeTo},</if>
<if test="dataFrom != null and dataFrom != ''">#{dataFrom},</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>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisWaybillChangeTo" parameterType="EmisWaybillChangeTo">
update emis_waybill_change_to
<trim prefix="SET" suffixOverrides=",">
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="changeFrom != null and changeFrom != ''">change_from = #{changeFrom},</if>
<if test="changeTo != null and changeTo != ''">change_to = #{changeTo},</if>
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisWaybillChangeToById" parameterType="Long">
delete from emis_waybill_change_to where id = #{id}
</delete>
<delete id="deleteEmisWaybillChangeToByIds" parameterType="String">
delete from emis_waybill_change_to where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -1178,7 +1178,6 @@
<if test="updateSite != null and updateSite != ''"> and a.update_site=#{updateSite}</if>
<if test="params.problemQueryType != null and params.problemQueryType == 1 and params.problemQueryIds != null and params.problemQueryIds !=''">
and a.bill_code in (
select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} )
@ -1199,14 +1198,26 @@
<if test="params.waybillStatType != null and params.waybillStatType == 2">
and a.waybill_status!='0' and a.order_status!='2'
and (
a.operate_employee_code=#{params.privEmpCode}
or a.take_piece_employee_code=#{params.privEmpCode}
or a.register_man_code=#{params.privEmpCode}
)
</if>
<if test="params.waybillStatType != null and params.waybillStatType == 3">
and a.order_status='2'
and (
a.operate_employee_code=#{params.privEmpCode}
or a.take_piece_employee_code=#{params.privEmpCode}
)
</if>
<!-- 转单 -->
<if test="params.waybillStatType != null and params.waybillStatType == 4">
and a.order_status='3'
and a.order_status='3'and exists (
select 1 from emis_waybill_change_to ewcto where a.bill_code=ewcto.bill_code and ewcto.change_from=#{params.privEmpCode}
)
</if>
@ -2020,7 +2031,7 @@
</select>
<select id="getWaybillStatMap" parameterType="EmisWaybill" resultType="Map">
select tba.waitGotCount,tbb.hasDoCount,tbc.hasCancelCount from (
select tba.waitGotCount,tbb.hasDoCount,tbc.hasCancelCount,tbd.hasChangeToCount from (
select count(1) as waitGotCount
from emis_waybill a
where a.del_flag='0'
@ -2048,19 +2059,13 @@
from emis_waybill a
where a.del_flag='0'
and a.waybill_status!='0'
and a.order_status!='2'
and DATE_FORMAT(a.send_date,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m')
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.send_site_code in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
and (
a.take_piece_employee_code=#{params.privEmpCode} or (a.take_piece_employee_code is null)
)
(a.operate_employee_code is not null and a.operate_employee_code=#{params.privEmpCode} )
or (a.take_piece_employee_code is not null and a.take_piece_employee_code=#{params.privEmpCode} )
or a.register_man_code=#{params.privEmpCode}
)
</if>
) tbb,
@ -2071,20 +2076,24 @@
and a.order_status='2'
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.send_site_code in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
and (
a.take_piece_employee_code=#{params.privEmpCode} or (a.take_piece_employee_code is null)
(a.operate_employee_code is not null and a.operate_employee_code=#{params.privEmpCode} )
or
(a.take_piece_employee_code is not null and a.take_piece_employee_code=#{params.privEmpCode} )
)
</if>
) tbc,
(
select count(1) as hasChangeToCount
from emis_waybill a
where a.del_flag='0'
and a.order_status='3'
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and exists (
select 1 from emis_waybill_change_to ewcto where a.bill_code=ewcto.bill_code and ewcto.change_from=#{params.privEmpCode}
)
</if>
) tbc
) tbd
</select>