Ver Fonte

Merge remote-tracking branch 'origin/master'

fenghaifu há 2 anos atrás
pai
commit
d47f7e3c5f

+ 27 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/impl/SyCostAllocationServiceImpl.java

@@ -2,10 +2,8 @@ package org.jeecg.modules.cost.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.google.gson.JsonObject;
 import org.apache.poi.ss.formula.functions.T;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
@@ -14,15 +12,17 @@ import org.jeecg.modules.cost.mapper.*;
 import org.jeecg.modules.cost.service.*;
 import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
 import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
-import org.jeecg.modules.system.util.JsonChangeUtils;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.report.entity.FabricMoOrderCK;
+import org.jeecg.modules.report.entity.FabricOMOrder;
+import org.jeecg.modules.report.entity.SyFabricLossReport;
+import org.jeecg.modules.report.service.ISyFabricLossReportService;
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import springfox.documentation.spring.web.json.Json;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -65,6 +65,8 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
     @Autowired
     private ISyCostAllocationShipdetailService syCostAllocationShipdetailService;
     @Autowired
+    private ISyFabricLossReportService syFabricLossReportService;
+    @Autowired
     private static ISenYuDataSourceOne senYuDataSourceOne;
     @Autowired
     private static ISenYuDataSourceThree senYuDataSourceThree;
@@ -172,6 +174,26 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
             }
         }
 
+        //查询单证面损数据
+//        SyFabricLossReport syFabricLossReport = null;
+//        QueryWrapper<SyFabricLossReport> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.eq("plan_code", plannum);
+//        List<SyFabricLossReport> syFabricLossReportList = syFabricLossReportService.list(queryWrapper);
+//        if (syFabricLossReportList.size()>0){
+//            syFabricLossReport = syFabricLossReportList.get(0);
+//        }
+//
+//        FabricLoss fabricLoss = null;
+//        if (syFabricLossReport != null){
+//            fabricLoss = JSON.parseObject(JSON.toJSONString(syFabricLossReport.getContent()), FabricLoss.class);
+//        }
+//        List<FabricMoOrderCK> fabricMoOrderCK = new ArrayList<>();
+//        for (FabricOMOrder fabricOMOrder:fabricLoss.getFabricOMOrderList2()) {
+//            for (FabricMoOrderCK f:fabricOMOrder.getFabricMoOrderCKList()) {
+//                fabricMoOrderCK.add(f);
+//            }
+//        }
+
         /*查询U8数据 面料*/
         List<SyCostAllocationFabric> list3 = syCostAllocationFabricMapper.queryByCostFabric(plannum);
         for (int i=0;i<list3.size();i++) {

+ 12 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/impl/SyOrderDataServiceImpl.java

@@ -66,6 +66,7 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
             //查找单证是否有当前销售订单 如果有 默认客户进行当前订单的更新操作
             //更新数据,如为更新数据 删除老数据重新添加新数据
             String id = syOrderDataMapper.queryIDBYOrderNumber(parameter);
+            String updateSql = "update so_somain set cdefine15='2'  where cSOCode = '"+parameter+"'";
             if(id!=null){
                 if(id.equals("已被参照")){
                     result.setMessage("销售订单已被参照!!!");
@@ -137,10 +138,19 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
 
                 List<Map<String, Object>> list = new ArrayList<>();
                 if(pkorgValue[0].equals("one")){
+                    if(id!=null){
+                        senYuDataSourceOne.update(updateSql);
+                    }
                     list = senYuDataSourceOne.queryForList(sql);
                 }else if(pkorgValue[0].equals("two")){
+                    if(id!=null){
+                        senYuDataSourceTwo.update(updateSql);
+                    }
                     list = senYuDataSourceTwo.queryForList(sql);
                 }else if(pkorgValue[0].equals("three")){
+                    if(id!=null){
+                        senYuDataSourceThree.update(updateSql);
+                    }
                     list = senYuDataSourceThree.queryForList(sql);
                 }
 
@@ -218,9 +228,9 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
                             sy2.setGuangpeiGateWidth(ordervo.getGuangpeiGateWidth());
                         }
                         sy2.setSupplier(ordervo.getSupplier());
-                        if(sy2.getInventoryCcode().substring(0,2).equals("09")){
+                        if(sy2.getInventoryCcode().substring(0,2).equals("19")){
                             sy2.setGarmentFactory(ordervo.getSupplier());
-                        }else if(sy.getCustomerAbbreviation().equals("森语集团") || sy.getCustomerAbbreviation().equals("宁波森语") ) {
+                        }else if(sy.getCustomerAbbreviation().equals("International Apparel Group") || sy.getCustomerAbbreviation().equals("宁波森语") ) {
                             sy2.setGarmentFactory(queryGSupplier(sy.getOrderNumber(),sy.getAccount(),sy.getCustomerCode()));
                         }else {
                             sy2.setGarmentFactory(sy.getGarmentFactory());

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/job/AddOrderJob.java

@@ -219,9 +219,9 @@ public class AddOrderJob implements Job,ApplicationContextAware {
                             sy2.setGuangpeiGateWidth(ordervo.getGuangpeiGateWidth());
                         }
                         sy2.setSupplier(ordervo.getSupplier());
-                        if(sy2.getInventoryCcode().substring(0,2).equals("09")){
+                        if(sy2.getInventoryCcode().substring(0,2).equals("19")){
                             sy2.setGarmentFactory(ordervo.getSupplier());
-                        }else if(sy.getCustomerAbbreviation().equals("森语集团") || sy.getCustomerAbbreviation().equals("宁波森语") ) {
+                        }else if(sy.getCustomerAbbreviation().equals("International Apparel Group") || sy.getCustomerAbbreviation().equals("宁波森语") ) {
                             sy2.setGarmentFactory(queryGSupplier(sy.getOrderNumber(),sy.getAccount(),sy.getCustomerCode()));
                         }else {
                             sy2.setGarmentFactory(sy.getGarmentFactory());

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java

@@ -533,7 +533,7 @@ public class SyPackingListFabricController {
 					 mainStrs.add(row.getCell(16)==null?"":row.getCell(16).toString());
 				 }else if(x==2){
 					 main =new SyPackingListFabric(mainStrs.toArray(new String[mainStrs.size()]));
-				 }else if(x>3){ 
+				 }else if(x>3){
 					 if(oConvertUtils.isEmpty(row.getCell(1))||row.getCell(1).toString().length()<10){//如果这一列为空就退出
 						 break;
 					 }
@@ -565,8 +565,8 @@ public class SyPackingListFabricController {
 	@ApiOperation(value="手动同步辅料数据", notes="手动同步辅料数据")
 	@GetMapping(value = "/getU8Data")
 	public Result<?> getU8Data(){
-		syPackingListFabricService.getU8Data();
-		return Result.OK("同步成功");
+		String massage=syPackingListFabricService.getU8Data();
+		return Result.OK(massage);
 	}
 
 	 @AutoLog(value = "装箱单面辅料JSON")

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/entity/SyPackingListFabricItem.java

@@ -45,6 +45,14 @@ public class SyPackingListFabricItem implements Serializable {
 	//@Excel(name = "发运明细子表id", width = 15)
 	@ApiModelProperty(value = "发运明细子表id")
 	private String syShippingDetailsItemId;
+	/**销售订单主表id*/
+	// @Excel(name = "销售订单主表id", width = 15)
+	@ApiModelProperty(value = "销售订单主表id")
+	private String syOrderDataId;
+	/**销售订单子表id*/
+	//@Excel(name = "销售订单主表id", width = 15)
+	@ApiModelProperty(value = "销售订单子表id")
+	private String syOrderDataItemId;
 	/**业务员*/
     @Excel(name = "业务员 Merchandiser", width = 15)
 	@ApiModelProperty(value = "业务员")

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/ISyPackingListFabricService.java

@@ -65,7 +65,7 @@ public interface ISyPackingListFabricService extends IService<SyPackingListFabri
 	//分页查询
 	IPage<SyPackingListFabric> selectPage(IPage<SyPackingListFabric> page,QueryWrapper<SyPackingListFabric> queryWrapper);
 
-	void getU8Data();
+	String getU8Data();
 
 	boolean submitBatch(String[] ids);
 

+ 96 - 79
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -128,6 +128,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			entity.setSmallPo(detailsItem.getSmallPo());//小po
 			entity.setOmpoAccount(detailsItem.getOmpoAccount());
 			entity.setOmpoIdItem(detailsItem.getOmpoIdItem());
+			entity.setSyOrderDataItemId(detailsItem.getSyOrderDataItemId());
+			entity.setSyOrderDataId(detailsItem.getSyOrderDataId());
 			entity.setOmpoId(detailsItem.getOmpoId());
 			entity.setInventoryQuantity(entity.getActualDeclaredQuantity());//入库数量=实际报关数量
 			entity.setDistributionPoint(detailsItem.getDistributionPoint());//分销点
@@ -532,6 +534,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				SyShippingDetailsItem item=syShippingDetailsItemMapper.selectById(s1.getSyShippingDetailsItemId());
 				if(item!=null){
 					//规格型号	超发	发运明细剩余数量	业务部门		价格	总价(计算)
+
+					s1.setSyOrderDataItemId(item.getSyOrderDataItemId());
+					s1.setSyOrderDataId(item.getSyOrderDataId());
 					s1.setSalesDepartment(item.getSalesDepartment());//业务部门
 					syPackingListFabric.setGarmentFactory(item.getGarmentFactory());//主表的成衣
 					syPackingListFabric.setCustomerAbbreviation(item.getCustomerAbbreviation());//客户简称
@@ -643,6 +648,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					item.setOmpoIdItem(syShippingDetailsItem.getOmpoIdItem());
 					item.setOmpoAccount(syShippingDetailsItem.getAccount());
 
+					item.setSyOrderDataItemId(syShippingDetailsItem.getSyOrderDataItemId());
+					item.setSyOrderDataId(syShippingDetailsItem.getSyOrderDataId());
+
 					if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("04")>-1
 							&&!item.getInventoryCcode().equals("0499")){
 						//满足条件
@@ -857,7 +865,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			map7.put("DDATE",createDate);//日期(格式2015-01-01)
 			map7.put("CMAKER",createBy);//制单人
 			map7.put("cVouchType",1);//传1
-			map7.put("CRDCODE","委外入库");//入库类别
+			map7.put("CRDCODE","12");//入库类别
 			map7.put("CGLTYPE","委外订单");//来源单据类型
 
 
@@ -873,7 +881,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 
 			if(mapt.get("account").equals("903")){//查询委外订单主表数据	顺序---1
 				orderData=syPackingListTailoringMapper.getOmOrPo("om_momain","cCode='"+mapt.get("mpOrder")+"'","moid");
-				map.put("CRDCODE","委外入库");//入库类别(采购入库/委外入库)
+				map.put("CRDCODE","12");//入库类别(采购入库/委外入库)
 				map.put("CGLTYPE","委外订单");//来源单据类型
 				map4.put("CGLTYPE","销售发货单");//来源单据类型
 				map5.put("CGLTYPE","委外订单");//来源单据类型
@@ -884,7 +892,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				}else{
 					orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+mapt.get("orderNumber")+"'","POID");//根据采购订单号判断
 				}
-				map.put("CRDCODE","采购入库");//入库类别(采购入库/委外入库)
+				map.put("CRDCODE","11");//入库类别(采购入库/委外入库)
 				map.put("CGLTYPE","采购订单");//来源单据类型
 				map4.put("CGLTYPE","销售发货单");//来源单据类型
 				map5.put("CGLTYPE","采购订单");//来源单据类型
@@ -974,8 +982,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 						}else{
 							JSONObject mapItem7=new JSONObject();
 							getcFree(mapItem7,mapStr1);
-							mapItem7.put("ALLCAUTOIDCOL","MODetailsID");//订单明细ID对应字段名(固定MOMaterialsID) MOMaterialsID
-							mapItem7.put("AUTOID_ALL",mapStr1.get("MODetailsID"));//关联明细ID
+							mapItem7.put("POAUTOIDCOL","MODetailsID");//订单明细ID对应字段名(固定MOMaterialsID) MOMaterialsID
+							mapItem7.put("AUTOID_PO",mapStr1.get("MODetailsID"));//关联明细ID
 							mapItem7.put("CINVCODE",mapStr1.get("cInvCode"));//存货编码(如果来源单据是委外订单,此字段需要传该订单的子件编码)
 							mapItem7.put("IQUANTITY",mapStr1.get("iQuantity"));//数量
 							mapItem7.put("CBATCH",item.getDyelotNumber());//批号
@@ -983,6 +991,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 						}
 						String cSOCode=syPackingListFabricMapper.getSO_SOMain(mapStr1.get("isosid").toString());
 						map7.put("CWHCODE",mapStr1.get("cVenDefine2"));
+						map2.put("CWHCODE",mapStr1.get("cVenDefine2"));//仓库编码
 						map7.put("CVENCODE",mapStr1.get("cVenCode"));
 						map7.put("cOrderCode",cSOCode);
 						for (Map<String,Object> stringObjectMap : orderDataItem3){
@@ -1008,7 +1017,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					String wheCode=syPackingListTailoringMapper.getWhCodeByVenCode(mapt.get("CVENCODE").toString());
 					if(wheCode!=null){
 						map.put("CWHCODE",wheCode);//仓库编码
-						map2.put("CWHCODE",wheCode);//仓库编码
 						map4.put("CWHCODE",wheCode);//仓库编码
 						mapItem3.put("CWHCODE",wheCode);//仓库编码	这个是子表需要字段
 						mapItem6.put("CWHCODE",wheCode);//仓库编码
@@ -1117,9 +1125,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		text(mapList3,"销售发货单");
 		text(mapList5,"采购发票单");
 		if(mapList2!=null&&mapList2.size()>0){
-			text(mapList2,"核销出库单");
+			text(mapList2,"材料出库单");
 			text(mapList7,"印厂采购入库单");
 		}
+		if(true){
+			return null;
+		}
 		String isSucceed=null;
 		if(mapList2!=null&&mapList2.size()>0&&main.getIsSucceed()!=null){//印花
 			JSONArray resturn2 = InterfaceConnUtils.doPost(mapList2,"materialout_import");//采购入库单
@@ -1400,63 +1411,65 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 	//@Override
 	//@Transactional
 	@Scheduled(fixedRate=1000*60*3)
-	public void getU8Data (){
-		try {
-			SimpleDateFormat sf = new SimpleDateFormat("yyMMdd");
-			String[] arrs = syPackingListFabricItemMapper.getu8Data();//获取发运明细已提交的辅料
-			Map<String, List<String>> maps = new HashMap<>();//获取两个账套
-			for (String arr : arrs) {
-				String account = arr.substring(0, 3);
-				String id = arr.substring(3);
-				if (maps.containsKey(account)) {
-					maps.get(account).add(id);
-				} else {
-					maps.put(account, new ArrayList<>());
-					maps.get(account).add(id);
-				}
+	public String getU8Data (){
+		String massage="";
+		int num=0;
+		int num1=0;
+		SimpleDateFormat sf = new SimpleDateFormat("yyMMdd");
+		String[] arrs = syPackingListFabricItemMapper.getu8Data();//获取发运明细已提交的辅料
+		Map<String, List<String>> maps = new HashMap<>();//获取两个账套
+		for (String arr : arrs) {
+			String account = arr.substring(0, 3);
+			String id = arr.substring(3);
+			if (maps.containsKey(account)) {
+				maps.get(account).add(id);
+			} else {
+				maps.put(account, new ArrayList<>());
+				maps.get(account).add(id);
 			}
-			//System.out.println("maps\n"+maps);
-			for (String account : maps.keySet()) {//分成两类数据
-				//先插主表数据,然后根据主表id查询子表数据再添加
-				String sql ="select     \n" +
-						"a.id u8Id,       \n" +
-						"f.ID as  fId, \n"+
-						"'1' as is_U8_Data,    \n" +
-						"a.cMemo memo,    \n" +
-						"0 as delflag,    \n" +
-						"0 as status,     \n" +
-						"a.cMaker createby,    \n" +
-						"a.cMaker preparedBy,  \n" +
-						"a.cDefine10  exportInvoiceNo,  \n" +
-						"a.dnmaketime  preparedDate     \n" +
-						"from rdrecord32 a     \n" +
-						"left JOIN rdrecords32 b\n" +
-						"on a.id=b.id \n" +
-						"left join Inventory c\n" +
-						"on b.cInvCode=c.cInvCode\n" +
-						"LEFT JOIN Person  d\n" +
-						"ON d.cPersonCode = a.cPersonCode\n" +
-						"left join ComputationUnit e\n" +
-						"on c.cComunitCode=e.cComunitCode\n" +
-						"left join SO_SODetails f\n" +
-						"on b.iorderdid=f.iSOsID\n" +
-						"where f.ID in (" + maps.get(account).toString().
-						substring(1, maps.get(account).toString().length() - 1) + ") "+
-						"and cMaker!='进出口平台管理员'  "+
-						"and (cWhCode='PT0004' "+//面料
-						"or cWhCode='PT0005') "+//辅料
-						"and cCusCode='T020001'" ;//获取所有id
-				List<Map<String, Object>> listMain = new ArrayList<>();
-				if (account.equals("903")) {
-					listMain = senYuDataSourceThree.queryForList(sql);//903
-				} else {
-					listMain = senYuDataSourceTwo.queryForList(sql);//902
-				}
-				if (listMain.size() == 0) {
-					continue;//退出本次循环
-				}
-				List<JSONObject> jsonObjects = JsonChangeUtils.toJSONObject(listMain);
-				for (JSONObject json : jsonObjects) {//子表
+		}
+		for (String account : maps.keySet()) {//分成两类数据
+			//先插主表数据,然后根据主表id查询子表数据再添加
+			String sql ="select     \n" +
+					"a.id u8Id,       \n" +
+					"f.ID as  fId, \n"+
+					"'1' as is_U8_Data,    \n" +
+					"a.cMemo memo,    \n" +
+					"0 as delflag,    \n" +
+					"0 as status,     \n" +
+					"a.cMaker createby,    \n" +
+					"a.cMaker preparedBy,  \n" +
+					"a.cDefine10  exportInvoiceNo,  \n" +
+					"a.dnmaketime  preparedDate     \n" +
+					"from rdrecord32 a     \n" +
+					"left JOIN rdrecords32 b\n" +
+					"on a.id=b.id \n" +
+					"left join Inventory c\n" +
+					"on b.cInvCode=c.cInvCode\n" +
+					"LEFT JOIN Person  d\n" +
+					"ON d.cPersonCode = a.cPersonCode\n" +
+					"left join ComputationUnit e\n" +
+					"on c.cComunitCode=e.cComunitCode\n" +
+					"left join SO_SODetails f\n" +
+					"on b.iorderdid=f.iSOsID\n" +
+					"where f.ID in (" + maps.get(account).toString().
+					substring(1, maps.get(account).toString().length() - 1) + ") "+
+					"and cMaker!='进出口平台管理员'  "+
+					"and (cWhCode='PT0004' "+//面料
+					"or cWhCode='PT0005') "+//辅料
+					"and cCusCode='T020001'" ;//获取所有id
+			List<Map<String, Object>> listMain = new ArrayList<>();
+			if (account.equals("903")) {
+				listMain = senYuDataSourceThree.queryForList(sql);//903
+			} else {
+				listMain = senYuDataSourceTwo.queryForList(sql);//902
+			}
+			if (listMain.size() == 0) {
+				continue;//退出本次循环
+			}
+			List<JSONObject> jsonObjects = JsonChangeUtils.toJSONObject(listMain);
+			for (JSONObject json : jsonObjects) {//子表
+				try{
 					SyPackingListFabric sy = JSONObject.toJavaObject(json, SyPackingListFabric.class);
 					QueryWrapper<SyPackingListFabric> queryWrapperCount = new QueryWrapper<>();
 					queryWrapperCount.like("create_time", new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()));//获取今天时间
@@ -1467,8 +1480,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					sy.setDataSource("2");//直接从u8拉取的数据
 					sy.setU8Id(account + sy.getU8Id());
 					sy.setId(sy.getU8Id());
-				//	sy.setGarmentFactory(maps3.get(sy.getId()));//获取成衣工厂
-				//	syPackingListFabricMapper.insert(sy);//添加数据
 					String sql2 = "select " +
 							"b.AutoID as u8id ,\n" +
 							"b.id as u8pid,\n" +
@@ -1478,6 +1489,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							"b.cBatch as dyelotNumber ,"+
 							account + " as account,\n" +
 							"0  as delflag,\n" +
+							"f.id  as syOrderDataId,\n" +
+							"f.AutoID  as syOrderDataItemId,\n" +
 							"f.AutoID  as isosid,\n" +
 							"b.iQuantity  as inventoryQuantity,\n" +
 							"b.cbMemo as remarks,\n" +
@@ -1526,13 +1539,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 						sy1.setSyPackingListFabricId(sy.getId());//账套号+主表id
 						sy1.setId(sy1.getU8Id());
 						sy1.setIsosid(sy1.getAccount() + sy1.getIsosid());//账套号+销售订单id
+						sy1.setSyOrderDataId(sy1.getAccount() +sy1.getSyOrderDataId());
+						sy1.setSyOrderDataItemId(sy1.getAccount() +sy1.getSyOrderDataItemId());
 						sy1.setActualDeclaredQuantity(sy1.getInventoryQuantity());//给报关数量赋值
-
-						//sy1.setGroupId(sy1.getOrderNumber() + "-" + sy1.getInventoryCode() + "-" + sy1.getSize());
 						sy1.setGroupId(oConvertUtils.getId());
-
 						QueryWrapper<SyShippingDetailsItem> queryWrapper2 = new QueryWrapper<>();
-						System.out.println("isosid\t"+sy1.getIsosid());
 						queryWrapper2.eq("sy_order_data_item_id", sy1.getIsosid());
 						queryWrapper2.last("limit 1");
 						SyShippingDetailsItem syShippingDetailsItem = syShippingDetailsItemMapper.selectOne(queryWrapper2);
@@ -1558,9 +1569,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 								sy1.setSupplierCodeDyeingPlant(syShippingDetailsItem.getSupplierCode());//染厂编码
 								sy1.setSupplierDyeingPlant(syShippingDetailsItem.getSupplier());//染厂
 							}
-							//sy1.setPrice(syShippingDetailsItem.getSalesUnitPrice());//销售单价
-							//sy1.setSupplierCodePrintingPlant(syShippingDetailsItem.getSupplierCode());//染厂供应商编码
-							//sy1.setSupplierPrintingPlant(syShippingDetailsItem.getSupplierCode());//染厂供应商
 							sy1.setSupplier(syShippingDetailsItem.getSupplier());//供应商编码
 							sy1.setSupplierCode(syShippingDetailsItem.getSupplierCode());//供应商
 							sy1.setSyShippingDetailsId(syShippingDetailsItem.getShippingDetailsId());//出运明细主表id
@@ -1571,26 +1579,35 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							sy.setGarmentFactory(syShippingDetailsItem.getGarmentFactory());//获取成衣工厂
 						}
 						else{
-							throw new JeecgBootException("发运明细未有对应的数据");
+							massage+="发运明细未有对应的数据"+sy1.getIsosid();
+							//throw new JeecgBootException("发运明细未有对应的数据"+sy1.getIsosid());
 						}
 						if(sy1.getPrice()!=null&&sy1.getActualDeclaredQuantity()!=null){
 							sy1.setTotalPrice(sy1.getActualDeclaredQuantity().multiply(sy1.getPrice()));//实际报关数量*单价
 						}
 						items.add(sy1);
-						//syPackingListFabricItemMapper.insert(sy1);//插入新数据
 					}
 					if(items.size()>0){
 						sy.setSyPackingListFabricItem(items);
-						syPackingListFabricMapper.insert(sy);//添加数据
 						for (SyPackingListFabricItem item : sy.getSyPackingListFabricItem()){
-							syPackingListFabricItemMapper.insert(item);//插入新数据
+							SyPackingListFabricItem item1=syPackingListFabricItemMapper.selectById(item.getId());
+							if(item1==null){
+								syPackingListFabricItemMapper.insert(item);//插入新数据
+							}
 						}
+						SyPackingListFabric syPackingListFabric=syPackingListFabricMapper.selectById(sy.getId());
+						if(syPackingListFabric==null){
+							syPackingListFabricMapper.insert(sy);//添加数据
+						}
+						num++;
+					}else{
+						num1++;
 					}
-
+				}catch (Exception e){
+					e.printStackTrace();
 				}
 			}
-		}catch (Exception e){
-			e.printStackTrace();
 		}
+		return "成功添加了"+num+"条数据!";
 	}
 }

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

@@ -741,7 +741,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 
 			if(mapt.get("account").equals("903")){//查询委外订单主表数据	顺序---1
 				orderData=syPackingListTailoringMapper.getOmOrPo("om_momain","cCode='"+mapt.get("mpOrder")+"'","moid");
-				map.put("CRDCODE","委外入库");//入库类别(采购入库/委外入库)
+				map.put("CRDCODE","12");//入库类别(采购入库/委外入库)
 				map.put("CGLTYPE","委外订单");//来源单据类型
 				map4.put("CGLTYPE","销售发货单");//来源单据类型
 				map5.put("CGLTYPE","委外订单");//来源单据类型
@@ -752,7 +752,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				}else{
 					orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+mapt.get("orderNumber")+"'","POID");//根据采购订单号判断
 				}
-				map.put("CRDCODE","采购入库");//入库类别(采购入库/委外入库)
+				map.put("CRDCODE","11");//入库类别(采购入库/委外入库)
 				map.put("CGLTYPE","采购订单");//来源单据类型
 				map4.put("CGLTYPE","销售发货单");//来源单据类型
 				map5.put("CGLTYPE","采购订单");//来源单据类型