|
@@ -38,6 +38,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileOutputStream;
|
|
|
+import java.io.FileWriter;
|
|
|
import java.io.Serializable;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
@@ -107,6 +110,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
item1.setSpurOrSubOrder(syPreItem.getSpurOrSubOrder());//获取采购委外订单号
|
|
|
item1.setOmpoId(syPreItem.getOmpoId());//获取采购委外主表id
|
|
|
item1.setOmpoIdItem(syPreItem.getOmpoIdItem());//获取采购委外子表id
|
|
|
+ item1.setOmpoAccount(syPreItem.getOmpoAccount());//委外采购账套号
|
|
|
syPreAssembledPackingListItemMapper.updateById(syPreItem);//修改剩余数量
|
|
|
syPackingListTailoringItemMapper.insert(item1);//添加子表数据
|
|
|
}
|
|
@@ -201,7 +205,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public synchronized SyPackingListTailoring saveMain(SyPackingListTailoring syPackingListTailoring) {
|
|
|
+ public synchronized SyPackingListTailoring saveMain(SyPackingListTailoring syPackingListTailoring) {
|
|
|
List<SyPackingListTailoringItem> items=syPackingListTailoring.getSyPackingListTailoringItemList();
|
|
|
syPackingListTailoring.setDelFlag("0");//删除状态默认为0
|
|
|
syPackingListTailoring.setPushState("0");//推送状态默认为0
|
|
@@ -224,7 +228,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
syPackingListTailoring.setCustomer(syPreAssembledPackingList.getCustomer());//客户
|
|
|
syPackingListTailoring.setCustomerAbbreviation(syPreAssembledPackingList.getCustomerAbbreviation());//客户简称
|
|
|
syPackingListTailoringMapper.insert(syPackingListTailoring);//往主表添加数据
|
|
|
- Map<String,String> mapId=new HashMap<String, String>();//key为发运明细子表id,value为分组id
|
|
|
+ Map<String,String> mapId=new HashMap<>();//key为发运明细子表id,value为分组id
|
|
|
/*syPackingListTailoring.setTotal(new BigDecimal("0"));
|
|
|
syPackingListTailoring.setTotalBoxes(new BigDecimal("0"));
|
|
|
syPackingListTailoring.setTotalVolume(new BigDecimal("0"));
|
|
@@ -283,12 +287,13 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public List<SyPackingListTailoring> saveList(List<SyPackingListTailoring> syPackingListTailoring) {
|
|
|
+ List<SyPackingListTailoring> syPackingListTailorings=new ArrayList<>();
|
|
|
for (SyPackingListTailoring splt : syPackingListTailoring){
|
|
|
- splt.setWhetherCloudFactoryPush("1");//1代表是云工厂推送的
|
|
|
+ splt.setWhetherCloudFactoryPush("2");//2代表是云工厂推送的
|
|
|
splt.setId(null);//id设置为null
|
|
|
- saveMain(splt);//无sizeTable的新增方法
|
|
|
+ syPackingListTailorings.add(saveMain(splt));//无sizeTable
|
|
|
}
|
|
|
- return syPackingListTailoring;
|
|
|
+ return syPackingListTailorings;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -597,6 +602,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
item1.setSpurOrSubOrder(syPreItem.getSpurOrSubOrder());//获取采购委外订货号
|
|
|
item1.setOmpoId(syPreItem.getOmpoId());//主表id
|
|
|
item1.setOmpoIdItem(syPreItem.getOmpoIdItem());//子表id
|
|
|
+ item1.setOmpoAccount(syPreItem.getOmpoAccount());//子表id
|
|
|
syPreAssembledPackingListItemMapper.updateById(syPreItem);//修改剩余数量
|
|
|
}
|
|
|
syPackingListTailoring.setTotalPrice(syPackingListTailoring.getTotalPrice().add(item1.getTotalPrice()));//获取总价
|
|
@@ -664,55 +670,53 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
private PurchaseWarehousingMapper purchaseWarehousingMapper;//采购入库表
|
|
|
|
|
|
@DS("multi-one")
|
|
|
- public JSONArray one(List<SyPackingListTailoring> mains){
|
|
|
- return saveBatch(mains );
|
|
|
+ public Map<String,String> one(List<SyPackingListTailoring> mains,Map<String,String> map){
|
|
|
+ return saveBatch(mains,map);
|
|
|
}
|
|
|
|
|
|
@DS("multi-two")
|
|
|
- public JSONArray two(List<SyPackingListTailoring> mains){
|
|
|
- return saveBatch(mains );
|
|
|
+ public Map<String,String> two(List<SyPackingListTailoring> mains,Map<String,String> map){
|
|
|
+ return saveBatch(mains,map);
|
|
|
}
|
|
|
|
|
|
@DS("multi-three")
|
|
|
- public JSONArray three(List<SyPackingListTailoring> mains){
|
|
|
- return saveBatch(mains );
|
|
|
+ public Map<String,String> three(List<SyPackingListTailoring> mains,Map<String,String> map){
|
|
|
+ return saveBatch(mains,map);
|
|
|
}
|
|
|
|
|
|
public String getOrderDataId(String id){
|
|
|
return syPackingListTailoringMapper.getOrderDataId(id);
|
|
|
}
|
|
|
|
|
|
- JSONArray saveBatch(List<SyPackingListTailoring> mains ){
|
|
|
+ Map<String,String> saveBatch(List<SyPackingListTailoring> mains,Map<String,String> mapt){
|
|
|
if(mains==null||mains.size()==0){
|
|
|
- return new JSONArray();//为空就传回空对象
|
|
|
+ return new HashMap();//为空就传回空对象
|
|
|
}
|
|
|
JSONArray mapList=new JSONArray();
|
|
|
- JSONArray mapList2=new JSONArray();
|
|
|
+ //JSONArray mapList2=new JSONArray();
|
|
|
JSONArray mapList3=new JSONArray();
|
|
|
JSONArray mapList4=new JSONArray();
|
|
|
JSONArray mapList5=new JSONArray();
|
|
|
JSONArray mapList6=new JSONArray();
|
|
|
|
|
|
|
|
|
+
|
|
|
JSONArray mapLists=new JSONArray();
|
|
|
//账套号
|
|
|
for (SyPackingListTailoring main : mains){
|
|
|
String createBy="进出口平台管理员";
|
|
|
- String ompoId="";//采购委外id
|
|
|
- String orderName="";//采购委外订单名
|
|
|
JSONObject map=new JSONObject();//采购(委外)入库单
|
|
|
map.put("CVOUCHCODE",purchaseWarehousingMapper.getMaxCode("id+1","RdRecord01","dnmaketime"));//获取单据号
|
|
|
map.put("DDATE",main.getCreateTime());//日期(格式2015-01-01)
|
|
|
map.put("CMAKER",createBy);//制单人
|
|
|
map.put("cVouchType",1);//传1
|
|
|
- map.put("cOrderCode",main.getOrderNumber());//销售订单号
|
|
|
|
|
|
- JSONObject map2=new JSONObject();//材料出库单
|
|
|
+ /* JSONObject map2=new JSONObject();//材料出库单
|
|
|
map2.put("CVOUCHCODE",purchaseWarehousingMapper.getMaxCode("ID+1","rdrecord11","dnmaketime"));//单号
|
|
|
map2.put("DDATE",main.getCreateTime());//日期(格式2015-01-01)
|
|
|
map2.put("CHANDLER",createBy);//审核人
|
|
|
map2.put("CMAKER",createBy);//制单人
|
|
|
- map2.put("cOrderCode",main.getOrderNumber());//销售订单号
|
|
|
+ map2.put("cOrderCode",main.getOrderNumber());//销售订单号*/
|
|
|
|
|
|
JSONObject map3=new JSONObject();//销售发货单
|
|
|
map3.put("CVOUCHCODE",purchaseWarehousingMapper.getMaxCode("DLID+1","DispatchList","dcreatesystime"));//发货单号
|
|
@@ -738,115 +742,135 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
map6.put("CMAKER",createBy);//制单人名称
|
|
|
|
|
|
JSONArray mapItems=new JSONArray();
|
|
|
- JSONArray mapItems2=new JSONArray();
|
|
|
+ //JSONArray mapItems2=new JSONArray();
|
|
|
JSONArray mapItems3=new JSONArray();
|
|
|
JSONArray mapItems4=new JSONArray();
|
|
|
JSONArray mapItems5=new JSONArray();
|
|
|
JSONArray mapItems6=new JSONArray();
|
|
|
|
|
|
- if(main.getSyOrderDataId()!=null){
|
|
|
- Map<String,Object> order=syPackingListTailoringMapper.getSoMain(main.getSyOrderDataId().substring(3));
|
|
|
- if(order!=null){
|
|
|
- //cPersonCode,cDepCode,cBusType,cPayCode,cexch_name,nflat
|
|
|
- map2.put("CDEPCODE",order.get("cDepCode"));//部门编码(如果传空,取来源单据)
|
|
|
- map2.put("CEXCH_NAME",order.get("cexch_name"));//币种名称(如果传空,接口默认人民币)
|
|
|
- map2.put("CPERSONCODE",order.get("cPersonCode"));//业务员编码(如果传空,取来源单据)
|
|
|
- map3.put("CBUSTYPE",order.get("cBusType"));//业务类型(普通销售、分期付款)(如果传空,取来源单据)
|
|
|
- map4.put("CEXCH_NAME",order.get("cexch_name"));//币种名称(如果传空,传来源单据;无来源单据,默认人民币)
|
|
|
- map6.put("CBUSTYPE",order.get("cBusType"));//业务类型
|
|
|
+ Map<String,Object> orderData=null;
|
|
|
+
|
|
|
+ if(mapt.get("account").equals("903")){//查询委外订单主表数据 顺序---1
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("om_momain","cCode='"+map.get("mpOrder")+"'","moid");
|
|
|
+ map.put("CRDCODE","委外入库");//入库类别(采购入库/委外入库)
|
|
|
+ //map2.put("CRDCODE","委外出库");//出库类别
|
|
|
+ }else {//查询委外订单表数据
|
|
|
+ if(mapt.get("orderNumber").equals("one")){
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+map.get("mpOrder")+"'","POID");
|
|
|
+ }else{
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+mapt.get("orderNumber")+"'","POID");//根据采购订单号判断
|
|
|
}
|
|
|
+ map.put("CRDCODE","采购入库");//入库类别(采购入库/委外入库)
|
|
|
+ //map2.put("CRDCODE","采购出库");//出库类别
|
|
|
+ }
|
|
|
+ if(orderData!=null){
|
|
|
+ map5.put("IEXCHRATE",orderData.get("nflat"));//汇率(如果传空,接口默认1)cPayCode
|
|
|
+ map5.put("CPAYCODE",orderData.get("cPayCode"));//付款条件编码(如果传空,取来源单据)
|
|
|
}
|
|
|
for (SyPackingListTailoringItem item : main.getSyPackingListTailoringItemList()){
|
|
|
JSONObject mapItem=new JSONObject();
|
|
|
- JSONObject mapItem2=new JSONObject();
|
|
|
+ //JSONObject mapItem2=new JSONObject();
|
|
|
JSONObject mapItem3=new JSONObject();
|
|
|
JSONObject mapItem4=new JSONObject();
|
|
|
JSONObject mapItem5=new JSONObject();
|
|
|
JSONObject mapItem6=new JSONObject();
|
|
|
|
|
|
- if(item.getSupplierCode()!=null){
|
|
|
- map.put("CVENCODE",item.getSupplierCode());//供应商编码(如果传空,取来源单据)
|
|
|
+
|
|
|
+ map.put("CACCID",mapt.get("account"));//账套号
|
|
|
+ //map2.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")){ //采购订单子表数据 顺序---2
|
|
|
+ if(mapt.get("orderNumber").equals("one")){
|
|
|
+ orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("PO_PoDetails", "ID='"+item.getOmpoIdItem()+"'","ID");
|
|
|
+ }else{
|
|
|
+ orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("PO_PoDetails", "poid='"+orderData.get("id")+"' and irowno=xxx" +
|
|
|
+ "xxxxxxxxxxxxxxxx" +
|
|
|
+ "xxxxxxxx" +
|
|
|
+ "xxxxxxxxxx" +
|
|
|
+ "xxxxxxxx" +
|
|
|
+ "xxxxxxx","ID");
|
|
|
+ }
|
|
|
+ mapItem.put("POAUTOIDCOL","ID");//订单明细ID对应字段名(关联单据类型为采购订单传ID,为采购到货单为Autoid,为委外订单传MODetailsID,为委外到货单为Autoid)
|
|
|
+ mapItem.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
+ mapItem5.put("POAUTOIDCOL","ID");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
+ mapItem5.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
+ }{//委外订单子表数据 顺序---2
|
|
|
+ //第二次怎么获取采购订单的子表id 查询销售订单子表保存行号去绑定上游的账套
|
|
|
+ orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("OM_MODetails", "MODetailsID='"+item.getOmpoIdItem()+"'","MODetailsID");
|
|
|
+ Map<String,Object> orderDataItem2=purchaseWarehousingMapper.getOMMoDetails(item.getOmpoIdItem());
|
|
|
+ System.out.println("orderDataItme2\t"+orderDataItem2);
|
|
|
+ getcFree(mapItem,orderDataItem2);
|
|
|
+ System.out.println("mapItem\t"+mapItem);
|
|
|
+ mapItem.put("POAUTOIDCOL","MODetailsID");//订单明细ID对应字段名(关联单据类型为采购订单传ID,为采购到货单为Autoid,为委外订单传MODetailsID,为委外到货单为Autoid)
|
|
|
+ mapItem.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
+ /* mapItem2.put("AUTOID_ALL",orderDataItem.get("id"));//关联明细ID
|
|
|
+ mapItem2.put("ALLCAUTOIDCOL","AllocateId");//订单明细ID对应字段名(固定AllocateId)*/
|
|
|
+ mapItem5.put("POAUTOIDCOL","MODetailsID");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
+ mapItem5.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
+ }
|
|
|
+ mapItem5.put("IORIMONEY",orderDataItem.get("iMoney"));//原币金额
|
|
|
+ mapItem5.put("IMONEY",orderDataItem.get("iNatMoney"));//本币金额
|
|
|
+
|
|
|
+
|
|
|
+ if(item.getSupplierCode()!=null){//查询供应商表获取编码 顺序---3
|
|
|
+ map.put("CVENCODE",orderData.get("cVenCode"));//供应商编码(如果传空,取来源单据)
|
|
|
String wheCode=syPackingListTailoringMapper.getWhCodeByVenCode(item.getSupplierCode());
|
|
|
if(wheCode!=null){
|
|
|
map.put("CWHCODE",wheCode);//仓库编码
|
|
|
- map2.put("CWHCODE",wheCode);//仓库编码
|
|
|
+ // map2.put("CWHCODE",wheCode);//仓库编码
|
|
|
map4.put("CWHCODE",main.getCreateBy());//仓库编码
|
|
|
mapItem3.put("CWHCODE",wheCode);//仓库编码 这个是子表需要字段
|
|
|
mapItem6.put("CWHCODE",wheCode);//仓库编码
|
|
|
}
|
|
|
}
|
|
|
- map.put("CACCID",item.getAcSetNo());//账套号
|
|
|
- map2.put("CACCID",item.getAcSetNo());//账套号
|
|
|
- map3.put("CACCID",item.getAcSetNo());//账套号
|
|
|
- map4.put("CACCID",item.getAcSetNo());//账套号
|
|
|
- map5.put("CACCID",item.getAcSetNo());//账套号
|
|
|
- map6.put("CACCID",item.getAcSetNo());//账套号
|
|
|
-
|
|
|
- if(map.get("cOrderCode")==null){
|
|
|
- map.put("cOrderCode",item.getOrderNumber());//销售订单号
|
|
|
- map2.put("cOrderCode",item.getOrderNumber());//销售订单号
|
|
|
- }
|
|
|
- ompoId=item.getOmpoId();
|
|
|
- orderName=item.getSpurOrSubOrder();
|
|
|
- if(ompoId!=null&&ompoId.length()!=0&&orderName!=null&&orderName.length()!=0&&!map.containsKey("CRDCODE")){
|
|
|
- Map<String,Object> orderData=null;
|
|
|
- orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","POID='"+ompoId+"'","cPOID='"+orderName+"'");
|
|
|
- map.put("CRDCODE","采购入库");//入库类别(采购入库/委外入库)
|
|
|
- map2.put("CRDCODE","采购出库");//出库类别
|
|
|
- if(orderData==null){
|
|
|
- orderData=syPackingListTailoringMapper.getOmOrPo("om_momain","MOID='"+ompoId+"'","cCode='"+orderName+"'");
|
|
|
- map.put("CRDCODE","委外入库");//入库类别(采购入库/委外入库)
|
|
|
- map2.put("CRDCODE","委外出库");//出库类别
|
|
|
- }
|
|
|
- if(orderData!=null){
|
|
|
- map5.put("IEXCHRATE",orderData.get("nflat"));//汇率(如果传空,接口默认1)cPayCode
|
|
|
- map5.put("CPAYCODE",orderData.get("cPayCode"));//付款条件编码(如果传空,取来源单据)
|
|
|
- }
|
|
|
- }
|
|
|
- if(map.containsKey("CRDCODE")&&map.get("CRDCODE").equals("采购入库")){
|
|
|
- mapItem.put("POAUTOIDCOL","ID");//订单明细ID对应字段名(关联单据类型为采购订单传ID,为采购到货单为Autoid,为委外订单传MODetailsID,为委外到货单为Autoid)
|
|
|
- }else if(map.containsKey("CRDCODE")&&map.get("CRDCODE").equals("委外入库")){
|
|
|
- mapItem.put("POAUTOIDCOL","MODetailsID");//订单明细ID对应字段名(关联单据类型为采购订单传ID,为采购到货单为Autoid,为委外订单传MODetailsID,为委外到货单为Autoid)
|
|
|
- mapItem2.put("AUTOID_ALL",item.getOmpoIdItem());//关联明细ID
|
|
|
- mapItem2.put("ALLCAUTOIDCOL","AllocateId");//订单明细ID对应字段名(固定AllocateId)
|
|
|
- }
|
|
|
|
|
|
- Map<String,Object> orderDataItem=null;
|
|
|
- if(map.containsKey("CRDCODE")&&map.get("CRDCODE").equals("采购入库")){
|
|
|
- orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("PO_PoDetails", "ID='"+item.getOmpoIdItem()+"'");
|
|
|
- mapItem5.put("POAUTOIDCOL","ID");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
- mapItem5.put("AUTOID_PO",item.getOmpoIdItem());//明细ID(采购订单行ID/委外订单行ID)
|
|
|
- }else{
|
|
|
- orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("OM_MODetails", "MODetailsID='"+item.getOmpoIdItem()+"'");
|
|
|
- mapItem5.put("POAUTOIDCOL","MODetailsID");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
- mapItem5.put("AUTOID_PO",item.getOmpoIdItem());//明细ID(采购订单行ID/委外订单行ID)
|
|
|
- }
|
|
|
- mapItem5.put("IORIMONEY",orderDataItem.get("iMoney"));//原币金额
|
|
|
- mapItem5.put("IMONEY",orderDataItem.get("iNatMoney"));//本币金额
|
|
|
|
|
|
- if(item.getSyOrderDataItemId()!=null){
|
|
|
- Map<String,Object> orderDataItem2=syPackingListTailoringMapper.getSoMainItem(item.getSyOrderDataItemId().substring(3));
|
|
|
+ if(item.getSyOrderDataItemId()!=null){//销售发货单 ---查询销售订单子表数据 顺序---5
|
|
|
+ Map<String,Object> orderDataItem2=syPackingListTailoringMapper.getSoMainItem(orderDataItem.get("iSOsID").toString());
|
|
|
mapItem3.put("ITAXUNITPRICE",orderDataItem2.get("iTaxUnitPrice"));//原币含税单价(如果传空,取来源单据)(以含税单价为准自动计算相关价格及金额)
|
|
|
mapItem3.put("ITAXRATE",orderDataItem2.get("iTaxRate"));//税率(如果传空,取来源单据,无来源单据,取存货档案对应的销项税率)
|
|
|
+ mapItem3.put("SOAUTOIDCOL","ISOSID");//来源单据明细ID对应字段名(如果取销售订单主键,需传固定值ISOSID)
|
|
|
+ mapItem3.put("AUTOID_SO",orderDataItem2.get("iSOsID"));//来源单据明细ID
|
|
|
+ mapt.put("orderNumber", orderDataItem2.get("id").toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!mapt.get("orderNumber").equals("one")){//销售订单
|
|
|
+ Map<String,Object> order=syPackingListTailoringMapper.getSoMain(mapt.get("orderNumber"));
|
|
|
+ if(order!=null){//销售订单主表
|
|
|
+ //cPersonCode,cDepCode,cBusType,cPayCode,cexch_name,nflat
|
|
|
+ /*map2.put("CDEPCODE",order.get("cDepCode"));//部门编码(如果传空,取来源单据)
|
|
|
+ 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"));//业务类型
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
mapItem.put("CINVCODE",item.getInventoryCode());//存货编码
|
|
|
mapItem.put("IQUANTITY",item.getTotal());//数量
|
|
|
- mapItem.put("AUTOID_PO",item.getOmpoIdItem());//明细ID(采购订单行ID/委外订单行ID)
|
|
|
- mapItem.put("cBatch","x");//批号
|
|
|
+ //mapItem.put("cBatch","x");//批号
|
|
|
|
|
|
- mapItem2.put("CINVCODE",item.getInventoryCode());//存货编码(如果来源单据是委外订单,此字段需要传该订单的子件编码)
|
|
|
- mapItem2.put("IQUANTITY",item.getTotal());//数量
|
|
|
+ /*mapItem2.put("CINVCODE",item.getInventoryCode());//存货编码(如果来源单据是委外订单,此字段需要传该订单的子件编码)
|
|
|
+ mapItem2.put("IQUANTITY",item.getTotal());//数量*/
|
|
|
|
|
|
mapItem3.put("CINVCODE",item.getInventoryCode());//存货编码
|
|
|
mapItem3.put("IQUANTITY",item.getTotal());//数量
|
|
|
- mapItem3.put("SOAUTOIDCOL","ISOSID");//来源单据明细ID对应字段名(如果取销售订单主键,需传固定值ISOSID)
|
|
|
- mapItem3.put("AUTOID_SO",item.getSyOrderDataItemId());//来源单据明细ID
|
|
|
|
|
|
mapItem4.put("CINVCODE",item.getInventoryCode());//存货编码
|
|
|
mapItem4.put("IQUANTITY",item.getTotal());//数量
|
|
|
- mapItem4.put("SOAUTOIDCOL","x");//订单明细ID对应字段名(关联单据类型为发货单IDLSID)
|
|
|
- mapItem4.put("AUTOID_PO","x");//关联明细ID
|
|
|
+ mapItem4.put("SOAUTOIDCOL","IDLSID");//订单明细ID对应字段名(关联单据类型为发货单IDLSID)
|
|
|
+ mapItem4.put("AUTOID_PO","10300001");//关联明细ID 测试用先写
|
|
|
|
|
|
mapItem5.put("CINVCODE",item.getInventoryCode());//存货编码
|
|
|
mapItem5.put("IQUANTITY",item.getTotal());//数量
|
|
@@ -855,7 +879,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
mapItem6.put("IQUNTITY",item.getTotal());//数量
|
|
|
|
|
|
mapItems.add(mapItem);
|
|
|
- mapItems2.add(mapItem2);
|
|
|
+ //mapItems2.add(mapItem2);
|
|
|
mapItems3.add(mapItem3);
|
|
|
mapItems4.add(mapItem4);
|
|
|
mapItems5.add(mapItem5);
|
|
@@ -864,8 +888,8 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
|
|
|
map.put("DETAILList",mapItems);//明细集合
|
|
|
mapList.add(map);
|
|
|
- map2.put("DETAILList",mapItems2);//明细集合
|
|
|
- mapList2.add(map2);
|
|
|
+ /* map2.put("DETAILList",mapItems2);//明细集合
|
|
|
+ mapList2.add(map2);*/
|
|
|
map3.put("DETAILList",mapItems3);//明细集合
|
|
|
mapList3.add(map3);
|
|
|
map4.put("DETAILList",mapItems4);//明细集合
|
|
@@ -876,34 +900,93 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
mapList6.add(map6);
|
|
|
}
|
|
|
|
|
|
- mapLists.addAll(mapList);/*
|
|
|
- mapLists.addAll(mapList2);
|
|
|
+ mapLists.addAll(mapList);
|
|
|
+ String txtWorld=mapt.get("account")+"\t"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(System.currentTimeMillis())+"\n\n";
|
|
|
+ txtWorld+=mapList.toString()+"\n\n";
|
|
|
+ txtWorld+=mapList3.toString()+"\n\n";
|
|
|
+ txtWorld+=mapList4.toString()+"\n\n";
|
|
|
+ txtWorld+=mapList5.toString()+"\n\n";
|
|
|
+ txtWorld+=mapList6.toString()+"\n\n";
|
|
|
+ //mapLists.addAll(mapList2);
|
|
|
mapLists.addAll(mapList3);
|
|
|
mapLists.addAll(mapList4);
|
|
|
mapLists.addAll(mapList5);
|
|
|
- mapLists.addAll(mapList6);*/
|
|
|
+ mapLists.addAll(mapList6);
|
|
|
|
|
|
- System.out.println("mapList1\n"+mapList);/*
|
|
|
- System.out.println("mapList2\n"+mapList2);
|
|
|
+ System.out.println("mapList1\n"+mapList);
|
|
|
+ // System.out.println("mapList2\n"+mapList2);
|
|
|
System.out.println("mapList3\n"+mapList3);
|
|
|
System.out.println("mapList4\n"+mapList4);
|
|
|
System.out.println("mapList5\n"+mapList5);
|
|
|
- System.out.println("mapList6\n"+mapList6);*/
|
|
|
-
|
|
|
- // JSONArray resturn1 = InterfaceConnUtils.doPost(mapList,"purchasein_import");//采购入库单
|
|
|
- /*JSONArray resturn2 = InterfaceConnUtils.doPost(mapList,"materialout_import");//材料出库单
|
|
|
- JSONArray resturn3 = InterfaceConnUtils.doPost(mapList,"consignment_import");//销售发货单
|
|
|
- JSONArray resturn4 = InterfaceConnUtils.doPost(mapList,"saleout_import");//销售出库单
|
|
|
- JSONArray resturn5 = InterfaceConnUtils.doPost(mapList,"purinvoice_import");//采购发票单
|
|
|
- JSONArray resturn6 = InterfaceConnUtils.doPost(mapList,"saleinvoice_import");//销售发票单*/
|
|
|
-
|
|
|
- // System.out.println("调用接口后返回的信息resturn1\n"+resturn1);
|
|
|
- /*System.out.println("resturn1\n"+resturn2);
|
|
|
- System.out.println("resturn1\n"+resturn3);
|
|
|
- System.out.println("resturn1\n"+resturn4);
|
|
|
- System.out.println("resturn1\n"+resturn5);
|
|
|
- System.out.println("resturn1\n"+resturn6);*/
|
|
|
-
|
|
|
- return mapLists;
|
|
|
+ System.out.println("mapList6\n"+mapList6);
|
|
|
+
|
|
|
+ /*JSONArray resturn1 = InterfaceConnUtils.doPost(mapList,"purchasein_import");//采购入库单
|
|
|
+ //JSONArray resturn2 = InterfaceConnUtils.doPost(mapList,"materialout_import");//材料出库单
|
|
|
+ JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
|
|
|
+ JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");//销售出库单
|
|
|
+ JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
|
|
|
+ JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");//销售发票单
|
|
|
+
|
|
|
+ System.out.println("调用接口后返回的信息resturn1\n"+resturn1);
|
|
|
+ //System.out.println("调用接口后返回的信息resturn2\n"+resturn2);
|
|
|
+ System.out.println("调用接口后返回的信息resturn3\n"+resturn3);
|
|
|
+ System.out.println("调用接口后返回的信息resturn4\n"+resturn4);
|
|
|
+ System.out.println("调用接口后返回的信息resturn5\n"+resturn5);
|
|
|
+ System.out.println("调用接口后返回的信息resturn6\n"+resturn6);*/
|
|
|
+
|
|
|
+ try{
|
|
|
+ FileWriter file =new FileWriter ("D:\\test\\test.txt",true);
|
|
|
+ //FileOutputStream fo = new FileOutputStream(file);
|
|
|
+ //向文件中写入内容
|
|
|
+ // byte [] bytecontent = txtWorld.getBytes(); //将字符串转换文字节数组类型
|
|
|
+ file.write(txtWorld); //以字节数组类型写入内容
|
|
|
+ //关闭文件输出流
|
|
|
+ file.close();
|
|
|
+ System.out.println("已创建test.txt文件,已写入内容");
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|