增加白坯成型、收坯数据接口

master
Yangwl 3 months ago
parent 91bf322f6b
commit e486f8b0c1

@ -1044,6 +1044,7 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
}
}
}
return reportOrderEnergyDTOList;
return reportOrderEnergyDTOList.stream().sorted(Comparator.comparing(ReportOrderEnergyDTO::getProductDate)
.thenComparing(ReportOrderEnergyDTO::getWorkorderName)).collect(Collectors.toList());
}
}

@ -16,6 +16,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
@ -131,6 +132,13 @@ public class WCSInterfaceController extends BaseController {
return success(wCInterfaceService.getWhiteBoardEquPro7Days(boardDTO));
}
@PostMapping("/getWhiteBoardProdDetails")
public AjaxResult getWhiteBoardProdDetails(@RequestBody(required = false) Map paramMap) {
return success(wCInterfaceService.getWhiteBoardProdDetails(paramMap));
}
/************************************************************/
/****************************数据库清理************************/
/************************************************************/

@ -113,4 +113,8 @@ public interface MesMapper {
Map<String,BoardDTO> getEveryDayMap(BoardDTO boardDTO);
@MapKey("ymd")
Map<String, BoardDTO> getPlanDayMap(BoardDTO boardDTO);
List<Map> getWhiteBoardProdDetails(Map paramMap);
List<Map> whiteBoardProdListDetailss(Map paramMap);
}

@ -46,4 +46,6 @@ public interface IWCSInterfaceService {
R prReportWork(MesReportWork mesReportWork);
Map getWhiteBoardEquPro7Days(BoardDTO boardDTO);
Map getWhiteBoardProdDetails(Map paramMap);
}

@ -3,6 +3,7 @@ package com.op.mes.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
@ -723,6 +724,42 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
return boardMap;
}
@Override
@DS("#header.poolName")
public Map getWhiteBoardProdDetails(Map paramMap) {
List<Map> whiteBoardProdListDetails = mesMapper.getWhiteBoardProdDetails(paramMap);
List<Map> whiteBoardProdListDetailss = mesMapper.whiteBoardProdListDetailss(paramMap);
if (paramMap.get("equipmentCode").toString().equals("S")) {
// 对第一个列表进行修改
for (Map map : whiteBoardProdListDetails) {
if (map.containsKey("completed_count")) {
// 获取 completed_count 字段的值并减去 5
Object completedCountObj = map.get("completed_count");
if (completedCountObj != null && completedCountObj instanceof Number) {
Number completedCount = (Number) completedCountObj;
map.put("completed_count", completedCount.intValue() - 5);
}
}
}
// 对第二个列表进行修改
for (Map map : whiteBoardProdListDetailss) {
if (map.containsKey("completed_count")) {
// 获取 completed_count 字段的值并减去 5
Object completedCountObj = map.get("completed_count");
if (completedCountObj != null && completedCountObj instanceof Number) {
Number completedCount = (Number) completedCountObj;
map.put("completed_count", completedCount.intValue() - 5);
}
}
}
}
Map resultMap=new HashMap();
resultMap.put("leftList",whiteBoardProdListDetails);
resultMap.put("rightlist",whiteBoardProdListDetailss);
return resultMap;
}
protected List<String> get7Days(){
List<String> days = new ArrayList<>();
// 获取当前日期

@ -487,5 +487,48 @@
where pow.product_date>=#{ymd} and pow.del_flag = '0' and pow.shift_id = #{shiftId} and pow.parent_order = '0'
group by pow.product_date
</select>
<select id="getWhiteBoardProdDetails" resultType="java.util.Map">
SELECT
p.workorder_id,
p.workorder_code,
p.car_num as plan_number,
COUNT ( * ) AS completed_count
FROM
pro_order_workorder p
JOIN mes_material_transfer_result m ON p.workorder_id = m.OrderCode
WHERE
CAST ( product_date AS DATE ) = CAST ( GETDATE( ) AS DATE )
AND m.rfid is not null
AND M.shift_id = #{shiftId}
AND m.equipmentCode LIKE 'C%'
GROUP BY
p.workorder_id,
p.workorder_code,
p.car_num;
</select>
<select id="whiteBoardProdListDetailss" resultType="java.util.Map">
SELECT
m.equipmentCode,
n.workorder_code,
n.product_name,
COUNT ( * ) AS completed_count
FROM
mes_material_transfer_result m
LEFT JOIN pro_order_workorder n ON m.OrderCode= n.workorder_id
WHERE
CAST ( n.product_date AS DATE ) = CAST ( GETDATE( ) AS DATE )
AND m.shift_id = #{shiftId} -- 示例的额外筛选条件
AND m.equipmentCode LIKE 'C%'
AND n.status= 'w2'
AND m.rfid IS NOT NULL
GROUP BY
n.workorder_code,
n.product_name,
m.OrderCode,
m.equipmentCode
ORDER BY
equipmentCode ASC;
</select>
</mapper>

@ -706,7 +706,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and CONVERT(varchar(10), #{productDateEnd}, 23) >= CONVERT(varchar(10),pow.product_date, 23)
</if>
<if test="productCode != null and productCode != ''">and pow.product_code like concat('%', #{productCode}, '%')</if>
order by be.equipment_code
order by pow.product_date ASC,pow.workorder_name ASC;
</select>
<select id="getDailyReportUpBP" resultType="com.op.mes.domain.vo.MesDailyReportVo">
select be.workshop_code workshopCode,

Loading…
Cancel
Save