|
|
@@ -1,517 +0,0 @@
|
|
|
-package com.uas.eis.service.Impl;
|
|
|
-
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
-import com.uas.eis.config.SynaConfig;
|
|
|
-import com.uas.eis.core.X12Converter;
|
|
|
-import com.uas.eis.core.config.SpObserver;
|
|
|
-import com.uas.eis.core.support.TokenProperties;
|
|
|
-import com.uas.eis.dao.BaseDao;
|
|
|
-import com.uas.eis.dao.SqlRowList;
|
|
|
-import com.uas.eis.entity.*;
|
|
|
-import com.uas.eis.sdk.entity.ApiResult;
|
|
|
-import com.uas.eis.sdk.entity.GRApiResult;
|
|
|
-import com.uas.eis.sdk.entity.Errors;
|
|
|
-import com.uas.eis.sdk.entity.ReturnData;
|
|
|
-import com.uas.eis.sdk.resp.ApiResponse;
|
|
|
-import com.uas.eis.service.CommonService;
|
|
|
-import com.uas.eis.service.GEService;
|
|
|
-import com.uas.eis.utils.HttpUtil;
|
|
|
-import com.uas.eis.utils.HuToolUtils;
|
|
|
-import com.uas.eis.vo.HttpResultResponse;
|
|
|
-import io.xlate.edi.schema.EDISchemaException;
|
|
|
-import io.xlate.edi.stream.EDIStreamException;
|
|
|
-import net.sf.json.JSONObject;
|
|
|
-import okhttp3.*;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.validation.constraints.Null;
|
|
|
-import java.io.IOException;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.*;
|
|
|
-import com.uas.eis.dto.*;
|
|
|
-
|
|
|
-/**
|
|
|
- * @author zxl
|
|
|
- * @email zxl@usoftchina.com
|
|
|
- */
|
|
|
-@Service
|
|
|
-public class GEServiceImpl implements GEService {
|
|
|
- private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
- private static Map<String, String> tokenConfig = TokenProperties.getAllProperty();
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private BaseDao baseDao;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SynaConfig synaConfig;
|
|
|
- @Autowired
|
|
|
- private CommonService commonService;
|
|
|
-
|
|
|
- @Value("${api.url.geer.asn}")
|
|
|
- private String asnUrl;
|
|
|
-
|
|
|
-
|
|
|
- final static String SALE_PRICE_CCP = "select spd_id,spd_price,spd_taxrate from (select spd_id,spd_price,spd_taxrate,spd_remark,spd_ratio from SalePriceDetail left join SalePrice on spd_spid=sp_id"
|
|
|
- + " where spd_arcustcode=? and spd_prodcode=? and spd_currency=? and to_char(sp_fromdate,'yyyymmdd')<=to_char(sysdate,'yyyymmdd') and nvl(spd_lapqty,0)<=? and"
|
|
|
- + " to_char(sp_todate,'yyyymmdd')>=to_char(sysdate,'yyyymmdd') AND spd_statuscode='VALID' and sp_statuscode='AUDITED' ORDER BY SalePrice.sp_indate DESC,SalePriceDetail.spd_price) where rownum<2";
|
|
|
- final static String SALE_PRICE_CCPR = "select spd_id,spd_price,spd_taxrate from (select spd_id,spd_price,spd_taxrate,spd_remark,spd_ratio from SalePriceDetail left join SalePrice on spd_spid=sp_id"
|
|
|
- + " where spd_arcustcode=? and spd_prodcode=? and spd_currency=? AND spd_taxrate=? and to_char(sp_fromdate,'yyyymmdd')<=to_char(sysdate,'yyyymmdd') and nvl(spd_lapqty,0)<=? and"
|
|
|
- + " to_char(sp_todate,'yyyymmdd')>=to_char(sysdate,'yyyymmdd') AND spd_statuscode='VALID' and sp_statuscode='AUDITED' ORDER BY SalePrice.sp_indate DESC,SalePriceDetail.spd_price) where rownum<2";
|
|
|
- final static String SALE_PRICE_KCP = "select spd_id,spd_price,spd_taxrate from (select spd_id,spd_price,spd_taxrate,spd_remark,spd_ratio from SalePriceDetail left join SalePrice on spd_spid=sp_id"
|
|
|
- + " where spd_prodcode=? and spd_currency=? and to_char(sp_fromdate,'yyyymmdd')<=to_char(sysdate,'yyyymmdd') and spd_pricetype=? and nvl(spd_lapqty,0)<=? and"
|
|
|
- + " to_char(sp_todate,'yyyymmdd')>=to_char(sysdate,'yyyymmdd') AND spd_statuscode='VALID' and sp_statuscode='AUDITED' ORDER BY SalePrice.sp_indate DESC,SalePriceDetail.spd_price) where rownum<2";
|
|
|
- final static String SALE_PRICE_PC = "select spd_id,spd_price,spd_taxrate from (select spd_id,spd_price,spd_taxrate,spd_remark,spd_ratio from SalePriceDetail left join SalePrice on spd_spid=sp_id"
|
|
|
- + " where spd_prodcode=? and spd_currency=? and to_char(sp_fromdate,'yyyymmdd')<=to_char(sysdate,'yyyymmdd') and nvl(spd_lapqty,0)<=? and"
|
|
|
- + " to_char(sp_todate,'yyyymmdd')>=to_char(sysdate,'yyyymmdd') AND spd_statuscode='VALID' and sp_statuscode='AUDITED' ORDER BY SalePrice.sp_indate DESC,SalePriceDetail.spd_price) where rownum<2";
|
|
|
- final static String SALE_PRICE_PCR = "select spd_id,spd_price,spd_taxrate from (select spd_id,spd_price,spd_taxrate,spd_remark,spd_ratio from SalePriceDetail left join SalePrice on spd_spid=sp_id"
|
|
|
- + " where spd_prodcode=? and spd_currency=? and spd_taxrate=? and to_char(sp_fromdate,'yyyymmdd')<=to_char(sysdate,'yyyymmdd') and nvl(spd_lapqty,0)<=? and"
|
|
|
- + " to_char(sp_todate,'yyyymmdd')>=to_char(sysdate,'yyyymmdd') AND spd_statuscode='VALID' and sp_statuscode='AUDITED' ORDER BY SalePrice.sp_indate DESC,SalePriceDetail.spd_price) where rownum<2";
|
|
|
- final static String SALE_PRICE_SCP = "select spd_id,spd_price,spd_taxrate from (select spd_id,spd_price,spd_taxrate,spd_remark,spd_ratio from SalePriceDetail left join SalePrice on spd_spid=sp_id"
|
|
|
- + " where sp_kind=? and spd_prodcode=? and spd_currency=? and to_char(sp_fromdate,'yyyymmdd')<=to_char(sysdate,'yyyymmdd') and nvl(spd_lapqty,0)<=? and"
|
|
|
- + " to_char(sp_todate,'yyyymmdd')>=to_char(sysdate,'yyyymmdd') AND spd_statuscode='VALID' and sp_statuscode='AUDITED' ORDER BY SalePrice.sp_indate DESC,SalePriceDetail.spd_price) where rownum<2";
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public GRApiResult<String> getPoordergr(HttpServletRequest request, PoInternalDTO dtop) {
|
|
|
- PoOrderGrDTO dto = dtop.getPo();
|
|
|
- GRApiResult<String> grApiResult = new GRApiResult<String>();
|
|
|
- String vendcode = dto.getDetails().get(0).getSubDetails().get(0).getAttr4();
|
|
|
- if("18850".equals(vendcode)){
|
|
|
- SpObserver.putSp("N_HUASL_QD");
|
|
|
- }else if("14780".equals(vendcode)){
|
|
|
- SpObserver.putSp("N_HUASL_T");
|
|
|
- }else {
|
|
|
- ReturnData returnData = new ReturnData();
|
|
|
- returnData.setSuccess("false");
|
|
|
- returnData.setTransId(dto.getTransId());
|
|
|
- List<Errors> errorss = new ArrayList<Errors>();
|
|
|
- Errors errors = new Errors();
|
|
|
- errors.setErrorCode("E07");
|
|
|
- errors.setErrorMsg("供应商编号不是18850或者14780!");
|
|
|
- errorss.add(errors);
|
|
|
- returnData.setErrors(errorss);
|
|
|
- grApiResult.setReturnData(returnData);
|
|
|
- return grApiResult;
|
|
|
- }
|
|
|
-
|
|
|
- List<String> sqls = new ArrayList<>();
|
|
|
- //PO表增加主键ID
|
|
|
- int poid = baseDao.getSeqId("POORDERGR_SEQ");
|
|
|
- sqls.add("insert into POORDERGR (HID,TRANSID,SITECODE,SENDERQUALIFIER,SENDERID,RECEIVERQUALIFIER,RECEIVERID,REGIONCODE," +
|
|
|
- "POTYPE,POHEADID,PONO,POVERSION,AGENTNAME," +
|
|
|
- "PODATE,CUSTREFNO,CURRENCY,RATE,TOTALAMOUNT," +
|
|
|
- "POE,MODELTYPE,MANUFACTORYCODE,MANUFACTORYNAME,VENDORCODE,VENDORNAME,SONO,INCOTERMSCODE,PAYMENTTERM," +
|
|
|
- "CARRIERTYPE,CARRIERCODE,CARRIERNAME,TRANSMODE,COC,CUSTSTORLOC,PURGROUP,CUSTCOMPCODE,POSTATUS," +
|
|
|
- "TRANSFLAG,TRANSDATE,ATTR1,ATTR2,ATTR3,ATTR4,ATTR5,ATTR6,ATTR7,ATTR8,ATTR9," +
|
|
|
- "ATTR10,EXTRAREFCODE1,EXTRAREFTEXT1,EXTRAREFCODE2,EXTRAREFTEXT2,PORECORDDATE,POID) " +
|
|
|
- "values ('"+dto.getHid()+"','"+dto.getTransId()+"','"+dto.getSiteCode()+"','"+dto.getSenderQualifier()+"','"+dto.getSenderId()+"','"+dto.getReceiverQualifier()+"','"+dto.getReceiverId()+"','"+dto.getRegionCode()+"'" +
|
|
|
- ",'"+dto.getPoType()+"','"+dto.getPoHeadId()+"','"+dto.getPoNo()+"','"+dto.getPoVersion()+"','"+dto.getAgentName()+"'," +
|
|
|
- "case when '"+dto.getPoDate()+"' = 'null' then null else TO_DATE('"+dto.getPoDate()+"', 'YYYY-MM-DD HH24:MI:SS') end,'"+dto.getCustRefNo()+"','"+dto.getCurrency()+"','"+dto.getRate()+"','"+dto.getTotalAmount()+"'" +
|
|
|
- ",'"+dto.getPoe()+"','"+dto.getModelType()+"','"+dto.getManufactoryCode()+"','"+dto.getManufactoryName()+"','"+dto.getVendorCode()+"','"+dto.getVendorName()+"','"+dto.getSoNo()+"','"+dto.getIncotermsCode()+"','"+dto.getPaymentTerm()+"'" +
|
|
|
- ",'"+dto.getCarrierType()+"','"+dto.getCarrierCode()+"','"+dto.getCarrierName()+"','"+dto.getTransMode()+"','"+dto.getCoc()+"','"+dto.getCustStorLoc()+"','"+dto.getPurGroup()+"','"+dto.getCustCompCode()+"','"+dto.getPoStatus()+"'" +
|
|
|
- ",'"+dto.getTransFlag()+"'," +
|
|
|
- "case when '"+dto.getTransDate()+"' = 'null' then null else TO_DATE('"+dto.getTransDate()+"', 'YYYY-MM-DD HH24:MI:SS') end,'"+dto.getAttr1()+"','"+dto.getAttr2()+"','"+dto.getAttr3()+"','"+dto.getAttr4()+"','"+dto.getAttr5()+"','"+dto.getAttr6()+"','"+dto.getAttr7()+"','"+dto.getAttr8()+"','"+dto.getAttr9()+"'" +
|
|
|
- ",'"+dto.getAttr10()+"','"+dto.getExtraRefCode1()+"','"+dto.getExtraRefText1()+"','"+dto.getExtraRefCode2()+"','"+dto.getExtraRefText2()+"',sysdate,"+poid+")");
|
|
|
- for (int i = 0; i < dto.getDetails().size(); i++) {
|
|
|
- //PO明细表增加主键ID
|
|
|
- int podetailid = baseDao.getSeqId("POORDERDETAILSGR_SEQ");
|
|
|
- PoOrderDetailsGrDTO podetail = dto.getDetails().get(i);
|
|
|
- sqls.add("insert into POORDERDETAILSGR (HID,PONO,POLINENO,POLINETYPE,ORDEREDQTY,QTYUOM,UNITPRICE,PRICEUOM," +
|
|
|
- "CUSTPARTNO,CUSTPARTDESC,VENDORPARTNO,VENDORPARTDESC,MANUFACTORYCODE,MANUFACTORYNAME," +
|
|
|
- "REQDATE,ETD,ETA," +
|
|
|
- "TRANSMODE,SONO,SOLINENO,TOTALAMOUNT,TAXRATE,ATTR1,ATTR2,ATTR3,ATTR4,ATTR5,ATTR6," +
|
|
|
- "ATTR7,ATTR8,ATTR9,ATTR10,EXTRAREFCODE1,EXTRAREFTEXT1,EXTRAREFCODE2,EXTRAREFTEXT2,DPOID,DETID) " +
|
|
|
- "values ('"+podetail.getHid()+"','"+podetail.getPoNo()+"','"+podetail.getPoLineNo()+"','"+podetail.getPoLineType()+"','"+podetail.getOrderedQty()+"','"+podetail.getQtyUom()+"','"+podetail.getUnitPrice()+"','"+podetail.getPriceUom()+"'" +
|
|
|
- ",'"+podetail.getCustPartNo()+"','"+podetail.getCustPartDesc()+"','"+podetail.getVendorPartNo()+"','"+podetail.getVendorPartDesc()+"','"+podetail.getManufactoryCode()+"','"+podetail.getManufactoryName()+"'" +
|
|
|
- ",case when '"+podetail.getReqDate()+"' = 'null' then null else TO_DATE('"+podetail.getReqDate()+"', 'YYYY-MM-DD HH24:MI:SS') end " +
|
|
|
- ",case when '"+podetail.getEtd()+"' = 'null' then null else TO_DATE('"+podetail.getEtd()+"', 'YYYY-MM-DD HH24:MI:SS') end " +
|
|
|
- ",case when '"+podetail.getEta()+"' = 'null' then null else TO_DATE('"+podetail.getEta()+"', 'YYYY-MM-DD HH24:MI:SS') end " +
|
|
|
- ",'"+podetail.getTransMode()+"','"+podetail.getSoNo()+"','"+podetail.getSoLineNo()+"','"+podetail.getTotalAmount()+"','"+podetail.getTaxRate()+"','"+podetail.getAttr1()+"','"+podetail.getAttr2()+"','"+podetail.getAttr3()+"','"+podetail.getAttr4()+"','"+podetail.getAttr5()+"','"+podetail.getAttr6()+"'" +
|
|
|
- ",'"+podetail.getAttr7()+"','"+podetail.getAttr8()+"','"+podetail.getAttr9()+"','"+podetail.getAttr10()+"','"+podetail.getExtraRefCode1()+"','"+podetail.getExtraRefText1()+"','"+podetail.getExtraRefCode2()+"','"+podetail.getExtraRefText2()+"',"+poid+","+podetailid+")");
|
|
|
- for (int j = 0; j < podetail.getSubDetails().size(); j++) {
|
|
|
- PoOrderSubDetailsGrDTO subdetails = dto.getDetails().get(i).getSubDetails().get(j);
|
|
|
- subdetails.setSdpoid(poid);
|
|
|
- subdetails.setSdetid(podetailid);
|
|
|
- sqls.add("insert into POORDERSUBDETAILSGR (HID,PONO,POLINENO,POSUBLINENO,STORGCODE,REQQTY,QTYUOM," +
|
|
|
- "REQDATE," +
|
|
|
- "SUBETD,SUBETA,ATTR1,ATTR2,ATTR3,ATTR4,ATTR5,ATTR6,ATTR7," +
|
|
|
- "ATTR8,ATTR9,ATTR10,SDPOID,SDETID)" +
|
|
|
- "values ('"+subdetails.getHid()+"','"+subdetails.getPoNo()+"','"+subdetails.getPoLineNo()+"','"+subdetails.getPoSubLineNo()+"','"+subdetails.getStOrgCode()+"','"+subdetails.getReqQty()+"','"+subdetails.getQtyUom()+"'" +
|
|
|
- ",case when '"+subdetails.getReqDate()+"' = 'null' then null else TO_DATE('"+subdetails.getReqDate()+"', 'YYYY-MM-DD HH24:MI:SS') end " +
|
|
|
- ",case when '"+subdetails.getSubETD()+"' = 'null' then null else TO_DATE('"+subdetails.getSubETD()+"', 'YYYY-MM-DD HH24:MI:SS') end " +
|
|
|
- ",case when '"+subdetails.getSubETA()+"' = 'null' then null else TO_DATE('"+subdetails.getSubETA()+"', 'YYYY-MM-DD HH24:MI:SS') end " +
|
|
|
- ",'"+subdetails.getAttr1()+"','"+subdetails.getAttr2()+"','"+subdetails.getAttr3()+"','"+subdetails.getAttr4()+"','"+subdetails.getAttr5()+"','"+subdetails.getAttr6()+"','"+subdetails.getAttr7()+"'" +
|
|
|
- ",'"+subdetails.getAttr8()+"','"+subdetails.getAttr9()+"','"+subdetails.getAttr10()+"',"+poid+","+podetailid+")");
|
|
|
- }
|
|
|
- }
|
|
|
- for (int i = 0; i < dto.getAddrInfos().size(); i++) {
|
|
|
- PoOrderAddrinfosGrDTO addrinfos = dto.getAddrInfos().get(i);
|
|
|
- sqls.add("insert into POORDERADDRINFOSGR (ADDRID,SENDERQUALIFIER,SENDERID,RECEIVERQUALIFIER,RECEIVERID,MSGTYPE,MSGALIAS,MSGID," +
|
|
|
- "PARTYTYPE,PARTYNAME,PARTYCODE,ADDINAME1,ADDINAME2,STREET1,STREET2,STREET3,STREET4," +
|
|
|
- "CITY,STATE,POSTALCODE,COUNTRYCODE,COUNTRYNAME,DISTRICT,CONTACTNAME,CONTACTEMAIL,PHONE," +
|
|
|
- "FAX,ATTR1,ATTR2,ATTR3,ATTR4,ATTR5,ATTR6,ATTR7,ATTR8," +
|
|
|
- "ATTR9,ATTR10,APOID)" +
|
|
|
- "values ('"+addrinfos.getAddrId()+"','"+addrinfos.getSenderQualifier()+"','"+addrinfos.getSenderId()+"','"+addrinfos.getReceiverQualifier()+"','"+addrinfos.getReceiverId()+"','"+addrinfos.getMsgType()+"','"+addrinfos.getMsgAlias()+"','"+addrinfos.getMsgId()+"'" +
|
|
|
- ",'"+addrinfos.getPartyType()+"','"+addrinfos.getPartyName()+"','"+addrinfos.getPartyCode()+"','"+addrinfos.getAddiName1()+"','"+addrinfos.getAddiName2()+"','"+addrinfos.getStreet1()+"','"+addrinfos.getStreet2()+"','"+addrinfos.getStreet3()+"','"+addrinfos.getStreet4()+"'" +
|
|
|
- ",'"+addrinfos.getCity()+"','"+addrinfos.getState()+"','"+addrinfos.getPostalCode()+"','"+addrinfos.getCountryCode()+"','"+addrinfos.getCountryName()+"','"+addrinfos.getDistrict()+"','"+addrinfos.getContactName()+"','"+addrinfos.getContactEmail()+"','"+addrinfos.getPhone()+"'" +
|
|
|
- ",'"+addrinfos.getFax()+"','"+addrinfos.getAttr1()+"','"+addrinfos.getAttr2()+"','"+addrinfos.getAttr3()+"','"+addrinfos.getAttr4()+"','"+addrinfos.getAttr5()+"','"+addrinfos.getAttr6()+"','"+addrinfos.getAttr7()+"','"+addrinfos.getAttr8()+"'" +
|
|
|
- ",'"+addrinfos.getAttr9()+"','"+addrinfos.getAttr10()+"',"+poid+")");
|
|
|
- }
|
|
|
-
|
|
|
- //插入系统中间表
|
|
|
- int scgid = baseDao.getSeqId("SALECONFIRMGR_SEQ");
|
|
|
- String scgcode = baseDao.sGetMaxNumber("SaleConfirmGr", 2);
|
|
|
- sqls.add("insert into SALECONFIRMGR (SCG_ID,SCG_CODE,SCG_RECORDDATE,SCG_RECORDER,SCG_STATUS,SCG_STATUSCODE,SCG_REMARK,SCG_AUDITMAN,SCG_AUDITDATE," +
|
|
|
- "SCG_CUSTGRCODE,SCG_CUSTGRNAME,SCG_CUSTCODE,SCG_CUSTNAME,SCG_SAKIND,SCG_POCODE,SCG_CURRENCY,SCG_RATE," +
|
|
|
- "SCG_SADATE,SCG_GRPOCODE,SCG_GRHID,SCG_GRPOID)" +
|
|
|
- "select "+scgid+",'"+scgcode+"',sysdate,'王平','在录入','ENTERING','','','', " +
|
|
|
- "PARTYCODE,PARTYNAME,nvl(cd_varchar50_1,PARTYCODE),nvl(cd_varchar50_2,PARTYNAME),'正常订单',poNo,currency,case when rate = 'null' then '0' else rate end," +
|
|
|
- "poDate,soNo,case when HID = 'null' then '0' else HID end,POID " +
|
|
|
- "from POORDERGR left join POORDERADDRINFOSGR on APOID = POID and nvl(PARTYTYPE,' ') = 'BY' " +
|
|
|
- "left join N_HUASL_QD.CUSTOMTABLE on ct_caller='GECUSTDZ' and CT_STATUS = '已审核' left join N_HUASL_QD.CUSTOMTABLEDETAIL ON CD_CTID = CT_ID and cd_varchar50_4 = PARTYNAME " +
|
|
|
- "where POID = " + poid);
|
|
|
- sqls.add("insert into SALECONFIRMGRDETAIL (SCGD_ID,SCGD_SCGID,SCGD_DETNO,SCGD_REMARK,SCGD_GRDETNO,SCGD_GRPRCODE,SCGD_GRPRNAME," +
|
|
|
- "SCGD_PRCODE,SCGD_PRDETAIL,SCGD_SELLERCODE,SCGD_SELLERNAME,SCGD_DELIVERY," +
|
|
|
- "SCGD_QTY,SCGD_PRICE,SCGD_TOTAL," +
|
|
|
- "SCGD_GRPOCODE,SCGD_GRHID,SCGD_GRPOID,SCGD_GRDPOID)" +
|
|
|
- "select SALECONFIRMGRDETAIL_SEQ.nextval,"+scgid+",rownum,'',poLineNo,custPartNo,custPartDesc," +
|
|
|
- "nvl(pc_prodcode,custPartNo),nvl(pr_detail,custPartDesc),cd_varchar50_3,cd_varchar50_4,reqDate," +
|
|
|
- "case when orderedQty = 'null' then '0' else orderedQty end, case when unitPrice = 'null' then '0' else unitPrice end,case when totalAmount = 'null' then '0' else totalAmount end, " +
|
|
|
- "PONO,case when HID = 'null' then '0' else HID end,DPOID,DETID " +
|
|
|
- "from POORDERDETAILSGR left join N_HUASL_QD.PRODUCTCUSTOMER on custPartNo = pc_custprodcode and pc_custcode = 'GOERTEK' left join Product on pc_prodid=pr_id " +
|
|
|
- "left join N_HUASL_QD.CUSTOMTABLE on CT_CALLER = 'GESELLERBRAND' and CT_STATUS = '已审核' left join N_HUASL_QD.CUSTOMTABLEDETAIL on CD_CTID = CT_ID and cd_varchar50_1 = pr_brand " +
|
|
|
- "where DPOID = " + poid);
|
|
|
- sqls.add("update SALECONFIRMGRDETAIL set SCGD_TOTAL = round(nvl(SCGD_QTY,0)*nvl(SCGD_PRICE,0),2) where SCGD_SCGID = " + scgid);
|
|
|
- baseDao.execute(sqls);
|
|
|
- getPrice(scgid);
|
|
|
- ReturnData returnData = new ReturnData();
|
|
|
- returnData.setSuccess("true");
|
|
|
- returnData.setTransId(dto.getTransId());
|
|
|
- return new GRApiResult(returnData);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public void getPrice(int scg_id) {
|
|
|
- Object sakind = baseDao.getFieldDataByCondition("SALECONFIRMGR", "scg_sakind", "scg_id=" + scg_id);
|
|
|
- Object pricekind = baseDao.getFieldDataByCondition("SaleKind", "sk_pricekind", "sk_name='" + sakind + "'");
|
|
|
- List<Object[]> objects = baseDao.getFieldsDatasByCondition(
|
|
|
- "SALECONFIRMGRDETAIL left join SALECONFIRMGR on SCGD_SCGID=SCG_ID left join Customer on scg_custcode=cu_code", new String[] { "scgd_prcode",
|
|
|
- "scg_custcode", "scg_currency", "scgd_qty", "scgd_id", "cu_pricetype", "nvl(scgd_xtprice,0)", "nvl(cu_taxrate,0)"}, " scg_id="
|
|
|
- + scg_id);
|
|
|
- JSONObject js = null;
|
|
|
- if(baseDao.isDBSetting("Sale","getPriceBySale")){
|
|
|
- for (Object[] obj : objects) {
|
|
|
- Double a = 0.0;
|
|
|
- Double b = 0.0;
|
|
|
- if(Double.parseDouble(obj[8].toString()) == 0.0){
|
|
|
- Object[] last = baseDao.getFieldsDataByCondition("(select * from sale left join saledetail on sa_id=sd_said where sa_custcode='"+obj[1]+"' and sa_currency='"+obj[2]+"' and sd_prodcode='"+obj[0]+"' and sa_statuscode='AUDITED' order by sa_date desc)", new String[]{"nvl(sd_price,0)","nvl(sd_taxrate,0)"}, "rownum<2");
|
|
|
- if(last != null){
|
|
|
- a = last[0] == null ? 0.0 : Double.parseDouble(last[0].toString());
|
|
|
- baseDao.execute("update SALECONFIRMGRDETAIL set scgd_xtprice="+a+" where scgd_id="+obj[4]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- for (Object[] obj : objects) {
|
|
|
- Object oqty = baseDao.getFieldDataByCondition("SALECONFIRMGRDETAIL", "sum(scgd_qty)",
|
|
|
- " SCGD_SCGID=" + scg_id + " and scgd_prcode='" + String.valueOf(obj[0]) + "'");
|
|
|
- if (pricekind == null
|
|
|
- || (!"CCPR".equals(pricekind) && !"CCP".equals(pricekind) && !"KCP".equals(pricekind) && !"PC".equals(pricekind) && !"SCP"
|
|
|
- .equals(pricekind)&&!"PCR".equals(pricekind))) {
|
|
|
-
|
|
|
- } else
|
|
|
- js = getSalePrice_N(String.valueOf(obj[1]), String.valueOf(sakind), String.valueOf(obj[0]), String.valueOf(obj[2]),
|
|
|
- String.valueOf(obj[5]), pricekind, Double.parseDouble(oqty.toString()), Double.parseDouble(obj[7].toString()));
|
|
|
- double price = 0;
|
|
|
- double tax = 0;
|
|
|
- double p = 0;
|
|
|
- int spdid = 0;
|
|
|
- if (js != null) {
|
|
|
- price = js.getDouble("sd_price");
|
|
|
- tax = js.getDouble("sd_taxrate");
|
|
|
- spdid = js.getInt("spd_id");
|
|
|
- }
|
|
|
- if (price != 0) {
|
|
|
- p = price;
|
|
|
- baseDao.updateByCondition("SALECONFIRMGRDETAIL", "scgd_xtprice=" + p, "scgd_id=" + obj[4]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public JSONObject getSalePrice_N(String custcode, String sakind, String prodcode, String currency, String cukind, Object pricekind,
|
|
|
- Double sumqty, Double taxrate) {
|
|
|
- SqlRowList rs = null;
|
|
|
- /**
|
|
|
- * 反馈编号:2017030117
|
|
|
- * 西博泰科UAS:销售类型-取价原则,增加一种原则PCR:“料号+币别+税率”;
|
|
|
- */
|
|
|
- if (pricekind != null) {
|
|
|
- if ("CCP".equals(pricekind)) {
|
|
|
- rs = baseDao.queryForRowSet(SALE_PRICE_CCP, custcode, prodcode, currency, sumqty);
|
|
|
- } else if ("CCPR".equals(pricekind)) {
|
|
|
- rs = baseDao.queryForRowSet(SALE_PRICE_CCPR, custcode, prodcode, currency, taxrate, sumqty);
|
|
|
- } else if ("KCP".equals(pricekind)) {
|
|
|
- rs = baseDao.queryForRowSet(SALE_PRICE_KCP, prodcode, currency, cukind, sumqty);
|
|
|
- } else if ("PC".equals(pricekind)) {
|
|
|
- rs = baseDao.queryForRowSet(SALE_PRICE_PC, prodcode, currency, sumqty);
|
|
|
- } else if ("SCP".equals(pricekind)) {
|
|
|
- rs = baseDao.queryForRowSet(SALE_PRICE_SCP, sakind, prodcode, currency, sumqty);
|
|
|
- } else if ("PCR".equals(pricekind)) {
|
|
|
- rs = baseDao.queryForRowSet(SALE_PRICE_PCR,prodcode, currency, taxrate,sumqty);
|
|
|
- }
|
|
|
- }
|
|
|
- if (rs.next()) {
|
|
|
- JSONObject obj = new JSONObject();
|
|
|
- obj.put("sd_price", rs.getObject("spd_price") == null ? 0 : rs.getObject("spd_price"));
|
|
|
- obj.put("sd_taxrate", rs.getObject("spd_taxrate") == null ? 0 : rs.getObject("spd_taxrate"));
|
|
|
- obj.put("spd_id", rs.getObject("spd_id") == null ? 0 : rs.getObject("spd_id"));
|
|
|
- return obj;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public ApiResult<String> pushSenderInfo(PoOrderGrDTO dto) {
|
|
|
-
|
|
|
- // todo 入参dto需要改成数据库查询出来的数据
|
|
|
- //dtoFrom(); 方法完善后放开
|
|
|
-
|
|
|
- //接口返回
|
|
|
- HttpResultResponse resultResponse = null;
|
|
|
- try{
|
|
|
- //resultResponse = HuToolUtils.post(asnUrl,dto);
|
|
|
- //头部请求参数
|
|
|
- Map<String,String> headerMap = new HashMap<>();
|
|
|
- headerMap.put("user","WD");
|
|
|
- headerMap.put("password","WD@test+1");
|
|
|
- resultResponse = HuToolUtils.post(asnUrl,dto,headerMap);
|
|
|
- logger.info("推送发货信息到歌尔,接口返回结果:{}",resultResponse);
|
|
|
- }catch (Exception e){
|
|
|
- logger.error("推送发货信息到歌尔,调用接口异常:{}",e);
|
|
|
- return ApiResponse.failRsp("400","推送发货信息到歌尔,接口调用异常 !", null,e.getMessage());
|
|
|
- }
|
|
|
- return ApiResponse.successRsp("200", JSON.toJSONString(resultResponse));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 数据转换,将数据参数转换成接口需要参数
|
|
|
- * */
|
|
|
- /*public 接口调用参数 dtoFrom(数据库查询出来的参数){
|
|
|
- return 接口调用需要的参数;
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public ApiResult<String> sendAsnShipment(String master, Integer id) throws EDISchemaException, EDIStreamException, IOException {
|
|
|
- SpObserver.putSp(master);
|
|
|
- Map<String, Object> modelMap = new HashMap<String, Object>();
|
|
|
- int count = baseDao.getCount("select count(1) from AsnShipment where as_id=" + id);
|
|
|
- if (count>0){
|
|
|
- //接口返回
|
|
|
- HttpResultResponse resultResponse = null;
|
|
|
- //头部请求参数
|
|
|
- Map<String,String> headerMap = new HashMap<>();
|
|
|
- /*headerMap.put("user","WD");
|
|
|
- headerMap.put("password","WD@test+1");*/
|
|
|
- String username = "WD";
|
|
|
- String password = "WD@test+1";
|
|
|
- String auth = username + ":" + password;
|
|
|
- String encodedAuth = Base64.getEncoder()
|
|
|
- .encodeToString(auth.getBytes(StandardCharsets.UTF_8));
|
|
|
- headerMap.put("Authorization", "Basic " + encodedAuth);
|
|
|
- headerMap.put("Content-Type", "application/json; charset=UTF-8");
|
|
|
- AsnDetDTO asnDetDTO = new AsnDetDTO();
|
|
|
- AsnDTO aAsnDTO = new AsnDTO();
|
|
|
- SqlRowList rs = baseDao.queryForRowSet("select as_transid,as_asnno,TO_CHAR(as_recorddate, 'yyyy-MM-dd hh24:mi:ss') as_recorddate,TO_CHAR(asd_senddate, 'yyyy-MM-dd hh24:mi:ss') asd_senddate, " +
|
|
|
- "as_packtype,asd_fyqty,asd_invoice,asd_tycode,TO_CHAR(asd_arrivaldate, 'yyyy-MM-dd hh24:mi:ss') asd_arrivaldate,TO_CHAR(asd_lgdate, 'yyyy-MM-dd hh24:mi:ss') asd_lgdate,TO_CHAR(asd_dgdate, 'yyyy-MM-dd hh24:mi:ss') asd_dgdate," +
|
|
|
- "asd_countryqy,asd_cityqy,asd_transportation,asd_organizecode,asd_iswooden " +
|
|
|
- "from AsnShipment left join (select asd_asid,max(asd_senddate) asd_senddate,sum(nvl(asd_fyqty,0)) asd_fyqty,max(asd_invoice) asd_invoice,max(asd_tycode) asd_tycode,max(asd_arrivaldate) asd_arrivaldate, " +
|
|
|
- "max(asd_lgdate) asd_lgdate,max(asd_dgdate) asd_dgdate,max(asd_countryqy) asd_countryqy,max(asd_cityqy) asd_cityqy,max(asd_transportation) asd_transportation,max(asd_organizecode) asd_organizecode,max(asd_iswooden) asd_iswooden " +
|
|
|
- "from ASNSHIPMENTDETAIL group by asd_asid) on asd_asid = as_id " +
|
|
|
- "where as_id = ?",id);
|
|
|
- while (rs.next()) {
|
|
|
- //ASN
|
|
|
- aAsnDTO.setTransId(rs.getGeneralString("as_transid"));
|
|
|
- aAsnDTO.setSenderQualifier("ZZ");
|
|
|
- aAsnDTO.setSenderId("WORLDSHINE");
|
|
|
- aAsnDTO.setReceiverQualifier("ZZ");
|
|
|
- aAsnDTO.setReceiverId("GOERTEK");
|
|
|
- aAsnDTO.setAsnNo(rs.getGeneralString("as_asnno"));
|
|
|
- aAsnDTO.setAsnDate(rs.getString("as_recorddate"));
|
|
|
- aAsnDTO.setShipDate(rs.getString("asd_senddate"));
|
|
|
-
|
|
|
- aAsnDTO.setPackType(rs.getGeneralString("as_packtype"));
|
|
|
- aAsnDTO.setPackCount(rs.getGeneralString("asd_fyqty"));
|
|
|
- aAsnDTO.setWaybillNo(rs.getGeneralString("asd_tycode"));
|
|
|
- aAsnDTO.setInvoiceNo(rs.getGeneralString("asd_invoice"));
|
|
|
- if ("N_HUASL_QD".equals(master)) {
|
|
|
- aAsnDTO.setVendorCode("18850");
|
|
|
- } else if ("N_HUASL_T".equals(master)) {
|
|
|
- aAsnDTO.setVendorCode("14780");
|
|
|
- }
|
|
|
- aAsnDTO.setEstCCDate(rs.getString("asd_arrivaldate"));
|
|
|
- aAsnDTO.setEtd(rs.getString("asd_lgdate"));
|
|
|
- aAsnDTO.setEta(rs.getString("asd_dgdate"));
|
|
|
- aAsnDTO.setAttr1(rs.getString("asd_organizecode"));
|
|
|
- aAsnDTO.setAttr2("Y");
|
|
|
- aAsnDTO.setAttr7("N");
|
|
|
- aAsnDTO.setAttr8(rs.getGeneralString("asd_iswooden"));
|
|
|
- aAsnDTO.setAttr5(rs.getGeneralString("asd_countryqy"));
|
|
|
- aAsnDTO.setAttr6(rs.getGeneralString("asd_cityqy"));
|
|
|
- aAsnDTO.setTransMethod(rs.getGeneralString("asd_transportation"));
|
|
|
- //addrInfo
|
|
|
- List<AsnAddrInfoDTO> asnAddrInfoDTOl = new ArrayList<AsnAddrInfoDTO>();
|
|
|
- AsnAddrInfoDTO asnAddrInfoDTO = new AsnAddrInfoDTO();
|
|
|
- asnAddrInfoDTO.setPartyType("SH");
|
|
|
- if ("N_HUASL_QD".equals(master)) {
|
|
|
- asnAddrInfoDTO.setPartyName("青岛华商龙科技有限公司");
|
|
|
- asnAddrInfoDTO.setPartyCode("P114310078");
|
|
|
- } else if ("N_HUASL_T".equals(master)) {
|
|
|
- asnAddrInfoDTO.setPartyName("华商龙科技有限公司");
|
|
|
- asnAddrInfoDTO.setPartyCode("SHPR083");
|
|
|
- }
|
|
|
-
|
|
|
- asnAddrInfoDTOl.add(asnAddrInfoDTO);
|
|
|
- aAsnDTO.setAddrInfo(asnAddrInfoDTOl);
|
|
|
- //asnOrder
|
|
|
- List<AsnOrderDTO> AsnOrderDTOl = new ArrayList<AsnOrderDTO>();
|
|
|
- SqlRowList rsOrder = baseDao.queryForRowSet("select distinct as_asnno,asd_cgcode,as_packtype " +
|
|
|
- "from AsnShipment left join ASNSHIPMENTDETAIL on as_id = asd_asid where as_id = ?",id);
|
|
|
- while (rsOrder.next()) {
|
|
|
- AsnOrderDTO asnOrderDTO = new AsnOrderDTO();
|
|
|
- asnOrderDTO.setAsnNo(rsOrder.getString("as_asnno"));
|
|
|
- asnOrderDTO.setPoNo(rsOrder.getString("asd_cgcode"));
|
|
|
- if("箱序".equals(rsOrder.getString("as_packtype"))){
|
|
|
- //箱序 asnPack
|
|
|
- SqlRowList rsasnPack = baseDao.queryForRowSet("select as_asnno,aspo_cgcode,aspo_cgdetno,aspo_bzway,aspo_packno,aspo_bzqty,aspo_grossload, " +
|
|
|
- "aspo_tall,aspo_wide,aspo_long,aspo_quantity,aspo_custpartno,aspo_cgqty,aspo_countryyc,aspo_bztype,aspo_weight,aspo_invoice " +
|
|
|
- "from AsnShipment left join ASNSHIPMENTORDER on as_id = aspo_asid where as_id = ?",id);
|
|
|
- List<AsnPackDTO> AsnPackDTOl = new ArrayList<AsnPackDTO>();
|
|
|
- while (rsasnPack.next()) {
|
|
|
- AsnPackDTO asnPackDTO = new AsnPackDTO();
|
|
|
- asnPackDTO.setAsnNo(rsasnPack.getString("as_asnno"));
|
|
|
- asnPackDTO.setPoNo(rsasnPack.getString("aspo_cgcode"));
|
|
|
- asnPackDTO.setPoLineNo(rsasnPack.getString("aspo_cgdetno"));
|
|
|
- //asnPackDTO.setPackType(rsasnPack.getString("aspo_bzway"));
|
|
|
- asnPackDTO.setPackType("P");
|
|
|
- asnPackDTO.setPackNo(rsasnPack.getString("aspo_packno"));
|
|
|
- asnPackDTO.setPackCount(rsasnPack.getString("aspo_bzqty"));
|
|
|
- asnPackDTO.setPackUnitWT(rsasnPack.getString("aspo_grossload"));
|
|
|
- asnPackDTO.setGrossWT(rsasnPack.getString("aspo_grossload"));
|
|
|
- asnPackDTO.setLength(rsasnPack.getString("aspo_tall"));
|
|
|
- asnPackDTO.setWidth(rsasnPack.getString("aspo_wide"));
|
|
|
- asnPackDTO.setHeight(rsasnPack.getString("aspo_long"));
|
|
|
- asnPackDTO.setDimUom("CM");
|
|
|
- asnPackDTO.setManPackCount(rsasnPack.getString("aspo_quantity"));
|
|
|
- asnPackDTO.setInnerPackCount(rsasnPack.getString("aspo_quantity"));
|
|
|
- asnPackDTO.setAttr1("1");
|
|
|
- //asnOrderDetail
|
|
|
- List<AsnOrderDetailDTO> asnOrderDetailDTOl = new ArrayList<AsnOrderDetailDTO>();
|
|
|
- AsnOrderDetailDTO asnOrderDetailDTO = new AsnOrderDetailDTO();
|
|
|
- asnOrderDetailDTO.setAsnNo(rsasnPack.getString("as_asnno"));
|
|
|
- asnOrderDetailDTO.setPoNo(rsasnPack.getString("aspo_cgcode"));
|
|
|
- asnOrderDetailDTO.setPoLineNo(rsasnPack.getString("aspo_cgdetno"));
|
|
|
- asnOrderDetailDTO.setPackNo(rsasnPack.getString("aspo_packno"));
|
|
|
- asnOrderDetailDTO.setCustPlant(rsasnPack.getString("aspo_custpartno"));
|
|
|
- asnOrderDetailDTO.setCustPartDesc(rsasnPack.getString("aspo_custpartname"));
|
|
|
- asnOrderDetailDTO.setQty(rsasnPack.getString("aspo_cgqty"));
|
|
|
- asnOrderDetailDTO.setAttr4(rsasnPack.getString("aspo_cgqty"));
|
|
|
- asnOrderDetailDTO.setAttr5(rsasnPack.getString("aspo_grossload"));
|
|
|
- asnOrderDetailDTO.setAttr6("KG");
|
|
|
- asnOrderDetailDTO.setAttr7(rsasnPack.getGeneralString("aspo_weight"));
|
|
|
- asnOrderDetailDTO.setAttr8(rsasnPack.getGeneralString("aspo_invoice"));
|
|
|
- asnOrderDetailDTO.setAttr9(rsasnPack.getString("aspo_countryyc"));
|
|
|
- asnOrderDetailDTO.setAttr19(rsasnPack.getString("aspo_bztype"));
|
|
|
-
|
|
|
- //asnSNDetail
|
|
|
- List<AsnSnDetailDTO> asnSnDetailDTOl = new ArrayList<AsnSnDetailDTO>();
|
|
|
- AsnSnDetailDTO asnSnDetailDTO = new AsnSnDetailDTO();
|
|
|
- asnSnDetailDTO.setAsnNo(rsasnPack.getString("as_asnno"));
|
|
|
- asnSnDetailDTO.setPoNo(rsasnPack.getString("aspo_cgcode"));
|
|
|
- asnSnDetailDTO.setPoLineNo(rsasnPack.getString("aspo_cgdetno"));
|
|
|
- asnSnDetailDTO.setPackNo(rsasnPack.getString("aspo_packno"));
|
|
|
- asnSnDetailDTO.setSnNo(rsasnPack.getString("aspo_custpartno"));
|
|
|
-
|
|
|
- asnSnDetailDTOl.add(asnSnDetailDTO);
|
|
|
- asnOrderDetailDTO.setAsnSNDetail(asnSnDetailDTOl);
|
|
|
-
|
|
|
- asnOrderDetailDTOl.add(asnOrderDetailDTO);
|
|
|
- asnPackDTO.setAsnOrderDetail(asnOrderDetailDTOl);
|
|
|
-
|
|
|
- AsnPackDTOl.add(asnPackDTO);
|
|
|
- asnOrderDTO.setAsnPack(AsnPackDTOl);
|
|
|
- }
|
|
|
- }else{
|
|
|
- //无托箱 asnPack
|
|
|
- SqlRowList rsasnPack = baseDao.queryForRowSet("select as_asnno,aspo_cgcode,aspo_cgdetno,aspo_bzway,aspo_packno,aspo_bzqty,aspo_grossload, " +
|
|
|
- "aspo_tall,aspo_wide,aspo_long,aspo_quantity,aspo_custpartno,aspo_cgqty,aspo_countryyc,aspo_bztype,aspo_weight,aspo_invoice " +
|
|
|
- "from AsnShipment left join ASNSHIPMENTORDER on as_id = aspo_asid where as_id = ?",id);
|
|
|
- List<AsnOrderDetailDTO> asnOrderDetailDTOl = new ArrayList<AsnOrderDetailDTO>();
|
|
|
- while (rsasnPack.next()) {
|
|
|
- //asnOrderDetail
|
|
|
- AsnOrderDetailDTO asnOrderDetailDTO = new AsnOrderDetailDTO();
|
|
|
- asnOrderDetailDTO.setAsnNo(rsasnPack.getString("as_asnno"));
|
|
|
- asnOrderDetailDTO.setPoNo(rsasnPack.getString("aspo_cgcode"));
|
|
|
- asnOrderDetailDTO.setPoLineNo(rsasnPack.getString("aspo_cgdetno"));
|
|
|
- asnOrderDetailDTO.setPackNo(rsasnPack.getString("aspo_packno"));
|
|
|
- asnOrderDetailDTO.setCustPlant(rsasnPack.getString("aspo_custpartno"));
|
|
|
- asnOrderDetailDTO.setCustPartDesc(rsasnPack.getString("aspo_custpartname"));
|
|
|
- asnOrderDetailDTO.setQty(rsasnPack.getString("aspo_cgqty"));
|
|
|
- asnOrderDetailDTO.setAttr4(rsasnPack.getString("aspo_cgqty"));
|
|
|
- asnOrderDetailDTO.setAttr5(rsasnPack.getString("aspo_grossload"));
|
|
|
- asnOrderDetailDTO.setAttr6("KG");
|
|
|
- asnOrderDetailDTO.setAttr7(rsasnPack.getGeneralString("aspo_weight"));
|
|
|
- asnOrderDetailDTO.setAttr8(rsasnPack.getGeneralString("aspo_invoice"));
|
|
|
- asnOrderDetailDTO.setAttr9(rsasnPack.getString("aspo_countryyc"));
|
|
|
- asnOrderDetailDTO.setAttr19(rsasnPack.getString("aspo_bztype"));
|
|
|
-
|
|
|
- //asnSNDetail
|
|
|
- List<AsnSnDetailDTO> asnSnDetailDTOl = new ArrayList<AsnSnDetailDTO>();
|
|
|
- AsnSnDetailDTO asnSnDetailDTO = new AsnSnDetailDTO();
|
|
|
- asnSnDetailDTO.setAsnNo(rsasnPack.getString("as_asnno"));
|
|
|
- asnSnDetailDTO.setPoNo(rsasnPack.getString("aspo_cgcode"));
|
|
|
- asnSnDetailDTO.setPoLineNo(rsasnPack.getString("aspo_cgdetno"));
|
|
|
- asnSnDetailDTO.setPackNo(rsasnPack.getString("aspo_packno"));
|
|
|
- asnSnDetailDTO.setSnNo(rsasnPack.getString("aspo_custpartno"));
|
|
|
-
|
|
|
- asnSnDetailDTOl.add(asnSnDetailDTO);
|
|
|
- asnOrderDetailDTO.setAsnSNDetail(asnSnDetailDTOl);
|
|
|
-
|
|
|
- asnOrderDetailDTOl.add(asnOrderDetailDTO);
|
|
|
- asnOrderDTO.setAsnOrderDetail(asnOrderDetailDTOl);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- AsnOrderDTOl.add(asnOrderDTO);
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- aAsnDTO.setAsnOrder(AsnOrderDTOl);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- asnDetDTO.setASN(aAsnDTO);
|
|
|
- resultResponse = HuToolUtils.post(asnUrl,asnDetDTO,headerMap);
|
|
|
- //System.out.println("HttpUtils post 响应失败. url={"+asnUrl+"}, headerMap={"+headerMap+"}, response={"+asnDetDTO+"}");
|
|
|
- logger.info("推送发货信息到歌尔,接口返回结果:{}",resultResponse);
|
|
|
- return ApiResponse.successRsp("200", JSON.toJSONString(resultResponse));
|
|
|
- }else{
|
|
|
- logger.info("单据不存在:id={}",id);
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-}
|