forked from I3-YF/i3plus-mes-pcn-yfai
41404 主工位与子工位修改
parent
8e90c343aa
commit
93b4d3a395
@ -0,0 +1,19 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.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.MesWorkCellExtendCfg;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IMesWorkCellExtendCfgService {
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页查询主子工位关系")
|
||||||
|
ListPager<MesWorkCellExtendCfg> queryMesWorkCellExtendCfgByPager(MesWorkCellExtendCfg mesWorkCellExtendCfg, Pager pager);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询主子工位关系")
|
||||||
|
List<MesWorkCellExtendCfg> queryMesWorkCellExtendCfg(MesWorkCellExtendCfg mesWorkCellExtendCfg);
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesWorkCellExtendCfgService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellExtendCfg;
|
||||||
|
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.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 主子工位关系
|
||||||
|
* @Author: gsz
|
||||||
|
* @Date: 2024/6/17 15:16
|
||||||
|
* @Modify:
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesWorkCellExtendCfg")
|
||||||
|
public class MesWorkCellExtendCfgController {
|
||||||
|
@Autowired
|
||||||
|
private IMesWorkCellExtendCfgService mesWorkCellExtendCfgService;
|
||||||
|
|
||||||
|
@GetMapping("/query-pager")
|
||||||
|
@ApiOperation(value = "分页查询主子工位关系")
|
||||||
|
public ResultBean queryMesProdShiftRecordByPager(MesWorkCellExtendCfg workCellExtendCfg, Pager pager) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
ListPager<MesWorkCellExtendCfg> mesWorkCellExtendCfgByPager = mesWorkCellExtendCfgService.queryMesWorkCellExtendCfgByPager(workCellExtendCfg, pager);
|
||||||
|
return ResultBean.success("查询主子工位关系成功").setListPager(mesWorkCellExtendCfgByPager);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/query")
|
||||||
|
@ApiOperation(value = "查询主子工位关系")
|
||||||
|
public ResultBean queryMesProdShiftRecord(MesWorkCellExtendCfg mesWorkCellExtendCfg) {
|
||||||
|
try {
|
||||||
|
//查询汇总工单数量
|
||||||
|
List<MesWorkCellExtendCfg> mesWorkCellExtendCfgList= mesWorkCellExtendCfgService.queryMesWorkCellExtendCfg(mesWorkCellExtendCfg);
|
||||||
|
return ResultBean.success("查询成功")
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(mesWorkCellExtendCfgList);
|
||||||
|
} catch (ImppBusiException e) {
|
||||||
|
return ResultBean.fail(e).build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResultBean.fail(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesWorkCellExtendCfgService;
|
||||||
|
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.base.util.StringUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellExtendCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellExtendCfgRepository;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 开关班记录表
|
||||||
|
* @Author: gsz
|
||||||
|
* @Date: 2024/5/21 14:16
|
||||||
|
* @Modify:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesWorkCellExtendCfgServiceImpl implements IMesWorkCellExtendCfgService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesWorkCellExtendCfgRepository mesWorkCellExtendCfgRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ListPager<MesWorkCellExtendCfg> queryMesWorkCellExtendCfgByPager(MesWorkCellExtendCfg bean, Pager pager) {
|
||||||
|
|
||||||
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getWorkCellCode(), "workCellCode", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getExtendType(), "extendType", packBean);
|
||||||
|
|
||||||
|
if(!StringUtil.isEmpty(bean.orderBy())){
|
||||||
|
packBean.setOrderByStr(bean.orderBy());
|
||||||
|
}else {
|
||||||
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"seq"}, packBean);
|
||||||
|
}
|
||||||
|
pager = PagerHelper.getPager(pager, mesWorkCellExtendCfgRDao.findByHqlWhereCount(packBean));
|
||||||
|
|
||||||
|
List<MesWorkCellExtendCfg> resultList = mesWorkCellExtendCfgRDao.findByHqlWherePage(packBean, pager);
|
||||||
|
|
||||||
|
return new ListPager<>(resultList, pager);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MesWorkCellExtendCfg> queryMesWorkCellExtendCfg(MesWorkCellExtendCfg bean) {
|
||||||
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getWorkCellCode(), "workCellCode", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(StringUtil.isEmpty(bean.getExtendType())?"20":bean.getExtendType(), "extendType", packBean);
|
||||||
|
if(!StringUtil.isEmpty(bean.orderBy())){
|
||||||
|
packBean.setOrderByStr(bean.orderBy());
|
||||||
|
}else {
|
||||||
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"seq"}, packBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesWorkCellExtendCfgRDao.findByHqlWhere(packBean);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue