入库检验方案报告+烘房看板2

master
zhaoxiaolin 9 months ago
parent 38075ba1f2
commit 6031e3f347

@ -70,4 +70,30 @@ public class MesBoardController extends BaseController {
return success(iMesBoradService.getPorOrderList(mesBoard)); 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));
}
} }

@ -91,4 +91,10 @@ public interface MesMapper {
List<QcCheckTaskDTO> getCheckList(BoardDTO boardDTO); List<QcCheckTaskDTO> getCheckList(BoardDTO boardDTO);
List<ProOrderWorkorder> getPorOrderList(BoardDTO boardDTO); List<ProOrderWorkorder> getPorOrderList(BoardDTO boardDTO);
List<BoardDTO> getHFProInfo(BoardDTO boardDTO);
List<BoardDTO> getHFQcInfo(BoardDTO boardDTO);
List<BoardDTO> getHFxlInfo(BoardDTO boardDTO);
} }

@ -16,4 +16,10 @@ public interface IMesBoradService {
public Map<String,BoardDTO> getProductionLineInfo(BoardDTO mesBoard); public Map<String,BoardDTO> getProductionLineInfo(BoardDTO mesBoard);
public List<ProOrderWorkorder> getPorOrderList(BoardDTO mesBoard); public List<ProOrderWorkorder> getPorOrderList(BoardDTO mesBoard);
public List<BoardDTO> getHFProInfo(BoardDTO mesBoard);
public List<BoardDTO> getHFQcInfo(BoardDTO mesBoard);
public List<BoardDTO> getHFxlInfo(BoardDTO mesBoard);
} }

@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Service @Service
public class MesBoradServiceImpl implements IMesBoradService { public class MesBoradServiceImpl implements IMesBoradService {
@ -141,6 +142,32 @@ public class MesBoradServiceImpl implements IMesBoradService {
return dtos; return dtos;
} }
@Override
public List<BoardDTO> getHFProInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<BoardDTO> dtos = mesMapper.getHFProInfo(boardDTO);
return dtos;
}
@Override
public List<BoardDTO> getHFQcInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<BoardDTO> dtos = mesMapper.getHFQcInfo(boardDTO);
if(!CollectionUtils.isEmpty(dtos)){
//不合格
List<BoardDTO> isquas = dtos.stream().filter(a -> a.getIsqua().equals("0")).collect(Collectors.toList());
dtos.get(0).setTaskNum(isquas.size()+"");
}
return dtos;
}
@Override
public List<BoardDTO> getHFxlInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<BoardDTO> dtos = mesMapper.getHFxlInfo(boardDTO);
return dtos;
}
//获取当前日期前几天 //获取当前日期前几天
private List<String> getDays(int dayNum){ private List<String> getDays(int dayNum){
List<String> days = new ArrayList<>(); List<String> days = new ArrayList<>();

@ -368,5 +368,42 @@
and pow.workorder_name = #{equCode} and pow.parent_order ='0' and powb.del_flag = '0' and pow.workorder_name = #{equCode} and pow.parent_order ='0' and powb.del_flag = '0'
order by powb.batch_code order by powb.batch_code
</select> </select>
<select id="getHFProInfo" resultType="com.op.system.api.domain.dto.BoardDTO">
select t.*,isnull(be.unit_working_hours,0) unitPro from
(
select count(0) totalNum,
device_code equCode
from mes_dryinghouse_result
where type = '1' and CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
GROUP BY device_code
) t
left join base_equipment be on be.equipment_code = t.equCode
</select>
<select id="getHFQcInfo" resultType="com.op.system.api.domain.dto.BoardDTO">
select rfid,
isqua,
machine_code equCode,
product_name productName,
create_time createTime
from qc_pro_check
where CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</select>
<select id="getHFxlInfo" resultType="com.op.system.api.domain.dto.BoardDTO">
select t2.totalNum0,t1.* from
(
select count(0) totalNum,
device_code equCode
from mes_dryinghouse_result
where type = '1' and CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
GROUP BY device_code
) t1
left join (
select count(0) totalNum0,
device_code equCode
from mes_dryinghouse_result
where type = '0' and CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
GROUP BY device_code
) t2 on t1.equCode = t2.equCode
</select>
</mapper> </mapper>

@ -83,4 +83,6 @@ public interface QcCheckReportIncomeMapper {
QcCheckReportIncome getLastXJTaskInfo(QcCheckReportIncome qcCheckReportIncome); QcCheckReportIncome getLastXJTaskInfo(QcCheckReportIncome qcCheckReportIncome);
QcCheckTaskProduce getLastProductTypeInfo(QcCheckTaskProduce qcCheckTaskProduce); QcCheckTaskProduce getLastProductTypeInfo(QcCheckTaskProduce qcCheckTaskProduce);
List<String> getBatchsByTaskId(String recordId);
} }

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils; 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.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*; import com.op.quality.domain.*;
@ -200,6 +201,17 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi
if (!CollectionUtils.isEmpty(files)) { if (!CollectionUtils.isEmpty(files)) {
dto.setFiles(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; return dtos;

@ -11,6 +11,7 @@ import com.op.quality.mapper.QcCheckTypeProjectMapper;
import com.op.quality.mapper.QcMaterialGroupDetailMapper; import com.op.quality.mapper.QcMaterialGroupDetailMapper;
import com.op.quality.service.IQcCheckReportProductService; import com.op.quality.service.IQcCheckReportProductService;
import com.op.system.api.domain.SysUser; import com.op.system.api.domain.SysUser;
import org.apache.commons.lang.StringUtils;
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 org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -50,7 +51,12 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) {
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); QcCheckReportIncome dto = qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId);
//汇总批次号
List<String> batchs = qcCheckReportIncomeMapper.getBatchsByTaskId(recordId);
dto.setIncomeBatchNo(StringUtils.join(batchs, ";"));
return dto;
} }
/** /**

@ -247,6 +247,14 @@
where c.check_type='checkTypeSCXJ' and c.order_no = #{orderNo} where c.check_type='checkTypeSCXJ' and c.order_no = #{orderNo}
order by c.create_time desc order by c.create_time desc
</select> </select>
<select id="getBatchsByTaskId" resultType="java.lang.String">
select powb.batch_code incomeBatchNo
from qc_check_task qct
left join pro_order_workorder pow on pow.workorder_code = qct.order_no
left join pro_order_workorder_batch powb on powb.workorder_id = pow.workorder_id
where qct.record_id = #{recordId}
order by powb.batch_code
</select>
<insert id="insertQcCheckReportIncome" parameterType="QcCheckReportIncome"> <insert id="insertQcCheckReportIncome" parameterType="QcCheckReportIncome">
insert into qc_check_task insert into qc_check_task
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save