forked from I3-YF/i3plus-mes-yfai
tags/yfai-mes-ext-v1.0
parent
2e7cf645f9
commit
2538d2e917
@ -0,0 +1,60 @@
|
||||
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.MesShiftProdCenterPm;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.repository.MesShiftProdCenterPmRepository;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author : wangjie
|
||||
* @CreateDate : 2022-02-15
|
||||
* @Modify:
|
||||
**/
|
||||
@Slf4j
|
||||
public class JxCenterWorkingBoardProxySpcPmService implements IJxCenterWorkingBoardService {
|
||||
|
||||
private MesShiftProdCenterPmRepository shiftProdCenterPmRepository;
|
||||
|
||||
public JxCenterWorkingBoardProxySpcPmService() {
|
||||
this.shiftProdCenterPmRepository = (MesShiftProdCenterPmRepository) SpringContextsUtil.getBean("mesShiftProdCenterPmRepository");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryCenterWorkingBoardData(Map<String, Object> dataMap) {
|
||||
|
||||
String organizeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE);
|
||||
String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE);
|
||||
String workTime = (String) dataMap.get(MesExtConstWords.WORK_TIME);
|
||||
String shiftCode = (String) dataMap.get(MesExtConstWords.SHIFT_CODE);
|
||||
String startTime = (String) dataMap.get(MesExtConstWords.START_TIME);
|
||||
String endTime = (String) dataMap.get(MesExtConstWords.END_TIME);
|
||||
|
||||
List<MesShiftProdCenterPm> shiftProdCenterPmList = null;
|
||||
if (!StringUtils.isEmpty(workCenterCode) && !StringUtils.isEmpty(workTime) && !StringUtils.isEmpty(shiftCode))
|
||||
shiftProdCenterPmList = shiftProdCenterPmRepository.findByProperty(
|
||||
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME, MesExtConstWords.SHIFT_CODE},
|
||||
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, workTime, shiftCode});
|
||||
else if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) {
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
||||
DdlPreparedPack.timeBuilder(startTime, endTime, MesExtConstWords.WORK_TIME, true, true, packBean);
|
||||
shiftProdCenterPmList = shiftProdCenterPmRepository.findByHqlWhere(packBean);
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(shiftProdCenterPmList)) return dataMap;
|
||||
|
||||
dataMap.put(MesShiftProdCenterPm.class.getSimpleName(), shiftProdCenterPmList);
|
||||
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue