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()); emisTmsSiteBatchMissService.confirmBatch(billCodes, remark, req.getBlManual());
return AjaxResult.success("确认成功"); 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

@ -332,6 +332,14 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
*/ */
List<EmisWaybill> selectMasterEmisWaybills(EmisWaybill emisWaybill); List<EmisWaybill> selectMasterEmisWaybills(EmisWaybill emisWaybill);
/**
* 根据运单号列表批量查询运单信息
*
* @param billCodes 运单号列表
* @return 运单列表
*/
List<EmisWaybill> selectEmisWaybillListByBillCodes(@Param("billCodes") List<String> billCodes);
/** /**
* *
* @param offset * @param offset

View File

@ -81,4 +81,13 @@ public interface IEmisTmsSiteBatchMissService {
* @param blManual * @param blManual
*/ */
void confirmBatch(List<String> billCodes, String remark, String blManual) throws EmisBizError; 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 @Async
@Override @Override
public void autoScanSiteBatch(String lineCode) { public void autoScanSiteBatch(String lineCode) {

View File

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

View File

@ -601,6 +601,16 @@
limit 10 limit 10
</select> </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"> <select id="selectWaitGotOrderList" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillVo"/> <include refid="selectEmisWaybillVo"/>
<where> <where>