This commit is contained in:
linfso 2024-06-03 15:56:54 +08:00
parent e41f3410fa
commit ab31909b0f
9 changed files with 147 additions and 27 deletions

View File

@ -151,6 +151,25 @@ public class EmisCommonController extends BaseController
} }
} }
/**
* 获取批次号
*/
@RequestMapping(value = "/getTmsGroupBatchNo")
public AjaxResult getTmsGroupBatchNo()
{
try {
String YYYYMMDDHH = "yyyyMMddHH";
String batchKey= "TGB-"+DateUtils.parseDateToStr(YYYYMMDDHH,new Date());
Long lockNo = redissonService.addAndGetLong(batchKey,1L);
String batchNo =batchKey+ "-" +StringUtils.leftPad(String.valueOf(lockNo),4,"0");
return AjaxResult.success("获取成功",batchNo);
}catch (Exception ex){
ex.printStackTrace();
return AjaxResult.error(ex.getMessage());
}
}
/** /**
* 获取进仓单号 * 获取进仓单号
*/ */

View File

@ -11,9 +11,16 @@
package com.xdadan.erp.web.emis; package com.xdadan.erp.web.emis;
import java.util.List; import java.util.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.xdadan.erp.common.utils.DateUtils;
import com.xdadan.erp.emis.domain.enumtype.ScanType;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.domain.vo.scan.ScanInfo;
import com.xdadan.erp.emis.service.IEmisTmsScanRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -48,6 +55,9 @@ public class EmisWaybillTransferController extends BaseController
@Autowired @Autowired
private IEmisWaybillTransferService emisWaybillTransferService; private IEmisWaybillTransferService emisWaybillTransferService;
@Autowired
private IEmisTmsScanRecordService emisTmsScanRecordService;
/** /**
* 查询运单转件表列表 * 查询运单转件表列表
*/ */
@ -91,7 +101,51 @@ public class EmisWaybillTransferController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody EmisWaybillTransfer emisWaybillTransfer) public AjaxResult add(@RequestBody EmisWaybillTransfer emisWaybillTransfer)
{ {
return toAjax(emisWaybillTransferService.insertEmisWaybillTransfer(emisWaybillTransfer)); int ret=emisWaybillTransferService.insertEmisWaybillTransfer(emisWaybillTransfer);
// 做转单扫描登记
/*
{
"scanType": "80",
"opType": "1-检查 2-确认",
"scanData": [
{
"billCode": "T001,T002,T002",
"transferCode": "转单同行快递代码",
"transferBillcode": "转单同行单号",
"destCity": "目的城市",
"scanDate": "2024-05-02 12:03:05",
"scanWeight": "0.0"
}
]
}
*/
ScanInfo scanInfo = new ScanInfo();
List<Map<String,Object>> scanDataList = new ArrayList<>();
scanInfo.setOpType(2);
scanInfo.setScanType(ScanType.TRANSFER.opCode);
Map<String,Object> scanDateItem = new HashMap<>();
scanDateItem.put("billCode",emisWaybillTransfer.getBillCode());
scanDateItem.put("transferCode",emisWaybillTransfer.getTransferExpress());
scanDateItem.put("transferBillcode",emisWaybillTransfer.getTransferBillCode());
scanDateItem.put("destCity",emisWaybillTransfer.getTransferCity());
scanDateItem.put("scanDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date()));
scanDateItem.put("scanWeight", "0.0");
scanDataList.add(scanDateItem);
scanInfo.setScanData(scanDataList);
try {
emisTmsScanRecordService.scan(scanInfo);
} catch (EmisBizError emisBizError) {
emisBizError.printStackTrace();
return AjaxResult.error(emisBizError.getMessage());
}catch (Exception e) {
e.printStackTrace();
return AjaxResult.error("数据异常!");
}
return AjaxResult.success("成功",ret);
} }
/** /**

View File

@ -49,10 +49,7 @@ public class EmisTmsPackDtl extends BaseEntity
/* 扫描员 */ /* 扫描员 */
private String scanMan; private String scanMan;
// 扩展参数 // 扩展参数
private EmisWaybill waybillDetail; private EmisWaybill waybillDetail;
} }

View File

@ -51,4 +51,7 @@ public class EmisTmsSiteBatchDtl extends BaseEntity
/* 扫描站点 */ /* 扫描站点 */
private String scanSite; private String scanSite;
// 扩展参数
private EmisWaybill waybillDetail;
} }

View File

@ -409,7 +409,7 @@ public class EmisWaybill extends BaseEntity
// 目的地名称 // 目的地名称
private String destinationName; private String destinationName;
// 目的网点名称 // 目的网点名称
private String dispatchUnderlingSiteName; private String dispatjchUnderlingSiteName;
// 派件网点名称,派件人 // 派件网点名称,派件人
private String dispatchSiteName; private String dispatchSiteName;

View File

@ -105,4 +105,8 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
// 更新上一站,下一站 // 更新上一站,下一站
public int updatePreOrNextSiteByBillCode(EmisWaybill emisWaybill); public int updatePreOrNextSiteByBillCode(EmisWaybill emisWaybill);
// 转件登记
public int updateTransferInfo(EmisWaybill emisWaybill);
} }

View File

@ -299,17 +299,13 @@ public class EmisBaseService {
* @param destCity * @param destCity
*/ */
public void wayBillTransfer(String billCode,String transferCode,String transferBillcode,String destCity){ public void wayBillTransfer(String billCode,String transferCode,String transferBillcode,String destCity){
EmisWaybill waybill=getWaybillByBillCode(billCode); EmisWaybill upd=new EmisWaybill();
if(waybill!=null){ upd.setBillCode(billCode);
EmisWaybill upd=new EmisWaybill(); upd.setTransferCode(transferCode);
upd.setId(waybill.getId()); upd.setTransferBillcode(transferBillcode);
upd.preUpdate(); upd.setBlDispFd("1");// 转单标识
upd.setTransferCode(transferCode); emisWaybillMapper.updateTransferInfo(upd);
upd.setTransferBillcode(transferBillcode);
upd.setBlDispFd("1");// 转单标识
emisWaybillMapper.updateEmisWaybill(upd);
}
} }

View File

@ -11,6 +11,8 @@
package com.xdadan.erp.emis.service.impl; package com.xdadan.erp.emis.service.impl;
import java.util.List; import java.util.List;
import com.xdadan.erp.emis.service.IEmisTmsScanRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.xdadan.erp.emis.domain.EmisWaybillTransfer; import com.xdadan.erp.emis.domain.EmisWaybillTransfer;
@ -24,11 +26,13 @@ import com.xdadan.erp.emis.service.IEmisWaybillTransferService;
* @date 2024-05-22 01:07:48 * @date 2024-05-22 01:07:48
*/ */
@Service @Service
public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferService public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferService
{ {
@Autowired @Autowired
private EmisWaybillTransferMapper emisWaybillTransferMapper; private EmisWaybillTransferMapper emisWaybillTransferMapper;
/** /**
* 查询运单转件表 * 查询运单转件表
* *
@ -62,6 +66,8 @@ public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferServi
@Override @Override
public int insertEmisWaybillTransfer(EmisWaybillTransfer emisWaybillTransfer) public int insertEmisWaybillTransfer(EmisWaybillTransfer emisWaybillTransfer)
{ {
// 做一次转件扫描记录
return emisWaybillTransferMapper.insertEmisWaybillTransfer(emisWaybillTransfer); return emisWaybillTransferMapper.insertEmisWaybillTransfer(emisWaybillTransfer);
} }

View File

@ -1022,7 +1022,15 @@
<update id="updatePrintStatus" parameterType="EmisWaybill"> <update id="updatePrintStatus" parameterType="EmisWaybill">
update emis_waybill set bl_print='1',print_man_code=#{printManCode},print_site=#{printSite},print_date=now(),print_count=print_count+1 where bill_code=#{billCode} update emis_waybill set
bl_print='1',
print_man_code=#{printManCode},
print_site=#{printSite},
print_date=now(),
print_count=print_count+1
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where bill_code=#{billCode}
</update> </update>
<update id="updateSignStatus" parameterType="EmisWaybill"> <update id="updateSignStatus" parameterType="EmisWaybill">
@ -1038,15 +1046,30 @@
where bill_code=#{billCode} where bill_code=#{billCode}
</update> </update>
<update id="updateProblemStatus" parameterType="EmisWaybill"> <update id="updateProblemStatus" parameterType="EmisWaybill">
update emis_waybill set update emis_waybill
bl_is_question = #{blIsQuestion}, <trim prefix="SET" suffixOverrides=",">
bl_is_question = '1',
problem_type = #{problemType}, problem_type = #{problemType},
problem_cause = #{problemCause}, problem_cause = #{problemCause},
problem_delay_days = #{problemDelayDays} problem_delay_days = #{problemDelayDays}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if> <if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite},</if> <if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
</trim>
where bill_code=#{billCode}
</update>
<update id="updateTransferInfo" parameterType="EmisWaybill">
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
bl_disp_fd ='1',
transfer_code = #{transferCode},
transfer_billcode = #{transferBillcode},
disp_fd_date = #{dispFdDate},
disp_fd_reason = #{dispFdReason}
<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} where bill_code=#{billCode}
</update> </update>
@ -1064,23 +1087,41 @@
</update> </update>
<update id="changeWaybillStatusByBillCode" parameterType="EmisWaybill"> <update id="changeWaybillStatusByBillCode" parameterType="EmisWaybill">
update emis_waybill set waybill_status=#{waybillStatus} where bill_code=#{billCode} update emis_waybill
<trim prefix="SET" suffixOverrides=",">
waybill_status=#{waybillStatus}
<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>
<update id="changeOrderStatusByBillCode" parameterType="EmisWaybill"> <update id="changeOrderStatusByBillCode" parameterType="EmisWaybill">
update emis_waybill set order_status=#{orderStatus} where bill_code=#{billCode} update emis_waybill set order_status=#{orderStatus}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where bill_code=#{billCode}
</update> </update>
<update id="changeOrderStatusByOrderSn" parameterType="EmisWaybill"> <update id="changeOrderStatusByOrderSn" parameterType="EmisWaybill">
update emis_waybill set order_status=#{orderStatus} where order_sn=#{orderSn} update emis_waybill set order_status=#{orderStatus}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where order_sn=#{orderSn}
</update> </update>
<delete id="deleteEmisWaybillById" parameterType="Long"> <delete id="deleteEmisWaybillById" parameterType="Long">
update emis_waybill set del_flag='1' where id = #{id} update emis_waybill set del_flag='1'
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where id = #{id}
</delete> </delete>
<delete id="deleteEmisWaybillByIds" parameterType="String"> <delete id="deleteEmisWaybillByIds" parameterType="String">
update emis_waybill set del_flag='1 where id in update emis_waybill set del_flag='1
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>