瀏覽代碼

面料损耗

LiGuang 2 年之前
父節點
當前提交
77250b57f8
共有 15 個文件被更改,包括 1288 次插入0 次删除
  1. 250 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/controller/FabricLossController.java
  2. 32 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricMoOrderCK.java
  3. 43 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricMoOrderRK.java
  4. 55 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricOMOrder.java
  5. 57 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricPoOrder.java
  6. 27 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricYarn.java
  7. 39 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/PoOrderSum.java
  8. 70 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/FabricOmOrderMapper.java
  9. 108 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/FabricPoOrderMapper.java
  10. 78 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/FabricOmOrderMapper.xml
  11. 181 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/FabricPoOrderMapper.xml
  12. 59 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/IFabricOmOrderService.java
  13. 110 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/IFabricPoOrderService.java
  14. 74 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricMoOrderServiceImpl.java
  15. 105 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricPoOrderServiceImpl.java

+ 250 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/controller/FabricLossController.java

@@ -0,0 +1,250 @@
+package org.jeecg.modules.report.controller;
+
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.base.service.BaseCommonService;
+import org.jeecg.modules.report.entity.*;
+import org.jeecg.modules.report.service.IFabricLossService;
+import org.jeecg.modules.report.service.IFabricOmOrderService;
+import org.jeecg.modules.report.service.IFabricPoOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 用户表 前端控制器
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+@Slf4j
+@RestController
+@RequestMapping("/report/FabricLoss")
+@Api(tags = "面料损耗")
+public class FabricLossController {
+	@Autowired
+	private ISysBaseAPI sysBaseAPI;
+
+	@Autowired
+    private IFabricPoOrderService fabricPoOrderService;
+
+    @Resource
+    private BaseCommonService baseCommonService;
+
+	@Autowired
+	private IFabricLossService fabricLossService;
+
+	@Autowired
+	private IFabricOmOrderService fabricOmOrderService;
+	/**
+	 *面料损耗
+	 * @param csocode 计划号
+	 * @return
+	 */
+	@AutoLog(value = "面料损耗整体数据")
+	@ApiOperation(value = "面料损耗整体数据")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="csocode",value="计划号",required = true)
+	})
+	@RequestMapping(value = "/getFabricLossDatas", method = RequestMethod.GET)
+	public Result<Map<String,Object>> getFabricLossDatas(String csocode) {
+		Result<Map<String,Object>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(csocode)){
+			Map<String,Object> fabricLossDatas = fabricLossService.getFabricLossDatas(csocode);
+			result.setSuccess(true);
+			result.setResult(fabricLossDatas);
+		}
+		return result;
+	}
+
+	/**
+	 * 面料损耗-采购订单-采购数量
+	 * @param code
+	 * @param cinvcode
+	 * @param cBatch
+	 * @param ioritaxcost
+	 * @param cfree1
+	 * @param cfree2
+	 * @param cfree3
+	 * @return
+	 */
+	@AutoLog(value = "面料损耗-采购订单-采购数量")
+	@ApiOperation(value = "面料损耗-采购订单-采购数量")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="code",value="计划号",required = true),@ApiImplicitParam(name="cinvcode",value="存货编码",required = true),
+			@ApiImplicitParam(name="cBatch",value="批号",required = true),@ApiImplicitParam(name="ioritaxcost",value="单价"),
+			@ApiImplicitParam(name="cfree1",value="存货自定义项1"),@ApiImplicitParam(name="cfree2",value="存货自定义项2"),@ApiImplicitParam(name="cfree3",value="存货自定义项3")
+	})
+	@RequestMapping(value = "/getFabricPoOrderSum", method = RequestMethod.GET)
+	public Result<Collection<PoOrderSum>> getFabricPoOrderSum( String code, String cinvcode, String cBatch, String ioritaxcost, String cfree1, String cfree2, String cfree3) {
+		Result<Collection<PoOrderSum>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(code)&&oConvertUtils.isNotEmpty(cinvcode)&&oConvertUtils.isNotEmpty(cBatch)){
+			List<PoOrderSum> fabricPoOrderSum = fabricPoOrderService.getFabricPoOrderSum(code,null, cinvcode, cBatch, ioritaxcost, cfree1, cfree2, cfree3);
+			result.setSuccess(true);
+			result.setResult(fabricPoOrderSum);
+		}
+		return result;
+	}
+
+	/**
+	 *面料损耗-采购订单-余纱数据(有批号)
+	 * @param csocode 计划号
+	 * @param csoordercode 源计划号
+	 * @param cinvcode 物料编码
+	 * @param cBatch 批号
+	 * @param comcode 委外订单号
+	 * @param cfree1 存货自定义项
+	 * @param cfree2 存货自定义项
+	 * @param cfree3 存货自定义项
+	 * @return
+	 */
+	@AutoLog(value = "面料损耗-采购订单-余纱数据(有批号)")
+	@ApiOperation(value = "面料损耗-采购订单-余纱数据(有批号)")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="csoordercode",value="源计划号",required = true),@ApiImplicitParam(name="cinvcode",value="存货编码",required = true),
+			@ApiImplicitParam(name="cBatch",value="批号",required = true),@ApiImplicitParam(name="csocode",value="计划号"),@ApiImplicitParam(name="comcode",value="委外订单号"),
+			@ApiImplicitParam(name="cfree1",value="存货自定义项1"),@ApiImplicitParam(name="cfree2",value="存货自定义项2"),@ApiImplicitParam(name="cfree3",value="存货自定义项3")
+	})
+	@RequestMapping(value = "/getFabricPoOrderYS", method = RequestMethod.GET)
+	public Result<Collection<FabricYarn>> getFabricPoOrderYS(String csocode, String csoordercode, String cinvcode,String cBatch,String comcode,String cfree1,String cfree2,String cfree3) {
+		Result<Collection<FabricYarn>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(csoordercode)&&oConvertUtils.isNotEmpty(cinvcode)&&oConvertUtils.isNotEmpty(cBatch)){
+			List<FabricYarn> fabricPoOrderYS = fabricPoOrderService.getFabricPoOrderYS(csocode, csoordercode, cinvcode, cBatch, comcode, cfree1, cfree2, cfree3);
+			result.setSuccess(true);
+			result.setResult(fabricPoOrderYS);
+		}
+		return result;
+	}
+
+
+	/**
+	 *面料损耗-采购订单-其他入库纱-集合数据
+	 * @param csocode 计划号
+	 * @param cBatch 批号
+	 * @param comcode 委外订单号
+	 * @return
+	 */
+	@AutoLog(value = "面料损耗-采购订单-其他入库纱-超链接")
+	@ApiOperation(value = "面料损耗-采购订单-其他入库纱-超链接")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="cBatch",value="批号",required = true),@ApiImplicitParam(name="csocode",value="计划号",required = true),@ApiImplicitParam(name="comcode",value="委外订单号")
+	})
+	@RequestMapping(value = "/getFabricGetPoOrderQTData", method = RequestMethod.GET)
+	public Result<Collection<FabricYarn>> getFabricGetPoOrderQTData(String csocode,String cBatch,String comcode) {
+		Result<Collection<FabricYarn>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(csocode)&&oConvertUtils.isNotEmpty(cBatch)){
+			List<FabricYarn> fabricGetPoOrderQTData = fabricPoOrderService.getFabricGetPoOrderQTData(csocode, cBatch, comcode);
+			result.setSuccess(true);
+			result.setResult(fabricGetPoOrderQTData);
+		}
+		return result;
+	}
+
+
+	/**
+	 *面料损耗-采购订单-来源余纱-集合数据
+	 * @param csocode 计划号
+	 * @param cBatch 过滤批号
+	 * @param cBatchs 条件批号
+	 * @param price 价格
+	 * @return
+	 */
+	@AutoLog(value = "面料损耗-采购订单-来源余纱-超链接")
+	@ApiOperation(value = "面料损耗-采购订单-来源余纱-超链接")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="cBatch",value="源批号",required = true),@ApiImplicitParam(name="csocode",value="计划号",required = true),@ApiImplicitParam(name="cBatchs",value="批号")
+			,@ApiImplicitParam(name="price",value="价格")
+	})
+	@RequestMapping(value = "/getFabricGetPoOrderYsData", method = RequestMethod.GET)
+	public Result<Collection<FabricYarn>> getFabricGetPoOrderYsData(String csocode,String cBatch,String cBatchs,String price) {
+		Result<Collection<FabricYarn>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(csocode)&&oConvertUtils.isNotEmpty(cBatch)){
+			List<FabricYarn> fabricGetPoOrderYsData = fabricPoOrderService.getFabricGetPoOrderYsData(csocode, cBatch, cBatchs, price);
+			result.setSuccess(true);
+			result.setResult(fabricGetPoOrderYsData);
+		}
+		return result;
+	}
+
+
+
+
+	/**
+	 *面料损耗-委外订单-出库数量-超链接
+	 * @param iOMoDID 子表id
+	 * @param cInvCode 物料编码
+	 * @param cInvName 物料名称
+	 * @param cbatch  批号
+	 * @param cVenAbbName  供应商
+	 * @return
+	 */
+	@AutoLog(value = "面料损耗-委外订单-出库数量-超链接")
+	@ApiOperation(value = "面料损耗-委外订单-出库数量-超链接")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="iOMoDID",value="委外子表id",required = true),@ApiImplicitParam(name="cInvCode",value="物料编码"),@ApiImplicitParam(name="cbatch",value="批号")
+			,@ApiImplicitParam(name="cVenAbbName",value="供应商")
+	})
+	@RequestMapping(value = "/getFabricOMOrderDataCK", method = RequestMethod.GET)
+	public Result<Collection<FabricMoOrderCK>> getFabricOMOrderDataCK(String iOMoDID,String cInvCode,String cInvName,String cbatch,String cVenAbbName) {
+		Result<Collection<FabricMoOrderCK>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(iOMoDID)){
+			List<FabricMoOrderCK> fabricOMOrderDataCK = fabricOmOrderService.getFabricOMOrderDataCK(iOMoDID, cInvCode, cInvName, cbatch, cVenAbbName);
+			result.setSuccess(true);
+			result.setResult(fabricOMOrderDataCK);
+		}
+		return result;
+	}
+
+
+	@AutoLog(value = "面料损耗-委外订单-入库数量-入库明细")
+	@ApiOperation(value = "面料损耗-委外订单-入库数量-入库明细")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="iOMoDID",value="委外子表id",required = true)
+			,@ApiImplicitParam(name="cordercode",value="委外订单号")
+	})
+	@RequestMapping(value = "/getFabricOMOrderDataRK", method = RequestMethod.GET)
+	public Result<Collection<FabricMoOrderRK>> getFabricOMOrderDataRK(String iOMoDID, String cordercode) {
+		Result<Collection<FabricMoOrderRK>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(iOMoDID)){
+			List<FabricMoOrderRK> fabricOMOrderDataRK = fabricOmOrderService.getFabricOMOrderDataRK(iOMoDID, cordercode);
+			result.setSuccess(true);
+			result.setResult(fabricOMOrderDataRK);
+		}
+		return result;
+	}
+
+
+	@AutoLog(value = "面料损耗-委外订单-入库数量-使用明细")
+	@ApiOperation(value = "面料损耗-委外订单-入库数量-使用明细")
+	@ApiImplicitParams(value={
+			@ApiImplicitParam(name="iOMoDID",value="委外子表id",required = true)
+			,@ApiImplicitParam(name="comcode",value="下游委外订单号")
+	})
+	@RequestMapping(value = "/getFabricOMOrderDataRK2", method = RequestMethod.GET)
+	public Result<Collection<FabricMoOrderRK>> getFabricOMOrderDataRK2(String iOMoDID, String comcode) {
+		Result<Collection<FabricMoOrderRK>> result = new Result<>();
+		if (oConvertUtils.isNotEmpty(iOMoDID)){
+			List<FabricMoOrderRK> fabricOMOrderDataRK2 = fabricOmOrderService.getFabricOMOrderDataRK2(iOMoDID, comcode);
+			result.setSuccess(true);
+			result.setResult(fabricOMOrderDataRK2);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,32 @@
+package org.jeecg.modules.report.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="demo对象", description="面料损耗-委外订单-材料出库-超链接")
+public class FabricMoOrderCK {
+    @ApiModelProperty(value = "入库单号")
+    private  String ccode;
+    @ApiModelProperty(value = "物料编码")
+    private  String cinvCode;
+    @ApiModelProperty(value = "物料名称")
+    private  String cinvName;
+    @ApiModelProperty(value = "批号")
+    private  String cbatch;
+    @ApiModelProperty(value = "数量")
+    private  String iquantity;
+    @ApiModelProperty(value = "单据")
+    private  String iunitcost;
+    @ApiModelProperty(value = "供应商")
+    private  String cvenAbbName;
+    @ApiModelProperty(value = "金额")
+    private  String price;
+    @ApiModelProperty(value = "成本")
+    private  String iprice;
+}

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

@@ -0,0 +1,43 @@
+package org.jeecg.modules.report.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="demo对象", description="面料损耗-委外订单-采购入库-超链接")
+public class FabricMoOrderRK {
+    @ApiModelProperty(value = "委外订单号")
+    private  String cordercode;
+
+    @ApiModelProperty(value = "下游委外订单号")
+    private  String comcode;
+
+    @ApiModelProperty(value = "下游供应商")
+    private  String cvenAbbName;
+
+    @ApiModelProperty(value = "批号")
+    private  String cbatch;
+
+    @ApiModelProperty(value = "入库数量/使用数量")
+    private  String iquantity;
+
+    @ApiModelProperty(value = "开票数量")
+    private  String ipbvquantity;
+
+    @ApiModelProperty(value = "未开票数量")
+    private  String ipbvquantitys;
+
+    @ApiModelProperty(value = "结算数量")
+    private  String isvquantity;
+
+    @ApiModelProperty(value = "未结算数量")
+    private  String isvquantitys;
+
+    @ApiModelProperty(value = "成本")
+    private  String sum;
+}

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

@@ -0,0 +1,55 @@
+package org.jeecg.modules.report.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+//面料损耗-委外订单
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="demo对象", description="面料损耗-委外订单")
+public class FabricOMOrder {
+    @ApiModelProperty(value = "制造工艺")
+    private String  cVCName;
+    @ApiModelProperty(value = "工厂")
+    private String cVenAbbName;
+    @ApiModelProperty(value = "材料出库数量")
+    private  String iQuantityCK;
+    @ApiModelProperty(value = "采购入库数量")
+    private  String iQuantityRK;
+    @ApiModelProperty(value = "物料编码")
+    private  String cInvCode;
+    @ApiModelProperty(value = "物料名称")
+    private String cInvName;
+    @ApiModelProperty(value = "颜色")
+    private  String cfree1;
+    @ApiModelProperty(value = "计划数量")
+    private  String iQuantity;
+    @ApiModelProperty(value = "多发少发")
+    private  String sum;
+    @ApiModelProperty(value = "损耗")
+    private  String count;
+    @ApiModelProperty(value = "子表id")
+    private  String iOMoDID;
+    @ApiModelProperty(value = "单位类型(入库)")
+    private  String type;
+    @ApiModelProperty(value = "单位类型(出库)")
+    private  String types;
+    @ApiModelProperty(value = "匹数(入库)")
+    private  String ps;
+    @ApiModelProperty(value = "匹数(出库)")
+    private  String pst;
+    @ApiModelProperty(value = "单位(入库)")
+    private List<Map<String,Object>>children=new ArrayList<>();
+    @ApiModelProperty(value = "单位(出库)")
+    private List<Map<String,Object>>childrens=new ArrayList<>();
+    @ApiModelProperty(value = "委外类型")
+    private  String motype;
+}

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

@@ -0,0 +1,57 @@
+package org.jeecg.modules.report.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+//面料损耗-采购订单
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="demo对象", description="面料损耗-采购订单")
+public class FabricPoOrder {
+    //存货编码
+    @ApiModelProperty(value = "存货编码")
+    private  String cInvCode;
+    //存货名称
+    @ApiModelProperty(value = "存货名称")
+    private String cInvName;
+    //批号
+    @ApiModelProperty(value = "批号")
+    private String cBatch;
+    //计划数量
+    @ApiModelProperty(value = "计划数量")
+    private String iquantity;
+    //采购数量
+    @ApiModelProperty(value = "采购数量")
+    private  String poiQuantity;
+    //分配数量
+    @ApiModelProperty(value = "分配数量")
+    private  String iquantitys;
+    //采购供应商
+    @ApiModelProperty(value = "采购供应商")
+    private  String cVenAbbName;
+    //委外供应商
+    @ApiModelProperty(value = "委外供应商")
+    private  String omcVenAbbName;
+    //余纱
+    @ApiModelProperty(value = "余纱")
+    private  String sum;
+    //采购损耗
+    @ApiModelProperty(value = "采购损耗")
+    private  String isum;
+    //计划号
+    @ApiModelProperty(value = "计划号")
+    private  String code;
+    //存货自定义项1
+    @ApiModelProperty(value = "存货自定义项1")
+    private  String cfree1;
+    //存货自定义项2
+    @ApiModelProperty(value = "存货自定义项2")
+    private  String cfree2;
+    //存货自定义项3
+    @ApiModelProperty(value = "存货自定义项3")
+    private  String cfree3;
+}

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

@@ -0,0 +1,27 @@
+package org.jeecg.modules.report.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+//面料损耗-采购订单-纱-超链接
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="demo对象", description="面料损耗-采购订单-纱-超链接")
+public class FabricYarn {
+    @ApiModelProperty(value = "委外订单号")
+    private  String comcode;
+    @ApiModelProperty(value = "计划号")
+    private  String csocode;
+    @ApiModelProperty(value = "纱批")
+    private  String cbatch;
+    @ApiModelProperty(value = "采购单价")
+    private  String price;
+    @ApiModelProperty(value = "使用数量")
+    private  String iquantity;
+
+
+}

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

@@ -0,0 +1,39 @@
+package org.jeecg.modules.report.entity;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+//面料损耗-采购订单-采购数量
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Api(tags = "面料损耗-采购订单-采购数量")
+public class PoOrderSum {
+    //单据号
+    @ApiModelProperty(value = "单据号")
+    private  String cCode;
+    //单据类型
+    @ApiModelProperty(value = "单据类型")
+    private String type;
+    //入库数量
+    @ApiModelProperty(value = "入库数量")
+    private  String iquantity;
+    //含税单价
+    @ApiModelProperty(value = "含税单价")
+    private  String ioritaxcost;
+    //开票数量
+    @ApiModelProperty(value = "开票数量")
+    private String ipbvquantity;
+    //未开票数量
+    @ApiModelProperty(value = "未开票数量")
+    private String ipbvquantitys;
+    //结算数量
+    @ApiModelProperty(value = "结算数量")
+    private String isvquantity;
+    //未结算数量
+    @ApiModelProperty(value = "未结算数量")
+    private  String isvquantitys;
+}

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

@@ -0,0 +1,70 @@
+package org.jeecg.modules.report.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.report.entity.FabricMoOrderCK;
+import org.jeecg.modules.report.entity.FabricMoOrderRK;
+import org.jeecg.modules.report.entity.FabricOMOrder;
+
+import java.util.List;
+
+/**
+ * <p>
+ *面料损耗表 Mapper 接口
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface FabricOmOrderMapper extends BaseMapper<FabricOMOrder> {
+
+
+	//面料损耗-委外订单
+
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricOMOrder>getFabricOMOrderData(@Param("csocode")String csocode);
+
+	//面料损耗-委外订单-出库数量-超链接
+
+	/**
+	 *
+	 * @param iOMoDID 子表id
+	 * @param cInvCode 物料编码
+	 * @param cInvName 物料名称
+	 * @param cbatch  批号
+	 * @param cVenAbbName  供应商
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricMoOrderCK>getFabricOMOrderDataCK(@Param("iOMoDID")String iOMoDID,@Param("cInvCode")String cInvCode,@Param("cInvName")String cInvName,@Param("cbatch")String cbatch,@Param("cVenAbbName")String cVenAbbName);
+
+
+	//面料损耗报表-委外订单-入库数量-超链接-入库明细
+
+	/**
+	 *
+	 * @param iOMoDID 子表id
+	 * @param cordercode 委外订单号
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricMoOrderRK>getFabricOMOrderDataRK(@Param("iOMoDID")String iOMoDID,@Param("cordercode")String cordercode);
+
+	//面料损耗-委外订单-入库数量-超链接-使用明细
+
+	/**
+	 *
+	 * @param iOMoDID 子表id
+	 * @param comcode 下游委外订单号
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricMoOrderRK>getFabricOMOrderDataRK2(@Param("iOMoDID")String iOMoDID,@Param("comcode")String comcode);
+}

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

@@ -0,0 +1,108 @@
+package org.jeecg.modules.report.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.report.entity.FabricPoOrder;
+import org.jeecg.modules.report.entity.FabricYarn;
+import org.jeecg.modules.report.entity.PoOrderSum;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ *面料损耗表 Mapper 接口
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface FabricPoOrderMapper extends BaseMapper<FabricPoOrder> {
+
+	//获取面料损耗-采购订单数据
+	/**
+	 *
+	 * @param code 计划号
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricPoOrder> getFabricPoOrderData(@Param("code")String code);
+
+
+	//获取面料损耗-采购订单-采购数量数据
+	/**
+	 *
+	 * @param code 计划号
+	 * @param iorderdid 物料唯一标识
+	 * @param cinvcode 物料编号
+	 * @param cBatch  批号
+	 * @param ioritaxcost 单价
+	 * @param cfree1 存货自定义项
+	 * @param cfree2 存货自定义项
+	 * @param cfree3 存货自定义项
+	 * @return
+	 */
+	@DS("multi-three")
+	List<PoOrderSum> getFabricPoOrderSum(@Param("code")String code,@Param("iorderdid") String iorderdid,@Param("cinvcode")String cinvcode,@Param("cBatch")String cBatch,@Param("ioritaxcost")String ioritaxcost,@Param("cfree1")String cfree1,@Param("cfree2")String cfree2,@Param("cfree3")String cfree3);
+
+	//获取面料损耗-采购订单-余纱数据(有批号)
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param csoordercode 源计划号
+	 * @param cinvcode 物料编码
+	 * @param cBatch 批号
+	 * @param comcode 委外订单号
+	 * @param cfree1 存货自定义项
+	 * @param cfree2 存货自定义项
+	 * @param cfree3 存货自定义项
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricYarn>getFabricPoOrderYS(@Param("csocode")String csocode,@Param("csoordercode")String csoordercode,@Param("cinvcode")String cinvcode,@Param("cBatch")String cBatch,@Param("comcode")String comcode,@Param("cfree1")String cfree1,@Param("cfree2")String cfree2,@Param("cfree3")String cfree3);
+
+	//面料损耗-采购订单-来源余纱数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch  批号
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricPoOrder>getFabricGetPoOrderYs(@Param("csocode")String csocode,@Param("cBatch")String cBatch);
+
+	//面料损耗-采购订单-其他入库纱数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch  批号
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricPoOrder>getFabricGetPoOrderQT(@Param("csocode")String csocode,@Param("cBatch")String cBatch);
+
+	//面料损耗-采购订单-其他入库纱-集合数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch 批号
+	 * @param comcode 委外订单号
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricYarn>getFabricGetPoOrderQTData(@Param("csocode")String csocode, @Param("cBatch")String cBatch, @Param("comcode")String comcode);
+
+	//面料损耗-采购订单-来源余纱-集合数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch 过滤批号
+	 * @param cBatchs 条件批号
+	 * @param price 价格
+	 * @return
+	 */
+	@DS("multi-three")
+	List<FabricYarn>getFabricGetPoOrderYsData(@Param("csocode")String csocode,@Param("cBatch")String cBatch,@Param("cBatchs")String cBatchs,@Param("price")String price);
+}

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

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.report.mapper.FabricOmOrderMapper">
+
+
+	<select id="getFabricOMOrderData" resultType="org.jeecg.modules.report.entity.FabricOMOrder">
+		select d.cVCName ,c.cVenAbbName ,e.iQuantity as 'iQuantityCK' ,f.iQuantity as 'iQuantityRK',b.cInvCode,co.cComUnitName as 'type',
+		g.cInvName ,b.cfree1 ,b.iQuantity ,f.iQuantity-b.iQuantity as 'sum',b.MODetailsID,(1-f.iQuantity/e.iQuantity)/100 as 'count',
+		(CASE sa.cSTName WHEN '国外销售' THEN '委外订单国外' WHEN '国内销售' THEN '委外订单国内' END)  as 'motype',f.cComUnitName as 'type',e.cComUnitName as 'types'
+		from OM_MOMain a left join OM_MODetails b on a.moid=b.moid
+						 left join Vendor c on a.cvencode=c.cvencode
+						 left join VendorClass d on c.cvccode=d.cVCCode
+		left join (select a.iOMoDID,sum(a.iQuantity) as 'iQuantity',co.cComUnitName from rdrecords11 a
+		left join Inventory g on g.cinvcode=a.cinvcode
+		left join ComputationUnit co on co.cComunitCode=g.cComUnitCode
+		GROUP BY a.iOMoDID,co.cComUnitName) e on b.MODetailsID  =e.iOMoDID
+		left join (select a.iOMoDID,sum(a.iQuantity) as 'iQuantity',co.cComUnitName from rdrecords01 a
+		left join Inventory g on g.cinvcode=a.cinvcode
+		left join ComputationUnit co on co.cComunitCode=g.cComUnitCode
+		GROUP BY a.iOMoDID,co.cComUnitName) f on b.MODetailsID  =f.iOMoDID
+						 left join Inventory g on g.cinvcode=b.cinvcode
+						left join ComputationUnit co on co.cComunitCode=g.cComUnitCode
+						where 1=1
+						<if test="csocode!=null and ''!=csocode">
+						 and b.csocode =#{csocode}
+						</if>
+	</select>
+	<select id="getFabricOMOrderDataCK" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
+		select d.ccode ,b.cInvCode ,e.cInvName ,b.cbatch ,b.iQuantity ,c.iunitcost ,v.cVenAbbName ,c.iPrice,c.iMaterialFee+c.iProcessFee as 'iprice'
+		from rdrecord11 a left join rdrecords11 b on a.id=b.id
+						  left join rdrecords01 c on b.cInvCode=c.cInvCode and b.cbatch=c.cbatch
+						  left join rdrecord01  d on c.id=d.id
+						  left join Inventory e on  e.cinvcode=b.cinvcode
+						  left join Vendor v on d.cvencode=v.cvencode
+						  where 1=1
+						  <if test="iOMoDID!=null and ''!=iOMoDID">
+							  and b.iOMoDID=#{iOMoDID}
+						  </if>
+						<if test="cInvCode!=null and ''!=cInvCode">
+							and b.cInvCode=#{cInvCode}
+						</if>
+						<if test="cInvName!=null and ''!=cInvName">
+							and e.cInvName=#{cInvName}
+						</if>
+						<if test="cbatch!=null and ''!=cbatch">
+							and b.cbatch=#{cbatch}
+						</if>
+						<if test="cVenAbbName!=null and ''!=cVenAbbName">
+							and v.cVenAbbName=#{cVenAbbName}
+						</if>
+	</select>
+	<select id="getFabricOMOrderDataRK" resultType="org.jeecg.modules.report.entity.FabricMoOrderRK">
+		select b.iQuantity ,b.cbatch ,a.cordercode ,isnull(pb.ipbvquantity,0) as 'ipbvquantity',isnull(p.isvquantity,0) as 'isvquantity' ,
+		isnull(b.iQuantity-pb.ipbvquantity,0) as 'ipbvquantitys',isnull(b.iQuantity-p.isvquantity,0) as 'isvquantitys',b.iunitcost as 'iprice'
+		from rdrecord01 a left join rdrecords01 b on a.id=b.id
+						  left join PurSettleVouchs p on p.irdsid=b.autoid and a.ccode=p.cpivcode
+						  left join PurBillVouchs pb on pb.rdsid=b.autoid
+		where  1=1
+		<if test="iOMoDID!=null and ''!=iOMoDID">
+			and b.iOMoDID=#{iOMoDID}
+		</if>
+		<if test="cordercode!=null and ''!=cordercode">
+			and a.cordercode=#{cordercode}
+		</if>
+	</select>
+	<select id="getFabricOMOrderDataRK2" resultType="org.jeecg.modules.report.entity.FabricMoOrderRK">
+		select b.comcode ,v.cVenAbbName ,b.iQuantity ,b.cbatch
+		from (select  cInvCode,cfree1,cbatch,cfree2,cfree3 from rdrecords01 where iOMoDID =#{iOMoDID}
+		<if test="comcode!=null and ''!=comcode">
+			and b.comcode=#{comcode}
+		</if>
+		GROUP BY cInvCode,cfree1,cbatch,cfree2,cfree3) a
+		left join rdrecords11 b on   b.cbatch=a.cbatch and COALESCE(a.cfree1,'NULL')=COALESCE(b.cfree1,'NULL') and  b.cInvCode=a.cInvCode
+		and COALESCE(a.cfree2,'NULL')=COALESCE(b.cfree2,'NULL') and COALESCE(a.cfree3,'NULL')=COALESCE(b.cfree3,'NULL')
+		left join rdrecord11 c on c.id=b.id
+		left join Vendor v on c.cvencode=v.cvencode
+	</select>
+</mapper>

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

@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.report.mapper.FabricPoOrderMapper">
+
+
+	<select id="getFabricPoOrderData" resultType="org.jeecg.modules.report.entity.FabricPoOrder">
+		select a.cInvCode,a.cInvName,a.cBatch,a.cVenAbbName,a.omcVenAbbName,sum(a.iQuantity)as 'iQuantity',
+		sum(a.poiQuantity) as 'poiQuantity',sum(a.iQuantitys) as 'iQuantitys',sum(a.sum) as 'sum',sum(a.isum) as 'isum',a.csoordercode as 'code'
+		,a.cfree1 as 'cfree1',a.cfree2 as 'cfree2',a.cfree3 as 'cfree3'
+		from (
+		select DISTINCT  t.cInvCode as 'cInvCode',
+		b.cInvName as 'cInvName',
+		c.cBatch as 'cBatch',
+		t.iQuantity as 'iQuantity',
+		c.iQuantity as 'poiQuantity',
+		d.cVenAbbName as 'cVenAbbName',
+		f.iQuantity as 'iQuantitys',
+		f.cVenAbbName as 'omcVenAbbName',
+		c.iQuantity-f.iQuantity as 'sum',
+		(c.iQuantity-f.iQuantity)/c.iQuantity as 'isum',
+		t.csoordercode,
+		t.cfree1,
+		t.cfree2,
+		t.cfree3
+		from  PO_Pomain a
+		left join Po_Podetails t on a.poid=t.poid
+		left join Inventory  b on t.cinvcode=b.cinvcode
+		left join (select iPOsID,cBatch,sum(iQuantity) as 'iQuantity' from rdrecords01 GROUP BY iPOsID,cBatch) c on t.ID =c.iPOsID
+		left join rdrecord01 ca on a.cpoid=ca.cordercode
+		left join Vendor d on a.cVenCode=d.cVenCode
+		left join rdrecord11  e on a.cPOID =e.cmpocode
+		left join OM_MODetails om on om.isosid=t.iorderdid
+		left join (select isodid,cInvCode,v.cVenAbbName,sum(iQuantity) as 'iQuantity' from rdrecords11 a left join rdrecord11  b on a.id=b.id
+		left join Vendor v on b.cVenCode=v.cVenCode
+		GROUP BY isodid,cInvCode,v.cVenAbbName ) f on t.iorderdid=f.isodid and t.cInvCode=f.cInvCode
+		) a  where 1=1
+		<if test="code!=null and ''!=code">
+		 and	a.csoordercode LIKE concat(concat('%',#{code}),'%')
+		</if>
+		GROUP BY a.cInvCode,a.cInvName,a.cBatch,a.cVenAbbName,a.omcVenAbbName,a.csoordercode,a.cfree1,a.cfree2,a.cfree3
+	</select>
+	<select id="getFabricPoOrderSum" resultType="org.jeecg.modules.report.entity.PoOrderSum">
+		select DISTINCT  p.isvquantity as 'isvquantity',c.iQuantity-p.isvquantity as 'isvquantitys',ca.ccode as 'cCode',c.isotype as 'type',c.iQuantity as 'iQuantity',pb.ioritaxcost as 'ioritaxcost',pb.ipbvquantity as 'ipbvquantity',c.iQuantity-pb.ipbvquantity as 'ipbvquantitys'
+		from  PO_Pomain a
+		left join Po_Podetails t on a.poid=t.poid
+		left join rdrecord01 ca on a.cpoid=ca.cordercode
+		left join rdrecords01  c on c.ID =ca.id
+		left join PurSettleVouchs p on p.irdsid=c.autoid and ca.ccode=p.cpivcode
+		left join PurBillVouchs pb on pb.rdsid=c.autoid
+				  where 1=1
+		<if test="cfree1!=null and ''!=cfree1">
+					and t.cfree1=#{cfree1}
+		</if>
+		<if test="cfree1==null or ''==cfree1">
+			and t.cfree1 is null
+		</if>
+		<if test="cfree2!=null and  ''!=cfree2">
+			and t.cfree2=#{cfree2}
+		</if>
+		<if test="cfree2==null or ''==cfree2">
+			and t.cfree2 is null
+		</if>
+		<if test="cfree3!=null and  ''!=cfree3">
+			and t.cfree3=#{cfree3}
+		</if>
+		<if test="cfree3==null or ''==cfree3">
+			and t.cfree3 is null
+		</if>
+				 <if test="code!=null and ''!=code">
+					 and t.csoordercode=#{code}
+				 </if>
+				<if test="cBatch!=null and ''!=cBatch">
+					and c.cBatch=#{cBatch}
+				</if>
+				<if test="cinvcode!=null and ''!=cinvcode">
+					and t.cinvcode=#{cinvcode}
+				</if>
+				<if test="iorderdid!=null and ''!=iorderdid">
+					and t.iorderdid=#{iorderdid}
+				</if>
+				<if test="ioritaxcost!=null and ''!=ioritaxcost">
+					and pb.ioritaxcost=#{ioritaxcost}
+				</if>
+	</select>
+	<select id="getFabricPoOrderYS" resultType="org.jeecg.modules.report.entity.FabricYarn">
+		select DISTINCT c.iQuantity ,
+		c.csocode ,
+		c.comcode ,
+		t.itaxprice as 'price'
+		from  rdrecord11 ca
+		left join rdrecords11  c on c.ID =ca.id
+		left join Po_Podetails t on t.cInvCode=c.cInvCode
+		where 1=1
+		<if test="cfree1!=null and ''!=cfree1">
+			and c.cfree1=#{cfree1}
+		</if>
+		<if test="cfree1==null or ''==cfree1">
+			and c.cfree1 is null
+		</if>
+		<if test="cfree2!=null and  ''!=cfree2">
+			and c.cfree2=#{cfree2}
+		</if>
+		<if test="cfree2==null or ''==cfree2">
+			and c.cfree2 is null
+		</if>
+		<if test="cfree3!=null and  ''!=cfree3">
+			and c.cfree3=#{cfree3}
+		</if>
+		<if test="cfree3==null or ''==cfree3">
+			and c.cfree3 is null
+		</if>
+		<if test="cinvcode!=null and ''!=cinvcode">
+			and c.cInvCode=#{cinvcode}
+		</if>
+		<if test="cBatch!=null and ''!=cBatch">
+			and c.cBatch=#{cBatch}
+		</if>
+		<if test="comcode!=null and ''!=comcode">
+			and c.comcode=#{comcode}
+		</if>
+		<if test="csocode!=null and ''!=csocode">
+			and c.csocode=#{csocode}
+		</if>
+		<if test="csoordercode!=null and ''!=csoordercode">
+			and c.csocode!=#{csoordercode}  and t.csoordercode=#{csoordercode}
+		</if>
+	</select>
+	<select id="getFabricGetPoOrderYs" resultType="org.jeecg.modules.report.entity.FabricPoOrder">
+		select'来源余纱' as 'cInvName',sum(a.iQuantity) as 'poiQuantity',a.csocode as 'code',#{cBatch} as 'cBatch' from (
+		select   sum(c.iQuantity) as 'iQuantity',c.cBatch,c.cInvCode,c.cfree1,c.cfree2,c.cfree3,c.csocode from  rdrecord11 ca
+		left join rdrecords11  c on c.ID =ca.id
+		where  c.cBatch NOT LIKE concat(concat('%',#{cBatch}),'%')
+		<if test="csocode!=null and ''!=csocode">
+			and c.csocode LIKE concat(concat('%',#{csocode}),'%')
+		</if>
+		 GROUP BY c.cBatch,c.cInvCode,c.cfree1,c.cfree2,c.cfree3,c.csocode) a
+		left join rdrecords01 b on COALESCE(a.cfree1,'NULL')=COALESCE(b.cfree1,'NULL')  and a.cInvCode=b.cInvCode and a.cBatch=b.cBatch and COALESCE(a.cfree2,'NULL')=COALESCE(b.cfree2,'NULL') and COALESCE(a.cfree3,'NULL')=COALESCE(b.cfree3,'NULL')
+		where b.id is not null GROUP BY a.csocode
+
+	</select>
+	<select id="getFabricGetPoOrderQT" resultType="org.jeecg.modules.report.entity.FabricPoOrder">
+		select '其他入库纱'as 'cInvName', sum(a.iQuantity) as 'poiQuantity',a.csocode as 'code',#{cBatch} as 'cBatch' from (
+		select DISTINCT sum(c.iQuantity) as 'iQuantity' ,c.cBatch,c.cInvCode,c.cfree1,c.cfree2,c.cfree3,c.csocode
+		from  rdrecord11 ca
+		left join rdrecords11  c on c.ID =ca.id
+		where c.cBatch not like concat(concat('%',#{cBatch}),'%') and  c.csocode LIKE concat(concat('%',#{csocode}),'%')  GROUP BY c.cInvCode,c.cBatch,c.cfree1,c.cfree2,c.cfree3,c.csocode) a
+		left join rdrecords08 b on a.cBatch=b.cBatch and a.cInvCode=b.cInvCode and COALESCE(a.cfree1,'NULL')=COALESCE(b.cfree1,'NULL')and COALESCE(a.cfree2,'NULL')=COALESCE(b.cfree2,'NULL') and COALESCE(a.cfree3,'NULL')=COALESCE(b.cfree3,'NULL')
+		left join rdrecord08 c on b.id=c.id
+		where c.cbustype='其他入库' and b.id is not null GROUP BY a.csocode
+	</select>
+	<select id="getFabricGetPoOrderQTData" resultType="org.jeecg.modules.report.entity.FabricYarn">
+		select  a.iQuantity as 'iQuantity',a.csocode,b.iunitcost as 'price',a.comcode   from (
+		select DISTINCT sum(c.iQuantity) as 'iQuantity' ,c.cBatch,c.cInvCode,isnull(c.cfree1,null)as 'cfree1',c.cfree2,c.cfree3,c.csocode,c.comcode
+		from  rdrecord11 ca
+		left join rdrecords11  c on c.ID =ca.id
+		where c.cBatch not like concat(concat('%',#{cBatch}),'%')
+		  <if test="csocode!=null and ''!=csocode">
+		and c.csocode=#{csocode}
+			</if>
+		GROUP BY c.cInvCode,c.cBatch,c.cfree1,c.cfree2,c.cfree3,c.csocode,c.comcode ) a
+		left join rdrecords08 b on COALESCE(a.cfree1,'NULL')=COALESCE(b.cfree1,'NULL')  and a.cInvCode=b.cInvCode and a.cBatch=b.cBatch and COALESCE(a.cfree2,'NULL')=COALESCE(b.cfree2,'NULL') and COALESCE(a.cfree3,'NULL')=COALESCE(b.cfree3,'NULL')
+		left join rdrecord08 c on b.id=c.id
+		where c.cRdCode='16' and  b.id is not null
+	</select>
+	<select id="getFabricGetPoOrderYsData" resultType="org.jeecg.modules.report.entity.FabricYarn">
+		select a.iQuantity as 'iQuantity',a.csocode,b.iunitcost as 'price',a.cBatch from (
+		select   sum(c.iQuantity) as 'iQuantity',c.cBatch,c.cInvCode,c.cfree1,c.cfree2,c.cfree3,c.csocode from  rdrecord11 ca
+		left join rdrecords11  c on c.ID =ca.id
+		where  c.cBatch NOT LIKE concat(concat('%',#{cBatch}),'%')
+		<if test="csocode!=null and ''!=csocode">
+			and c.csocode=#{csocode}
+		</if>
+		<if test="cBatchs!=null and ''!=cBatchs">
+			and c.cBatch=#{cBatchs}
+		</if>
+		GROUP BY c.cBatch,c.cInvCode,c.cfree1,c.cfree2,c.cfree3,c.csocode) a
+		left join rdrecords01 b on COALESCE(a.cfree1,'NULL')=COALESCE(b.cfree1,'NULL')  and a.cInvCode=b.cInvCode and a.cBatch=b.cBatch and COALESCE(a.cfree2,'NULL')=COALESCE(b.cfree2,'NULL') and COALESCE(a.cfree3,'NULL')=COALESCE(b.cfree3,'NULL')
+		where b.id is not null
+	</select>
+
+</mapper>

+ 59 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/IFabricOmOrderService.java

@@ -0,0 +1,59 @@
+package org.jeecg.modules.report.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.report.entity.FabricMoOrderCK;
+import org.jeecg.modules.report.entity.FabricMoOrderRK;
+import org.jeecg.modules.report.entity.FabricOMOrder;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 面料损耗表 服务类
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface IFabricOmOrderService extends IService<FabricOMOrder> {
+
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @return
+	 */
+	List<FabricOMOrder> getFabricOMOrderData(String csocode);
+
+
+
+	/**
+	 *
+	 * @param iOMoDID 子表id
+	 * @param cInvCode 物料编码
+	 * @param cInvName 物料名称
+	 * @param cbatch  批号
+	 * @param cVenAbbName  供应商
+	 * @return
+	 */
+	List<FabricMoOrderCK>getFabricOMOrderDataCK(String iOMoDID,String cInvCode,String cInvName,String cbatch,String cVenAbbName);
+
+	/**
+	 *
+	 * @param iOMoDID 子表id
+	 * @param cordercode 委外订单号
+	 * @return
+	 */
+	List<FabricMoOrderRK>getFabricOMOrderDataRK(String iOMoDID,String cordercode);
+
+	/**
+	 *
+	 * @param iOMoDID 子表id
+	 * @param comcode 下游委外订单号
+	 * @return
+	 */
+	List<FabricMoOrderRK>getFabricOMOrderDataRK2(String iOMoDID,String comcode);
+}

+ 110 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/IFabricPoOrderService.java

@@ -0,0 +1,110 @@
+package org.jeecg.modules.report.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.report.entity.FabricPoOrder;
+import org.jeecg.modules.report.entity.FabricYarn;
+import org.jeecg.modules.report.entity.PoOrderSum;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 面料损耗表-采购订单 服务类
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface IFabricPoOrderService extends IService<FabricPoOrder> {
+	//面料损耗-采购订单数据
+	/**
+	 *
+	 * @param code 计划号
+	 * @return
+	 */
+	List<FabricPoOrder> getFabricPoOrderData(String code);
+
+	//面料损耗-采购订单-采购数量链接数据
+	/**
+	 *
+	 * @param code 计划号
+	 * @param iorderdid 物料唯一标识
+	 * @param cinvcode 物料编号
+	 * @param cBatch  批号
+	 * @param ioritaxcost 单价
+	 * @param cfree1 存货自定义项
+	 * @param cfree2 存货自定义项
+	 * @param cfree3 存货自定义项
+	 * @return
+	 */
+	List<PoOrderSum> getFabricPoOrderSum(String code,String iorderdid,String cinvcode, String cBatch,String ioritaxcost,String cfree1,String cfree2,String cfree3);
+
+	//面料损耗-采购订单-余纱数据(有批号)
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param csoordercode 源计划号
+	 * @param cinvcode 物料编码
+	 * @param cBatch 批号
+	 * @param comcode 委外订单号
+	 * @param cfree1 存货自定义项
+	 * @param cfree2 存货自定义项
+	 * @param cfree3 存货自定义项
+	 * @return
+	 */
+	List<FabricYarn>getFabricPoOrderYS(String csocode, String csoordercode, String cinvcode,String cBatch,String comcode,String cfree1,String cfree2,String cfree3);
+
+
+	//面料损耗-采购订单-来源余纱数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch  批号
+	 * @return
+	 */
+	List<FabricPoOrder>getFabricGetPoOrderYs(String csocode,String cBatch);
+
+	//面料损耗-采购订单-其他入库纱数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch  批号
+	 * @return
+	 */
+	List<FabricPoOrder>getFabricGetPoOrderQT(String csocode,String cBatch);
+
+	//面料损耗-采购订单-其他入库纱-集合数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch 批号
+	 * @param comcode 委外订单号
+	 * @return
+	 */
+	List<FabricYarn>getFabricGetPoOrderQTData(String csocode, String cBatch, String comcode);
+
+	//面料损耗-采购订单-来源余纱-集合数据
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @param cBatch 过滤批号
+	 * @param cBatchs 条件批号
+	 * @param price 价格
+	 * @return
+	 */
+	List<FabricYarn>getFabricGetPoOrderYsData(String csocode,String cBatch,String cBatchs,String price);
+
+
+	//采购订单数据总汇接口
+	/**
+	 *
+	 * @param csocode 计划号
+	 * @return
+	 */
+	List<FabricPoOrder>getPoOrderData(String csocode);
+
+}

+ 74 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricMoOrderServiceImpl.java

@@ -0,0 +1,74 @@
+package org.jeecg.modules.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.report.entity.*;
+import org.jeecg.modules.report.mapper.FabricLossMapper;
+import org.jeecg.modules.report.mapper.FabricOmOrderMapper;
+import org.jeecg.modules.report.service.IFabricLossService;
+import org.jeecg.modules.report.service.IFabricOmOrderService;
+import org.jeecg.modules.report.service.IFabricPoOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 面料损耗表 服务实现类
+ * </p>
+ *
+ * @Author: scott
+ * @Date: 2018-12-20
+ */
+@Service
+@Slf4j
+public class FabricMoOrderServiceImpl extends ServiceImpl<FabricOmOrderMapper, FabricOMOrder> implements IFabricOmOrderService {
+
+	@Autowired
+	private  FabricOmOrderMapper fabricOmOrderMapper;
+
+
+	@Override
+	public List<FabricOMOrder> getFabricOMOrderData(String csocode) {
+		List<FabricOMOrder> fabricOMOrderData = fabricOmOrderMapper.getFabricOMOrderData(csocode);
+		if (fabricOMOrderData!=null&&fabricOMOrderData.size()>0){
+			fabricOMOrderData.forEach(str->{
+				List<Map<String,Object>>list=new ArrayList<>();
+				Map<String,Object>map=new HashMap<>();
+				Map<String,Object>maps=new HashMap<>();
+				map.put("m","");
+				maps.put("g","");
+				if (oConvertUtils.isNotEmpty(str.getType())&&str.getType().equals("M")){
+					map.put("m",str.getIQuantityCK());
+				}else  if (oConvertUtils.isNotEmpty(str.getType())&&str.getType().equals("PCS")){
+					maps.put("g",str.getIQuantityCK());
+				}
+				list.add(map);
+				list.add(maps);
+				str.setChildren(list);
+			});
+		}
+		return fabricOMOrderData;
+	}
+
+	@Override
+	public List<FabricMoOrderCK> getFabricOMOrderDataCK(String iOMoDID, String cInvCode, String cInvName, String cbatch, String cVenAbbName) {
+		return fabricOmOrderMapper.getFabricOMOrderDataCK(iOMoDID,cInvCode,cInvName,cbatch,cVenAbbName);
+	}
+
+	@Override
+	public List<FabricMoOrderRK> getFabricOMOrderDataRK(String iOMoDID, String cordercode) {
+		return fabricOmOrderMapper.getFabricOMOrderDataRK(iOMoDID,cordercode);
+	}
+
+	@Override
+	public List<FabricMoOrderRK> getFabricOMOrderDataRK2(String iOMoDID, String comcode) {
+		return fabricOmOrderMapper.getFabricOMOrderDataRK2(iOMoDID,comcode);
+	}
+}

+ 105 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricPoOrderServiceImpl.java

@@ -0,0 +1,105 @@
+package org.jeecg.modules.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.CommonUtils;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.report.entity.FabricPoOrder;
+import org.jeecg.modules.report.entity.FabricYarn;
+import org.jeecg.modules.report.entity.PoOrderSum;
+import org.jeecg.modules.report.mapper.FabricLossMapper;
+import org.jeecg.modules.report.mapper.FabricPoOrderMapper;
+import org.jeecg.modules.report.service.IFabricLossService;
+import org.jeecg.modules.report.service.IFabricPoOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 面料损耗表 服务实现类
+ * </p>
+ *
+ * @Author: scott
+ * @Date: 2018-12-20
+ */
+@Service
+@Slf4j
+public class FabricPoOrderServiceImpl extends ServiceImpl<FabricPoOrderMapper, FabricPoOrder> implements IFabricPoOrderService {
+
+	@Autowired
+	private FabricPoOrderMapper fabricPoOrderMapper;
+
+
+	@Override
+	public List<FabricPoOrder> getFabricPoOrderData(String code) {
+		return fabricPoOrderMapper.getFabricPoOrderData(code);
+	}
+
+	@Override
+	public List<PoOrderSum> getFabricPoOrderSum(String code, String iorderdid, String cinvcode, String cBatch, String ioritaxcost,String cfree1,String cfree2,String cfree3) {
+		return fabricPoOrderMapper.getFabricPoOrderSum(code,iorderdid,cinvcode,cBatch,ioritaxcost,cfree1,cfree2,cfree3);
+	}
+
+	@Override
+	public List<FabricYarn> getFabricPoOrderYS(String csocode, String csoordercode, String cinvcode, String cBatch, String comcode,String cfree1,String cfree2,String cfree3) {
+		return fabricPoOrderMapper.getFabricPoOrderYS(csocode,csoordercode,cinvcode,cBatch,comcode, cfree1, cfree2, cfree3);
+	}
+
+	@Override
+	public List<FabricPoOrder> getFabricGetPoOrderYs(String csocode, String cBatch) {
+		return fabricPoOrderMapper.getFabricGetPoOrderYs(csocode,cBatch);
+	}
+
+	@Override
+	public List<FabricPoOrder> getFabricGetPoOrderQT(String csocode, String cBatch) {
+		return fabricPoOrderMapper.getFabricGetPoOrderQT(csocode,cBatch);
+	}
+
+	@Override
+	public List<FabricYarn> getFabricGetPoOrderQTData(String csocode, String cBatch, String comcode) {
+		return fabricPoOrderMapper.getFabricGetPoOrderQTData(csocode,cBatch,comcode);
+	}
+
+	@Override
+	public List<FabricYarn> getFabricGetPoOrderYsData(String csocode, String cBatch, String cBatchs, String price) {
+		return fabricPoOrderMapper.getFabricGetPoOrderYsData(csocode,cBatch,cBatchs,price);
+	}
+
+	@Override
+	public List<FabricPoOrder> getPoOrderData(String csocode) {
+		if (oConvertUtils.isNotEmpty(csocode)){
+			List<FabricPoOrder> fabricPoOrderData = this.getFabricPoOrderData(csocode);
+			if (oConvertUtils.isNotEmpty(fabricPoOrderData)){
+				for (FabricPoOrder str : fabricPoOrderData) {
+					if (oConvertUtils.isNotEmpty(str.getCBatch())){
+						List<FabricPoOrder> fabricGetPoOrderYs = this.getFabricGetPoOrderYs(csocode, str.getCBatch());
+						if (oConvertUtils.isNotEmpty(fabricGetPoOrderYs)&&fabricGetPoOrderYs.size()>0){
+							fabricPoOrderData.addAll(fabricGetPoOrderYs);
+						}else {
+							fabricPoOrderData.add(new FabricPoOrder().setCInvName("来源余纱").setPoiQuantity("0"));
+						}
+						List<FabricPoOrder> fabricGetPoOrderQT = this.getFabricGetPoOrderQT(csocode, str.getCBatch());
+						if (oConvertUtils.isNotEmpty(fabricGetPoOrderQT)&&fabricGetPoOrderQT.size()>0){
+							fabricPoOrderData.addAll(fabricGetPoOrderQT);
+						}else {
+							fabricPoOrderData.add(new FabricPoOrder().setCInvName("其他入库纱").setPoiQuantity("0"));
+						}
+						break;
+					}
+				}
+			}
+			return fabricPoOrderData;
+		}else {
+			return null ;
+		}
+
+	}
+
+}
+
+