demand: tms系统-运输管理-漏组批次订单-增加批量取消确认按钮

committer: heyu
This commit is contained in:
aike 2025-08-22 10:51:48 +08:00
parent 39b9f83dbc
commit 0e2e8ff9f8
6 changed files with 112 additions and 19 deletions

View File

@ -172,4 +172,50 @@ public class EmisTmsSiteBatchMissController extends EmisBaseController {
emisTmsSiteBatchMissService.confirmBatch(billCodes, remark, req.getBlManual());
return AjaxResult.success("确认成功");
}
/**
* 批量取消确认组批次:参数通过 params.billCodeList 传入
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchMiss:cancelConfirm')")
@Log(title = "TMS漏组批次信息", businessType = BusinessType.UPDATE)
@PostMapping("/cancelConfirmBatch")
public AjaxResult cancelConfirmBatch(@RequestBody EmisTmsSiteBatchMiss req) throws EmisBizError {
Object listObj = req.getParams() != null ? req.getParams().get("billCodeList") : null;
if (listObj == null) {
return AjaxResult.error("参数缺失:billCodeList");
}
List<String> billCodes;
if (listObj instanceof List) {
List<?> tmp = (List<?>) listObj;
billCodes = new java.util.ArrayList<>();
for (Object o : tmp) {
if (o != null) {
String s = String.valueOf(o).trim();
if (!s.isEmpty()) {
billCodes.add(s);
}
}
}
} else if (listObj instanceof String) {
String str = ((String) listObj).trim();
if (str.isEmpty()) {
billCodes = java.util.Collections.emptyList();
} else {
String[] arr = str.split(",");
billCodes = new java.util.ArrayList<>(arr.length);
for (String a : arr) {
if (a != null) {
String s = a.trim();
if (!s.isEmpty()) {
billCodes.add(s);
}
}
}
}
} else {
return AjaxResult.error("参数格式错误:billCodeList");
}
emisTmsSiteBatchMissService.cancelConfirmBatch(billCodes);
return AjaxResult.success("取消确认成功");
}
}

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisWaybillMapper.java
* @author linfso
* @date 2024-02-29 08:15:14
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 运单列表 Mapper 接口 </p>
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
*/
@ -52,14 +52,14 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
/**
* 主键查询
* @param id
* @return
* @return
*/
public EmisWaybill selectEmisWaybillById(Long id);
/**
* 查询列表
*
* @param emisWaybill
*
* @param emisWaybill
* @return 集合
*/
public List<EmisWaybill> selectEmisWaybillList(EmisWaybill emisWaybill);
@ -99,19 +99,19 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
public List<EmisWaybill> selectWaitDoCostList(EmisWaybill emisWaybill);
/**
* 新增
*
* 新增
*
* @param emisWaybill
* @return
* @return
*/
public int insertEmisWaybill(EmisWaybill emisWaybill);
/**
* 修改
*
* @param emisWaybill
* @return
*
* @param emisWaybill
* @return
*/
@DataAuditLog(operateType= OperateType.UPDATE,serviceClass=EmisWaybillServiceImpl.class)
public int updateEmisWaybill(EmisWaybill emisWaybill);
@ -121,7 +121,7 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
/**
* 删除
*
*
* @param id 主键
* @return 结果
*/
@ -129,7 +129,7 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
/**
* 批量删除
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
@ -332,6 +332,14 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
*/
List<EmisWaybill> selectMasterEmisWaybills(EmisWaybill emisWaybill);
/**
* 根据运单号列表批量查询运单信息
*
* @param billCodes 运单号列表
* @return 运单列表
*/
List<EmisWaybill> selectEmisWaybillListByBillCodes(@Param("billCodes") List<String> billCodes);
/**
*
* @param offset

View File

@ -81,4 +81,13 @@ public interface IEmisTmsSiteBatchMissService {
* @param blManual
*/
void confirmBatch(List<String> billCodes, String remark, String blManual) throws EmisBizError;
/**
* 批量取消确认组批次:
* 1) 根据运单号列表删除运单组批次状态数据
* 2) 重新扫描运单组批次状态
*
* @param billCodes 运单号列表
*/
void cancelConfirmBatch(List<String> billCodes) throws EmisBizError;
}

View File

@ -223,6 +223,28 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
}
}
/**
* 批量取消确认组批次:删除运单组批次状态数据并重新扫描
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void cancelConfirmBatch(List<String> billCodes) throws EmisBizError {
if (billCodes == null || billCodes.isEmpty()) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "运单号不能为空");
}
// 1) 彻底删除运单组批次状态数据
emisWaybillBatchStatusMapper.deleteByBillCodes(billCodes);
// 2) 批量查询运单信息
List<EmisWaybill> waybills = emisWaybillMapper.selectEmisWaybillListByBillCodes(billCodes);
// 3) 调用scanSiteBatchByWaybills重新扫描
if (!waybills.isEmpty()) {
this.scanSiteBatchByWaybills(waybills);
}
}
@Async
@Override
public void autoScanSiteBatch(String lineCode) {

View File

@ -36,15 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<!-- 根据运单号列表批量逻辑删除批次状态 -->
<update id="deleteByBillCodes" parameterType="java.util.List">
update emis_waybill_batch_status
set del_flag = '1'
<!-- 根据运单号列表批量彻底删除批次状态 -->
<delete id="deleteByBillCodes" parameterType="java.util.List">
delete from emis_waybill_batch_status
where bill_code in
<foreach collection="billCodes" item="billCode" open="(" separator="," close=")">
#{billCode}
</foreach>
and del_flag = '0'
</update>
</delete>
</mapper>

View File

@ -601,6 +601,16 @@
limit 10
</select>
<!-- 根据运单号列表批量查询运单信息 -->
<select id="selectEmisWaybillListByBillCodes" parameterType="java.util.List" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
where a.del_flag = '0'
and a.bill_code in
<foreach collection="billCodes" item="billCode" open="(" separator="," close=")">
#{billCode}
</foreach>
</select>
<select id="selectWaitGotOrderList" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
<where>