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:
commit
34bb02e08c
@ -80,4 +80,6 @@ public interface EmisTransProductMapper extends BaseMapper<EmisTransProduct>
|
|||||||
public int deleteEmisTransProductByIds(Long[] ids);
|
public int deleteEmisTransProductByIds(Long[] ids);
|
||||||
|
|
||||||
public EmisTransProduct getEmisTransProductByProdCode(String prodCode);
|
public EmisTransProduct getEmisTransProductByProdCode(String prodCode);
|
||||||
|
|
||||||
|
EmisTransProduct selectTransProductByCode(@Param("lineCode") String lineCode,@Param("prodCode") String prodCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 {
|
public static void main(String[] args) throws ParseException {
|
||||||
// Date startDate = new Date("202");
|
// Date startDate = new Date("202");
|
||||||
Date startDate= new SimpleDateFormat("yyyy-MM-dd").parse("2025-05-11");
|
Date startDate= new SimpleDateFormat("yyyy-MM-dd").parse("2025-05-11");
|
||||||
|
|||||||
@ -3130,6 +3130,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
|||||||
// 校验寄件国家是否匹配线路
|
// 校验寄件国家是否匹配线路
|
||||||
checkCountry(emisWaybillSave);
|
checkCountry(emisWaybillSave);
|
||||||
|
|
||||||
|
// 校验产品类型与线路是否匹配
|
||||||
|
checkLineWithProd(emisWaybillSave);
|
||||||
|
|
||||||
// 子单号做扣减
|
// 子单号做扣减
|
||||||
if ("1".equals(emisWaybillSave.getBlGenSubbill())) {
|
if ("1".equals(emisWaybillSave.getBlGenSubbill())) {
|
||||||
Integer subBillCount = emisElectronicSitePagService.getTotalAvailablePagCount(emisWaybillSave.getSendSiteCode(), "T7080", "1002");
|
Integer subBillCount = emisElectronicSitePagService.getTotalAvailablePagCount(emisWaybillSave.getSendSiteCode(), "T7080", "1002");
|
||||||
@ -3649,6 +3652,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
|||||||
// 公共计算部分
|
// 公共计算部分
|
||||||
emisWaybillSave.setId(oldEmisWaybill.getId());
|
emisWaybillSave.setId(oldEmisWaybill.getId());
|
||||||
|
|
||||||
|
// 校验产品类型与线路是否匹配
|
||||||
|
checkLineWithProd(emisWaybillSave);
|
||||||
|
|
||||||
calcWayBillCommonInfo(emisWaybillSave,oldEmisWaybill,false);
|
calcWayBillCommonInfo(emisWaybillSave,oldEmisWaybill,false);
|
||||||
|
|
||||||
emisWaybillSave.preUpdate();
|
emisWaybillSave.preUpdate();
|
||||||
|
|||||||
@ -73,6 +73,12 @@
|
|||||||
where a.trans_line_code=#{lineCode} and a.prod_name=#{prodName} limit 1
|
where a.trans_line_code=#{lineCode} and a.prod_name=#{prodName} limit 1
|
||||||
</select>
|
</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 id="checkUnique" parameterType="EmisTransProduct" resultType="int">
|
||||||
select count(1) from emis_trans_product
|
select count(1) from emis_trans_product
|
||||||
where del_flag='0'
|
where del_flag='0'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user