生产日报表优化

master
杨万里 2 months ago
parent a774e1cc4d
commit 7d67eb7be0

@ -250,7 +250,7 @@ public class MesReportWorkController extends BaseController {
@RequiresPermissions("mes:dailyReport:list") @RequiresPermissions("mes:dailyReport:list")
@GetMapping("/getDailyReportNew") @GetMapping("/getDailyReportNew")
@Log(title = "生产日报表查询", businessType = BusinessType.QUERY) //@Log(title = "生产日报表查询", businessType = BusinessType.QUERY)
public TableDataInfo getDailyReportNew(MesDailyReportVo mesDailyReportVo) { public TableDataInfo getDailyReportNew(MesDailyReportVo mesDailyReportVo) {
startPage(); startPage();
List<MesDailyReportVo> list = mesReportWorkService.getDailyReportNew(mesDailyReportVo); List<MesDailyReportVo> list = mesReportWorkService.getDailyReportNew(mesDailyReportVo);

@ -107,6 +107,7 @@ public class MesDailyReportVo extends BaseEntity {
private String reason; private String reason;
private String machineCode; private String machineCode;
private BigDecimal reportRate; private BigDecimal reportRate;
@Excel(name = "用人情况说明")
private String useManRemark; private String useManRemark;
public String getUseManRemark() { public String getUseManRemark() {

@ -433,18 +433,16 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName"; String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", ""); String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
List<MesDailyReportVo> dtos = mesReportWorkMapper.getDailyReportUp(mesDailyReportVo); List<MesDailyReportVo> dtos = mesReportWorkMapper.getDailyReportUp(mesDailyReportVo);
for (MesDailyReportVo dto : dtos) { for (MesDailyReportVo dto : dtos) {
dto.setFactoryCode(factoryCode); dto.setFactoryCode(factoryCode);
//品类 //品类
String typeName = mesReportWorkMapper.getTypeName(dto.getProductCode().replace("0000000","")); // String typeName = mesReportWorkMapper.getTypeName(dto.getProductCode().replace("0000000",""));
if(StringUtils.isNotBlank(typeName)){ // if(StringUtils.isNotBlank(typeName)){
dto.setProdType(typeName); // dto.setProdType(typeName);
}else { // }else {
dto.setProdType("蚊香"); // dto.setProdType("蚊香");
} // }
QuantityDto quantityDto = new QuantityDto(); QuantityDto quantityDto = new QuantityDto();
String workorderCode = dto.getWorkorderCode(); String workorderCode = dto.getWorkorderCode();
@ -453,15 +451,15 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
quantityDto.setWorkorderCode(workorderCode); quantityDto.setWorkorderCode(workorderCode);
quantityDto.setMachineCode(machineCode); quantityDto.setMachineCode(machineCode);
//影响效率原因/用人说明 //影响效率原因/用人说明
MesDailyReportVos mesDailyReportVos = mesReportWorkMapper.getProductReason(quantityDto); // MesDailyReportVos mesDailyReportVos = mesReportWorkMapper.getProductReason(quantityDto);
if (mesDailyReportVos!=null){ // if (mesDailyReportVos!=null){
if (StringUtils.isNotBlank(mesDailyReportVos.getReason())){ // if (StringUtils.isNotBlank(mesDailyReportVos.getReason())){
dto.setReason(mesDailyReportVos.getReason().replaceAll(";+", " ")); // dto.setReason(mesDailyReportVos.getReason().replaceAll(";+", " "));
} // }
if (StringUtils.isNotBlank(mesDailyReportVos.getUseManRemark())){ // if (StringUtils.isNotBlank(mesDailyReportVos.getUseManRemark())){
dto.setUseManRemark(mesDailyReportVos.getUseManRemark().replaceAll(";+", " ")); // dto.setUseManRemark(mesDailyReportVos.getUseManRemark().replaceAll(";+", " "));
} // }
} // }
QuantityDto parentMesReport = mesReportWorkMapper.getRealQuantity(quantityDto); QuantityDto parentMesReport = mesReportWorkMapper.getRealQuantity(quantityDto);
QuantityDto sonMesReport = mesReportWorkMapper.getSumQuantity(quantityDto); QuantityDto sonMesReport = mesReportWorkMapper.getSumQuantity(quantityDto);
if(sonMesReport == null){//单层工单的情况 if(sonMesReport == null){//单层工单的情况

@ -802,12 +802,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pow.workorder_code workorderCode, pow.workorder_code workorderCode,
pow.workorder_name workorderName, pow.workorder_name workorderName,
bp.umrez spec, bp.umrez spec,
bp.report_rate reportRate bp.report_rate reportRate,
COALESCE(bpa.category, '蚊香') AS category,
mrw.reason AS reason,
mrw.useManRemark AS useManRemark
from base_equipment be from base_equipment be
left join pro_order_workorder pow on be.equipment_code = pow.workorder_name left join pro_order_workorder pow on be.equipment_code = pow.workorder_name
LEFT JOIN base_shifts_t bst ON bst.Shift_Id=pow.shift_id LEFT JOIN base_shifts_t bst ON bst.Shift_Id=pow.shift_id
left join mes_line_product mlp on pow.workorder_name = mlp.line_code and pow.product_code = mlp.product_code and mlp.del_flag='0' left join mes_line_product mlp on pow.workorder_name = mlp.line_code and pow.product_code = mlp.product_code and mlp.del_flag='0'
left join base_product bp on bp.product_code = pow.product_code left join base_product bp on bp.product_code = pow.product_code
LEFT JOIN (SELECT MIN(id) AS min_id,product_code,category FROM base_product_attached GROUP BY product_code,category) bpa ON RIGHT(pow.product_code, 11) = bpa.product_code
LEFT JOIN (SELECT
remark AS reason,
use_man_remark AS useManRemark,
workorder_code
FROM
mes_report_work
WHERE
del_flag = '0'
AND Reason IS NOT NULL
AND use_man_remark IS NOT NULL
AND reason != '无'
GROUP BY
use_man_remark,
remark,workorder_code) mrw ON mrw.workorder_code = pow.workorder_code
where be.del_flag = '0' and be.sap_code is not null and pow.status in ('w2','w3') where be.del_flag = '0' and be.sap_code is not null and pow.status in ('w2','w3')
and pow.parent_order = '0' and pow.del_flag='0' and pow.parent_order = '0' and pow.del_flag='0'
<if test="sapName != null and sapName != ''">and be.equipment_name like concat('%', #{sapName}, '%')</if> <if test="sapName != null and sapName != ''">and be.equipment_name like concat('%', #{sapName}, '%')</if>
@ -1775,7 +1793,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND product_code = #{productCode} AND product_code = #{productCode}
</select> </select>
<select id="getProductReason" resultType="com.op.mes.domain.vo.MesDailyReportVos"> <select id="getProductReason" resultType="com.op.mes.domain.vo.MesDailyReportVos">
SELECT SELECT
remark AS reason, remark AS reason,
use_man_remark AS useManRemark use_man_remark AS useManRemark
FROM FROM

Loading…
Cancel
Save