tags/yfai-pcn-ext-v1.0
LML丶 12 months ago
parent 1e7ab441be
commit e5930fba43

@ -3,9 +3,11 @@ 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.MesEquipmentSpotCheck;
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrder;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
/**
* @Description :
@ -27,6 +29,17 @@ public interface IMesSpotCheckOrderService {
@ApiOperation("查询点检单")
ListPager<MesSpotCheckOrder> querySpotCheckOrder(MesSpotCheckOrder spotCheckOrder, Pager pager);
/**
*
*
*
* @param spotCheckOrder
* @param pager
* @return
*/
@ApiOperation("查询设备点检")
List<MesEquipmentSpotCheck> queryEquipmentSpotCheck(MesEquipmentSpotCheck spotCheckOrder);
/**
*

@ -5,6 +5,7 @@ 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.ext.mes.pcn.pojo.model.MesSpotCheckOrderModel;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentSpotCheck;
import cn.estsh.i3plus.pojo.mes.bean.MesSpotCheckOrder;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
@ -28,6 +29,39 @@ public class MesSpotCheckOrderController {
private IMesSpotCheckOrderService spotCheckOrderService;
@GetMapping("/query-equipment-spot")
@ApiOperation(value = "查询设备点检")
public ResultBean queryEquipmentSpotCheck(MesEquipmentSpotCheck spotCheckOrder) {
try {
spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode());
return ResultBean.success("查询成功").setResultList(spotCheckOrderService.queryEquipmentSpotCheck(spotCheckOrder));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@PostMapping("/insert")
@ApiOperation(value = "新增点检单")
public ResultBean insert(@RequestBody MesSpotCheckOrder bean) {
try {
if (StringUtils.isEmpty(bean)) {
throw new ImppBusiException("点检单不能为空");
}
bean.setOrganizeCode(AuthUtil.getOrganizeCode());
return ResultBean.success("扫描产品条码成功").setResultObject(spotCheckOrderService.insert(bean));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@GetMapping("/query-pager")
@ApiOperation(value = "查询点检单")
public ResultBean querySpotCheckOrderByPager(MesSpotCheckOrder spotCheckOrder, Pager pager) {
@ -81,6 +115,7 @@ public class MesSpotCheckOrderController {
}
}
@PostMapping("/query-equip-info")
@ApiOperation(value = "开始点检-查询设备数据")
public ResultBean queryEquipInfo(@RequestBody MesSpotCheckOrderModel model) {

@ -299,7 +299,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
detail.setDefectTypeId(defectType.getId());
detail.setId(null);
detail.setOrganizeCode(org);
detail.setPid(model.getPartInspection().getId());
detail.setPid(partInspection.getId());
ConvertBean.serviceModelInitialize(detail, AuthUtil.getSessionUser().getUserName());
}
@ -512,7 +512,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
//若不存在则提示条码不存在
if (StringUtils.isEmpty(produceSn)) {
throw new ImppBusiException(String.format("【%s】此条码不存在,请检查数据", serialNumber));
throw new ImppBusiException(String.format("【%s】此条码不存在saveCheck,请检查数据", serialNumber));
}
//根据条码状态判断 是不是已下线条码

@ -357,6 +357,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
reworkTask.setReworkedQty(model.getPartInspection().getQty());
reworkTask.setSn(model.getPartInspection().getSn());
reworkTask.setReworkOrder(rework);
reworkTask.setStatus(MesExtEnumUtil.REWORK_TASK_STATUS.CREATE.getValue());
reworkTask.setPartNo(model.getPartInspection().getPartNo());
reworkTask.setPartInspectionId(model.getPartInspection().getId());
reworkTask.setOrganizeCode(org);

@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingLoadingCheckService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingLoadingCheckModel;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
@ -20,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -81,7 +83,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
//查询最近扫描完成的装车单号
DdlPackBean recentlyOrderPackBean = DdlPackBean.getDdlPackBean(loadingList.organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.LOADING_ORDER_STATUS.SHIPPING.getValue(), "status", recentlyOrderPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.MES_LOADING_STATUS.SCANNED.getValue(), "status", recentlyOrderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"modifyDatetime"}, recentlyOrderPackBean);
MesLoadingList recentlyVehiclesOrder = vehiclesOrderRepository.getByProperty(recentlyOrderPackBean);
@ -107,11 +109,17 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
public MesLoadingList queryLoadingOrderNoByAutoPushOrder(String shippingGroupNo, String org) {
List<Integer> statusList = new ArrayList<>();
statusList.add(MesExtEnumUtil.MES_LOADING_STATUS.CREATE.getValue());
statusList.add(MesExtEnumUtil.MES_LOADING_STATUS.PUBLISH.getValue());
statusList.add(MesExtEnumUtil.MES_LOADING_STATUS.CREATE_ASN.getValue());
statusList.add(MesExtEnumUtil.MES_LOADING_STATUS.LOADING.getValue());
//查询最近需要扫描的装车单号
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(org);
// DdlPreparedPack.getStringEqualPack(shippingGroupNo, "partShippingGroupCode", orderPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.LOADING_ORDER_STATUS.CREATE.getValue(), "status", orderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"seq"}, orderPackBean);
DdlPreparedPack.getInPackList(statusList, "status", orderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"seq"}, orderPackBean);
MesLoadingList loadingList = vehiclesOrderRepository.getByProperty(orderPackBean);
return loadingList;
@ -147,7 +155,14 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
//根据是否启动记忆判断 若启用记忆,则根据保存数据库
if (loadingList.getIsEnableMemory() == MesCommonConstant.TRUE_INTEGER) {
loadingList.setStatus(MesExtEnumUtil.LOADING_ORDER_STATUS.LOADING.getValue());
//若装车单状态为创建或发布已生成ASN 则写入开始扫描时间
if (loadingList.getStatus() == MesExtEnumUtil.MES_LOADING_STATUS.CREATE.getValue() ||
loadingList.getStatus() == MesExtEnumUtil.MES_LOADING_STATUS.PUBLISH.getValue() ||
loadingList.getStatus() == MesExtEnumUtil.MES_LOADING_STATUS.CREATE_ASN.getValue()) {
loadingList.setStartScanTime(TimeTool.getNowTime(true));
}
loadingList.setStatus(MesExtEnumUtil.MES_LOADING_STATUS.LOADING.getValue());
ConvertBean.serviceModelUpdate(loadingList, AuthUtil.getSessionUser().getUserName());
vehiclesOrderRepository.save(loadingList);
@ -179,8 +194,15 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
//全部扫描完成
if (count.intValue() == model.getDetailList().size()) {
//若装车单状态为创建或发布已生成ASN 则写入开始扫描时间
if (loadingList.getStatus() == MesExtEnumUtil.MES_LOADING_STATUS.CREATE.getValue() ||
loadingList.getStatus() == MesExtEnumUtil.MES_LOADING_STATUS.PUBLISH.getValue() ||
loadingList.getStatus() == MesExtEnumUtil.MES_LOADING_STATUS.CREATE_ASN.getValue()) {
loadingList.setStartScanTime(TimeTool.getNowTime(true));
}
loadingList.setEndScanTime(TimeTool.getNowTime(true));
//装车单主表
loadingList.setStatus(MesExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getValue());
loadingList.setStatus(MesExtEnumUtil.MES_LOADING_STATUS.SCANNED.getValue());
ConvertBean.serviceModelUpdate(loadingList, AuthUtil.getSessionUser().getUserName());
//装车单明细
@ -215,9 +237,16 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
}
//校验装车单状态 必须是未装车条码
if (loadingList.getStatus() != MesExtEnumUtil.LOADING_ORDER_STATUS.CREATE.getValue() && loadingList.getStatus() != MesExtEnumUtil.LOADING_ORDER_STATUS.LOADING.getValue()) {
throw new ImppBusiException(String.format("【%s】此装车单状态为【%s】,请选择状态为【%s】或状态【%s】的装车单", loadingList.getOrderCode(),
MesExtEnumUtil.LOADING_ORDER_STATUS.valueOfDescription(loadingList.getStatus()), MesExtEnumUtil.LOADING_ORDER_STATUS.CREATE.getDescription(), MesExtEnumUtil.LOADING_ORDER_STATUS.LOADING.getDescription()));
if (loadingList.getStatus() != MesExtEnumUtil.MES_LOADING_STATUS.CREATE.getValue() &&
loadingList.getStatus() != MesExtEnumUtil.MES_LOADING_STATUS.PUBLISH.getValue() &&
loadingList.getStatus() != MesExtEnumUtil.MES_LOADING_STATUS.CREATE_ASN.getValue() &&
loadingList.getStatus() != MesExtEnumUtil.MES_LOADING_STATUS.LOADING.getValue()) {
throw new ImppBusiException(String.format("【%s】此装车单状态为【%s】,请选择状态为【%s】或状态【%s】或状态【%s】或状态【%s】的装车单", loadingList.getOrderCode(),
MesExtEnumUtil.MES_LOADING_STATUS.valueOfDescription(loadingList.getStatus()),
MesExtEnumUtil.MES_LOADING_STATUS.CREATE.getDescription(),
MesExtEnumUtil.MES_LOADING_STATUS.PUBLISH.getDescription(),
MesExtEnumUtil.MES_LOADING_STATUS.CREATE_ASN.getDescription(),
MesExtEnumUtil.MES_LOADING_STATUS.LOADING.getDescription()));
}
return loadingList;
}

@ -96,9 +96,11 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
if (orderManagement.getIsFirstInstall() == MesCommonConstant.TRUE_INTEGER) {
//若没进行装车校验,则提示【%s】此发运单对应的【%s】此装车单状态为【%s】请选择状态为【%s】的数据
if (loadingList.getStatus() != MesExtEnumUtil.LOADING_DETAIL_ORDER_STATUS.LOADED.getValue()) {
throw new ImppBusiException(String.format("【%s】此发运单对应的【%s】此装车单状态为【%s】请选择状态为【%s】的数据", shippingOrderManagement.getShippingCode(),
loadingList.getOrderCode(), MesExtEnumUtil.LOADING_ORDER_STATUS.valueOfDescription(loadingList.getStatus()), MesExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getDescription()));
if (loadingList.getStatus() != MesExtEnumUtil.MES_LOADING_STATUS.SCANNED.getValue()) {
throw new ImppBusiException(String.format("【%s】此发运单对应的【%s】此装车单状态为【%s】请选择状态为【%s】的数据",
shippingOrderManagement.getShippingCode(), loadingList.getOrderCode(),
MesExtEnumUtil.MES_LOADING_STATUS.valueOfDescription(loadingList.getStatus()),
MesExtEnumUtil.MES_LOADING_STATUS.SCANNED.getDescription()));
}
}
}

@ -69,6 +69,7 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
private MesEquipmentSpotCheckPartRepository equipmentSpotCheckPartRepository;
@Override
public ListPager<MesSpotCheckOrder> querySpotCheckOrder(MesSpotCheckOrder spotCheckOrder, Pager pager) {
@ -83,6 +84,20 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
}
@Override
public List<MesEquipmentSpotCheck> queryEquipmentSpotCheck(MesEquipmentSpotCheck bean) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode(), bean.getIsValid());
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
DdlPreparedPack.getStringEqualPack(bean.getSpotCheckCode(), "spotCheckCode", packBean);
DdlPreparedPack.getStringLikerPack(bean.getSpotCheckName(), "spotCheckName", packBean);
DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
DdlPreparedPack.getStringEqualPack(bean.getWorkCellCode(), "workCellCode", packBean);
return equipmentSpotCheckRepository.findByHqlWhere(packBean);
}
@Override
public MesSpotCheckOrderModel scanProduceSn(MesSpotCheckOrderModel model, String org) {
//校验点检单

Loading…
Cancel
Save