瀏覽代碼

面损表调整

fenghaifu 1 年之前
父節點
當前提交
8d9d178a3e

+ 16 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricInvInType.java

@@ -0,0 +1,16 @@
+package org.jeecg.modules.report.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 物料入库类型
+ */
+@Data
+public class FabricInvInType {
+    @ApiModelProperty(value = "入库类型:11-采购入库")
+    private  String  cInType;
+
+    @ApiModelProperty(value = "物料id:编码+颜色+批号")
+    private  String  cInvId;
+}

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

@@ -155,4 +155,7 @@ public interface FabricLossMapper extends BaseMapper<FabricLoss> {
 	@DS("multi-three")
 	@InterceptorIgnore(tenantLine = "1")
 	List<FabricPoSaleOut> getSaleOutByInventory(@Param("invIdList")List<String> invIdList);
+	@DS("multi-three")
+	@InterceptorIgnore(tenantLine = "1")
+	List<FabricInvInType> getInTypeByInvId(@Param("invIdList")List<String> invIdList);
 }

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/FabricLossMapper.xml

@@ -698,4 +698,15 @@
 		</foreach>
 		group by c.cCusAbbName ,b.cinvcode,b.cbatch,b.cfree1
 	</select>
+	<!-- 根据物料,查询入库类型 -->
+
+	<select id="getInTypeByInvId" resultType="org.jeecg.modules.report.entity.FabricInvInType">
+		select a.crdcode as cInType, b.cInvCode + isnull(b.cFree1,'') + isnull(b.cBatch,'') as cInvId
+		from rdrecord01 a join rdrecords01 b on a.id=b.id
+		where b.cInvCode + isnull(b.cFree1,'') + isnull(b.cBatch,'') in
+			<foreach item="item" collection="invIdList" index="index" open="(" separator="," close=")">
+				#{item}
+			</foreach>
+		order by a.id desc
+	</select>
 </mapper>

+ 18 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricLossServiceImpl.java

@@ -1922,12 +1922,27 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 		if (oConvertUtils.listIsNotEmpty(outList1)){
 			otherOutList.addAll(outList1);
 		}
+		// 获取物料入库类型
+		List<FabricInvInType> invInTypeList = new ArrayList<>();
+		if (otherOutList.size()>0){
+			List<String> cInvIdList = new ArrayList<>();
+			otherOutList.forEach(e->{
+				cInvIdList.add(e.getInvOutId());
+			});
+			 invInTypeList = fabricLossMapper.getInTypeByInvId(cInvIdList);
+		}
+
 		// 把0299和0399 的 成衣材料出库和销售出库cBusType设置成否,只用于扣减入库。不作为转入成本
-		otherOutList.forEach(e->{
+		// 采购入库的不计入,其他计入
+		for (FabricMoOrderCK e : otherOutList) {
 			if ("0299".equalsIgnoreCase(e.getCInvCCodeOut()) || "0399".equalsIgnoreCase(e.getCInvCCodeOut())) {
-				e.setCBusType("否");
+				FabricInvInType invInType = invInTypeList.stream().filter(t->t.getCInvId().equalsIgnoreCase(e.getInvOutId())).findFirst().orElse(null);
+				if (invInType != null && "11".equalsIgnoreCase(invInType.getCInType())) {
+					e.setCBusType("否");
+				}
 			}
-		});
+
+		}
 
 		allOutList.addAll(otherOutList);
 		allOutList.forEach(e->{