jx mes 生产线运行看板

tags/yfai-mes-ext-v1.0
王杰 2 years ago
parent 46ebadc5e1
commit 72ed1f52de

@ -12,11 +12,10 @@ import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -35,6 +34,7 @@ import java.util.Map;
public class JxCenterWorkingBoardController extends MesBaseController {
@Autowired
@Qualifier("jxCenterWorkingBoardDispatchService")
private IJxCenterWorkingBoardService centerWorkingBoardService;
@PostMapping(value = "/ext/jx/center-working-board/query")
@ -47,8 +47,7 @@ public class JxCenterWorkingBoardController extends MesBaseController {
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("参数缺失业务标志[flag]!")
.build();
dataMap.put(MesExtConstWords.ORGANIZE_CODE, "CN33");
// dataMap.put(MesExtConstWords.ORGANIZE_CODE, AuthUtil.getOrganize().getOrganizeCode());
dataMap.put(MesExtConstWords.ORGANIZE_CODE, AuthUtil.getOrganize().getOrganizeCode());
dataMap.put(MesExtConstWords.START_TIME, TimeTool.getNowTime(true));
return ResultBean.success("查询成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultMap(centerWorkingBoardService.queryCenterWorkingBoardData(dataMap));
} catch (ImppBusiException busExcep) {

@ -16,7 +16,6 @@ import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
import java.awt.*;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
@ -38,13 +37,9 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard
private MesWorkCenterNotificationBarRepository workCenterNotificationBarRepository;
public JxCenterWorkingBoardBusiOneService(IJxCenterWorkingBoardService proxyService) {
this.proxyService = proxyService;
this.fourMDetailRepository = (MesFourMDetailRepository) SpringContextsUtil.getBean("mesFourMDetailRepository");
this.workCenterNotificationBarRepository = (MesWorkCenterNotificationBarRepository) SpringContextsUtil.getBean("mesWorkCenterNotificationBarRepository");
}
@Override
@ -116,7 +111,7 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard
}
enum SHIFT_PROD_TYPE_COLOR {
//System.out.println(String.format("#%02x%02x%02x", Color.white.getRed(), Color.white.getGreen(), Color.white.getBlue()));
NO_WORKING(0, "无生产", "无生产", "#808080", "gray"),
NORMAL_STOP_CENTER(10, "常规停机", "常规停机", "#808080", "gray"),
UNNORMAL_STOP_CENTER(20, "非常规停机", "异常停机", "#ff0000", "red"),
@ -151,8 +146,4 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard
}
}
public static void main(String[] args) {
System.out.println(String.format("#%02x%02x%02x", Color.white.getRed(), Color.white.getGreen(), Color.white.getBlue()));
}
}

@ -1,9 +1,19 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx;
import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesOutPutStatistics;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.platform.common.tool.MathOperation;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @Author : wangjie
@ -11,7 +21,7 @@ import java.util.Map;
* @Modify:
**/
@Slf4j
public class JxCenterWorkingBoardBusiThreeService implements IJxCenterWorkingBoardService {
public class JxCenterWorkingBoardBusiThreeService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService {
private IJxCenterWorkingBoardService proxyService;
@ -21,7 +31,66 @@ public class JxCenterWorkingBoardBusiThreeService implements IJxCenterWorkingBoa
@Override
public Map<String, Object> queryCenterWorkingBoardData(Map<String, Object> dataMap) {
dataMap = proxyService.queryCenterWorkingBoardData(dataMap);
MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName());
List<MesWorkOrder> workOrderList = (List<MesWorkOrder>) dataMap.get(MesWorkOrder.class.getSimpleName());
List<MesOutPutStatistics> outPutStatisticsList = (List<MesOutPutStatistics>) dataMap.get(MesOutPutStatistics.class.getSimpleName());
Optional<MesWorkOrder> curWorkOrder = getFirstWorkOrder(workOrderList, outPutStatisticsList, workCenterExtDb);
List<MesOutPutStatistics> curOutPutStatisticsList = getFirstOutPutStatisticsList(outPutStatisticsList, curWorkOrder);
dataMap.put("当前生产机种名", getCurProdPartNo(curOutPutStatisticsList, curWorkOrder));
dataMap.put("当前计划台数", getQtyStr(getCurPlanQty(curOutPutStatisticsList, curWorkOrder, workCenterExtDb, dataMap)));
dataMap.put("当前实绩台数", getQtyStr(dataMap.containsKey(MesExtConstWords.COMPLET_QTY) ? (Double) dataMap.get(MesExtConstWords.COMPLET_QTY) : getOutPutStatisticsList2AmountQty(curOutPutStatisticsList)));
return clearUselessData(dataMap);
}
@Override
public Map<String, Object> clearUselessData(Map<String, Object> dataMap) {
dataMap.remove(MesWorkCenterExt.class.getSimpleName());
dataMap.remove(MesWorkOrder.class.getSimpleName());
dataMap.remove(MesOutPutStatistics.class.getSimpleName());
dataMap.remove(MesExtConstWords.COMPLET_QTY);
return dataMap;
}
private Optional<MesWorkOrder> getFirstWorkOrder(List<MesWorkOrder> workOrderList, List<MesOutPutStatistics> outPutStatisticsList, MesWorkCenterExt workCenterExtDb) {
if (!CollectionUtils.isEmpty(outPutStatisticsList)) return CollectionUtils.isEmpty(workOrderList) ? null : workOrderList.stream().filter(o -> (null != o && o.getOrderNo().equals(outPutStatisticsList.get(0).getWorkOrderNo()))).findFirst();
List<MesWorkOrder> workOrderList2Sort = getWorkOrderList2Sort(workOrderList, outPutStatisticsList, workCenterExtDb);
return CollectionUtils.isEmpty(workOrderList2Sort) ? null : Optional.of(workOrderList2Sort.get(0));
}
private List<MesOutPutStatistics> getFirstOutPutStatisticsList(List<MesOutPutStatistics> outPutStatisticsList, Optional<MesWorkOrder> curWorkOrder) {
String curWorkOrderNo = (null != curWorkOrder && curWorkOrder.isPresent()) ? curWorkOrder.get().getOrderNo() : (!CollectionUtils.isEmpty(outPutStatisticsList) ? outPutStatisticsList.get(0).getWorkOrderNo() : null);
return (StringUtils.isEmpty(curWorkOrderNo) || CollectionUtils.isEmpty(outPutStatisticsList)) ? null : outPutStatisticsList.stream().filter(o -> (null != o && o.getWorkOrderNo().equals(curWorkOrderNo))).collect(Collectors.toList());
}
private Object getCurProdPartNo(List<MesOutPutStatistics> curOutPutStatisticsList, Optional<MesWorkOrder> curWorkOrder) {
return !CollectionUtils.isEmpty(curOutPutStatisticsList) ? curOutPutStatisticsList.get(0).getPartNo() : ((null != curWorkOrder && curWorkOrder.isPresent()) ? curWorkOrder.get().getPartNo() : MesExtConstWords.EMPTY);
}
private Double getCurPlanQty(List<MesOutPutStatistics> curOutPutStatisticsList, Optional<MesWorkOrder> curWorkOrder, MesWorkCenterExt workCenterExtDb, Map<String, Object> dataMap) {
return (null == curWorkOrder || !curWorkOrder.isPresent()) ? MesExtConstWords.ZERO :
(curWorkOrder.get().getStartTime().contains(workCenterExtDb.getWorkTime()) ? curWorkOrder.get().getQty() :
MathOperation.add(MathOperation.sub(curWorkOrder.get().getQty(), curWorkOrder.get().getCompleteQty()), amountOutPutStatisticsQty(curOutPutStatisticsList, dataMap)));
}
private Double amountOutPutStatisticsQty(List<MesOutPutStatistics> outPutStatisticsList, Map<String, Object> dataMap) {
Double qty = getOutPutStatisticsList2AmountQty(outPutStatisticsList);
dataMap.put(MesExtConstWords.COMPLET_QTY, qty);
return qty;
}
}

@ -28,7 +28,7 @@ import java.util.stream.Collectors;
* @Modify:
**/
@Slf4j
public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoardService {
public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService {
private IJxCenterWorkingBoardService proxyService;
@ -39,15 +39,10 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
private MesRepairTaskRepository repairTaskRepository;
public JxCenterWorkingBoardBusiTwoService(IJxCenterWorkingBoardService proxyService) {
this.proxyService = proxyService;
this.shiftRepository = (MesShiftRepository) SpringContextsUtil.getBean("mesShiftRepository");
this.orderJobRepository = (MesOrderJobRepository) SpringContextsUtil.getBean("mesOrderJobRepository");
this.repairTaskRepository = (MesRepairTaskRepository) SpringContextsUtil.getBean("mesRepairTaskRepository");
}
@Override
@ -115,9 +110,10 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
}
private List<MesRepairTask> getRepairTaskList(MesWorkCenterExt workCenterExtDb) {
return repairTaskRepository.findByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME},
new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getWorkTime()});
return StringUtils.isEmpty(workCenterExtDb.getWorkTime()) ? null :
repairTaskRepository.findByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME},
new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getWorkTime()});
}
private void statisticsData(List<MesShiftProdCenterRecord> shiftProdCenterRecordList, List<MesOutPutStatistics> outPutStatisticsList,
@ -162,15 +158,17 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
}
private String getShiftName(MesWorkCenterExt workCenterExtDb) {
return shiftRepository.getByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.SHIFT_CODE},
new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getShiftCode()}).getShiftName();
return StringUtils.isEmpty(workCenterExtDb.getShiftCode()) ? MesExtConstWords.EMPTY :
shiftRepository.getByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.SHIFT_CODE},
new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getShiftCode()}).getShiftName();
}
private String getOrderJobStatistics(MesWorkCenterExt workCenterExtDb) {
List<MesOrderJob> orderJobList = orderJobRepository.findByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME, MesExtConstWords.SHIFT_CODE},
new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getWorkTime(), workCenterExtDb.getShiftCode()});
List<MesOrderJob> orderJobList = (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) ? null :
orderJobRepository.findByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME, MesExtConstWords.SHIFT_CODE},
new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getWorkTime(), workCenterExtDb.getShiftCode()});
orderJobList = CollectionUtils.isEmpty(orderJobList)? null :
orderJobList.stream().filter(o -> (null != o && MesExtEnumUtil.MES_ORJ_ORDER_STATUS.CLOSE.getValue() != o.getOrderStatus())).collect(Collectors.toList());
List<MesOrderJob> orderJobList4Complete = CollectionUtils.isEmpty(orderJobList)? null :
@ -194,8 +192,6 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
return getQtyStr(completeQty);
}
private String getQtyStr(Double qty) { return qty.intValue() + "台"; }
private BigDecimal getCurProdPassthroughRate(List<MesOutPutStatistics> outPutStatisticsList, List<MesRepairTask> repairTaskList) {
if (CollectionUtils.isEmpty(outPutStatisticsList)) return new BigDecimal(0);
List<MesOutPutStatistics> filterList = outPutStatisticsList.stream().filter(o -> (null != o && o.getWorkOrderNo().equals(outPutStatisticsList.get(0).getWorkOrderNo()))).collect(Collectors.toList());
@ -212,16 +208,11 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
return divThenMul100Format1RoundHalfUp(qty, MathOperation.add(qty, repairQty));
}
private Double getOutPutStatisticsList2AmountQty(List<MesOutPutStatistics> outPutStatisticsList) {
return CollectionUtils.isEmpty(outPutStatisticsList) ? new Double(0) : outPutStatisticsList.stream().filter(o -> null != o).mapToDouble(MesOutPutStatistics::getQty).sum();
}
private JxCenterWorkingBoardBusiModel getProductionSchedule(List<MesWorkOrder> workOrderList, List<MesOutPutStatistics> outPutStatisticsList, MesWorkCenterExt workCenterExtDb) {
JxCenterWorkingBoardBusiModel psData = new JxCenterWorkingBoardBusiModel().title("生产计划进度");
List<MesWorkOrder> workOrderList2Sort = CollectionUtils.isEmpty(workOrderList) ? null :
workOrderList.stream().filter(o -> (null != o && (o.getStartTime().contains(workCenterExtDb.getWorkTime()) || MesExtEnumUtil.WORK_ORDER_STATUS.CLOSE.getValue() != o.getWorkOrderStatus()))).sorted(Comparator.comparing(MesWorkOrder::getSeq)).collect(Collectors.toList());
List<MesWorkOrder> workOrderList2Sort = getWorkOrderList2Sort(workOrderList, outPutStatisticsList, workCenterExtDb);
Set<String> partNoList = new TreeSet<>();
if (!CollectionUtils.isEmpty(outPutStatisticsList)) partNoList.add(outPutStatisticsList.get(0).getPartNo());
@ -229,7 +220,7 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
if (!CollectionUtils.isEmpty(outPutStatisticsList)) outPutStatisticsList.stream().filter(o -> null != o).forEach(o -> partNoList.add(o.getPartNo()));
if (CollectionUtils.isEmpty(partNoList)) return psData;
Map<String, List<MesWorkOrder>> orderMap = CollectionUtils.isEmpty(workOrderList) ? null : workOrderList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrder::getPartNo));
Map<String, List<MesWorkOrder>> orderMap = CollectionUtils.isEmpty(workOrderList2Sort) ? null : workOrderList2Sort.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrder::getPartNo));
Map<String, List<MesOutPutStatistics>> outPutMap = CollectionUtils.isEmpty(outPutStatisticsList) ? null : outPutStatisticsList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesOutPutStatistics::getPartNo));
for (String partNo : partNoList) {
@ -240,7 +231,7 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
Map<String, List<MesOutPutStatistics>> itemMap2OutPut = CollectionUtils.isEmpty(outPutList) ? null : outPutList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesOutPutStatistics::getWorkOrderNo));
psData.addChartData(partNo, statisticsPlanQty(orderList, itemMap2OutPut, workCenterExtDb), getOutPutStatisticsList2AmountQty(outPutList), !CollectionUtils.isEmpty(psData.getChartDataList()) ? "#ffffff" : "#00ff00");
psData.addChartData2ChartDataLists(5, partNo, statisticsPlanQty(orderList, itemMap2OutPut, workCenterExtDb), getOutPutStatisticsList2AmountQty(outPutList), !CollectionUtils.isEmpty(psData.getChartDataList()) ? "#ffffff" : "#00ff00");
}

@ -0,0 +1,36 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesOutPutStatistics;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt;
import cn.estsh.i3plus.platform.common.tool.MathOperation;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author : wangjie
* @CreateDate : 2022-02-15
* @Modify:
**/
@Slf4j
public class JxCenterWorkingBoardCommonService {
public List<MesWorkOrder> getWorkOrderList2Sort(List<MesWorkOrder> workOrderList, List<MesOutPutStatistics> outPutStatisticsList, MesWorkCenterExt workCenterExtDb) {
List<String> hasOutPutOrder = CollectionUtils.isEmpty(outPutStatisticsList) ? null : outPutStatisticsList.stream().filter(o -> null != o).map(MesOutPutStatistics::getWorkOrderNo).collect(Collectors.toList());
return CollectionUtils.isEmpty(workOrderList) ? null :
workOrderList.stream().filter(o -> (null != o && (
o.getStartTime().contains(workCenterExtDb.getWorkTime()) || (MathOperation.compareTo(o.getQty(), o.getCompleteQty()) != 0 || (!CollectionUtils.isEmpty(hasOutPutOrder) && hasOutPutOrder.contains(o.getOrderNo())))
))).sorted(Comparator.comparing(MesWorkOrder::getSeq)).collect(Collectors.toList());
}
public Double getOutPutStatisticsList2AmountQty(List<MesOutPutStatistics> outPutStatisticsList) {
return CollectionUtils.isEmpty(outPutStatisticsList) ? new Double(0) : outPutStatisticsList.stream().filter(o -> null != o).mapToDouble(MesOutPutStatistics::getQty).sum();
}
public String getQtyStr(Double qty) { return qty.intValue() + "台"; }
}

@ -14,7 +14,7 @@ import java.util.Map;
**/
@Slf4j
@Service
public class JxCenterWorkingBoardService implements IJxCenterWorkingBoardService {
public class JxCenterWorkingBoardDispatchService implements IJxCenterWorkingBoardService {
@Override
public Map<String, Object> queryCenterWorkingBoardData(Map<String, Object> dataMap) {
@ -25,8 +25,10 @@ public class JxCenterWorkingBoardService implements IJxCenterWorkingBoardService
case "2":
return new JxCenterWorkingBoardBusiTwoService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxySpcrService(new JxCenterWorkingBoardProxyCenterService())))).queryCenterWorkingBoardData(dataMap);
case "3":
return new JxCenterWorkingBoardBusiThreeService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyCenterService()))).queryCenterWorkingBoardData(dataMap);
default:
return dataMap;
}
}

@ -20,9 +20,7 @@ public class JxCenterWorkingBoardProxyCenterService implements IJxCenterWorkingB
private IProdOrgExtService prodOrgExtService;
public JxCenterWorkingBoardProxyCenterService() {
this.prodOrgExtService = (IProdOrgExtService) SpringContextsUtil.getBean("prodOrgExtService");
}
@Override

@ -32,11 +32,8 @@ public class JxCenterWorkingBoardProxyOrderService implements IJxCenterWorkingBo
private MesWorkOrderRepository workOrderRepository;
public JxCenterWorkingBoardProxyOrderService(IJxCenterWorkingBoardService proxyService) {
this.proxyService = proxyService;
this.workOrderRepository = (MesWorkOrderRepository) SpringContextsUtil.getBean("mesWorkOrderRepository");
}
@Override
@ -50,7 +47,10 @@ public class JxCenterWorkingBoardProxyOrderService implements IJxCenterWorkingBo
DdlPackBean packBean = DdlPackBean.getDdlPackBean(workCenterExtDb.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(workCenterExtDb.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue(), MesExtConstWords.WORK_ORDER_TYPE, packBean);
DdlPreparedPack.timeBuilder(getStatrtTimeByFlag(dataMap, workCenterExtDb.getWorkTime()) + MesExtConstWords.APPEND_ZERO_HMS, workCenterExtDb.getWorkTime() + MesExtConstWords.APPEND_24_HMS, MesExtConstWords.START_TIME, true, true, packBean);
DdlPreparedPack.timeBuilder(
TimeTool.timeCalc(TimeTool.stringParseToDate(workCenterExtDb.getWorkTime(), MesExtConstWords.DATE_FORMAT), Calendar.DATE, -1, MesExtConstWords.DATE_FORMAT) + MesExtConstWords.APPEND_ZERO_HMS,
workCenterExtDb.getWorkTime() + MesExtConstWords.APPEND_24_HMS, MesExtConstWords.START_TIME, true, true, packBean
);
List<MesWorkOrder> workOrderList = workOrderRepository.findByHqlWhere(packBean);
workOrderList = CollectionUtils.isEmpty(workOrderList) ? null : workOrderList.stream().filter(o -> (null != o && MesExtEnumUtil.WORK_ORDER_STATUS.CREATE.getValue() != o.getWorkOrderStatus() && MesExtEnumUtil.WORK_ORDER_STATUS.REMOVE.getValue() != o.getWorkOrderStatus())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workOrderList)) return dataMap;
@ -60,10 +60,4 @@ public class JxCenterWorkingBoardProxyOrderService implements IJxCenterWorkingBo
return dataMap;
}
private String getStatrtTimeByFlag(Map<String, Object> dataMap, String startTime) {
if (!dataMap.get(MesExtConstWords.FLAG).equals("2")) return startTime;
return TimeTool.timeCalc(TimeTool.stringParseToDate(startTime, MesExtConstWords.DATE_FORMAT), Calendar.DATE, -1, MesExtConstWords.DATE_FORMAT);
}
}

@ -31,13 +31,9 @@ public class JxCenterWorkingBoardProxyOutPutService implements IJxCenterWorkingB
private IPartExtDao partExtDao;
public JxCenterWorkingBoardProxyOutPutService(IJxCenterWorkingBoardService proxyService) {
this.proxyService = proxyService;
this.outPutStatisticsRepository = (MesOutPutStatisticsRepository) SpringContextsUtil.getBean("mesOutPutStatisticsRepository");
this.partExtDao = (IPartExtDao) SpringContextsUtil.getBean("partExtDao");
}
@Override

@ -27,11 +27,8 @@ public class JxCenterWorkingBoardProxySpcrService implements IJxCenterWorkingBoa
private MesShiftProdCenterRecordRepository shiftProdCenterRecordRepository;
public JxCenterWorkingBoardProxySpcrService(IJxCenterWorkingBoardService proxyService) {
this.proxyService = proxyService;
this.shiftProdCenterRecordRepository = (MesShiftProdCenterRecordRepository) SpringContextsUtil.getBean("mesShiftProdCenterRecordRepository");
}
@Override

@ -21,6 +21,9 @@ public class JxCenterWorkingBoardBusiModel extends JxEChartsReportCommonDataMode
private static final long serialVersionUID = -3290431005501985429L;
@ApiParam("图表数据")
private List<List<SxDataModel>> chartDataLists;
@ApiParam("图表数据")
private List<SxDataModel> chartDataList;
@ApiParam("标题")
@ -31,9 +34,18 @@ public class JxCenterWorkingBoardBusiModel extends JxEChartsReportCommonDataMode
return this;
}
public JxCenterWorkingBoardBusiModel addChartData2ChartDataLists(Integer size, String key, Object value, Object value2, Object value3) {
if (CollectionUtils.isEmpty(this.chartDataLists)) this.chartDataLists = new LinkedList<>();
List<SxDataModel> chartDataList = (CollectionUtils.isEmpty(this.chartDataLists) || this.chartDataLists.get(this.chartDataLists.size() - 1).size() == size) ? new LinkedList<>() : this.chartDataLists.get(this.chartDataLists.size() - 1);
chartDataList.add(new JxEChartsReportCommonDataModel.SxDataModel(key, value, value2, value3));
this.chartDataLists.add(chartDataList.size() == 1 ? this.chartDataLists.size() : this.chartDataLists.size() - 1, chartDataList);
return this;
}
public JxCenterWorkingBoardBusiModel addChartData(String key, Object value, Object value2, Object value3) {
if (CollectionUtils.isEmpty(this.chartDataList)) this.chartDataList = new LinkedList<>();
this.chartDataList.add(new JxEChartsReportCommonDataModel.SxDataModel(key, value, value2, value3));
return this;
}
}

Loading…
Cancel
Save