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;
import java.util.List;
import java.util.*;
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.dao.DuplicateKeyException;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -48,6 +55,9 @@ public class EmisWaybillTransferController extends BaseController
@Autowired
private IEmisWaybillTransferService emisWaybillTransferService;
@Autowired
private IEmisTmsScanRecordService emisTmsScanRecordService;
/**
* 查询运单转件表列表
*/
@ -91,7 +101,51 @@ public class EmisWaybillTransferController extends BaseController
@PostMapping
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 EmisWaybill waybillDetail;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -11,6 +11,8 @@
package com.xdadan.erp.emis.service.impl;
import java.util.List;
import com.xdadan.erp.emis.service.IEmisTmsScanRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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
*/
@Service
public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferService
public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferService
{
@Autowired
private EmisWaybillTransferMapper emisWaybillTransferMapper;
/**
* 查询运单转件表
*
@ -62,6 +66,8 @@ public class EmisWaybillTransferServiceImpl implements IEmisWaybillTransferServi
@Override
public int insertEmisWaybillTransfer(EmisWaybillTransfer emisWaybillTransfer)
{
// 做一次转件扫描记录
return emisWaybillTransferMapper.insertEmisWaybillTransfer(emisWaybillTransfer);
}

View File

@ -1022,7 +1022,15 @@
<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 id="updateSignStatus" parameterType="EmisWaybill">
@ -1038,15 +1046,30 @@
where bill_code=#{billCode}
</update>
<update id="updateProblemStatus" parameterType="EmisWaybill">
update emis_waybill set
bl_is_question = #{blIsQuestion},
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
bl_is_question = '1',
problem_type = #{problemType},
problem_cause = #{problemCause},
problem_delay_days = #{problemDelayDays}
<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}
</update>
@ -1064,23 +1087,41 @@
</update>
<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 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 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>
<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 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=")">
#{id}
</foreach>