Browse Source

防重复

java8
han\hanst 1 month ago
parent
commit
98a4dd2eec
  1. 3
      src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java
  2. 8
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  3. 7
      src/main/resources/mapper/ecss/CoDelMapper.xml

3
src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java

@ -25,6 +25,9 @@ public interface CoDelMapper {
List<EcssCoDelNotifyHeaderData> checkEcssCoDelNotifyHeaderByDelNo( @Param("site") String site,@Param("delNo") String delNo); List<EcssCoDelNotifyHeaderData> checkEcssCoDelNotifyHeaderByDelNo( @Param("site") String site,@Param("delNo") String delNo);
List<EcssCoDelNotifyHeaderData> checkEcssDeclarationHeaderByDelNo( @Param("site") String site,@Param("delNo") String delNo);
List<EcssCoDelNotifyDetailData> searchEcssCoDelNotifyDetail(EcssCoDelNotifyHeaderData data); List<EcssCoDelNotifyDetailData> searchEcssCoDelNotifyDetail(EcssCoDelNotifyHeaderData data);
List<EcssCoDelNotifyDetailData> getEcssCoDelNotifyDetail(EcssCoDelNotifyDetailData data); List<EcssCoDelNotifyDetailData> getEcssCoDelNotifyDetail(EcssCoDelNotifyDetailData data);

8
src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java

@ -2255,6 +2255,10 @@ public class CoDelServiceImpl implements CoDelService {
} else { } else {
notifyHeaderData = getCoDelNotifyHeaderData.get(0); notifyHeaderData = getCoDelNotifyHeaderData.get(0);
} }
List<EcssCoDelNotifyHeaderData> headerData = coDelMapper.checkEcssDeclarationHeaderByDelNo(inData.getSite(), inData.getDelNo());
if (!headerData.isEmpty()) {
throw new RuntimeException("报关单已经存在,请刷新界面!");
}
//获取重量 //获取重量
EcssCoDelPalletHeader getAllWeight = coDelMapper.getAllWeight(inData.getSite(), inData.getDelNo(),inData.getBuNo()); EcssCoDelPalletHeader getAllWeight = coDelMapper.getAllWeight(inData.getSite(), inData.getDelNo(),inData.getBuNo());
if (getAllWeight == null) { if (getAllWeight == null) {
@ -2343,6 +2347,10 @@ public class CoDelServiceImpl implements CoDelService {
@Override @Override
@Transactional @Transactional
public void saveDeclaration(EcssDeclarationHeaderData inData) { public void saveDeclaration(EcssDeclarationHeaderData inData) {
List<EcssCoDelNotifyHeaderData> getCoDelNotifyHeaderData = coDelMapper.checkEcssDeclarationHeaderByDelNo(inData.getSite(), inData.getDelNo());
if (!getCoDelNotifyHeaderData.isEmpty()) {
throw new RuntimeException("报关单已经存在,请刷新界面!");
}
String transNo; String transNo;
coDelMapper.updateTransNo(inData.getSite(), "BG"); coDelMapper.updateTransNo(inData.getSite(), "BG");
transNo = coDelMapper.getTransNo(inData.getSite(), "BG"); transNo = coDelMapper.getTransNo(inData.getSite(), "BG");

7
src/main/resources/mapper/ecss/CoDelMapper.xml

@ -124,6 +124,13 @@
AND a.delNo = #{delNo} AND a.delNo = #{delNo}
</select> </select>
<select id="checkEcssDeclarationHeaderByDelNo" resultType="EcssCoDelNotifyHeaderData">
select a.site,a.delNo
from ecss_declaration_header a
where a.site = #{site}
AND a.delNo = #{delNo}
</select>
<select id="searchEcssCoDelNotifyDetail" resultType="EcssCoDelNotifyDetailData"> <select id="searchEcssCoDelNotifyDetail" resultType="EcssCoDelNotifyDetailData">
select a.site,a.bu_no,a.delNo,a.item_no,a.salesOrder,a.salesOrder_item_no,a.customerPO,a.line,a.version,a.status,a.family, select a.site,a.bu_no,a.delNo,a.item_no,a.salesOrder,a.salesOrder_item_no,a.customerPO,a.line,a.version,a.status,a.family,
a.part_no,a.part_description,a.qty,a.lt,a.cmc_comment,a.saleType,a.awb_bl,a.shipping_number,a.forwarder_info,isnull(a.surplus_qty,0) surplusQty, a.part_no,a.part_description,a.qty,a.lt,a.cmc_comment,a.saleType,a.awb_bl,a.shipping_number,a.forwarder_info,isnull(a.surplus_qty,0) surplusQty,

Loading…
Cancel
Save