Explorar el Código

供应商产能报表增加件数,面辅料拉取增加集装箱号

huxy hace 2 años
padre
commit
739371625f

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

@@ -48,6 +48,9 @@ public class SupplierCapacity {
     @ApiModelProperty(value = "单位")
     private String unit;//单位
 
+    @ApiModelProperty(value = "件数")
+    private BigDecimal total;//件数
+
     @ApiModelProperty(value = "计划到货月份")
     private Integer arriveMonth;//计划到货月份
 

+ 3 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo1.java

@@ -4,7 +4,6 @@ import lombok.Data;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.math.BigDecimal;
-import java.util.Date;
 
 @Data
 public class SupplierCapacityVo1 {
@@ -12,12 +11,12 @@ public class SupplierCapacityVo1 {
     private String cDepCode;//部门
     @Excel(name = "供应商", width = 30)
     private String cVenCode;//供应商
-    @Excel(name = "统计数量", width = 30)
+    @Excel(name = "数量", width = 30,type = 4,numFormat = "#.##")
     private BigDecimal iQuantity;//统计数量
-    @Excel(name = "累计入库数量", width = 30)
+    @Excel(name = "累计入库数量", width = 30,type = 4,numFormat = "#.##")
     private BigDecimal iReceivedQTY;//累计入库数量
     @Excel(name = "计划到货月份", width = 15)
     private String dArriveDate;//计划到货月份
-    @Excel(name = "能耗", width = 15)
+    @Excel(name = "工时(分)", width = 15,type = 4,numFormat = "#.##")
     private BigDecimal coefficient;//能耗
 }

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo2.java

@@ -9,12 +9,12 @@ import java.math.BigDecimal;
 public class SupplierCapacityVo2 {
     @Excel(name = "部门", width = 15)
     private String cDepCode;//部门
-    @Excel(name = "统计数量", width = 30)
+    @Excel(name = "数量", width = 30,type = 4,numFormat = "#.##")
     private BigDecimal iQuantity;//统计数量
-    @Excel(name = "累计入库数量", width = 30)
+    @Excel(name = "累计入库数量", width = 30,type = 4,numFormat = "#.##")
     private BigDecimal iReceivedQTY;//累计入库数量
     @Excel(name = "计划到货月份", width = 15)
     private String dArriveDate;//计划到货月份
-    @Excel(name = "能耗", width = 15)
+    @Excel(name = "工时(分)", width = 15,type = 4,numFormat = "#.##")
     private BigDecimal coefficient;//能耗
 }

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo3.java

@@ -9,12 +9,12 @@ import java.math.BigDecimal;
 public class SupplierCapacityVo3 {
     @Excel(name = "供应商", width = 30)
     private String cVenCode;//供应商
-    @Excel(name = "统计数量", width = 30)
+    @Excel(name = "数量", width = 30,type = 4,numFormat = "#.##")
     private BigDecimal iQuantity;//统计数量
-    @Excel(name = "累计入库数量", width = 30)
+    @Excel(name = "累计入库数量", width = 30,type = 4,numFormat = "#.##")
     private BigDecimal iReceivedQTY;//累计入库数量
     @Excel(name = "计划到货月份", width = 15)
     private String dArriveDate;//计划到货月份
-    @Excel(name = "能耗", width = 15)
+    @Excel(name = "工时(分)", width = 15,type = 4,numFormat = "#.##")
     private BigDecimal coefficient;//能耗
 }

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

@@ -190,11 +190,11 @@
         p.dArriveDate,
         sum(p.iQuantity) iQuantity,
         sum(p.iReceivedQTY) iReceivedQTY,
-        sum(p.coefficient*p.iQuantity) coefficient
+        cast(isnull(p.coefficient,'0') as decimal) coefficient
          from Supplier_Capacity_Test p
            ${ew.customSqlSegment}
-        group by p.cDepCode,p.cVenCode,p.dArriveDate
-        order by p.cDepCode,p.cVenCode,p.dArriveDate
+        group by p.cDepCode,p.cVenCode,p.dArriveDate,p.coefficient
+        order by p.cDepCode,p.cVenCode,p.dArriveDate,p.coefficient
     </select>
 
     <select id="excel002" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2">
@@ -241,11 +241,11 @@
         p.dArriveDate,
         sum(p.iQuantity) iQuantity,
         sum(p.iReceivedQTY) iReceivedQTY,
-        sum(p.coefficient*p.iQuantity) coefficient
+        cast(isnull(p.coefficient,'0') as decimal) coefficient
          from Supplier_Capacity_Test p
            ${ew.customSqlSegment}
-   group by p.cDepCode,p.dArriveDate
-    order  by p.cDepCode,p.dArriveDate
+   group by p.cDepCode,p.dArriveDate,p.coefficient
+    order  by p.cDepCode,p.dArriveDate,p.coefficient
     </select>
 
 
@@ -292,11 +292,11 @@
             p.dArriveDate,
             sum(p.iQuantity) iQuantity,
             sum(p.iReceivedQTY) iReceivedQTY,
-            sum(p.coefficient*p.iQuantity) coefficient
+            cast(isnull(p.coefficient,'0') as decimal) coefficient
          from Supplier_Capacity_Test p
            ${ew.customSqlSegment}
-         group by p.cVenCode,p.dArriveDate
-         order by p.cVenCode,p.dArriveDate
+         group by p.cVenCode,p.dArriveDate,p.coefficient
+         order by p.cVenCode,p.dArriveDate,p.coefficient
     </select>
 
 </mapper>

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/mapper/SyPackingListFabricItemMapper.java

@@ -49,4 +49,6 @@ public interface SyPackingListFabricItemMapper extends BaseMapper<SyPackingListF
 	String[] getu8Data();
 
     List<SyPackingListFabricPage> getPages(@Param("ew")QueryWrapper<SyPackingListFabric> queryWrapper);
+
+    List<String> getDocumentNos();
 }

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

@@ -203,6 +203,13 @@
 		and submit_Status='1'
 	</select>
 
+	<select id="getDocumentNos"  resultType="java.lang.String">
+		SELECT DISTINCT Document_No
+		FROM `sy_packing_list_fabric`
+		WHERE  del_flag=0
+		and Document_No not like 'ML%'
+	</select>
+
 <!--
 SELECT
     sy_order_data_id AS isosid

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

@@ -2000,8 +2000,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		String massage="";
 		int num=0;
 		int num1=0;
+		long startTime = System.currentTimeMillis();
 		SimpleDateFormat sf = new SimpleDateFormat("yyMMdd");
 		String[] arrs = syPackingListFabricItemMapper.getu8Data();//获取发运明细已提交的辅料
+		List<String> documentNos=syPackingListFabricItemMapper.getDocumentNos();
+		System.out.println("documentNos.size\t"+documentNos.size());
 		Map<String, List<String>> maps = new HashMap<>();//获取两个账套
 		for (String arr : arrs) {
 			String account = arr.substring(0, 3);
@@ -2026,6 +2029,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					"a.id u8Id,       \n" +
 					"a.ccode as documentNo,\n"+
 					"f.ID as  fId, \n"+
+
+					"a.cDefine3 as  containerNumber, \n"+
+
+
 					"'1' as is_U8_Data,    \n" +
 					"a.cMemo memo,    \n" +
 					"0 as delflag,    \n" +
@@ -2061,8 +2068,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				continue;//退出本次循环
 			}
 			List<JSONObject> jsonObjects = JsonChangeUtils.toJSONObject(listMain);
-			System.out.println("数据长度\t"+jsonObjects.size());
-			for (JSONObject json : jsonObjects) {//
+			System.out.println("主表长度\t"+jsonObjects.size());
+			for (JSONObject json : jsonObjects) {//
 				try{
 					SyPackingListFabric sy = JSONObject.toJavaObject(json, SyPackingListFabric.class);
 					/*QueryWrapper<SyPackingListFabric> queryWrapperCount = new QueryWrapper<>();
@@ -2071,11 +2078,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					queryWrapperCount.select("lpad(count(0)+1,6,0) as id");
 					String dateNo = "FL" + sf.format(System.currentTimeMillis()) + getOne(queryWrapperCount).getId();//生成辅料单据号*/
 					sy.setDocumentNo(account+sy.getDocumentNo());//单据号
-					QueryWrapper queryWrapper=new QueryWrapper();
+					/*QueryWrapper queryWrapper=new QueryWrapper();
 					queryWrapper.eq("document_No",sy.getDocumentNo());
 					queryWrapper.eq("del_flag","0");
-					SyPackingListFabric Fabric=syPackingListFabricMapper.selectOne(queryWrapper);
-					if(Fabric!=null){
+					SyPackingListFabric Fabric=syPackingListFabricMapper.selectOne(queryWrapper);*/
+					if(documentNos.contains(sy.getDocumentNo())){
 						continue;
 					}
 					sy.setDataSource("u8拉取");//直接从u8拉取的数据
@@ -2140,6 +2147,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					}
 					List<JSONObject> jianSon = JsonChangeUtils.toJSONObject(list);
 					List<SyPackingListFabricItem> items=new ArrayList<>();
+					System.out.println("获取子表长度\t"+jianSon.size());
 					for (JSONObject json1 : jianSon) {
 						SyPackingListFabricItem sy1 = JSONObject.toJavaObject(json1, SyPackingListFabricItem.class);
 						sy1.setU8Id(account + sy1.getU8Id());//获取账套号+子表id
@@ -2292,6 +2300,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				}
 			}
 		}
+		long endTime2 = System.currentTimeMillis();
+		System.out.println("删除时间:" + (endTime2 - startTime) + "ms");
 		return "成功添加了"+num+"条数据!";
 	}
 

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/SyPackingListTailoringItem.java

@@ -333,6 +333,18 @@ public class SyPackingListTailoringItem implements Serializable {
 	@ApiModelProperty(value = "订单数据子表id")
 	private String syOrderDataItemId;
 
+	@Excel(name = "件数/包", width = 15)
+	@ApiModelProperty(value = "件数/包")
+	private BigDecimal totalPack;
+
+	@Excel(name = "包数/箱", width = 15)
+	@ApiModelProperty(value = "包数/箱")
+	private BigDecimal packBox;
+
+	@Excel(name = "包数", width = 15)
+	@ApiModelProperty(value = "包数")
+	private BigDecimal packs;
+
 	public SyPackingListTailoringItem(){
 
 	}