|
|
@@ -2188,10 +2188,13 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
Map<String,List<SyPackingListTailoring>> codeMaps=new HashMap<>();//key:传入销售发-票单id,value:主表数据
|
|
|
JSONArray jsonArrays1=new JSONArray();
|
|
|
String code=redisUtil.get("pushsno002").toString();//发-票号
|
|
|
+ String orderType="";//订单类型
|
|
|
+ String cvenCode="";//供应商编码
|
|
|
for (String customer : customers.keySet()){
|
|
|
SyPackingListTailoring syPackingListTailoring=listTailoringMaps.get(customer).get(0);
|
|
|
Map<String, Object> orderData=null;
|
|
|
if(account.equals("103")||maps.get("account1").toString().equals("101")){
|
|
|
+ orderType="委外";
|
|
|
orderData=syPackingListTailoringMapper.getOmOrPo("om_momain",
|
|
|
"cCode=(select top 1 cOrderCode from rdrecord01 where ccode='"+syPackingListTailoring.getRdrecord32Code()+"')","MOID");
|
|
|
if (orderData.size()==0){
|
|
|
@@ -2199,6 +2202,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
throw new JeecgBootException(account+"查询不到对应的委外订单");
|
|
|
}
|
|
|
}else{
|
|
|
+ orderType="采购";
|
|
|
orderData=syPackingListTailoringMapper.getOmOrPo("po_pomain",
|
|
|
"cpoid=(select top 1 cOrderCode from rdrecord01 where ccode='"+syPackingListTailoring.getRdrecord32Code()+"')","poid");
|
|
|
if (orderData.size()==0){
|
|
|
@@ -2206,6 +2210,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
throw new JeecgBootException(account+"查询不到对应的采购订单");
|
|
|
}
|
|
|
}
|
|
|
+ cvenCode=oConvertUtils.getString(orderData.get("cvencode"));
|
|
|
String orderNumber=listTailorings.get(0).getShippingOrderNumber().substring(0,syPackingListTailoring.getShippingOrderNumber().indexOf("-"));
|
|
|
List<SyPackingListTailoringItem> listTailoringItems=listTailoringItemMaps.get(customer);
|
|
|
List<Map<String,Object>> invoices=getInvoices1(customers.get(customer));
|
|
|
@@ -2410,6 +2415,45 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if ((maps.get("account1").equals("101")&&orderType.equals("委外"))||
|
|
|
+ (account.equals("102")&&orderType.equals("采购")&&cvenCode.equals("T020001"))||
|
|
|
+ (account.equals("101")&&orderType.equals("采购")&&cvenCode.equals("T010001"))){
|
|
|
+ JSONArray jsonArrays2=new JSONArray();
|
|
|
+ jsonArrays1.forEach(j->{
|
|
|
+ JSONObject jsonObject=(JSONObject)j;
|
|
|
+ JSONObject jsonObject1=new JSONObject();
|
|
|
+ jsonObject1.put("CACCID","101");
|
|
|
+ jsonObject1.put("CMAKER","进出口平台管理员");
|
|
|
+ jsonObject1.put("CVOUCHCODE_U8",jsonObject.get("CVOUCHCODE"));
|
|
|
+ jsonObject1.put("DDATE",jsonObject.get("DDATE"));
|
|
|
+ jsonArrays2.add(jsonObject1);
|
|
|
+ });
|
|
|
+ text(jsonArrays2,"测试合并推送成衣结算单");
|
|
|
+ JSONArray resturnJsonArrays2 = InterfaceConnUtils.doPost(jsonArrays2,"purchasesettle_import");//结算单
|
|
|
+ Map<String,String> codeMaps3 = result(resturnJsonArrays2,"结算单",account);
|
|
|
+
|
|
|
+ for (String code1 : codeMaps.keySet()){
|
|
|
+ List<SyPackingListTailoring> listTailoringList=codeMaps.get(code1);
|
|
|
+ for (SyPackingListTailoring tailoring : listTailoringList){
|
|
|
+ tailoring.setRdrecord32Code(null);
|
|
|
+ if (codeMaps3.get(code1).indexOf("失败")>-1){
|
|
|
+ if(tailoring.getSaleInvoiceError()==null){
|
|
|
+ tailoring.setSaleInvoiceError(codeMaps3.get(code1));
|
|
|
+ }else{
|
|
|
+ tailoring.setSaleInvoiceError(tailoring.getSaleInvoiceError()+";"+codeMaps3.get(code1));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(tailoring.getSaleInvoiceCode()==null){
|
|
|
+ tailoring.setSaleInvoiceCode(codeMaps3.get(code1));
|
|
|
+ }else{
|
|
|
+ tailoring.setSaleInvoiceCode(tailoring.getSaleInvoiceCode()+";"+codeMaps3.get(code1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
return "推送成功";
|
|
|
}
|