|
|
@ -55,6 +55,15 @@ public class MesBoradServiceImpl implements IMesBoradService {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
boardDTO.setEquipmentTypeCode("equ_type_bzx");
|
|
|
|
boardDTO.setEquipmentTypeCode("equ_type_bzx");
|
|
|
|
List<BoardDTO> lineList = mesMapper.getLineList(boardDTO);
|
|
|
|
List<BoardDTO> lineList = mesMapper.getLineList(boardDTO);
|
|
|
|
|
|
|
|
if (boardDTO.getIsqua()!=null){
|
|
|
|
|
|
|
|
//查询当天生产的产线
|
|
|
|
|
|
|
|
List<String> productLineList = mesMapper.getproductLineList();
|
|
|
|
|
|
|
|
// 使用Stream过滤lineList,只保留equCode在productLineList中的数据
|
|
|
|
|
|
|
|
lineList = lineList.stream()
|
|
|
|
|
|
|
|
.filter(item -> productLineList.contains(item.getEquCode()))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return lineList;
|
|
|
|
return lineList;
|
|
|
|
}finally {
|
|
|
|
}finally {
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
@ -65,6 +74,7 @@ public class MesBoradServiceImpl implements IMesBoradService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public BoardDTO getProduction15Days(BoardDTO boardDTO) {
|
|
|
|
public BoardDTO getProduction15Days(BoardDTO boardDTO) {
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
|
|
|
|
try {
|
|
|
|
BoardDTO dto = new BoardDTO();
|
|
|
|
BoardDTO dto = new BoardDTO();
|
|
|
|
|
|
|
|
|
|
|
|
String nowDate = DateUtils.getDate();
|
|
|
|
String nowDate = DateUtils.getDate();
|
|
|
@ -109,11 +119,16 @@ public class MesBoradServiceImpl implements IMesBoradService {
|
|
|
|
dto.setPlans(plans);
|
|
|
|
dto.setPlans(plans);
|
|
|
|
dto.setActs(acts);
|
|
|
|
dto.setActs(acts);
|
|
|
|
return dto;
|
|
|
|
return dto;
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String,BoardDTO> getProductionLineInfo(BoardDTO boardDTO) {
|
|
|
|
public Map<String,BoardDTO> getProductionLineInfo(BoardDTO boardDTO) {
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
|
|
|
|
try {
|
|
|
|
Map<String,BoardDTO> dtoMap = new HashMap<>();
|
|
|
|
Map<String,BoardDTO> dtoMap = new HashMap<>();
|
|
|
|
//当前工单信息
|
|
|
|
//当前工单信息
|
|
|
|
BoardDTO workOrder = mesMapper.getWorkOrder(boardDTO);
|
|
|
|
BoardDTO workOrder = mesMapper.getWorkOrder(boardDTO);
|
|
|
@ -183,39 +198,56 @@ public class MesBoradServiceImpl implements IMesBoradService {
|
|
|
|
dtoMap.put("piedata",task4);//巡检结果
|
|
|
|
dtoMap.put("piedata",task4);//巡检结果
|
|
|
|
|
|
|
|
|
|
|
|
return dtoMap;
|
|
|
|
return dtoMap;
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<ProOrderWorkorder> getPorOrderList(BoardDTO boardDTO) {
|
|
|
|
public List<ProOrderWorkorder> getPorOrderList(BoardDTO boardDTO) {
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
|
|
|
|
try{
|
|
|
|
List<ProOrderWorkorder> dtos = mesMapper.getPorOrderList(boardDTO);
|
|
|
|
List<ProOrderWorkorder> dtos = mesMapper.getPorOrderList(boardDTO);
|
|
|
|
return dtos;
|
|
|
|
return dtos;
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<BoardDTO> getHFProInfo(BoardDTO boardDTO) {
|
|
|
|
public List<BoardDTO> getHFProInfo(BoardDTO boardDTO) {
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
|
|
|
|
try {
|
|
|
|
List<BoardDTO> dtos = mesMapper.getHFProInfo(boardDTO);
|
|
|
|
List<BoardDTO> dtos = mesMapper.getHFProInfo(boardDTO);
|
|
|
|
return dtos;
|
|
|
|
return dtos;
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<BoardDTO> getHFQcInfo(BoardDTO boardDTO) {
|
|
|
|
public List<BoardDTO> getHFQcInfo(BoardDTO boardDTO) {
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
|
|
|
|
try {
|
|
|
|
List<BoardDTO> dtos = mesMapper.getHFQcInfo(boardDTO);
|
|
|
|
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;
|
|
|
|
return dtos;
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<BoardDTO> getHFxlInfo(BoardDTO boardDTO) {
|
|
|
|
public List<BoardDTO> getHFxlInfo(BoardDTO boardDTO) {
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
|
|
|
|
|
|
|
|
try {
|
|
|
|
List<BoardDTO> dtos = mesMapper.getHFxlInfo(boardDTO);
|
|
|
|
List<BoardDTO> dtos = mesMapper.getHFxlInfo(boardDTO);
|
|
|
|
return dtos;
|
|
|
|
return dtos;
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -240,24 +272,12 @@ public class MesBoradServiceImpl implements IMesBoradService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map getProductionNumberPLC(BoardDTO mesBoard) {
|
|
|
|
public Map getProductionNumberPLC(BoardDTO mesBoard) {
|
|
|
|
DynamicDataSourceContextHolder.push(mesBoard.getFactoryCode());
|
|
|
|
DynamicDataSourceContextHolder.push(mesBoard.getFactoryCode());
|
|
|
|
|
|
|
|
try {
|
|
|
|
Map mapList = mesMapper.getProductionNumberPLC(mesBoard);
|
|
|
|
Map mapList = mesMapper.getProductionNumberPLC(mesBoard);
|
|
|
|
return mapList;
|
|
|
|
return mapList;
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args){
|
|
|
|
|
|
|
|
List<String> days = new ArrayList<>();
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
|
|
|
|
|
//获取前面的时间用-负号
|
|
|
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
|
|
|
for(int num=0;num<15;num++){
|
|
|
|
|
|
|
|
cal.setTime(date);
|
|
|
|
|
|
|
|
cal.add(Calendar.DAY_OF_MONTH, -num);
|
|
|
|
|
|
|
|
days.add(sdf.format(cal.getTime()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Collections.reverse(days);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(JSONObject.toJSONString(days));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|