浏览代码

推送导出等功能调整

huxy 1 年之前
父节点
当前提交
78938fdc46
共有 18 个文件被更改,包括 296 次插入62 次删除
  1. 38 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/controller/SupplierCapacityController.java
  2. 11 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/SupplierCapacity.java
  3. 45 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo4.java
  4. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/SupplierCapacityMapper.java
  5. 7 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/xml/SupplierCapacityMapper.xml
  6. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/service/ISupplierCapacityService.java
  7. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/service/impl/SupplierCapacityServiceImpl.java
  8. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/entity/SyPreAssembledPackingListItem.java
  9. 11 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java
  10. 12 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java
  11. 26 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java
  12. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/PushJob.java
  13. 6 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/SyPackingListTailoring.java
  14. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/SyPackingListTailoringItemMapper.java
  15. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/SyPackingListTailoringMapper.java
  16. 9 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringItemMapper.xml
  17. 4 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringMapper.xml
  18. 108 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

+ 38 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/controller/SupplierCapacityController.java

@@ -20,6 +20,7 @@ import org.jeecg.modules.scas.entity.SupplierCapacity;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
+import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
 import org.jeecg.modules.scas.service.ISupplierCapacityService;
 import org.jeecgframework.poi.excel.ExcelExportUtil;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -257,4 +258,41 @@ public class SupplierCapacityController extends JeecgController<SupplierCapacity
       }
       return super.export("月份供应商合计导出", SupplierCapacityVo3.class,SupplierCapacityService.excel3(queryWrapper));
    }
+
+   @AutoLog(value = "供应链产能报表-通过供应商、列表明细导出")
+   @ApiOperation(value="供应链产能报表-通过供应商、列表明细导出", notes="供应链产能报表-通过供应商、列表明细导出")
+   @RequestMapping(value = "/excel4",method = RequestMethod.GET)
+   public ModelAndView  excel4( SupplierCapacityDto supplierCapacityDto) {
+      QueryWrapper<SupplierCapacityDto> queryWrapper = new QueryWrapper<>();//初始化
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getCsrccode())){
+         queryWrapper.eq("p.csrccode",supplierCapacityDto.getCsrccode());;//订单号
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getVenName())){
+         queryWrapper.like("p.cVenCode",supplierCapacityDto.getVenName());//供应商名称
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getPlanLotNumber())){
+         queryWrapper.eq("p.cPlanLotNumber",supplierCapacityDto.getPlanLotNumber());//计划单号
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getStartDate())){//起始日期
+         String []starts =supplierCapacityDto.getStartDate().split("-");
+         queryWrapper.nested(i->i.gt("p.dArriveYear",starts[0]).or().nested(s->s.eq("p.dArriveYear",starts[0]).ge("p.dArriveMonth",starts[1])));
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getEndDate())){//结束日期
+         String []end =supplierCapacityDto.getEndDate().split("-");
+         queryWrapper.nested(i->i.lt("p.dArriveYear",end[0]).or().nested(s->s.eq("p.dArriveYear",end[0]).le("p.dArriveMonth",end[1])));
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getOrderType())){//订单类型
+         queryWrapper.eq("p.iOrderType",supplierCapacityDto.getOrderType());//订单类型iOrderType
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getCVenCodeType())){//供应商类型
+         queryWrapper.eq("p.cVenCodeType",supplierCapacityDto.getCVenCodeType());//供应商类型cVenCodeType
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getItemNumber())){//款号
+         queryWrapper.like("p.itemnumber",supplierCapacityDto.getItemNumber());//供应商类型cVenCodeType
+      }
+      if(oConvertUtils.isNotEmpty(supplierCapacityDto.getCDepCode())){//部门
+         queryWrapper.eq("p.cDepCode",supplierCapacityDto.getCDepCode());//部门
+      }
+      return super.export("供应商列表明细导出", SupplierCapacityVo4.class,SupplierCapacityService.excel4(queryWrapper));
+   }
 }

+ 11 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/SupplierCapacity.java

@@ -18,18 +18,23 @@ public class SupplierCapacity {
     @ApiModelProperty(value = "订单号")
     private String csrccode;//订单号
 
+    @Excel(name = "计划单号", width = 30)
     @ApiModelProperty(value = "计划单号")
     private String cPlanLotNumber;//计划单号
 
+    @Excel(name = "部门", width = 30)
     @ApiModelProperty(value = "部门")
     private String cDepCode;//部门
 
+    @Excel(name = "款号", width = 30)
     @ApiModelProperty(value = "款号")
     private String itemNumber;//款号
 
+    @Excel(name = "业务员", width = 30)
     @ApiModelProperty(value = "业务员")
     private String cPersonCode;//业务员
 
+    @Excel(name = "供应商", width = 30)
     @ApiModelProperty(value = "供应商")
     private String cVenCode;//供应商
 
@@ -39,6 +44,7 @@ public class SupplierCapacity {
     @ApiModelProperty(value = "订单类型")
     private String iOrderType;//订单类型
 
+    @Excel(name = "数量", width = 30,type = 4,numFormat = "#.##")
     @ApiModelProperty(value = "数量")
     private BigDecimal iQuantity;//数量
 
@@ -51,12 +57,16 @@ public class SupplierCapacity {
     @ApiModelProperty(value = "件数")
     private BigDecimal total;//件数
 
-    @ApiModelProperty(value = "计划到货月份")
+    @Excel(name = "预约发货月份", width = 30)
+    @ApiModelProperty(value = "预约发货月份")
     private Integer arriveMonth;//计划到货月份
 
     @ApiModelProperty(value = "计划到货日期")
     private String dArriveDate;//计划到货日期
 
+    @Excel(name = "工时(分)", width = 30)
     @ApiModelProperty(value = "系数")
     private BigDecimal coefficient;//系数
+
+
 }

+ 45 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo4.java

@@ -0,0 +1,45 @@
+package org.jeecg.modules.scas.entity.vo;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+@Data
+public class SupplierCapacityVo4 {
+
+    @Excel(name = "计划单号", width = 25)
+    @ApiModelProperty(value = "计划单号")
+    private String cPlanLotNumber;//计划单号
+
+    @Excel(name = "部门", width = 15)
+    @ApiModelProperty(value = "部门")
+    private String cDepCode;//部门
+
+    @Excel(name = "款号", width = 25)
+    @ApiModelProperty(value = "款号")
+    private String itemNumber;//款号
+
+    @Excel(name = "业务员", width = 15)
+    @ApiModelProperty(value = "业务员")
+    private String cPersonCode;//业务员
+
+    @Excel(name = "供应商", width = 25)
+    @ApiModelProperty(value = "供应商")
+    private String cVenCode;//供应商
+
+    @Excel(name = "数量", width = 15,type = 4,numFormat = "#.##")
+    @ApiModelProperty(value = "数量")
+    private BigDecimal iQuantity;//数量
+
+    @Excel(name = "预约发货月份", width = 15)
+    @ApiModelProperty(value = "预约发货月份")
+    private String darrivedate;//计划到货月份
+
+    @Excel(name = "工时(分)", width = 15)
+    @ApiModelProperty(value = "系数")
+    private BigDecimal coefficient;//系数
+
+}

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/SupplierCapacityMapper.java

@@ -13,6 +13,7 @@ import org.jeecg.modules.scas.entity.SupplierCapacity;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
+import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
 
 import java.util.List;
 import java.util.Map;
@@ -40,4 +41,6 @@ public interface SupplierCapacityMapper extends BaseMapper<SupplierCapacity> {
     List<SupplierCapacity> selectPage2(@Param("begin")Integer begin, @Param("end")Integer end, @Param("ew")QueryWrapper<SupplierCapacityDto> queryWrapper);
 
     long selectCounts(@Param("ew")QueryWrapper<SupplierCapacityDto> queryWrapper);
+
+    List<SupplierCapacityVo4> excel004(@Param("ew")QueryWrapper<SupplierCapacityDto> queryWrapper);
 }

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/xml/SupplierCapacityMapper.xml

@@ -201,4 +201,11 @@
          order by p.cVenCode,p.dArriveDate
     </select>
 
+    <select id="excel004" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4">
+         --供应商	月份	数量	累计入库数量	能耗(能耗相加的汇总)
+        select cPlanLotNumber,cDepCode,itemNumber,cPersonCode,cVenCode,iQuantity,darrivedate,coefficient
+        from Supplier_Capacity_Test p
+        ${ew.customSqlSegment}
+    </select>
+
 </mapper>

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/service/ISupplierCapacityService.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
+import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
 
 import java.util.List;
 import java.util.Map;
@@ -28,4 +29,6 @@ public interface ISupplierCapacityService extends IService<SupplierCapacity> {
     public IPage<SupplierCapacity> selectPage(IPage<SupplierCapacity> page, QueryWrapper<SupplierCapacityDto> queryWrapper);
 
     IPage<SupplierCapacity>  selectPage2(Integer begin, Integer end, QueryWrapper<SupplierCapacityDto> queryWrapper);
+
+    List<SupplierCapacityVo4> excel4(QueryWrapper<SupplierCapacityDto> queryWrapper);
 }

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/service/impl/SupplierCapacityServiceImpl.java

@@ -12,6 +12,7 @@ import org.jeecg.modules.scas.entity.SupplierCapacity;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
 import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
+import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
 import org.jeecg.modules.scas.mapper.SupplierCapacityMapper;
 import org.jeecg.modules.scas.service.ISupplierCapacityService;
 import org.jeecgframework.poi.excel.ExcelExportUtil;
@@ -50,6 +51,10 @@ public class SupplierCapacityServiceImpl extends ServiceImpl<SupplierCapacityMap
         return supplierCapacityMapper.excel003(queryWrapper);
     }
 
+    @DS("multi-three")
+    public List<SupplierCapacityVo4> excel4(QueryWrapper<SupplierCapacityDto> queryWrapper) {
+        return supplierCapacityMapper.excel004(queryWrapper);
+    }
     @DS("multi-three")
     public IPage<SupplierCapacity> selectPage(IPage<SupplierCapacity> page, QueryWrapper<SupplierCapacityDto> queryWrapper) {
         //return supplierCapacityMapper.selectPage(queryWrapper);

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/entity/SyPreAssembledPackingListItem.java

@@ -517,6 +517,7 @@ public class SyPreAssembledPackingListItem implements Serializable {
 				}
 			}
 		}
+
 		//System.out.println("totalVolume\t"+totalVolume+"\ttotalNetWeight\t"+totalNetWeight+"\ttotalGrossWeight\t"+totalGrossWeight);
 		return
 			"," +

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

@@ -585,7 +585,12 @@ public class SyPackingListFabricController implements Job {
 			/* List<SyPackingListFabricItem> fabricItemList=syPackingListFabricService.getList(fabric.getId());
 			 fabric.setSyPackingListFabricItem(fabricItemList);*/
 		 }
-		 String message=syPackingListFabricService.pushInvoice(listFabrics);
+		 String message="";
+		 try {
+			 message = syPackingListFabricService.pushInvoice(listFabrics);
+		 }catch (Exception e){
+		 	e.printStackTrace();
+		 }
 		 syPackingListFabricService.updateBatchById(listFabrics);
 		 List<String> msgs=new ArrayList<>();
 		 List<String> errors=new ArrayList<>();
@@ -1153,7 +1158,11 @@ public class SyPackingListFabricController implements Job {
 			 result.setMessage("数据库未找到数据");
 			 return result;
 		 }
-		 syPackingListFabric.setPushState("4");
+		 if(syPackingListFabric.getPushState().equals("4")){
+			 syPackingListFabric.setPushState("4");
+		 }else{
+			 syPackingListFabric.setPushState("0");
+		 }
 		 syPackingListFabricService.updateById(syPackingListFabric);
 		 result.setSuccess(true);
 		 result.setMessage("修改成功");

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

@@ -397,12 +397,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		List<SyPackingListFabricItem> items=syPackingListFabricItemMapper.selectByMainId(syPackingListFabric.getId());
 		List<SyPackingListFabricItem> items2=new ArrayList<>();
 		Map<String,SyPackingListFabricItem> maps=new HashMap<>();
-		for (SyPackingListFabricItem item : syPackingListFabricItemList){
+		for (SyPackingListFabricItem item : items){
 			maps.put(item.getId(),item);
 		}
 		//2.子表数据重新插入
 		int i=0;
-		for(SyPackingListFabricItem entity : items) {
+		for(SyPackingListFabricItem entity : syPackingListFabricItemList) {
 			if(maps.containsKey(entity.getId())){
 				//entity.setDelFlag("0");
 				//外键设置
@@ -445,7 +445,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							updateQuantity(actualDeclaredQuantity.negate(),entity.getSyShippingDetailsItemId(),entity.getMasterMetering());
 						}
 					}
-					items2.add(entity1);//获取所有子表
+					items2.add(entity);//获取所有子表
 				}
 			}else{
 				syPackingListFabricItemMapper.deleteById(entity.getId());
@@ -2453,7 +2453,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			jsonObject1.put("CMAKER","进出口平台管理员");//制单人
 			jsonObject1.put("CVERIFIER","进出口平台管理员");//审核人
 			jsonObject1.put("CACCID","103");//账套号
-			jsonObject1.put("CTYPE","");//发票类型
+			jsonObject1.put("CTYPE","专用");//发票类型
+			System.out.println("成衣销售order\t"+order);
+			if(order.get("cCusCode").equals("T020001")){
+				jsonObject1.put("CTYPE","普通");//发票类型
+			}
 			jsonObject1.put("CGLTYPE","销售出库单");//上游单据
 			jsonObject1.put("CDEFINE11",syPackingListFabric.getEndCustomer());//最终客户
 
@@ -2482,6 +2486,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				jsonObject1.put("IEXCHRATE",rate.get("nflat").toString());//汇率(如果传空,接口默认1)cPayCode
 			}
 			JSONArray jsonArrays=new JSONArray();
+			List<Object> autoIds=new ArrayList<>();
 			for (SyPackingListFabricItem item : listFabricItems){
 				JSONObject  jsonObject=new JSONObject();
 				if(item.getMasterMetering().equalsIgnoreCase("KG")){
@@ -2491,11 +2496,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				}
 				jsonObject.put("CINVCODE",item.getInventoryCode());//存货编码
 				//jsonObject.put("size",item.getInventoryCode());//存货编码
-				jsonObject.put("DISAUTOIDCOL","DISAUTOIDCOL");//对应类型
+				jsonObject.put("DISAUTOIDCOL","AUTOID");//对应类型
 				boolean bool=true;
 				for (Map<String,Object> map : invoices){
 					if(Double.parseDouble(map.get("iQuantity").toString())==Double.parseDouble(jsonObject.get("IQUANTITY").toString())&&
-							map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode())){
+							map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode())&&!autoIds.contains(map.get("AutoID"))){
+						autoIds.add(map.get("AutoID"));
 						jsonObject.put("AUTOID_DIS",map.get("AutoID"));
 						//System.out.println("map\t"+map);
 						getcFree(jsonObject,map);

+ 26 - 16
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java

@@ -1327,7 +1327,11 @@ public class SyPackingListTailoringController implements Job {
 			 result.setMessage("数据库未找到数据");
 			 return result;
 		 }
-		 syPackingListTailoring.setPushState("4");
+		 if(syPackingListTailoring.getPushState().equals("4")){
+			 syPackingListTailoring.setPushState("4");
+		 }else{
+			 syPackingListTailoring.setPushState("0");
+		 }
 		 syPackingListTailoringService.updateById(syPackingListTailoring);
 		 result.setSuccess(true);
 		 result.setMessage("修改成功");
@@ -1951,6 +1955,7 @@ public class SyPackingListTailoringController implements Job {
 		 Map<String,List<SyPackingListTailoring>> listMap=new HashMap<>();
 		 Map<String,List<String>> listStrMap=new HashMap<>();
 		 for (SyPackingListTailoring tailoring : listTailorings){
+			 tailoring.setSaleInvoiceError(null);
 		 	 if (!tailoring.getPushState().equals("1")){
 		 		 return "需要装箱单全部推送成功,才能推送发票";
 			 }
@@ -1991,7 +1996,7 @@ public class SyPackingListTailoringController implements Job {
 			 Map<String,Object> maps=new HashMap<>();
 			 maps.put("account",key);//账套号
 			 maps.put("account1",key);//账套号
-			 for (int i=0;i<2;i++){
+			 for (int i=0;i<3;i++){
 			 	/*if(maps.get("account").equals("103")){
 					message+=syPackingListTailoringService.pushInvoice3(listTailorings, maps);
 					message+=syPackingListTailoringService.pushInvoice6(listTailorings, maps);
@@ -2002,22 +2007,27 @@ public class SyPackingListTailoringController implements Job {
 					message+=syPackingListTailoringService.pushInvoice1(listTailorings, maps);
 					message+=syPackingListTailoringService.pushInvoice6(listTailorings, maps);
 				}*/
-				 if(i==0){
-					 maps.put("account","103");//账套号
-					 message+=syPackingListTailoringService.pushInvoice3(listTailorings, maps);
-					 message+=syPackingListTailoringService.pushInvoice6(listTailorings, maps);
-				 }else if(i==1){
-					 maps.put("account","102");//账套号
-					 message+=syPackingListTailoringService.pushInvoice2(listTailorings, maps);
-					 message+=syPackingListTailoringService.pushInvoice5(listTailorings, maps);
-				 }else if(i==2){
-					 maps.put("account","101");//账套号
-					 message+=syPackingListTailoringService.pushInvoice1(listTailorings, maps);
-					 message+=syPackingListTailoringService.pushInvoice4(listTailorings, maps);
-				 }
+			 	try{
+					if(i==0){
+						maps.put("account","103");//账套号
+						message+=syPackingListTailoringService.pushInvoice3(listTailorings, maps);
+						message+=syPackingListTailoringService.pushInvoice6(listTailorings, maps);
+					}else if(i==1){
+						maps.put("account","102");//账套号
+						message+=syPackingListTailoringService.pushInvoice2(listTailorings, maps);
+						message+=syPackingListTailoringService.pushInvoice5(listTailorings, maps);
+					}else if(i==2){
+						maps.put("account","101");//账套号
+						message+=syPackingListTailoringService.pushInvoice1(listTailorings, maps);
+						message+=syPackingListTailoringService.pushInvoice4(listTailorings, maps);
+					}
+				}catch (Exception e){
+			 		e.printStackTrace();
+				}
 			 }
 		 }
-		 syPackingListTailoringService.updateBatchById(listTailorings);
+		 boolean bool= syPackingListTailoringService.updateBatchById(listTailorings);
+		 log.info("listTailorings\n"+listTailorings);
 		 List<String> msgs=new ArrayList<>();
 		 List<String> errors=new ArrayList<>();
 		 for (SyPackingListTailoring tailoring : listTailorings){

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/PushJob.java

@@ -33,9 +33,10 @@ public class PushJob implements Job {
     public void execute(JobExecutionContext context) throws JobExecutionException {
         long startTime = System.currentTimeMillis();
         QueryWrapper<SyShippingOrder> queryWrapper= new QueryWrapper();
-        queryWrapper.nested(i->i.eq("time_Stuta",1).or().eq("time_Stuta",3));//1、待推送,2、推送成功,3、推送失败
-        //queryWrapper.eq("time_Stuta","1");//待推送
+        //queryWrapper.nested(i->i.eq("time_Stuta",1).or().eq("time_Stuta",3));//1、待推送,2、推送成功,3、推送失败
+        queryWrapper.eq("time_Stuta","1");//待推送
         queryWrapper.eq("del_flag","0");
+        //queryWrapper.eq("id","17cdedf723b142b2bc95c0c49d9decce");
         //queryWrapper.eq("ready_Fabric","成衣");
         //queryWrapper.last("limit 2");
       //  queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or().like("recording_Error","超时"))) ;//推送中

+ 6 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/SyPackingListTailoring.java

@@ -188,6 +188,12 @@ public class SyPackingListTailoring implements Serializable {
 	@ApiModelProperty(value = "业务员")
 	private String salesman;
 
+	/**业务员*/
+	//@Excel(name = "业务员", width = 15)
+	@ApiModelProperty(value = "业务员")
+	@TableField(exist = false)
+	private String salesman1;
+
 	/*recording*/
 	@ApiModelProperty(value = "u8推送记录")
 	private String recording;
@@ -287,7 +293,6 @@ public class SyPackingListTailoring implements Serializable {
 			}
 		}
 	}*/
-
 	/**是否被参照(0:无,1:被预托书参照,2:被装箱单参照)*/
 	//@Excel(name = "是否被参照(0:无,1:被预托书参照,2:被装箱单参照)", width = 15)
 	@ApiModelProperty(value = "是否被参照(0:无,1:被预托书参照,2:被装箱单参照)")

+ 3 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/SyPackingListTailoringItemMapper.java

@@ -37,7 +37,7 @@ public interface SyPackingListTailoringItemMapper extends BaseMapper<SyPackingLi
 
 	public List<SizeTable> sizes(String id);
 
-	public List<SizeTable> sizeAlls(@Param("list")String[] ids);
+	public List<SizeTable> sizeAlls(@Param("list")String... ids);
 
     List<SyPackingListTailoringItem> getList(String id);
 
@@ -47,4 +47,6 @@ public interface SyPackingListTailoringItemMapper extends BaseMapper<SyPackingLi
     List<Map<String, Object>> getInvoice1(@Param("codes") String[] toArray);
 
 	String getiTaxPrice(String id);
+
+	String getiTaxPrice2(String id);
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/SyPackingListTailoringMapper.java

@@ -74,7 +74,7 @@ public interface SyPackingListTailoringMapper extends BaseMapper<SyPackingListTa
 
     public List<SyPackingListTailoring> queryByList(String id);
 
-    List<Map<String, Object>> getSuppliers(@Param("codes")String[] toArray);
+    List<Map<String, Object>> getSuppliers(@Param("tableName")String tableName,@Param("codes")String[] toArray);
 
     //获取供应商,区分来源
     public Map<String,Object> getSoMainCode(String id);

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringItemMapper.xml

@@ -360,4 +360,13 @@
         where rdrecords01.autoid=#{value }
     </select>
 
+	<select id="getiTaxPrice2" parameterType="java.lang.String" resultType="java.lang.String">
+		select
+        OM_MODetails.iTaxPrice iTaxPrice
+        from rdrecords01
+        left join OM_MODetails
+        on OM_MODetails.MODetailsID  =rdrecords01.iOMoDID
+        where rdrecords01.autoid=#{value }
+    </select>
+
 </mapper>

+ 4 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringMapper.xml

@@ -335,7 +335,9 @@
 		      (select supplier_code from sy_packing_list_tailoring_item
 		     where sy_packing_list_tailoring_id=sy_packing_list_tailoring.id limit 1) supplier_code,
 		      (select ompo_account from sy_packing_list_tailoring_item
-		     where sy_packing_list_tailoring_id=sy_packing_list_tailoring.id limit 1) ompo_account
+		     where sy_packing_list_tailoring_id=sy_packing_list_tailoring.id limit 1) ompo_account,
+		      (select salesman from sy_packing_list_tailoring_item
+		     where sy_packing_list_tailoring_id=sy_packing_list_tailoring.id limit 1) salesman1
 		from sy_packing_list_tailoring
 		where del_flag=0 and id in
 		(select tailoring_fabric_id
@@ -345,7 +347,7 @@
 	</select>
 
     <select id="getSuppliers"  parameterType="java.lang.String" resultType="java.util.HashMap">
-        select cVenCode ,ccode  from rdrecord01
+        select cVenCode ,ccode,cPersonCode   from ${tableName}
         where ccode in
         <foreach collection="codes" item="value" index="index" open="(" separator="," close=")">
             #{value}

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

@@ -600,9 +600,21 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		SyPackingListTailoring syPackingListTailoring=syPackingListTailoringMapper.getMainId(id);
 		List<SyPackingListTailoringItem> items=syPackingListTailoringItemMapper.queryId(id);
 		List<SizeTable> size=syPackingListTailoringItemMapper.sizes(syPackingListTailoring.getId());
+		List<SizeTable> sizes=syPackingListTailoringItemMapper.sizeAlls(syPackingListTailoring.getId());
+		Map<String,List<SizeTable>> mapItems=new HashMap<>();
+		for (SizeTable sizeTable : sizes){
+			if(mapItems.containsKey(sizeTable.getGroupId())){
+				mapItems.get(sizeTable.getGroupId()).add(sizeTable);
+			}else{
+				List<SizeTable> sizeTables=new ArrayList<>();
+				sizeTables.add(sizeTable);
+				mapItems.put(sizeTable.getGroupId(),sizeTables);
+			}
+		}
 		syPackingListTailoring.setSizeTables(size);//获取id
 		for (SyPackingListTailoringItem item : items){
-			item.setSizeTables(syPackingListTailoringItemMapper.size(item.getGroupId(),item.getSyPackingListTailoringId()));
+			//item.setSizeTables(syPackingListTailoringItemMapper.size(item.getGroupId(),item.getSyPackingListTailoringId()));
+			item.setSizeTables(mapItems.get(item.getGroupId()));
 		}
 		syPackingListTailoring.setSyPackingListTailoringItemList(items);
 		long end= System.currentTimeMillis();
@@ -1934,7 +1946,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 	}
 
 	/**
-	 * 采购委外入库单
+	 * 采购委外发票
 	 * @param listTailorings
 	 * @param maps
 	 * @return
@@ -1943,22 +1955,25 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		long startTime = System.currentTimeMillis();
 		String message="";
 		List<String> codes=getList(listTailorings,maps.get("account").toString());//获取出库单号
-		System.out.println("成衣查看入库单号\t"+codes);
+		System.out.println(maps.get("account")+"账套成衣查看入库单号\t"+codes);
 		if(codes.size()==0){
 			return "无可推送数据!";
 		}
+		String account=maps.get("account").toString();
 		Map<String,List<String>> customers=getSuppliers(codes);//key:供应商编码,value:出库单id
+		if(account.equals("102")){
+			customers=getSuppliers2(codes);//key:供应商编码,value:出库单id
+		}
 		Map<String,List<SyPackingListTailoringItem>> listTailoringItemMaps=getListTailoringItemMaps(customers,listTailorings);//key:供应商编码,value:对应子表
 		Map<String,List<SyPackingListTailoring>> listTailoringMaps=getListTailoringMaps(customers,listTailorings);//key:供应商编码,value:对应主表
 		Map<String,List<SyPackingListTailoring>> codeMaps=new HashMap<>();//key:传入销售发票单id,value:主表数据
 		JSONArray jsonArrays1=new JSONArray();
 		String code=purchaseWarehousingMapper.getMaxCode("cpbvcode ","PurBillVouch","cmaketime");//发票号
-		String account=maps.get("account").toString();
 
 		for (String customer : customers.keySet()){
 			SyPackingListTailoring syPackingListTailoring=listTailoringMaps.get(customer).get(0);
 			Map<String, Object> orderData=null;
-			if(account.equals("103")||account.equals("101")){
+			if(account.equals("103")||maps.get("account1").toString().equals("101")){
 				orderData=syPackingListTailoringMapper.getOmOrPo("om_momain",
 				"cCode=(select  top 1 cOrderCode from rdrecord01 where ccode='"+syPackingListTailoring.getRdrecord32Code()+"')","MOID");
 			}else{
@@ -2001,18 +2016,25 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				jsonObject1.put("IEXCHRATE",rate.get("nflat").toString());//汇率(如果传空,接口默认1)cPayCode
 			}
 			JSONArray jsonArrays=new JSONArray();
+			List<Object> autoIds=new ArrayList<>();
 			for (SyPackingListTailoringItem item : listTailoringItems){
 				JSONObject  jsonObject=new JSONObject();
 				jsonObject.put("IQUANTITY",item.getTotal());//净重
 				jsonObject.put("size",item.getSize());//尺码
 				jsonObject.put("CINVCODE",item.getInventoryCode());//存货编码
 				jsonObject.put("CDEFINE28",item.getSmallPo());//小po
-				jsonObject.put("DISAUTOIDCOL","DISAUTOIDCOL");//对应类型
+				jsonObject.put("POAUTOIDCOL","Autoid");//对应类型
 				for (Map<String,Object> map : invoices){
 					if(Double.parseDouble(map.get("iQuantity").toString())==Double.parseDouble(jsonObject.get("IQUANTITY").toString())&&
-					   map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode())&&map.get("cFree2").equals(item.getSize())){
+					   map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode())&&map.get("cFree2").equals(item.getSize())
+							&&jsonObject.get("size").equals(item.getSize()) &&!autoIds.contains(map.get("AutoID"))){
+						autoIds.add(map.get("AutoID"));
 						jsonObject.put("AUTOID_PO",map.get("AutoID"));
-						jsonObject.put("IORITAXCOST",syPackingListTailoringItemMapper.getiTaxPrice(map.get("AutoID").toString()));
+						if(maps.get("account1").toString().equals("101")){
+							jsonObject.put("IORITAXCOST",syPackingListTailoringItemMapper.getiTaxPrice2(map.get("AutoID").toString()));
+						}else{
+							jsonObject.put("IORITAXCOST",syPackingListTailoringItemMapper.getiTaxPrice(map.get("AutoID").toString()));
+						}
 						getcFree(jsonObject,map);
 						break;
 					}
@@ -2034,36 +2056,47 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		System.out.println("jsonArrays1\n"+jsonArrays1);
 		text(jsonArrays1,"测试合并推送成衣采购发票");
 		JSONArray resturnJsonArrays = InterfaceConnUtils.doPost(jsonArrays1,"purinvoice_import");//采购发票单
-		Map<String,String> codeMaps2 = result(resturnJsonArrays,"销售发票",account);
+		Map<String,String> codeMaps2 = result(resturnJsonArrays,"采购发票",account);
 		for (String code1 : codeMaps.keySet()){
 			List<SyPackingListTailoring> listTailoringList=codeMaps.get(code1);
 			//List<String> ids=new ArrayList<>();
 			for (SyPackingListTailoring tailoring : listTailoringList){
 				//ids.add(fabric.getId());
 				if (codeMaps2.get(code1).indexOf("失败")>-1){
-					tailoring.setSaleInvoiceError(codeMaps2.get(code1));
+					if(tailoring.getSaleInvoiceError()==null){
+						tailoring.setSaleInvoiceError(codeMaps2.get(code1));
+					}else{
+						tailoring.setSaleInvoiceError(tailoring.getSaleInvoiceError()+";"+codeMaps2.get(code1));
+					}
+					//tailoring.setSaleInvoiceError(codeMaps2.get(code1));
 				}else{
 					if(tailoring.getSaleInvoiceCode()==null){
 						tailoring.setSaleInvoiceCode(codeMaps2.get(code1));
 					}else{
 						tailoring.setSaleInvoiceCode(tailoring.getSaleInvoiceCode()+";"+codeMaps2.get(code1));
 					}
-					tailoring.setSaleInvoiceError("");
+					//tailoring.setSaleInvoiceError("");
 				}
 			}
 		}
 		return "推送成功";
 	}
 
+	/**
+	 * 銷售發票
+	 * @param listTailorings
+	 * @param maps
+	 * @return
+	 */
 	public String pushInvoices2(List<SyPackingListTailoring> listTailorings,Map<String,Object> maps) {
 		long startTime = System.currentTimeMillis();
 		String message="";
 		List<String> codes=getList2(listTailorings,maps.get("account").toString());//获取出库单号
-		System.out.println("成衣查看出库单号\t"+codes);
+		System.out.println(maps.get("account")+"账套成衣查看出库单号\t"+codes);
 		if(codes.size()==0){
 			return "无可推送数据!";
 		}
-		Map<String,List<String>> customers=getCustomers(codes);//key:供应商编码,value:出库单id
+		Map<String,List<String>> customers=getCustomers(codes,listTailorings);//key:供应商编码,value:出库单id
 		Map<String,List<SyPackingListTailoringItem>> listTailoringItemMaps=getListTailoringItemMaps(customers,listTailorings);//key:供应商编码,value:子表数据
 		Map<String,List<SyPackingListTailoring>> listTailoringMaps=getListTailoringMaps(customers,listTailorings);//key:供应商编码,value:主表数据
 		Map<String,List<SyPackingListTailoring>> codeMaps=new HashMap<>();//key:传入销售发票单id,value:主表数据
@@ -2121,15 +2154,18 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				jsonObject1.put("IEXCHRATE",rate.get("nflat").toString());//汇率(如果传空,接口默认1)cPayCode
 			}
 			JSONArray jsonArrays=new JSONArray();
+			List<Object> autoIds=new ArrayList<>();
 			for (SyPackingListTailoringItem item : listFabricItems){
 				JSONObject  jsonObject=new JSONObject();
 				jsonObject.put("IQUANTITY",item.getTotal());//净重
 				jsonObject.put("size",item.getSize());
 				jsonObject.put("CINVCODE",item.getInventoryCode());//存货编码
-				jsonObject.put("DISAUTOIDCOL","DISAUTOIDCOL");//对应类型
+				jsonObject.put("DISAUTOIDCOL","AUTOID");//对应类型
 				for (Map<String,Object> map : invoices){
 					if(Double.parseDouble(map.get("iQuantity").toString())==Double.parseDouble(jsonObject.get("IQUANTITY").toString())&&
-							map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode())){
+							map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode()) &&jsonObject.get("size").equals(item.getSize())
+							&&!autoIds.contains(map.get("AutoID"))){
+						autoIds.add(map.get("AutoID"));
 						jsonObject.put("AUTOID_DIS",map.get("AutoID"));
 						getcFree(jsonObject,map);
 						break;
@@ -2163,14 +2199,18 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			}
 			for (SyPackingListTailoring tailoring : listTailoringList){
 				if (codeMaps2.get(code1).indexOf("失败")>-1){
-					tailoring.setSaleInvoiceError(codeMaps2.get(code1));
+					if(tailoring.getSaleInvoiceError()==null){
+						tailoring.setSaleInvoiceError(codeMaps2.get(code1));
+					}else{
+						tailoring.setSaleInvoiceError(tailoring.getSaleInvoiceError()+";"+codeMaps2.get(code1));
+					}
 				}else{
 					if(tailoring.getSaleInvoiceCode()==null){
 						tailoring.setSaleInvoiceCode(codeMaps2.get(code1));
 					}else{
 						tailoring.setSaleInvoiceCode(tailoring.getSaleInvoiceCode()+";"+codeMaps2.get(code1));
 					}
-						tailoring.setSaleInvoiceError("");
+					//	tailoring.setSaleInvoiceError("");
 				}
 			}
 		}
@@ -2219,7 +2259,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			JSONObject jsonObject=jsonArray.getJSONObject(i);
 			if(jsonObject.get("Result").equals("F")){//获取发货单是否成功添加
 				//throw new JeecgBootException("账套"+account+"接口"+tableName+",原因"+ jsonObject.get("Description"));
-				codeMaps.put(jsonObject.get("ReceiptNo").toString(),pushName+"接口推送失败原因:"+jsonObject.get("Description").toString());//key:传入的单号,value:失败的信息
+				codeMaps.put(jsonObject.get("ReceiptNo").toString(),account+"账套"+pushName+"接口推送失败原因:"+jsonObject.get("Description").toString());//key:传入的单号,value:失败的信息
 			}else{
 				codeMaps.put(jsonObject.get("ReceiptNo").toString(),account+pushName+"接口"+jsonObject.get("U8ReceiptNo").toString());//key:传入的单号,value:生成的单号
 			}
@@ -2252,30 +2292,68 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		return invoices;
 	}
 
-	public Map<String,List<String>> getCustomers(List<String> codes){
-		List<Map<String,Object>> customers=syPackingListFabricMapper.getCustomers(codes.toArray(new String[codes.size()]));
+	/**
+	 * 销售发票
+	 * @param codes
+	 * @return
+	 */
+	public Map<String,List<String>> getCustomers(List<String> codes,List<SyPackingListTailoring> listTailorings){
+		/*List<Map<String,Object>> customers=syPackingListTailoringMapper.getSuppliers("rdrecord32",codes.toArray(new String[codes.size()]));
 		Map<String,List<String>> mapLists=new HashMap<>();
-		System.out.println("customers.size\t"+customers.size());
-		System.out.println("customers\t"+customers);
 		for (Map<String,Object> map : customers){
-			if(mapLists.containsKey(map.get("cCusCode"))){
-				mapLists.get(map.get("cCusCode").toString()).add(map.get("ccode").toString());
+			if(mapLists.containsKey(map.get("cVenCode").toString()+map.get("cPersonCode").toString())){
+				mapLists.get(map.get("cVenCode").toString()+map.get("cPersonCode").toString()).add(map.get("ccode").toString());
 			}else{
 				List<String> list=new ArrayList<>();
 				list.add(map.get("ccode").toString());
-				mapLists.put(map.get("cCusCode").toString(),list);
+				mapLists.put(map.get("cVenCode").toString()+map.get("cPersonCode").toString(),list);
+			}
+		}*/
+
+		Map<String,List<String>> mapLists=new HashMap<>();
+		for (SyPackingListTailoring tailoring : listTailorings){
+			if (mapLists.containsKey(tailoring.getSupplier()+tailoring.getSalesman1())){
+				mapLists.get(tailoring.getSupplier()+tailoring.getSalesman1()).add(tailoring.getRdrecord32Code());
+			}else{
+				List<String> list=new ArrayList<>();
+				list.add(tailoring.getRdrecord32Code());
+				mapLists.put(tailoring.getSupplier()+tailoring.getSalesman1(),list);
 			}
 		}
 		return mapLists;
 	}
 
+	/**
+	 * 采购发票
+	 * @param codes
+	 * @return
+	 */
 	public Map<String,List<String>> getSuppliers(List<String> codes){
-		List<Map<String,Object>> suppliers=syPackingListTailoringMapper.getSuppliers(codes.toArray(new String[codes.size()]));
+		List<Map<String,Object>> suppliers=syPackingListTailoringMapper.getSuppliers("rdrecord01",codes.toArray(new String[codes.size()]));
+		Map<String,List<String>> mapLists=new HashMap<>();
+		for (Map<String,Object> map : suppliers){
+			if(mapLists.containsKey(map.get("cVenCode").toString()+map.get("cPersonCode").toString())){
+				mapLists.get(map.get("cVenCode").toString()+map.get("cPersonCode").toString()).add(map.get("ccode").toString());
+			}else{
+				List<String> list=new ArrayList<>();
+				list.add(map.get("ccode").toString());
+				mapLists.put(map.get("cVenCode").toString()+map.get("cPersonCode").toString(),list);
+			}
+		}
+		System.out.println("mapLists\t"+mapLists);
+		return mapLists;
+	}
+
+	/**
+	 * 采购发票
+	 * @param codes
+	 * @return
+	 */
+	public Map<String,List<String>> getSuppliers2(List<String> codes){
+		List<Map<String,Object>> suppliers=syPackingListTailoringMapper.getSuppliers("rdrecord01",codes.toArray(new String[codes.size()]));
 		Map<String,List<String>> mapLists=new HashMap<>();
-		System.out.println("suppliers.size\t"+suppliers.size());
-		System.out.println("suppliers\t"+suppliers);
 		for (Map<String,Object> map : suppliers){
-			if(mapLists.containsKey(map.get("cVenCode"))){
+			if(mapLists.containsKey(map.get("cVenCode").toString())){
 				mapLists.get(map.get("cVenCode").toString()).add(map.get("ccode").toString());
 			}else{
 				List<String> list=new ArrayList<>();
@@ -2339,7 +2417,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			if(syPackingListFabric.getRecordingCode()!=null){
 				String [] strs=syPackingListFabric.getRecordingCode().split(";");
 				for (String str : strs){
-					if(str.indexOf(account+"账套销售出库单")>-1&&(syPackingListFabric.getSaleInvoiceCode()==null||syPackingListFabric.getSaleInvoiceCode().indexOf(account+"采购发票")==-1)){
+					if(str.indexOf(account+"账套销售出库单")>-1&&(syPackingListFabric.getSaleInvoiceCode()==null||syPackingListFabric.getSaleInvoiceCode().indexOf(account+"销售发票")==-1)){
 						ids.add(str.split(":")[1]);
 						syPackingListFabric.setRdrecord32Code(str.split(":")[1]);
 					}