forked from I3-YF/i3plus-mes-pcn-yfai
tags/yfai-pcn-ext-v1.0
parent
1e2129808a
commit
65b32a91a1
@ -0,0 +1,48 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.busi.spot;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSpotCheckOrderModel;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrder;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author :
|
||||
* @CreateDate : 2024-04-26 15:37
|
||||
* @Modify:
|
||||
**/
|
||||
public interface IMesSpotCheckOrderService {
|
||||
|
||||
/**
|
||||
* 、
|
||||
* 查询点检单
|
||||
*
|
||||
* @param spotCheckOrder
|
||||
* @param pager
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询点检单")
|
||||
ListPager<MesSpotCheckOrder> querySpotCheckOrder(MesSpotCheckOrder spotCheckOrder, Pager pager);
|
||||
|
||||
|
||||
/**
|
||||
* 扫描产品条码
|
||||
*
|
||||
* @param spotCheckOrder
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("扫描产品条码")
|
||||
MesSpotCheckOrderModel scanProduceSn(MesSpotCheckOrder spotCheckOrder);
|
||||
|
||||
/**
|
||||
* 查询点检单明细
|
||||
*
|
||||
* @param spotCheckOrder
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询点检单明细")
|
||||
MesSpotCheckOrderModel querySpotCheckOrderResult(MesSpotCheckOrder spotCheckOrder);
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi.spot;
|
||||
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.spot.IMesSpotCheckOrderService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrder;
|
||||
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 io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "点检单页面")
|
||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/spot-check-order")
|
||||
@Slf4j
|
||||
public class MesSpotCheckOrderController {
|
||||
|
||||
@Autowired
|
||||
private IMesSpotCheckOrderService spotCheckOrderService;
|
||||
|
||||
|
||||
@GetMapping("/query-pager")
|
||||
@ApiOperation(value = "查询点检单")
|
||||
public ResultBean querySpotCheckOrderByPager(MesSpotCheckOrder spotCheckOrder, Pager pager) {
|
||||
|
||||
try {
|
||||
|
||||
spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||
return ResultBean.success("查询成功").setListPager(spotCheckOrderService.querySpotCheckOrder(spotCheckOrder, pager));
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/scan-produce")
|
||||
@ApiOperation(value = "扫描产品条码")
|
||||
public ResultBean querySpotCheckOrderByPager(MesSpotCheckOrder spotCheckOrder) {
|
||||
|
||||
try {
|
||||
|
||||
spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||
return ResultBean.success("查询成功").setResultObject(spotCheckOrderService.scanProduceSn(spotCheckOrder));
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/query-result")
|
||||
@ApiOperation(value = "查询点检单明细")
|
||||
public ResultBean queryWorkOrderByPager(MesSpotCheckOrder spotCheckOrder) {
|
||||
|
||||
try {
|
||||
spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||
|
||||
return ResultBean.success("查询成功").setResultObject(spotCheckOrderService.querySpotCheckOrderResult(spotCheckOrder));
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.spot.IMesSpotCheckOrderService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSpotCheckOrderModel;
|
||||
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.tool.DdlPreparedPack;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrder;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrderPart;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrderResult;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesSpotCheckOrderPartRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesSpotCheckOrderRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesSpotCheckOrderResultRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author :
|
||||
* @CreateDate : 2024-05-15 20:50
|
||||
* @Modify:
|
||||
**/
|
||||
public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
|
||||
|
||||
@Autowired
|
||||
private MesSpotCheckOrderRepository spotCheckOrderRepository;
|
||||
|
||||
@Autowired
|
||||
private MesSpotCheckOrderResultRepository spotCheckOrderResultRepository;
|
||||
@Autowired
|
||||
private MesSpotCheckOrderPartRepository spotCheckOrderPartRepository;
|
||||
|
||||
@Override
|
||||
public ListPager<MesSpotCheckOrder> querySpotCheckOrder(MesSpotCheckOrder spotCheckOrder, Pager pager) {
|
||||
|
||||
DdlPackBean packBean = getDdlPackBean(spotCheckOrder);
|
||||
|
||||
pager = PagerHelper.getPager(pager, spotCheckOrderRepository.findByHqlWhereCount(packBean));
|
||||
|
||||
List<MesSpotCheckOrder> resultList = spotCheckOrderRepository.findByHqlWherePage(packBean, pager);
|
||||
|
||||
return new ListPager<>(resultList, pager);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public MesSpotCheckOrderModel scanProduceSn(MesSpotCheckOrder spotCheckOrder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MesSpotCheckOrderModel querySpotCheckOrderResult(MesSpotCheckOrder spotCheckOrder) {
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(spotCheckOrder.getOrganizeCode());
|
||||
DdlPreparedPack.getNumEqualPack(spotCheckOrder.getId(), "pid", packBean);
|
||||
List<MesSpotCheckOrderResult> orderResultList = spotCheckOrderResultRepository.findByHqlWhere(packBean);
|
||||
List<MesSpotCheckOrderPart> orderPartList = spotCheckOrderPartRepository.findByHqlWhere(packBean);
|
||||
|
||||
MesSpotCheckOrderModel model = new MesSpotCheckOrderModel();
|
||||
model.setOrderResultList(orderResultList);
|
||||
model.setOrderPartList(orderPartList);
|
||||
return model;
|
||||
}
|
||||
|
||||
private DdlPackBean getDdlPackBean(MesSpotCheckOrder spotCheckOrder) {
|
||||
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(spotCheckOrder.getOrganizeCode());
|
||||
DdlPreparedPack.getStringLikerPack(spotCheckOrder.getWorkCenterCode(), "workCenterCode", packBean);
|
||||
DdlPreparedPack.getStringLikerPack(spotCheckOrder.getWorkCellCode(), "workCellCode", packBean);
|
||||
DdlPreparedPack.getStringLikerPack(spotCheckOrder.getSpotCheckOrderNo(), "spotCheckOrderNo", packBean);
|
||||
return packBean;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
|
||||
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrder;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrderPart;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrderResult;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author :
|
||||
* @CreateDate : 2024-04-26 15:44
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
public class MesSpotCheckOrderModel {
|
||||
|
||||
|
||||
@ApiParam("点检单明细")
|
||||
private List<MesSpotCheckOrderResult> orderResultList;
|
||||
|
||||
@ApiParam("点检单零件")
|
||||
private List<MesSpotCheckOrderPart> orderPartList;
|
||||
|
||||
@ApiParam("点检单")
|
||||
private MesSpotCheckOrder spotCheckOrder;
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue