Merge pull request 'demand: 运单录入、运单修改、运单批量录入、网点费用申请增加校验线路与产品类型是否匹配' (#157) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/157
This commit is contained in:
heyu 2025-08-15 13:13:49 +08:00
commit 34bb02e08c
4 changed files with 49 additions and 22 deletions

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisTransProductMapper.java
* @author linfso
* @date 2024-01-09 11:50:34
* @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>
*/
@ -26,7 +26,7 @@ public interface EmisTransProductMapper extends BaseMapper<EmisTransProduct>
/**
* 主键查询
* @param id
* @return
* @return
*/
public EmisTransProduct selectEmisTransProductById(Long id);
@ -41,31 +41,31 @@ public interface EmisTransProductMapper extends BaseMapper<EmisTransProduct>
/**
* 查询列表
*
* @param emisTransProduct
*
* @param emisTransProduct
* @return 集合
*/
public List<EmisTransProduct> selectEmisTransProductList(EmisTransProduct emisTransProduct);
/**
* 新增
*
* 新增
*
* @param emisTransProduct
* @return
* @return
*/
public int insertEmisTransProduct(EmisTransProduct emisTransProduct);
/**
* 修改
*
* @param emisTransProduct
* @return
*
* @param emisTransProduct
* @return
*/
public int updateEmisTransProduct(EmisTransProduct emisTransProduct);
/**
* 删除
*
*
* @param id 主键
* @return 结果
*/
@ -73,11 +73,13 @@ public interface EmisTransProductMapper extends BaseMapper<EmisTransProduct>
/**
* 批量删除
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteEmisTransProductByIds(Long[] ids);
public EmisTransProduct getEmisTransProductByProdCode(String prodCode);
EmisTransProduct selectTransProductByCode(@Param("lineCode") String lineCode,@Param("prodCode") String prodCode);
}

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisWaybillServiceImpl.java
* @author linfso
* @date 2024-02-29 08:15:14
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 运单列表 实体类 </p>
*/
@ -58,7 +58,7 @@ package com.xdadan.erp.emis.service;
/**
* 运单列表Service业务层处理
*
*
* @author linfso
* @date 2024-02-29 08:15:14
*/
@ -5480,6 +5480,19 @@ public class EmisBaseService {
}
public void checkLineWithProd(EmisWaybill emisWaybillSave) throws EmisBizError {
if (StringUtil.isBlank(emisWaybillSave.getProductType()) || StringUtil.isBlank(emisWaybillSave.getTransLineType()
)) {
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "线路/产品类型不能为空");
}
EmisTransProduct transProduct = emisTransProductMapper.selectTransProductByCode(
emisWaybillSave.getTransLineType(),
emisWaybillSave.getProductType());
if (transProduct == null) {
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "产品类型与线路不匹配");
}
}
public static void main(String[] args) throws ParseException {
// Date startDate = new Date("202");
Date startDate= new SimpleDateFormat("yyyy-MM-dd").parse("2025-05-11");
@ -5549,4 +5562,4 @@ public class EmisBaseService {
}
}

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisWaybillServiceImpl.java
* @author linfso
* @date 2024-02-29 08:15:14
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 运单列表 实体类 </p>
*/
@ -72,7 +72,7 @@ package com.xdadan.erp.emis.service.impl;
/**
* 运单列表Service业务层处理
*
*
* @author linfso
* @date 2024-02-29 08:15:14
*/
@ -192,7 +192,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
/**
* 查询运单列表列表
*
*
* @param emisWaybill 运单列表
* @return 运单列表
*/
@ -3130,6 +3130,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 校验寄件国家是否匹配线路
checkCountry(emisWaybillSave);
// 校验产品类型与线路是否匹配
checkLineWithProd(emisWaybillSave);
// 子单号做扣减
if ("1".equals(emisWaybillSave.getBlGenSubbill())) {
Integer subBillCount = emisElectronicSitePagService.getTotalAvailablePagCount(emisWaybillSave.getSendSiteCode(), "T7080", "1002");
@ -3649,6 +3652,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 公共计算部分
emisWaybillSave.setId(oldEmisWaybill.getId());
// 校验产品类型与线路是否匹配
checkLineWithProd(emisWaybillSave);
calcWayBillCommonInfo(emisWaybillSave,oldEmisWaybill,false);
emisWaybillSave.preUpdate();

View File

@ -73,6 +73,12 @@
where a.trans_line_code=#{lineCode} and a.prod_name=#{prodName} limit 1
</select>
<select id="selectTransProductByCode" parameterType="String" resultMap="EmisTransProductResult">
select id, prod_code, prod_name, prod_name_en, status, country, trans_line_code, trans_line, carry_type, trans_type, aging_desc, aging_flag, min_aging, max_aging, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_trans_product a
where a.trans_line_code=#{lineCode} and a.prod_code=#{prodCode} limit 1
</select>
<select id="checkUnique" parameterType="EmisTransProduct" resultType="int">
select count(1) from emis_trans_product
where del_flag='0'
@ -211,4 +217,4 @@
#{id}
</foreach>
</delete>
</mapper>
</mapper>