提交
This commit is contained in:
parent
92ce39f236
commit
b6b7fd653a
|
@ -23,5 +23,7 @@ public class K3ProdField {
|
||||||
public static final String F_BASE_UNIT_QTY = "FBaseUnitQty"; // 明细.基本单位数量
|
public static final String F_BASE_UNIT_QTY = "FBaseUnitQty"; // 明细.基本单位数量
|
||||||
public static final String F_QTY = "FQty"; // 明细.数量
|
public static final String F_QTY = "FQty"; // 明细.数量
|
||||||
public static final String F_UNIT_ID = "FUnitId"; // 明细.单位
|
public static final String F_UNIT_ID = "FUnitId"; // 明细.单位
|
||||||
|
public static final String F_BASE_UNIT_ID = "FBaseUnitId"; // 明细.基本单位
|
||||||
public static final String F_NO_STOCK_IN_QTY = "FNoStockInQty"; // 明细.未入库数量
|
public static final String F_NO_STOCK_IN_QTY = "FNoStockInQty"; // 明细.未入库数量
|
||||||
|
public static final String F_BASE_NO_STOCK_IN_QTY = "FBaseNoStockInQty"; // 明细.基本单位未入库数量
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,4 +110,15 @@ public class ProdOrder extends BaseEntity
|
||||||
@ApiModelProperty("ERP未入库数量")
|
@ApiModelProperty("ERP未入库数量")
|
||||||
private BigDecimal erpNoStockInQty;
|
private BigDecimal erpNoStockInQty;
|
||||||
|
|
||||||
|
@Excel(name = "ERP基本单位未入库数量")
|
||||||
|
@ApiModelProperty("ERP基本单位未入库数量")
|
||||||
|
private BigDecimal erpBaseNoStockInQty;
|
||||||
|
|
||||||
|
@Excel(name = "已审核通过的基础数量")
|
||||||
|
@ApiModelProperty("已审核通过的基础数量")
|
||||||
|
private BigDecimal verifiedBaseNum;
|
||||||
|
|
||||||
|
@Excel(name = "ERP明细基本单位ID")
|
||||||
|
@ApiModelProperty("ERP明细基本单位ID")
|
||||||
|
private String erpBaseUnitId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,5 +24,7 @@ public class ProdOrderQuery extends ProdOrderVO {
|
||||||
@ApiModelProperty("订单ID列表")
|
@ApiModelProperty("订单ID列表")
|
||||||
private List<Long> ids;
|
private List<Long> ids;
|
||||||
|
|
||||||
|
@ApiModelProperty("ERP业务状态列表")
|
||||||
|
private List<String> erpStatusList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,10 @@ public class ProdOrderVO extends ProdOrder {
|
||||||
@ApiModelProperty("单位名称")
|
@ApiModelProperty("单位名称")
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty("基本单位名称")
|
||||||
|
private String baseUnitName;
|
||||||
|
|
||||||
@ApiModelProperty("部门ID")
|
@ApiModelProperty("部门ID")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
@ApiModelProperty("ERP业务状态列表")
|
|
||||||
private List<String> erpStatusList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,19 @@
|
||||||
bpo.erp_material_id,
|
bpo.erp_material_id,
|
||||||
bpo.match_prices,
|
bpo.match_prices,
|
||||||
bpo.erp_no_stock_in_qty,
|
bpo.erp_no_stock_in_qty,
|
||||||
|
bpo.erp_base_no_stock_in_qty,
|
||||||
|
bpo.verified_base_num,
|
||||||
|
bpo.erp_base_unit_id,
|
||||||
bm.erp_number as material_number,
|
bm.erp_number as material_number,
|
||||||
sd.dept_name as work_shop_name,
|
sd.dept_name as work_shop_name,
|
||||||
sd.dept_id as dept_id,
|
sd.dept_id as dept_id,
|
||||||
bu.erp_name as unit_name
|
bu.erp_name as unit_name,
|
||||||
|
bu_b.erp_name as base_unit_name
|
||||||
from bst_prod_order bpo
|
from bst_prod_order bpo
|
||||||
left join sys_dept sd on sd.erp_id = bpo.erp_work_shop_id
|
left join sys_dept sd on sd.erp_id = bpo.erp_work_shop_id
|
||||||
left join bst_material bm on bm.erp_id = bpo.erp_material_id
|
left join bst_material bm on bm.erp_id = bpo.erp_material_id
|
||||||
left join bst_unit bu on bu.erp_id = bpo.erp_unit_id
|
left join bst_unit bu on bu.erp_id = bpo.erp_unit_id
|
||||||
|
left join bst_unit bu_b on bu_b.erp_id = bpo.erp_base_unit_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="searchCondition">
|
<sql id="searchCondition">
|
||||||
|
@ -59,6 +64,7 @@
|
||||||
<if test="query.erpReqSrc != null and query.erpReqSrc != ''"> and bpo.erp_req_src = #{query.erpReqSrc}</if>
|
<if test="query.erpReqSrc != null and query.erpReqSrc != ''"> and bpo.erp_req_src = #{query.erpReqSrc}</if>
|
||||||
<if test="query.deptId != null "> and sd.dept_id = #{query.deptId}</if>
|
<if test="query.deptId != null "> and sd.dept_id = #{query.deptId}</if>
|
||||||
<if test="query.erpMaterialId != null and query.erpMaterialId != ''"> and bpo.erp_material_id = #{query.erpMaterialId}</if>
|
<if test="query.erpMaterialId != null and query.erpMaterialId != ''"> and bpo.erp_material_id = #{query.erpMaterialId}</if>
|
||||||
|
<if test="query.erpBaseUnitId != null and query.erpBaseUnitId != ''"> and erp_base_unit_id = #{query.erpBaseUnitId}</if>
|
||||||
<if test="query.erpStatusList != null and query.erpStatusList.size() > 0">
|
<if test="query.erpStatusList != null and query.erpStatusList.size() > 0">
|
||||||
and bpo.erp_status in
|
and bpo.erp_status in
|
||||||
<foreach collection="query.erpStatusList" item="item" open="(" close=")" separator=",">
|
<foreach collection="query.erpStatusList" item="item" open="(" close=")" separator=",">
|
||||||
|
@ -110,6 +116,9 @@
|
||||||
<if test="erpMaterialId != null">erp_material_id,</if>
|
<if test="erpMaterialId != null">erp_material_id,</if>
|
||||||
<if test="matchPrices != null">match_prices,</if>
|
<if test="matchPrices != null">match_prices,</if>
|
||||||
<if test="erpNoStockInQty != null">erp_no_stock_in_qty,</if>
|
<if test="erpNoStockInQty != null">erp_no_stock_in_qty,</if>
|
||||||
|
<if test="erpBaseNoStockInQty != null">erp_base_no_stock_in_qty,</if>
|
||||||
|
<if test="verifiedBaseNum != null">verified_base_num,</if>
|
||||||
|
<if test="erpBaseUnitId != null">erp_base_unit_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="erpId != null and erpId != ''">#{erpId},</if>
|
<if test="erpId != null and erpId != ''">#{erpId},</if>
|
||||||
|
@ -133,6 +142,9 @@
|
||||||
<if test="erpMaterialId != null">#{erpMaterialId},</if>
|
<if test="erpMaterialId != null">#{erpMaterialId},</if>
|
||||||
<if test="matchPrices != null">#{matchPrices,typeHandler=com.ruoyi.common.mybatis.typehandler.StringSplitListTypeHandler},</if>
|
<if test="matchPrices != null">#{matchPrices,typeHandler=com.ruoyi.common.mybatis.typehandler.StringSplitListTypeHandler},</if>
|
||||||
<if test="erpNoStockInQty != null">#{erpNoStockInQty},</if>
|
<if test="erpNoStockInQty != null">#{erpNoStockInQty},</if>
|
||||||
|
<if test="erpBaseNoStockInQty != null">#{erpBaseNoStockInQty},</if>
|
||||||
|
<if test="verifiedBaseNum != null">#{verifiedBaseNum},</if>
|
||||||
|
<if test="erpBaseUnitId != null">#{erpBaseUnitId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -166,6 +178,9 @@
|
||||||
<if test="data.erpMaterialId != null">erp_material_id = #{data.erpMaterialId},</if>
|
<if test="data.erpMaterialId != null">erp_material_id = #{data.erpMaterialId},</if>
|
||||||
<if test="data.matchPrices != null">match_prices = #{data.matchPrices,typeHandler=com.ruoyi.common.mybatis.typehandler.StringSplitListTypeHandler},</if>
|
<if test="data.matchPrices != null">match_prices = #{data.matchPrices,typeHandler=com.ruoyi.common.mybatis.typehandler.StringSplitListTypeHandler},</if>
|
||||||
<if test="data.erpNoStockInQty != null">erp_no_stock_in_qty = #{data.erpNoStockInQty},</if>
|
<if test="data.erpNoStockInQty != null">erp_no_stock_in_qty = #{data.erpNoStockInQty},</if>
|
||||||
|
<if test="data.erpBaseNoStockInQty != null">erp_base_no_stock_in_qty = #{data.erpBaseNoStockInQty},</if>
|
||||||
|
<if test="data.verifiedBaseNum != null">verified_base_num = #{data.verifiedBaseNum},</if>
|
||||||
|
<if test="data.erpBaseUnitId != null">erp_base_unit_id = #{data.erpBaseUnitId},</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<delete id="deleteProdOrderById" parameterType="Long">
|
<delete id="deleteProdOrderById" parameterType="Long">
|
||||||
|
|
|
@ -95,12 +95,18 @@ public class ProdOrderConverterImpl implements ProdOrderConverter {
|
||||||
case K3ProdField.F_UNIT_ID:
|
case K3ProdField.F_UNIT_ID:
|
||||||
po.setErpUnitId(row.getString(i));
|
po.setErpUnitId(row.getString(i));
|
||||||
break;
|
break;
|
||||||
|
case K3ProdField.F_BASE_UNIT_ID:
|
||||||
|
po.setErpBaseUnitId(row.getString(i));
|
||||||
|
break;
|
||||||
case K3ProdField.F_MATERIAL_ID:
|
case K3ProdField.F_MATERIAL_ID:
|
||||||
po.setErpMaterialId(row.getString(i));
|
po.setErpMaterialId(row.getString(i));
|
||||||
break;
|
break;
|
||||||
case K3ProdField.F_NO_STOCK_IN_QTY:
|
case K3ProdField.F_NO_STOCK_IN_QTY:
|
||||||
po.setErpNoStockInQty(row.getBigDecimal(i));
|
po.setErpNoStockInQty(row.getBigDecimal(i));
|
||||||
break;
|
break;
|
||||||
|
case K3ProdField.F_BASE_NO_STOCK_IN_QTY:
|
||||||
|
po.setErpBaseNoStockInQty(row.getBigDecimal(i));
|
||||||
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,8 +148,10 @@ public class ProdOrderServiceImpl implements ProdOrderService
|
||||||
K3ProdField.F_BASE_UNIT_QTY,
|
K3ProdField.F_BASE_UNIT_QTY,
|
||||||
K3ProdField.F_QTY,
|
K3ProdField.F_QTY,
|
||||||
K3ProdField.F_UNIT_ID,
|
K3ProdField.F_UNIT_ID,
|
||||||
|
K3ProdField.F_BASE_UNIT_ID,
|
||||||
K3ProdField.F_MATERIAL_ID,
|
K3ProdField.F_MATERIAL_ID,
|
||||||
K3ProdField.F_NO_STOCK_IN_QTY
|
K3ProdField.F_NO_STOCK_IN_QTY,
|
||||||
|
K3ProdField.F_BASE_NO_STOCK_IN_QTY
|
||||||
);
|
);
|
||||||
int startRow = 0;
|
int startRow = 0;
|
||||||
int limit = 10000;
|
int limit = 10000;
|
||||||
|
|
|
@ -3,7 +3,10 @@ package com.ruoyi.web.yh.report.domain;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,4 +20,8 @@ public class ReportQuery extends ReportVO {
|
||||||
@ApiModelProperty("状态列表")
|
@ApiModelProperty("状态列表")
|
||||||
private List<String> statusList;
|
private List<String> statusList;
|
||||||
|
|
||||||
|
@ApiModelProperty("报表日期范围")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private List<LocalDate> reportDateRange;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,9 @@
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="query.reportDateRange != null and query.reportDateRange.size() > 1">
|
||||||
|
and date(br.report_date) >= date(#{query.reportDateRange[0]}) and date(br.report_date) <= date(#{query.reportDateRange[1]})
|
||||||
|
</if>
|
||||||
${query.params.dataScope}
|
${query.params.dataScope}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import com.ruoyi.web.yh.report.service.ReportValidator;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.bo.ReportOrderProdBO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.bo.ReportOrderProdBO;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.service.IReportOrderProdService;
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdService;
|
||||||
import com.ruoyi.web.yh.reportProd.domain.ReportProd;
|
import com.ruoyi.web.yh.reportProd.domain.ReportProd;
|
||||||
import com.ruoyi.web.yh.reportProd.domain.ReportProdVO;
|
import com.ruoyi.web.yh.reportProd.domain.ReportProdVO;
|
||||||
import com.ruoyi.web.yh.reportProd.domain.bo.ReportProdBO;
|
import com.ruoyi.web.yh.reportProd.domain.bo.ReportProdBO;
|
||||||
|
@ -58,7 +58,7 @@ public class ReportServiceImpl implements ReportService
|
||||||
private ReportUserProdService reportUserProdService;
|
private ReportUserProdService reportUserProdService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReportOrderProdService reportOrderProdService;
|
private ReportOrderProdService reportOrderProdService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.ruoyi.web.yh.reportOrderProd.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdAssembler;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -19,7 +21,7 @@ import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.service.IReportOrderProdService;
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdService;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
@ -34,7 +36,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
public class ReportOrderProdController extends BaseController
|
public class ReportOrderProdController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReportOrderProdService reportOrderProdService;
|
private ReportOrderProdService reportOrderProdService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReportOrderProdAssembler reportOrderProdAssembler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单产量列表
|
* 查询订单产量列表
|
||||||
|
@ -46,6 +51,7 @@ public class ReportOrderProdController extends BaseController
|
||||||
startPage();
|
startPage();
|
||||||
startOrderBy();
|
startOrderBy();
|
||||||
List<ReportOrderProdVO> list = reportOrderProdService.selectReportOrderProdList(query);
|
List<ReportOrderProdVO> list = reportOrderProdService.selectReportOrderProdList(query);
|
||||||
|
reportOrderProdAssembler.assembleVerifyingBaseNum(list);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,10 @@ public class ReportOrderProdQuery extends ReportOrderProdVO {
|
||||||
@ApiModelProperty("报表产量ID列表")
|
@ApiModelProperty("报表产量ID列表")
|
||||||
private List<Long> reportProdIds;
|
private List<Long> reportProdIds;
|
||||||
|
|
||||||
|
@ApiModelProperty("生产订单ID列表")
|
||||||
|
private List<Long> orderIds;
|
||||||
|
|
||||||
|
@ApiModelProperty("报表状态")
|
||||||
|
private String reportStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,25 @@ public class ReportOrderProdVO extends ReportOrderProd {
|
||||||
@ApiModelProperty("订单数量")
|
@ApiModelProperty("订单数量")
|
||||||
private BigDecimal orderErpQty;
|
private BigDecimal orderErpQty;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单基础数量")
|
||||||
|
private BigDecimal orderErpBaseUnitQty;
|
||||||
|
|
||||||
@ApiModelProperty("订单未入库数量")
|
@ApiModelProperty("订单未入库数量")
|
||||||
private BigDecimal orderErpNoStockInQty;
|
private BigDecimal orderErpNoStockInQty;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单单位名称")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单基础单位名称")
|
||||||
|
private String baseUnitName;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单基础未入库数量")
|
||||||
|
private BigDecimal orderErpBaseNoStockInQty;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单审核中的基础产量")
|
||||||
|
private BigDecimal verifyingBaseNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单已审核通过的基础产量")
|
||||||
|
private BigDecimal verifiedBaseNum;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.ruoyi.web.yh.reportOrderProd.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wjh
|
||||||
|
* 2024/11/19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportOrderProdSumOfBaseNumGroupByOrderIdVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础产量总和
|
||||||
|
*/
|
||||||
|
private BigDecimal sum;
|
||||||
|
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.domain.vo.ReportOrderProdSumOfBaseNumGroupByOrderIdVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,4 +77,9 @@ public interface ReportOrderProdMapper
|
||||||
* 批量逻辑删除
|
* 批量逻辑删除
|
||||||
*/
|
*/
|
||||||
int batchLogicDel(@Param("ids") List<Long> ids);
|
int batchLogicDel(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单基础产量合计
|
||||||
|
*/
|
||||||
|
List<ReportOrderProdSumOfBaseNumGroupByOrderIdVO> selectSumOfBaseNumGroupByOrderId(@Param("query") ReportOrderProdQuery query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
brp.report_id as report_id,
|
brp.report_id as report_id,
|
||||||
bpo.erp_bill_no as order_erp_bill_no,
|
bpo.erp_bill_no as order_erp_bill_no,
|
||||||
bpo.erp_qty as order_erp_qty,
|
bpo.erp_qty as order_erp_qty,
|
||||||
bpo.erp_no_stock_in_qty as order_erp_no_stock_in_qty
|
bpo.erp_no_stock_in_qty as order_erp_no_stock_in_qty,
|
||||||
|
bpo.erp_base_unit_qty as order_erp_base_unit_qty,
|
||||||
|
bpo.erp_base_no_stock_in_qty as order_erp_base_no_stock_in_qty,
|
||||||
|
bpo.verified_base_num as verified_base_num,
|
||||||
|
bu.erp_name as unit_name,
|
||||||
|
bu_b.erp_name as base_unit_name
|
||||||
from bst_report_order_prod brop
|
from bst_report_order_prod brop
|
||||||
left join bst_report_prod brp on brp.id = brop.report_prod_id
|
left join bst_report_prod brp on brp.id = brop.report_prod_id
|
||||||
|
left join bst_report br on br.report_id = brp.report_id
|
||||||
left join bst_prod_order bpo on bpo.id = brop.order_id
|
left join bst_prod_order bpo on bpo.id = brop.order_id
|
||||||
|
left join bst_unit bu on bu.erp_id = bpo.erp_unit_id
|
||||||
|
left join bst_unit bu_b on bu_b.erp_id = bpo.erp_base_unit_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="searchCondition">
|
<sql id="searchCondition">
|
||||||
|
@ -29,12 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="query.reportId != null "> and brp.report_id = #{query.reportId}</if>
|
<if test="query.reportId != null "> and brp.report_id = #{query.reportId}</if>
|
||||||
<if test="query.deleted == null "> and brop.deleted = false</if>
|
<if test="query.deleted == null "> and brop.deleted = false</if>
|
||||||
<if test="query.deleted != null "> and brop.deleted = #{query.deleted}</if>
|
<if test="query.deleted != null "> and brop.deleted = #{query.deleted}</if>
|
||||||
|
<if test="query.reportStatus != null "> and br.status = #{query.reportStatus}</if>
|
||||||
<if test="query.reportProdIds != null and query.reportProdIds.size() > 0">
|
<if test="query.reportProdIds != null and query.reportProdIds.size() > 0">
|
||||||
and brop.report_prod_id in
|
and brop.report_prod_id in
|
||||||
<foreach collection="query.reportProdIds" item="item" open="(" separator="," close=")">
|
<foreach collection="query.reportProdIds" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="query.orderIds != null and query.orderIds.size() > 0">
|
||||||
|
and brop.order_id in
|
||||||
|
<foreach collection="query.orderIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
${query.params.dataScope}
|
${query.params.dataScope}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
@ -50,6 +65,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where brop.id = #{id}
|
where brop.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<resultMap id="ReportOrderProdSumOfBaseNumGroupByOrderIdVO" type="ReportOrderProdSumOfBaseNumGroupByOrderIdVO" autoMapping="true">
|
||||||
|
<result property="sum" column="sum" typeHandler="com.ruoyi.common.mybatis.typehandler.NonNullDecimalTypeHandler"/>
|
||||||
|
</resultMap>
|
||||||
|
<select id="selectSumOfBaseNumGroupByOrderId" resultMap="ReportOrderProdSumOfBaseNumGroupByOrderIdVO">
|
||||||
|
select
|
||||||
|
sum(brop.num * if(brp.price_quantity is null, 1, brp.price_quantity)) as `sum`,
|
||||||
|
order_id
|
||||||
|
from bst_report_order_prod brop
|
||||||
|
left join bst_report_prod brp on brp.id = brop.report_prod_id
|
||||||
|
left join bst_report br on br.report_id = brp.report_id
|
||||||
|
<where>
|
||||||
|
<include refid="searchCondition"/>
|
||||||
|
</where>
|
||||||
|
group by order_id
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertReportOrderProd" parameterType="ReportOrderProd" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertReportOrderProd" parameterType="ReportOrderProd" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into bst_report_order_prod
|
insert into bst_report_order_prod
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.web.yh.reportOrderProd.service;
|
||||||
|
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wjh
|
||||||
|
* 2024/11/19
|
||||||
|
*/
|
||||||
|
public interface ReportOrderProdAssembler {
|
||||||
|
/**
|
||||||
|
* 拼接审核中的基础产量
|
||||||
|
*/
|
||||||
|
void assembleVerifyingBaseNum(List<ReportOrderProdVO> list);
|
||||||
|
}
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.bo.ReportOrderProdBO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.vo.ReportOrderProdSumOfBaseNumGroupByOrderIdVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单产量Service接口
|
* 订单产量Service接口
|
||||||
|
@ -12,7 +12,7 @@ import com.ruoyi.web.yh.reportOrderProd.domain.bo.ReportOrderProdBO;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2024-11-19
|
* @date 2024-11-19
|
||||||
*/
|
*/
|
||||||
public interface IReportOrderProdService
|
public interface ReportOrderProdService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询订单产量
|
* 查询订单产量
|
||||||
|
@ -78,4 +78,9 @@ public interface IReportOrderProdService
|
||||||
int batchUpdate(List<? extends ReportOrderProd> list);
|
int batchUpdate(List<? extends ReportOrderProd> list);
|
||||||
|
|
||||||
int batchLogicDel(List<? extends ReportOrderProd> list);
|
int batchLogicDel(List<? extends ReportOrderProd> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单基础产量合计
|
||||||
|
*/
|
||||||
|
List<ReportOrderProdSumOfBaseNumGroupByOrderIdVO> selectSumOfBaseNumGroupByOrderId(ReportOrderProdQuery query);
|
||||||
}
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.ruoyi.web.yh.reportOrderProd.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
|
import com.ruoyi.web.yh.report.domain.enums.ReportStatus;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.domain.vo.ReportOrderProdSumOfBaseNumGroupByOrderIdVO;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdAssembler;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wjh
|
||||||
|
* 2024/11/19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ReportOrderProdAssemblerImpl implements ReportOrderProdAssembler {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReportOrderProdService reportOrderProdService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void assembleVerifyingBaseNum(List<ReportOrderProdVO> list) {
|
||||||
|
if (CollectionUtils.isEmptyElement(list)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReportOrderProdQuery query = new ReportOrderProdQuery();
|
||||||
|
query.setOrderIds(CollectionUtils.map(list, ReportOrderProdVO::getOrderId));
|
||||||
|
query.setReportStatus(ReportStatus.WAIT_VERIFY.getStatus());
|
||||||
|
List<ReportOrderProdSumOfBaseNumGroupByOrderIdVO> sumList = reportOrderProdService.selectSumOfBaseNumGroupByOrderId(query);
|
||||||
|
|
||||||
|
for (ReportOrderProdVO orderProd : list) {
|
||||||
|
ReportOrderProdSumOfBaseNumGroupByOrderIdVO sum = sumList.stream()
|
||||||
|
.filter(item -> item.getOrderId().equals(orderProd.getOrderId()))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
if (sum == null) {
|
||||||
|
orderProd.setVerifyingBaseNum(BigDecimal.ZERO);
|
||||||
|
} else {
|
||||||
|
orderProd.setVerifyingBaseNum(sum.getSum());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,13 +4,14 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.domain.vo.ReportOrderProdSumOfBaseNumGroupByOrderIdVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.mapper.ReportOrderProdMapper;
|
import com.ruoyi.web.yh.reportOrderProd.mapper.ReportOrderProdMapper;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProd;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.service.IReportOrderProdService;
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单产量Service业务层处理
|
* 订单产量Service业务层处理
|
||||||
|
@ -19,7 +20,7 @@ import com.ruoyi.web.yh.reportOrderProd.service.IReportOrderProdService;
|
||||||
* @date 2024-11-19
|
* @date 2024-11-19
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ReportOrderProdServiceImpl implements IReportOrderProdService
|
public class ReportOrderProdServiceImpl implements ReportOrderProdService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReportOrderProdMapper reportOrderProdMapper;
|
private ReportOrderProdMapper reportOrderProdMapper;
|
||||||
|
@ -130,4 +131,9 @@ public class ReportOrderProdServiceImpl implements IReportOrderProdService
|
||||||
List<Long> ids = CollectionUtils.map(list, ReportOrderProd::getId);
|
List<Long> ids = CollectionUtils.map(list, ReportOrderProd::getId);
|
||||||
return reportOrderProdMapper.batchLogicDel(ids);
|
return reportOrderProdMapper.batchLogicDel(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ReportOrderProdSumOfBaseNumGroupByOrderIdVO> selectSumOfBaseNumGroupByOrderId(ReportOrderProdQuery query) {
|
||||||
|
return reportOrderProdMapper.selectSumOfBaseNumGroupByOrderId(query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,8 @@ package com.ruoyi.web.yh.reportProd.service.impl;
|
||||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdQuery;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
import com.ruoyi.web.yh.reportOrderProd.domain.ReportOrderProdVO;
|
||||||
import com.ruoyi.web.yh.reportOrderProd.service.IReportOrderProdService;
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdAssembler;
|
||||||
|
import com.ruoyi.web.yh.reportOrderProd.service.ReportOrderProdService;
|
||||||
import com.ruoyi.web.yh.reportProd.domain.ReportProdVO;
|
import com.ruoyi.web.yh.reportProd.domain.ReportProdVO;
|
||||||
import com.ruoyi.web.yh.reportProd.service.ReportProdAssembler;
|
import com.ruoyi.web.yh.reportProd.service.ReportProdAssembler;
|
||||||
import com.ruoyi.web.yh.reportUserProd.domain.ReportUserProdQuery;
|
import com.ruoyi.web.yh.reportUserProd.domain.ReportUserProdQuery;
|
||||||
|
@ -28,7 +29,10 @@ public class ReportProdAssemblerImpl implements ReportProdAssembler {
|
||||||
private ReportUserProdService reportUserProdService;
|
private ReportUserProdService reportUserProdService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReportOrderProdService reportOrderProdService;
|
private ReportOrderProdService reportOrderProdService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReportOrderProdAssembler reportOrderProdAssembler;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void assembleUserProdList(List<ReportProdVO> list) {
|
public void assembleUserProdList(List<ReportProdVO> list) {
|
||||||
|
@ -58,8 +62,13 @@ public class ReportProdAssemblerImpl implements ReportProdAssembler {
|
||||||
|
|
||||||
ReportOrderProdQuery query = new ReportOrderProdQuery();
|
ReportOrderProdQuery query = new ReportOrderProdQuery();
|
||||||
query.setReportProdIds(CollectionUtils.map(list, ReportProdVO::getId));
|
query.setReportProdIds(CollectionUtils.map(list, ReportProdVO::getId));
|
||||||
Map<Long, List<ReportOrderProdVO>> group = reportOrderProdService.selectReportOrderProdList(query)
|
List<ReportOrderProdVO> orderList = reportOrderProdService.selectReportOrderProdList(query);
|
||||||
.stream().collect(Collectors.groupingBy(ReportOrderProdVO::getReportProdId));
|
|
||||||
|
// 拼接订单数据
|
||||||
|
reportOrderProdAssembler.assembleVerifyingBaseNum(orderList);
|
||||||
|
|
||||||
|
Map<Long, List<ReportOrderProdVO>> group = orderList.stream()
|
||||||
|
.collect(Collectors.groupingBy(ReportOrderProdVO::getReportProdId));
|
||||||
|
|
||||||
for (ReportProdVO prod : list) {
|
for (ReportProdVO prod : list) {
|
||||||
List<ReportOrderProdVO> orderProdList = group.get(prod.getId());
|
List<ReportOrderProdVO> orderProdList = group.get(prod.getId());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user