This commit is contained in:
linfso 2024-08-17 19:47:30 +08:00
parent a44ad066a7
commit 6b590dd07c
6 changed files with 65 additions and 9 deletions

View File

@ -254,6 +254,10 @@ public class EmisWaybillTransferController extends EmisBaseController
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(emisWaybillTransferService.deleteEmisWaybillTransferByIds(ids));
if(ids!=null&&ids.length>0) {
return toAjax(emisWaybillTransferService.deleteEmisWaybillTransferByIds(ids));
}else{
return AjaxResult.error("请选择记录");
}
}
}

View File

@ -158,6 +158,9 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
// 转件登记
public int updateTransferInfo(EmisWaybill emisWaybill);
public int cancelTransferInfo(EmisWaybill emisWaybill);
// 检查子单是否存在
public int checkDbSubBillIsExists(@Param("billCode")String billCode,@Param("subNum") Integer subNum);

View File

@ -821,6 +821,7 @@ public class EmisBaseService {
}
/**
* 获取三方物流轨迹
* @param billCode

View File

@ -11,8 +11,9 @@ package com.xdadan.erp.emis.service;
import java.util.List;
import com.xdadan.erp.emis.domain.EmisWaybillTransfer;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
/**
/**
* @ClassName EmisWaybillTransferService
* @Description 运单转件表
* @author linfso
@ -65,5 +66,5 @@ public interface IEmisWaybillTransferService
* @param id 运单转件表主键
* @return 结果
*/
public int deleteEmisWaybillTransferById(Long id);
public int deleteEmisWaybillTransferById(Long id) throws EmisBizError;
}

View File

@ -12,6 +12,11 @@ package com.xdadan.erp.emis.service.impl;
import java.util.List;
import com.xdadan.erp.emis.domain.EmisWaybill;
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.mapper.EmisTmsTransferTraceMapper;
import com.xdadan.erp.emis.mapper.EmisWaybillMapper;
import com.xdadan.erp.emis.service.IEmisTmsScanRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -32,6 +37,11 @@ public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferServ
private EmisWaybillTransferMapper emisWaybillTransferMapper;
@Autowired
protected EmisWaybillMapper emisWaybillMapper;
@Autowired
private EmisTmsTransferTraceMapper emisTmsTransferTraceMapper;
/**
* 查询运单转件表
@ -90,10 +100,18 @@ public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferServ
* @return 结果
*/
@Override
public int deleteEmisWaybillTransferByIds(Long[] ids)
{
return emisWaybillTransferMapper.deleteEmisWaybillTransferByIds(ids);
public int deleteEmisWaybillTransferByIds(Long[] ids) {
if(ids!=null&& ids.length>0) {
for (int i=0;i<ids.length;i++){
Long id=ids[i];
try {
this.deleteEmisWaybillTransferById(id);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
return 1;
}
/**
@ -103,8 +121,22 @@ public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferServ
* @return 结果
*/
@Override
public int deleteEmisWaybillTransferById(Long id)
{
public int deleteEmisWaybillTransferById(Long id) throws EmisBizError {
EmisWaybillTransfer emisWaybillTransfer=emisWaybillTransferMapper.selectEmisWaybillTransferById(id);
if(emisWaybillTransfer==null){
throw new EmisBizError(EmisBizErrorType.FAIL,"转件不存在");
}
// 删除转件记录
// 清除运单转单记录
EmisWaybill upd=new EmisWaybill();
upd.setBillCode(emisWaybillTransfer.getBillCode());
emisWaybillMapper.cancelTransferInfo(upd);
// 删除转件轨迹抓取记录
emisTmsTransferTraceMapper.deleteEmisTmsTransferTraceByBillCode(emisWaybillTransfer.getBillCode());
return emisWaybillTransferMapper.deleteEmisWaybillTransferById(id);
}

View File

@ -2437,6 +2437,21 @@
where bill_code=#{billCode}
</update>
<update id="cancelTransferInfo" parameterType="EmisWaybill">
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
bl_disp_fd ='0',
transfer_code = null,
transfer_billcode = null,
disp_fd_date =null,
disp_fd_reason =null
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
</trim>
where bill_code=#{billCode}
</update>
<update id="updatePreOrNextSiteByBillCode" parameterType="EmisWaybill">
update emis_waybill