|
@@ -954,9 +954,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
//String createDate=main.getCreateTime().toString();
|
|
|
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","ddate DESC,cCode")));//获取单据号
|
|
|
+ map.put("CVOUCHCODE", org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cCode+100","RdRecord01","cCode")));//获取单据号
|
|
|
+ //map.put("CVOUCHCODE", main.getId());//获取单据号
|
|
|
map.put("DDATE",createDate);//日期(格式2015-01-01)
|
|
|
map.put("CMAKER",createBy);//制单人
|
|
|
+ map.put("CMEMO",main.getRemarks());//制单人
|
|
|
map.put("CHANDLER",createBy);//审核人
|
|
|
map.put("cVouchType",1);//传1
|
|
|
|
|
@@ -984,8 +986,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
JSONObject map5=new JSONObject();//采购发票
|
|
|
map5.put("CVOUCHCODE",org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cpbvcode ","PurBillVouch","cmaketime")));//发票号
|
|
|
map5.put("DDATE",createDate);//发票日期(格式2015-01-01)
|
|
|
- map5.put("CTYPE","普通");//发票类型(01:专用 02:普票)
|
|
|
+ map5.put("CTYPE","专用");//发票类型(01:专用 02:普票)
|
|
|
map5.put("CMAKER",createBy);//制单人
|
|
|
+ map5.put("CGLTYPE","入库单");
|
|
|
map5.put("CHANDLER",createBy);//审核人
|
|
|
|
|
|
JSONObject map6=new JSONObject();//销售发票
|
|
@@ -1027,7 +1030,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
map.put("CRDCODE","12");//入库类别(采购入库/委外入库)
|
|
|
map.put("CGLTYPE","委外订单");//来源单据类型
|
|
|
map4.put("CGLTYPE","销售发货单");//来源单据类型
|
|
|
- map5.put("CGLTYPE","委外订单");//来源单据类型
|
|
|
+ //map5.put("CGLTYPE","委外订单");//来源单据类型
|
|
|
map6.put("CGLTYPE","销售出库单");//来源单据类型
|
|
|
}else {//查询采购订单表数据
|
|
|
if(mapt.get("account1").equals("901")){
|
|
@@ -1035,7 +1038,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
map.put("CRDCODE","12");//入库类别(采购入库/委外入库)
|
|
|
map.put("CGLTYPE","委外订单");//来源单据类型
|
|
|
map4.put("CGLTYPE","销售发货单");//来源单据类型
|
|
|
- map5.put("CGLTYPE","委外订单");//来源单据类型
|
|
|
+ //map5.put("CGLTYPE","委外订单");//来源单据类型
|
|
|
map6.put("CGLTYPE","销售出库单");//来源单据类型
|
|
|
}else{
|
|
|
if(mapt.get("orderNumber").equals("one")){
|
|
@@ -1046,7 +1049,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
map.put("CRDCODE","11");//入库类别(采购入库/委外入库)
|
|
|
map.put("CGLTYPE","采购订单");//来源单据类型
|
|
|
map4.put("CGLTYPE","销售发货单");//来源单据类型
|
|
|
- map5.put("CGLTYPE","采购订单");//来源单据类型
|
|
|
+ //map5.put("CGLTYPE","采购订单");//来源单据类型
|
|
|
map6.put("CGLTYPE","销售出库单");//来源单据类型
|
|
|
}
|
|
|
}
|
|
@@ -1135,8 +1138,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
mapItem.put("CBATCHPROPERTY3",item.getRolls());
|
|
|
mapItem.put("POAUTOIDCOL","ID");//订单明细ID对应字段名(关联单据类型为采购订单传ID,为采购到货单为Autoid,为委外订单传MODetailsID,为委外到货单为Autoid)
|
|
|
mapItem.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
- map5.put("CGLTYPE","采购订单");
|
|
|
- mapItem5.put("POAUTOIDCOL","ID");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
+ //map5.put("CGLTYPE","采购订单");
|
|
|
+ mapItem5.put("POAUTOIDCOL","Autoid");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
mapItem5.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
mapItem5.put("IORITAXCOST",orderDataItem.get("iTaxPrice"));//原币单价
|
|
|
/*mapItem5.put("IORIMONEY",orderDataItem.get("iMoney"));//原币金额
|
|
@@ -1153,7 +1156,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
mapItem.put("POAUTOIDCOL","MODetailsID");//订单明细ID对应字段名(关联单据类型为采购订单传ID,为采购到货单为Autoid,为委外订单传MODetailsID,为委外到货单为Autoid)
|
|
|
mapItem.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
mapItem.put("CBATCHPROPERTY3",item.getRolls());
|
|
|
- map5.put("CGLTYPE","委外订单");
|
|
|
+ //map5.put("CGLTYPE","委外订单");
|
|
|
if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("040")>-1&&mapt.get("account").equals("903")){//903账套中物料分类为040的印花面料
|
|
|
List<Map<String,Object>> orderDataItem3 =syPackingListFabricMapper.getOM_MOMaterials(item.getOmpoIdItem(),item.getInventoryCode());//委外订单子表
|
|
|
Map<String,Object> mapStr1=syPackingListFabricMapper.getOM_MOMain(item.getOmpoIdItem(),item.getInventoryCode());//供应商编码,存货编码
|
|
@@ -1189,8 +1192,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- mapItem5.put("POAUTOIDCOL","MODetailsID");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
- mapItem5.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
+ mapItem5.put("POAUTOIDCOL","Autoid");//明细ID对应字段名(关联单据类型为采购订单传ID,委外订单传MODetailsID,入库单为Autoid)
|
|
|
+ //mapItem5.put("AUTOID_PO",orderDataItem.get("id"));//明细ID(采购订单行ID/委外订单行ID)
|
|
|
mapItem5.put("IORITAXCOST",orderDataItem.get("iTaxPrice"));//原币单价
|
|
|
/*mapItem5.put("IORIMONEY",orderDataItem.get("iMoney"));//原币金额
|
|
|
mapItem5.put("IMONEY",orderDataItem.get("iNatMoney"));//本币金额*/
|
|
@@ -1206,6 +1209,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
mapItem6.put("CWHCODE",mapt.get("CWHCODE"));//仓库编码
|
|
|
}
|
|
|
mapt.put("poid","one");//重置销售订单id
|
|
|
+ mapItem5.put("CDEFINE23",item.getDeclarationUnit());//报关单位
|
|
|
+ mapItem5.put("CDEFINE33",item.getDeclarationName());//报关品名
|
|
|
|
|
|
//if(item.getSyOrderDataItemId()!=null){//销售发货单 ---查询销售订单子表数据 顺序---5
|
|
|
if(orderDataItem!=null&&orderDataItem.containsKey("iSOsID")&&orderDataItem.get("iSOsID")!=null){
|
|
@@ -1318,8 +1323,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
|
|
|
text(mapList,"采购入库单");
|
|
|
- text(mapList3,"销售发货单");
|
|
|
- text(mapList5,"采购发票单");
|
|
|
if(mapList2!=null&&mapList2.size()>0){
|
|
|
text(mapList2,"材料出库单");
|
|
|
text(mapList7,"印厂采购入库单");
|
|
@@ -1355,12 +1358,34 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
if (maps.containsKey(account)){
|
|
|
switch (maps.get(account).get("index")){
|
|
|
case "1": //代表已完成第一道
|
|
|
- JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
|
|
|
- recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
|
|
|
- recording(main,recording);
|
|
|
- this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
|
|
|
- if(((Map) mapList.get(0)).get("CACCID").toString().equals("901")){
|
|
|
- return account+"账套推送成功!";
|
|
|
+ //JSONObject jsonObject1=resturn1.getJSONObject(0);//采购入库单
|
|
|
+ String purchaseinName=maps.get(account).get("code");//获取销售发货单
|
|
|
+ //String purchaseinName=jsonObject1.get("U8ReceiptNo").toString();//获取销售发货单
|
|
|
+ List<Map<String,Object>> purchaseinMaps= syPackingListTailoringMapper.getRdRecord01(purchaseinName);
|
|
|
+ if(purchaseinMaps!=null){
|
|
|
+ for (Map map : purchaseinMaps){
|
|
|
+ JSONObject jsonObject=mapList5.getJSONObject(0);//循环迭代
|
|
|
+ List<Map<String,Object>> mapItems5= (List<Map<String,Object>>) jsonObject.get("DETAILList");
|
|
|
+ for (Map itemMap5 : mapItems5){
|
|
|
+ if((Double.parseDouble( itemMap5.get("IQUANTITY").toString())
|
|
|
+ ==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap5.containsKey("AUTOID_SO")){//根据尺码判断
|
|
|
+ //getcFree((JSONObject) itemMap5,map);
|
|
|
+ itemMap5.put("AUTOID_PO",map.get("AutoID"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("mapItems4\t"+mapItems5);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ text(mapList3,"销售发货单");
|
|
|
+ text(mapList5,"采购发票单");
|
|
|
+ if(!((Map) mapList.get(0)).get("CACCID").toString().equals("903")){
|
|
|
+ JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
|
|
|
+ recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
|
|
|
+ recording(main,recording);
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
|
|
|
+ if(((Map) mapList.get(0)).get("CACCID").toString().equals("901")){
|
|
|
+ return account+"账套推送成功!";
|
|
|
+ }
|
|
|
}
|
|
|
case "2":
|
|
|
if(account.equals("901")){
|
|
@@ -1371,7 +1396,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
maps.get(account).put("code",resturn3.getJSONObject(0).get("U8ReceiptNo").toString());
|
|
|
recording(main,recording);
|
|
|
String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
|
|
|
- this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(u8ReceiptNo103,"108");
|
|
|
case "3":
|
|
|
String consignmentName=maps.get(account).get("code");//获取销售发货单
|
|
|
List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
|
|
@@ -1427,11 +1452,34 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
recording(main,recording);
|
|
|
this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
|
|
|
|
|
|
- JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
|
|
|
- recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
|
|
|
- recording(main,recording);
|
|
|
- this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
|
|
|
+ JSONObject jsonObject1=resturn1.getJSONObject(0);//采购入库单
|
|
|
+ String purchaseinName=jsonObject1.get("U8ReceiptNo").toString();//获取销售发货单
|
|
|
+ List<Map<String,Object>> purchaseinMaps= syPackingListTailoringMapper.getRdRecord01(purchaseinName);
|
|
|
+
|
|
|
+ if(purchaseinMaps!=null){
|
|
|
+ for (Map map : purchaseinMaps){
|
|
|
+ JSONObject jsonObject=mapList5.getJSONObject(0);//循环迭代
|
|
|
+ List<Map<String,Object>> mapItems5= (List<Map<String,Object>>) jsonObject.get("DETAILList");
|
|
|
+ for (Map itemMap5 : mapItems5){
|
|
|
+ if((Double.parseDouble( itemMap5.get("IQUANTITY").toString())
|
|
|
+ ==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap5.containsKey("AUTOID_PO")){//根据尺码判断
|
|
|
+ //getcFree((JSONObject) itemMap5,map);
|
|
|
+ itemMap5.put("AUTOID_PO",map.get("AutoID"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("mapItems4\t"+mapItems5);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ text(mapList3,"销售发货单");
|
|
|
+ text(mapList5,"采购发票单");
|
|
|
+ if(!((Map) mapList.get(0)).get("CACCID").toString().equals("903")){
|
|
|
+ JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
|
|
|
+ recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
|
|
|
+ recording(main,recording);
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
|
|
|
+
|
|
|
+ }
|
|
|
if(((Map) mapList.get(0)).get("CACCID").toString().equals("901")){
|
|
|
return mapList.getJSONObject(0).get("CACCID").toString()+"账套推送成功!";
|
|
|
}
|
|
@@ -1440,7 +1488,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//销售发货单
|
|
|
recording(main,recording);
|
|
|
String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
|
|
|
- this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(u8ReceiptNo103,"108");
|
|
|
|
|
|
JSONObject jsonObject3=resturn3.getJSONObject(0);//销售发货单
|
|
|
String consignmentName=jsonObject3.get("U8ReceiptNo").toString();//获取销售发货单
|
|
@@ -1450,8 +1498,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
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")){//根据尺码判断
|
|
|
+ if((Double.parseDouble( itemMap4.get("IQUANTITY").toString())
|
|
|
+ ==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_PO")){//根据尺码判断
|
|
|
getcFree((JSONObject) itemMap4,map);
|
|
|
itemMap4.put("AUTOID_SO",map.get("iDLsID"));
|
|
|
}
|
|
@@ -1614,7 +1662,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
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("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")));
|