|
@@ -1,11 +1,13 @@
|
|
|
package org.jeecg.modules.splfi.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.config.InterfaceConnUtils;
|
|
|
import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
|
|
|
import org.jeecg.modules.documents.orderData.mapper.SyOrderDataItemMapper;
|
|
|
import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements;
|
|
@@ -19,6 +21,7 @@ import org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsItemM
|
|
|
import org.jeecg.modules.documents.shippingDetails.service.impl.SyShippingDetailsItemServiceImpl;
|
|
|
import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder;
|
|
|
import org.jeecg.modules.openApi.entity.DxpDataPlan;
|
|
|
+import org.jeecg.modules.openApi.mapper.PurchaseWarehousingMapper;
|
|
|
import org.jeecg.modules.openApi.service.IDxpDataPlanService;
|
|
|
import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
|
|
|
import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
|
|
@@ -33,6 +36,7 @@ import org.jeecg.modules.splfi.mapper.SyPackingListFabricMapper;
|
|
|
import org.jeecg.modules.splfi.service.ISyPackingListFabricService;
|
|
|
import org.jeecg.modules.splt.entity.SyPackingListTailoring;
|
|
|
import org.jeecg.modules.splt.entity.SyPackingListTailoringItem;
|
|
|
+import org.jeecg.modules.splt.mapper.SyPackingListTailoringMapper;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
|
import org.jeecg.modules.system.util.JsonChangeUtils;
|
|
|
import org.jeecg.modules.system.util.oConvertUtils;
|
|
@@ -43,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
+import java.io.FileWriter;
|
|
|
import java.io.Serializable;
|
|
|
import java.lang.reflect.Array;
|
|
|
import java.math.BigDecimal;
|
|
@@ -116,6 +121,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
entity.setPreDeliveryDate(detailsItem.getPreDeliveryDate());
|
|
|
entity.setOrderNumber(detailsItem.getOrderNumber());
|
|
|
entity.setSmallPo(detailsItem.getSmallPo());
|
|
|
+ entity.setOmpoAccount(detailsItem.getOmpoAccount());
|
|
|
+ entity.setOmpoIdItem(detailsItem.getOmpoIdItem());
|
|
|
+ entity.setOmpoId(detailsItem.getOmpoId());
|
|
|
entity.setInventoryQuantity(entity.getActualDeclaredQuantity());
|
|
|
entity.setDistributionPoint(detailsItem.getDistributionPoint());
|
|
|
entity.setPurOrSubOrder(detailsItem.getPurOrSubOrder());
|
|
@@ -686,6 +694,421 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return strs;
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SyPackingListTailoringMapper syPackingListTailoringMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PurchaseWarehousingMapper purchaseWarehousingMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void one(List<SyPackingListFabric> mains, Map<String, Object> map) {
|
|
|
+ saveBatch(mains,map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void two(List<SyPackingListFabric> mains, Map<String, Object> map) {
|
|
|
+ saveBatch(mains,map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void three(List<SyPackingListFabric> mains, Map<String, Object> map) {
|
|
|
+ saveBatch(mains,map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String,Object> saveBatch(List<SyPackingListFabric> mains,Map<String,Object> mapt){
|
|
|
+ mapt.put("customerCode","xxx");
|
|
|
+ if(mains==null||mains.size()==0){
|
|
|
+ return new HashMap();
|
|
|
+ }
|
|
|
+ JSONArray mapList=new JSONArray();
|
|
|
+
|
|
|
+ JSONArray mapList3=new JSONArray();
|
|
|
+ JSONArray mapList4=new JSONArray();
|
|
|
+ JSONArray mapList5=new JSONArray();
|
|
|
+ JSONArray mapList6=new JSONArray();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ JSONArray mapLists=new JSONArray();
|
|
|
+
|
|
|
+ for (SyPackingListFabric main : mains){
|
|
|
+ Map<String,String> mapSort=new HashMap<>();
|
|
|
+
|
|
|
+ String createBy="进出口平台管理员";
|
|
|
+
|
|
|
+ String createDate=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(main.getCreateTime());
|
|
|
+ JSONObject map=new JSONObject();
|
|
|
+ map.put("CVOUCHCODE", org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cCode","RdRecord01","dnmaketime")));
|
|
|
+ map.put("DDATE",createDate);
|
|
|
+ map.put("CMAKER",createBy);
|
|
|
+ map.put("cVouchType",1);
|
|
|
+
|
|
|
+
|
|
|
+ map2.put("CVOUCHCODE",org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cCode","rdrecord11","dnmaketime")));
|
|
|
+ map2.put("DDATE",main.getCreateTime());
|
|
|
+ map2.put("CHANDLER",createBy);
|
|
|
+ map2.put("CMAKER",createBy);
|
|
|
+ map2.put("cOrderCode",main.getOrderNumber());
|
|
|
+
|
|
|
+ JSONObject map3=new JSONObject();
|
|
|
+ map3.put("CVOUCHCODE",org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cDLCode","DispatchList","dcreatesystime")));
|
|
|
+ map3.put("DDATE",createDate);
|
|
|
+ map3.put("BRETURNFLAG","0");
|
|
|
+ map3.put("CMAKER",createBy);
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject map4=new JSONObject();
|
|
|
+ map4.put("CVOUCHCODE",org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("ccode","rdrecord32","dnmaketime")));
|
|
|
+ map4.put("DDATE",createDate);
|
|
|
+ map4.put("CHANDLER",createBy);
|
|
|
+ map4.put("CMAKER",createBy);
|
|
|
+
|
|
|
+ JSONObject map5=new JSONObject();
|
|
|
+ map5.put("CVOUCHCODE",org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cpbvcode ","PurBillVouch","cmaketime")));
|
|
|
+ map5.put("DDATE",createDate);
|
|
|
+ map5.put("CTYPE","普通");
|
|
|
+ map5.put("CMAKER",createBy);
|
|
|
+
|
|
|
+ JSONObject map6=new JSONObject();
|
|
|
+ map6.put("CVOUCHCODE",org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cSBVCode","SaleBillVouch","dcreatesystime")));
|
|
|
+ map6.put("DDATE",createDate);
|
|
|
+ map6.put("CTYPE","普通");
|
|
|
+ map6.put("CMAKER",createBy);
|
|
|
+
|
|
|
+ JSONArray mapItems=new JSONArray();
|
|
|
+
|
|
|
+ JSONArray mapItems3=new JSONArray();
|
|
|
+ JSONArray mapItems4=new JSONArray();
|
|
|
+ JSONArray mapItems5=new JSONArray();
|
|
|
+ JSONArray mapItems6=new JSONArray();
|
|
|
+
|
|
|
+ Map<String,Object> orderData=null;
|
|
|
+
|
|
|
+ if(mapt.get("account").equals("903")){
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("om_momain","cCode='"+mapt.get("mpOrder")+"'","moid");
|
|
|
+ map.put("CRDCODE","委外入库");
|
|
|
+ map.put("CGLTYPE","委外订单");
|
|
|
+ map4.put("CGLTYPE","销售发货单");
|
|
|
+ map5.put("CGLTYPE","委外订单");
|
|
|
+ map6.put("CGLTYPE","销售出库单");
|
|
|
+
|
|
|
+ }else {
|
|
|
+ if(mapt.get("orderNumber").equals("one")){
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+mapt.get("mpOrder")+"'","POID");
|
|
|
+ }else{
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+mapt.get("orderNumber")+"'","POID");
|
|
|
+ }
|
|
|
+ map.put("CRDCODE","采购入库");
|
|
|
+ map.put("CGLTYPE","采购订单");
|
|
|
+ map4.put("CGLTYPE","销售发货单");
|
|
|
+ map5.put("CGLTYPE","采购订单");
|
|
|
+ map6.put("CGLTYPE","销售出库单");
|
|
|
+
|
|
|
+ }
|
|
|
+ if(orderData!=null){
|
|
|
+ map.put("CVENCODE",orderData.get("cvencode"));
|
|
|
+ mapt.put("CVENCODE",orderData.get("cvencode"));
|
|
|
+ map5.put("IEXCHRATE",orderData.get("nflat"));
|
|
|
+ map5.put("CPAYCODE",orderData.get("cPayCode"));
|
|
|
+ }
|
|
|
+ for (SyPackingListFabricItem item : main.getSyPackingListFabricItem()){
|
|
|
+ JSONObject mapItem=new JSONObject();
|
|
|
+
|
|
|
+ JSONObject mapItem3=new JSONObject();
|
|
|
+ JSONObject mapItem4=new JSONObject();
|
|
|
+ JSONObject mapItem5=new JSONObject();
|
|
|
+ JSONObject mapItem6=new JSONObject();
|
|
|
+
|
|
|
+
|
|
|
+ map.put("CACCID",mapt.get("account"));
|
|
|
+
|
|
|
+ map3.put("CACCID",mapt.get("account"));
|
|
|
+ map4.put("CACCID",mapt.get("account"));
|
|
|
+ map5.put("CACCID",mapt.get("account"));
|
|
|
+ map6.put("CACCID",mapt.get("account"));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String,Object> orderDataItem=null;
|
|
|
+ if(!mapt.get("account").equals("903")){
|
|
|
+ System.out.println("mapt.get(\"orderNumber\")\n"+mapt.get("orderNumber"));
|
|
|
+ System.out.println("mapt.containsKey(\"itemSort\")\t"+mapt.containsKey("itemSort"));
|
|
|
+ System.out.println("item.getOmpoIdItem()\t"+item.getOmpoIdItem());
|
|
|
+ if(!mapt.containsKey("itemSort")){
|
|
|
+ orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("PO_PoDetails", "ID='"+item.getOmpoIdItem()+"'","ID");
|
|
|
+ }else{
|
|
|
+ if(orderData!=null&&orderData.containsKey("id")){
|
|
|
+ orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("PO_PoDetails", "poid='"+orderData.get("id")+"' and irowno='"+
|
|
|
+ ((Map<String,String>)mapt.get("itemSort")).get(item.getId())+"'","ID");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(orderDataItem!=null){
|
|
|
+ Map<String,Object> orderDataItem2=purchaseWarehousingMapper.getPOPodetails(orderDataItem.get("id").toString());
|
|
|
+ getcFree(mapItem,orderDataItem2);
|
|
|
+ getcFree(mapItem5,orderDataItem2);
|
|
|
+ mapItem.put("POAUTOIDCOL","ID");
|
|
|
+ mapItem.put("AUTOID_PO",orderDataItem.get("id"));
|
|
|
+ map5.put("CGLTYPE","采购订单");
|
|
|
+ mapItem5.put("POAUTOIDCOL","ID");
|
|
|
+ mapItem5.put("AUTOID_PO",orderDataItem.get("id"));
|
|
|
+ mapItem5.put("IORITAXCOST",orderDataItem.get("iTaxPrice"));
|
|
|
+
|
|
|
+ mapItem5.put("IMONEY",orderDataItem.get("iNatMoney"));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("OM_MODetails", "MODetailsID='"+item.getOmpoIdItem()+"'","MODetailsID");
|
|
|
+ Map<String,Object> orderDataItem2=purchaseWarehousingMapper.getOMMoDetails(item.getOmpoIdItem());
|
|
|
+ getcFree(mapItem,orderDataItem2);
|
|
|
+ getcFree(mapItem5,orderDataItem2);
|
|
|
+ mapItem.put("POAUTOIDCOL","MODetailsID");
|
|
|
+ mapItem.put("AUTOID_PO",orderDataItem.get("id"));
|
|
|
+ map5.put("CGLTYPE","委外订单");
|
|
|
+
|
|
|
+ mapItem2.put("ALLCAUTOIDCOL","AllocateId");
|
|
|
+ mapItem5.put("POAUTOIDCOL","MODetailsID");
|
|
|
+ mapItem5.put("AUTOID_PO",orderDataItem.get("id"));
|
|
|
+ mapItem5.put("IORITAXCOST",orderDataItem.get("iTaxPrice"));
|
|
|
+
|
|
|
+ mapItem5.put("IMONEY",orderDataItem.get("iNatMoney"));
|
|
|
+ }
|
|
|
+ if(!mapt.get("CVENCODE").equals("one")){
|
|
|
+ String wheCode=syPackingListTailoringMapper.getWhCodeByVenCode(mapt.get("CVENCODE").toString());
|
|
|
+ if(wheCode!=null){
|
|
|
+ map.put("CWHCODE",wheCode);
|
|
|
+
|
|
|
+ map4.put("CWHCODE",wheCode);
|
|
|
+ mapItem3.put("CWHCODE",wheCode);
|
|
|
+ mapItem6.put("CWHCODE",wheCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mapt.put("poid","one");
|
|
|
+
|
|
|
+
|
|
|
+ if(orderDataItem!=null&&orderDataItem.containsKey("iSOsID")){
|
|
|
+ Map<String,Object> orderDataItem2=syPackingListTailoringMapper.getSoMainItem(orderDataItem.get("iSOsID").toString());
|
|
|
+ mapSort.put(item.getId(),orderDataItem2.get("irowno").toString());
|
|
|
+ mapItem3.put("ITAXUNITPRICE",orderDataItem2.get("iTaxUnitPrice"));
|
|
|
+ mapItem3.put("ITAXRATE",orderDataItem2.get("iTaxRate"));
|
|
|
+ mapItem3.put("SOAUTOIDCOL","ISOSID");
|
|
|
+ mapItem3.put("AUTOID_SO",orderDataItem2.get("iSOsID"));
|
|
|
+ mapt.put("poid", orderDataItem2.get("id"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(!mapt.get("poid").equals("one")){
|
|
|
+ Map<String,Object> order=syPackingListTailoringMapper.getSoMain(mapt.get("poid").toString());
|
|
|
+ mapt.put("orderNumber",order.get("cSOCode"));
|
|
|
+ mapt.put("customerCode",order.get("cCusCode"));
|
|
|
+ if(order!=null){
|
|
|
+
|
|
|
+
|
|
|
+ map2.put("CEXCH_NAME",order.get("cexch_name"));
|
|
|
+ map2.put("CPERSONCODE",order.get("cPersonCode"));
|
|
|
+ map.put("cOrderCode",order.get("cSOCode"));
|
|
|
+ map3.put("CBUSTYPE",order.get("cBusType"));
|
|
|
+ map4.put("CEXCH_NAME",order.get("cexch_name"));
|
|
|
+ map6.put("CBUSTYPE",order.get("cBusType"));
|
|
|
+ map6.put("CCUSCODE",order.get("cCusCode"));
|
|
|
+ map6.put("CDEPCODE",order.get("cDepCode"));
|
|
|
+ map6.put("SALETPYECODE",order.get("cSTCode"));
|
|
|
+ map6.put("IEXCHRATE",order.get("iExchRate"));
|
|
|
+ map6.put("CEXCH_NAME",order.get("cexch_name"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ mapItem.put("CINVCODE",item.getInventoryCode());
|
|
|
+ mapItem.put("IQUANTITY",item.getActualDeclaredQuantity());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ mapItem2.put("IQUANTITY",item.getTotal());
|
|
|
+
|
|
|
+ mapItem3.put("CINVCODE",item.getInventoryCode());
|
|
|
+ mapItem3.put("IQUANTITY",item.getActualDeclaredQuantity());
|
|
|
+
|
|
|
+ mapItem4.put("CINVCODE",item.getInventoryCode());
|
|
|
+ mapItem4.put("IQUANTITY",item.getActualDeclaredQuantity());
|
|
|
+ mapItem4.put("size",item.getSize());
|
|
|
+ mapItem4.put("SOAUTOIDCOL","IDLSID");
|
|
|
+
|
|
|
+
|
|
|
+ mapItem5.put("CINVCODE",item.getInventoryCode());
|
|
|
+ mapItem5.put("IQUANTITY",item.getActualDeclaredQuantity());
|
|
|
+
|
|
|
+ mapItem6.put("CINVCODE",item.getInventoryCode());
|
|
|
+ mapItem6.put("IQUANTITY",item.getActualDeclaredQuantity());
|
|
|
+ mapItem6.put("size",item.getSize());
|
|
|
+
|
|
|
+
|
|
|
+ mapItems.add(mapItem);
|
|
|
+
|
|
|
+ mapItems3.add(mapItem3);
|
|
|
+ mapItems4.add(mapItem4);
|
|
|
+ mapItems5.add(mapItem5);
|
|
|
+ mapItems6.add(mapItem6);
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("DETAILList",mapItems);
|
|
|
+ mapList.add(map);
|
|
|
+
|
|
|
+ mapList2.add(map2);*/
|
|
|
+ map3.put("DETAILList",mapItems3);
|
|
|
+ mapList3.add(map3);
|
|
|
+ map4.put("DETAILList",mapItems4);
|
|
|
+ mapList4.add(map4);
|
|
|
+ map5.put("DETAILList",mapItems5);
|
|
|
+ mapList5.add(map5);
|
|
|
+ map6.put("DETAILList",mapItems6);
|
|
|
+ mapList6.add(map6);
|
|
|
+
|
|
|
+ if(mapt.get("customerCode").equals("0001")&&!mapt.get("account").equals("901")){
|
|
|
+ mapt.put("account","901");
|
|
|
+ }else if(mapt.get("customerCode").equals("T020001")&&!mapt.get("account").equals("902")){
|
|
|
+ mapt.put("account","902");
|
|
|
+ }else{
|
|
|
+ mapt.put("account","904");
|
|
|
+ }
|
|
|
+ mapt.put("itemSort",mapSort);
|
|
|
+ }
|
|
|
+ text(mapList,"采购入库单");
|
|
|
+ text(mapList3,"销售发货单");
|
|
|
+ text(mapList5,"采购发票单");
|
|
|
+ JSONArray resturn1 = InterfaceConnUtils.doPost(mapList,"purchasein_import");
|
|
|
+
|
|
|
+ JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");
|
|
|
+ JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");
|
|
|
+
|
|
|
+ result(resturn1,"采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
|
|
|
+
|
|
|
+ result(resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+ String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
|
|
|
+
|
|
|
+
|
|
|
+ result(resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
|
|
|
+
|
|
|
+ JSONObject jsonObject3=resturn3.getJSONObject(0);
|
|
|
+ String consignmentName=jsonObject3.get("U8ReceiptNo").toString();
|
|
|
+
|
|
|
+ List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
|
|
|
+ if(consignmentMaps!=null){
|
|
|
+ for (Map map : consignmentMaps){
|
|
|
+ JSONObject jsonObject=mapList4.getJSONObject(0);
|
|
|
+ List<Map<String,Object>> mapItems4= (List<Map<String,Object>>) jsonObject.get("DETAILList");
|
|
|
+ for (Map itemMap4 : mapItems4){
|
|
|
+ if(itemMap4.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap4.get("IQUANTITY").toString())
|
|
|
+ ==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")){
|
|
|
+ getcFree((JSONObject) itemMap4,map);
|
|
|
+ itemMap4.put("AUTOID_SO",map.get("iDLsID"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("mapItems4\t"+mapItems4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ text(mapList4,"销售出库单");
|
|
|
+ JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");
|
|
|
+ result(resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject jsonObject4=resturn4.getJSONObject(0);
|
|
|
+ String saleoutName=jsonObject4.get("U8ReceiptNo").toString();
|
|
|
+
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
|
|
|
+
|
|
|
+
|
|
|
+ List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
|
|
|
+
|
|
|
+ if(saleoutMaps!=null){
|
|
|
+ for (Map map : saleoutMaps){
|
|
|
+ JSONObject jsonObject=mapList6.getJSONObject(0);
|
|
|
+ List<Map<String,Object>> mapItems6= (List<Map<String,Object>>) jsonObject.get("DETAILList");
|
|
|
+ for (Map itemMap6 : mapItems6){
|
|
|
+ itemMap6.put("DISAUTOIDCOL","AUTOID");
|
|
|
+ if(itemMap6.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap6.get("IQUANTITY").toString())
|
|
|
+ ==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap6.containsKey("AUTOID_DIS")){
|
|
|
+ itemMap6.put("AUTOID_DIS",map.get("autoid"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ text(mapList6,"销售发票单");
|
|
|
+ JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");
|
|
|
+ result(resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+
|
|
|
+ return mapt;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void text(JSONArray mapList,String tableName){
|
|
|
+ try{
|
|
|
+ String txtWorld="\n"+((Map)mapList.get(0)).get("CACCID")+"\t"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(System.currentTimeMillis())+"\n\n";
|
|
|
+ txtWorld+=mapList.toString()+"\n";
|
|
|
+ FileWriter file =new FileWriter ("D:\\test1\\面辅料-"+tableName+".txt",true);
|
|
|
+ file.write(txtWorld);
|
|
|
+ file.close();
|
|
|
+ System.out.println("已创建test.txt文件,已写入内容");
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void result(JSONArray jsonArray,String tableName ,String account,String id){
|
|
|
+ JSONObject jsonObject=jsonArray.getJSONObject(0);
|
|
|
+ if(jsonObject.get("Result").equals("F")){
|
|
|
+
|
|
|
+ syPackingListTailoring.setRecording(account+"-"+tableName);
|
|
|
+ syPackingListTailoringMapper.updateById(syPackingListTailoring);*/
|
|
|
+ throw new JeecgBootException("报错账套"+account+"接口"+tableName+",原因\t"+ jsonObject.get("Description"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void getcFree(JSONObject itemMap,Map<String,Object> mapPOPodetails){
|
|
|
+ itemMap.put("CDEFINE22",setNull(mapPOPodetails.get("cDefine22")));
|
|
|
+ itemMap.put("CDEFINE23",setNull(mapPOPodetails.get("cDefine23")));
|
|
|
+ itemMap.put("CDEFINE24",setNull(mapPOPodetails.get("cDefine24")));
|
|
|
+ itemMap.put("CDEFINE25",setNull(mapPOPodetails.get("cDefine25")));
|
|
|
+ itemMap.put("CDEFINE26",setNull(mapPOPodetails.get("cDefine26")));
|
|
|
+ itemMap.put("CDEFINE27",setNull(mapPOPodetails.get("cDefine27")));
|
|
|
+ itemMap.put("CDEFINE28",setNull(mapPOPodetails.get("cDefine28")));
|
|
|
+ itemMap.put("CDEFINE29",setNull(mapPOPodetails.get("cDefine29")));
|
|
|
+ itemMap.put("CDEFINE30",setNull(mapPOPodetails.get("cDefine30")));
|
|
|
+ itemMap.put("CDEFINE31",setNull(mapPOPodetails.get("cDefine31")));
|
|
|
+ itemMap.put("CDEFINE32",setNull(mapPOPodetails.get("cDefine32")));
|
|
|
+ itemMap.put("CDEFINE33",setNull(mapPOPodetails.get("cDefine33")));
|
|
|
+ itemMap.put("CDEFINE34",setNull(mapPOPodetails.get("cDefine34")));
|
|
|
+ itemMap.put("CDEFINE35",setNull(mapPOPodetails.get("cDefine35")));
|
|
|
+ itemMap.put("CDEFINE36",setNull(mapPOPodetails.get("cDefine36")));
|
|
|
+ itemMap.put("CDEFINE37",setNull(mapPOPodetails.get("cDefine37")));
|
|
|
+ itemMap.put("CFREE1",setNull(mapPOPodetails.get("cFree1")));
|
|
|
+ itemMap.put("CFREE2",setNull(mapPOPodetails.get("cFree2")));
|
|
|
+ itemMap.put("CFREE3",setNull(mapPOPodetails.get("cFree3")));
|
|
|
+ itemMap.put("CFREE4",setNull(mapPOPodetails.get("cFree4")));
|
|
|
+ itemMap.put("CFREE5",setNull(mapPOPodetails.get("cFree5")));
|
|
|
+ itemMap.put("CFREE6",setNull(mapPOPodetails.get("cFree6")));
|
|
|
+ itemMap.put("CFREE7",setNull(mapPOPodetails.get("cFree7")));
|
|
|
+ itemMap.put("CFREE8",setNull(mapPOPodetails.get("cFree8")));
|
|
|
+ itemMap.put("CFREE9",setNull(mapPOPodetails.get("cFree9")));
|
|
|
+ itemMap.put("CFREE10",setNull(mapPOPodetails.get("cFree10")));
|
|
|
+ }
|
|
|
+ public Object setNull(Object o){
|
|
|
+ if(o==null){
|
|
|
+ return "";
|
|
|
+ }else{
|
|
|
+ return o;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
@Scheduled(fixedRate=1000*60*300)
|