42966 设备实时查询报表-设备变量名称、设备变量ID可以多选查询,输入时,用逗号隔开

tags/yfai-mes-ext-v1.9
gsz 8 months ago
parent ae7bb006a5
commit 46c4bdded3

@ -1,5 +1,7 @@
package cn.estsh.i3plus.ext.mes.api.base;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection;
/**
@ -10,4 +12,5 @@ import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection;
public interface IMesPartInspectionService extends IBaseMesService<MesPartInspection> {
ListPager queryMesPartInspectionParamByPager(MesPartInspection mesPartInspection, Pager pager);
}

@ -1,8 +1,16 @@
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesPartInspectionService;
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -14,4 +22,19 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesPartInspection")
public class MesPartInspectionController extends BaseMesController<MesPartInspection> {
@Autowired
private IMesPartInspectionService mesPartInspectionService;
@GetMapping("/query-param")
@ApiOperation(value = "查询零件检测")
public ResultBean queryMesPartInspectionParamByPager(MesPartInspection mesPartInspection, Pager pager) {
try {
return ResultBean.success("查询成功").setListPager(mesPartInspectionService.queryMesPartInspectionParamByPager(mesPartInspection, pager));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -1,17 +1,29 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesPartInspectionService;
import cn.estsh.i3plus.platform.common.util.MesConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection;
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCenterRepository;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Slf4j
public class MesPartInspectionService extends BaseMesService<MesPartInspection> implements IMesPartInspectionService {
@Autowired
private MesWorkCenterRepository mesWorkCenterRDao;
@Override
protected void setPackQueryBean(MesPartInspection bean, DdlPackBean packBean) {
DdlPreparedPack.getStringEqualPack(bean.getSn(), "sn", packBean);
@ -28,4 +40,36 @@ public class MesPartInspectionService extends BaseMesService<MesPartInspection>
// DdlPreparedPack.getStringLikerPack(bean.getInspectionDate(), "inspectionDate", packBean);
}
@Override
public ListPager queryMesPartInspectionParamByPager(MesPartInspection bean, Pager pager) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(bean.getSn(), "sn", packBean);
DdlPreparedPack.getStringLikerPack(bean.getPartNo(), "partNo", packBean);
DdlPreparedPack.getStringLikerPack(bean.getPartName(), "partName", packBean);
DdlPreparedPack.getStringLikerPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
DdlPreparedPack.getNumEqualPack(bean.getNcStatus(), "ncStatus", packBean);
if (StringUtils.isNotBlank(bean.getCreateDateTimeStart()) && StringUtils.isNotBlank(bean.getCreateDateTimeEnd())) {
DdlPreparedPack.timeBuilder(bean.getCreateDateTimeStart(), bean.getCreateDateTimeEnd(), "createDatetime", packBean, true);
}
if (StringUtils.isNotBlank(bean.getModifyDateTimeStart()) && StringUtils.isNotBlank(bean.getModifyDateTimeEnd())) {
DdlPreparedPack.timeBuilder(bean.getModifyDateTimeStart(), bean.getModifyDateTimeEnd(), "modifyDatetime", packBean, true);
}
pager = PagerHelper.getPager(pager, baseRDao.findByHqlWhereCount(packBean));
List<MesPartInspection> resultList = baseRDao.findByHqlWherePage(packBean, pager);
if (!CollectionUtils.isEmpty(resultList)){
for (MesPartInspection mesPartInspection : resultList) {
if (!StringUtils.isEmpty(mesPartInspection.getWorkCenterCode())){
MesWorkCenter mesWorkCenter = mesWorkCenterRDao.getByProperty(
new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "workCenterCode"},
new Object[]{bean.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
CommonEnumUtil.IS_VAILD.VAILD.getValue(), mesPartInspection.getWorkCenterCode()});
if (null != mesWorkCenter) {
mesPartInspection.setWorkCenterName(mesWorkCenter.getWorkCenterName());
}
}
}
}
return new ListPager<>(resultList, pager);
}
}

@ -30,9 +30,15 @@ public class MesEquipmentLogDetailService extends BaseMesService<MesEquipmentLog
DdlPreparedPack.getStringEqualPack(new StringJoiner(MesExtConstWords.E_UNDERLINE).add(bean.getOrganizeCode()).add(bean.getEquipId().toString()).toString(), MesExtConstWords.ORG_EQUIP_ID, packBean);
// DdlPreparedPack.getNumEqualPack(bean.getEquipId(), MesExtConstWords.EQUIP_ID, packBean);
DdlPreparedPack.getNumEqualPack(bean.getVariableType(), MesExtConstWords.VARIABLE_TYPE, packBean);
DdlPreparedPack.getNumEqualPack(bean.getEquipVariableId(), MesExtConstWords.EQUIP_VARIABLE_ID, packBean);
if (!StringUtils.isEmpty(bean.getEquipVariableIds())) {
DdlPreparedPack.getInPackList(Arrays.asList(bean.getEquipVariableIds().split(",")), MesExtConstWords.EQUIP_VARIABLE_ID, packBean);
}
// DdlPreparedPack.getStringEqualPack(bean.getEquipmentCode(), MesExtConstWords.EQUIPMENT_CODE, packBean);
DdlPreparedPack.getStringLikerPack(bean.getEquipVariableName(), MesExtConstWords.EQUIP_VARIABLE_NAME, packBean);
if (!StringUtils.isEmpty(bean.getEquipVariableName()) && bean.getEquipVariableName().split(",").length > 1) {
DdlPreparedPack.getInPackList(Arrays.asList(bean.getEquipVariableName().split(",")), MesExtConstWords.EQUIP_VARIABLE_NAME, packBean);
} else {
DdlPreparedPack.getStringLikerPack(bean.getEquipVariableName(), MesExtConstWords.EQUIP_VARIABLE_NAME, packBean);
}
DdlPreparedPack.timeBuilder(bean.getCreateDateTimeStart(), bean.getCreateDateTimeEnd(), MesExtConstWords.CREATE_DATE_TIME, packBean, true);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{MesExtConstWords.CREATE_DATE_TIME}, packBean);
}

Loading…
Cancel
Save