diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoardController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoardController.java index 2819bf5f..7a61a25e 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoardController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoardController.java @@ -70,4 +70,30 @@ public class MesBoardController extends BaseController { return success(iMesBoradService.getPorOrderList(mesBoard)); } + /**烘房生产监控看板--当天烘房情况**/ + @PostMapping("/getHFProInfo") + public AjaxResult getHFProInfo(@RequestBody BoardDTO mesBoard) { + if (StringUtils.isBlank(mesBoard.getFactoryCode())) { + return error("[factoryCode] 不能为空"); + } + return success(iMesBoradService.getHFProInfo(mesBoard)); + } + + /**烘房生产监控看板--当天质量情况**/ + @PostMapping("/getHFQcInfo") + public AjaxResult getHFQcInfo(@RequestBody BoardDTO mesBoard) { + if (StringUtils.isBlank(mesBoard.getFactoryCode())) { + return error("[factoryCode] 不能为空"); + } + return success(iMesBoradService.getHFQcInfo(mesBoard)); + } + + /**烘房生产监控看板--效率分析**/ + @PostMapping("/getHFxlInfo") + public AjaxResult getHFxlInfo(@RequestBody BoardDTO mesBoard) { + if (StringUtils.isBlank(mesBoard.getFactoryCode())) { + return error("[factoryCode] 不能为空"); + } + return success(iMesBoradService.getHFxlInfo(mesBoard)); + } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java index f435ad48..7e99c2b0 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java @@ -91,4 +91,10 @@ public interface MesMapper { List getCheckList(BoardDTO boardDTO); List getPorOrderList(BoardDTO boardDTO); + + List getHFProInfo(BoardDTO boardDTO); + + List getHFQcInfo(BoardDTO boardDTO); + + List getHFxlInfo(BoardDTO boardDTO); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoradService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoradService.java index d0dcf839..03ff6336 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoradService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoradService.java @@ -16,4 +16,10 @@ public interface IMesBoradService { public Map getProductionLineInfo(BoardDTO mesBoard); public List getPorOrderList(BoardDTO mesBoard); + + public List getHFProInfo(BoardDTO mesBoard); + + public List getHFQcInfo(BoardDTO mesBoard); + + public List getHFxlInfo(BoardDTO mesBoard); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoradServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoradServiceImpl.java index 522d109b..1471b0f9 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoradServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoradServiceImpl.java @@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; @Service public class MesBoradServiceImpl implements IMesBoradService { @@ -141,6 +142,32 @@ public class MesBoradServiceImpl implements IMesBoradService { return dtos; } + @Override + public List getHFProInfo(BoardDTO boardDTO) { + DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode()); + List dtos = mesMapper.getHFProInfo(boardDTO); + return dtos; + } + + @Override + public List getHFQcInfo(BoardDTO boardDTO) { + DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode()); + List dtos = mesMapper.getHFQcInfo(boardDTO); + if(!CollectionUtils.isEmpty(dtos)){ + //不合格 + List isquas = dtos.stream().filter(a -> a.getIsqua().equals("0")).collect(Collectors.toList()); + dtos.get(0).setTaskNum(isquas.size()+""); + } + return dtos; + } + + @Override + public List getHFxlInfo(BoardDTO boardDTO) { + DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode()); + List dtos = mesMapper.getHFxlInfo(boardDTO); + return dtos; + } + //获取当前日期前几天 private List getDays(int dayNum){ List days = new ArrayList<>(); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml index c71f287e..c04b7cc0 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml @@ -368,5 +368,42 @@ and pow.workorder_name = #{equCode} and pow.parent_order ='0' and powb.del_flag = '0' order by powb.batch_code + + + diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java index 15e5e1cc..ce996f4f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java @@ -83,4 +83,6 @@ public interface QcCheckReportIncomeMapper { QcCheckReportIncome getLastXJTaskInfo(QcCheckReportIncome qcCheckReportIncome); QcCheckTaskProduce getLastProductTypeInfo(QcCheckTaskProduce qcCheckTaskProduce); + + List getBatchsByTaskId(String recordId); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java index 5d3465fd..6f6b40bf 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONArray; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.*; @@ -200,6 +201,17 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi if (!CollectionUtils.isEmpty(files)) { dto.setFiles(files); } + //实测结果 + if(StringUtils.isBlank(dto.getActualValue())){ + dto.setActualValue("符合"); + } + + //判定 + if("Y".equals(dto.getStatus())){ + dto.setStatus("√"); + }else if("N".equals(dto.getStatus())){ + dto.setStatus("×"); + } } return dtos; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java index d48f901f..c37d1526 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java @@ -11,6 +11,7 @@ import com.op.quality.mapper.QcCheckTypeProjectMapper; import com.op.quality.mapper.QcMaterialGroupDetailMapper; import com.op.quality.service.IQcCheckReportProductService; import com.op.system.api.domain.SysUser; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -50,7 +51,12 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer @Override @DS("#header.poolName") public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { - return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); + QcCheckReportIncome dto = qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); + + //汇总批次号 + List batchs = qcCheckReportIncomeMapper.getBatchsByTaskId(recordId); + dto.setIncomeBatchNo(StringUtils.join(batchs, ";")); + return dto; } /** diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml index 4a797b31..451b58ba 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml @@ -247,6 +247,14 @@ where c.check_type='checkTypeSCXJ' and c.order_no = #{orderNo} order by c.create_time desc + insert into qc_check_task