SPS 生成webservice从MES换到PCN

tags/yfai-pcn-ext-v2.3
jun 7 months ago
parent c6bc7781b2
commit b1f27d6e72

@ -27,4 +27,6 @@ public interface IMesPullingOrderInfoService {
ListPager queryMesPullingOrderPartInfoByPager(MesPullingOrderInfo mesPullingOrderInfo, Pager pager);
List<MesPullingOrderPartInfo> doMesPullingOrderInfoSend(List<MesPullingOrderPartInfo> infoList, String userName);
Map<String,Object> doSPSForEquipment(String assemblyLine, String pullingGroupCode, String organizeCode);
}

@ -1,73 +0,0 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesPullingOrderInfo;
import cn.estsh.i3plus.pojo.mes.bean.MesPullingOrderPartInfo;
import cn.estsh.i3plus.pojo.mes.repository.MesPullingOrderInfoRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesPullingOrderPartInfoRepository;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.util.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description : SPS
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/10/22 9:29
* @Modify:
**/
@Service
@Slf4j
public class MesPullingOrderInfoService {
public static final Logger LOGGER = LoggerFactory.getLogger(MesPullingOrderInfoService.class);
@Autowired
private MesPullingOrderInfoRepository mesPullingOrderInfoRepository;
@Autowired
private MesPullingOrderPartInfoRepository mesPullingOrderPartInfoRepository;
public Map<String,Object> doSPSForEquipment(String assemblyLine, String pullingGroupCode, String organizeCode) {
Map<String,Object> resultMap = new HashMap();
//查询拉动单状态为已扫描=20的 拉动单
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_PULL_ORDER_TYPE.SPS_PULL.getValue(), "pullOrderType", seriesPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PULL_ORDER_STATUS.JIS_PULL.getValue(), "pullOrderStatus", seriesPackBean);
seriesPackBean.setWhereAppend(seriesPackBean.getWhereAppend() + " order by modifyDatetime desc");
MesPullingOrderInfo mesPullingOrder = mesPullingOrderInfoRepository.getByProperty(seriesPackBean);
if (StringUtil.isEmpty(mesPullingOrder)) {
resultMap.put("success", false);
String message = "SPS拉动数据已扫描数据为空请检查拉动单数据";
resultMap.put("message", message);
return resultMap;
}
//更新主表状态 源系统为25配料完成 现在-【已发送设备-30】
mesPullingOrder.setPullOrderStatus(MesExtEnumUtil.PULL_ORDER_STATUS.SPS_PULL.getValue());
ConvertBean.serviceModelUpdate(mesPullingOrder, "WS.SPS");
mesPullingOrderInfoRepository.update(mesPullingOrder);
String message = "更新SPS状态成功已发送SPS信息给设备! id:" + mesPullingOrder.getId() + "Code:" + mesPullingOrder.getPullingOrderNo() + "产线" + assemblyLine + "拉动组" + pullingGroupCode + "";
//查询拉动组明细
DdlPackBean partPackBean = DdlPackBean.getDdlPackBean(mesPullingOrder.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(mesPullingOrder.getPullingOrderNo(), "pullingOrderNo", partPackBean);
List<MesPullingOrderPartInfo> pullingOrderPartInfos = mesPullingOrderPartInfoRepository.findByHqlWhere(partPackBean);
if (!CollectionUtils.isEmpty(pullingOrderPartInfos)) {
mesPullingOrder.setPartList(pullingOrderPartInfos);
}
resultMap.put("orderInfo", mesPullingOrder);
resultMap.put("success", true);
resultMap.put("message", message);
return resultMap;
}
}

@ -290,6 +290,41 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
return partInfo;
}
@Override
public Map<String,Object> doSPSForEquipment(String assemblyLine, String pullingGroupCode, String organizeCode) {
Map<String,Object> resultMap = new HashMap();
//查询拉动单状态为已扫描=20的 拉动单
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_PULL_ORDER_TYPE.SPS_PULL.getValue(), "pullOrderType", seriesPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PULL_ORDER_STATUS.JIS_PULL.getValue(), "pullOrderStatus", seriesPackBean);
seriesPackBean.setWhereAppend(seriesPackBean.getWhereAppend() + " order by modifyDatetime desc");
MesPullingOrderInfo mesPullingOrder = mesPullingOrderInfoRepository.getByProperty(seriesPackBean);
if (StringUtil.isEmpty(mesPullingOrder)) {
resultMap.put("success", false);
String message = "SPS拉动数据已扫描数据为空请检查拉动单数据";
resultMap.put("message", message);
return resultMap;
}
//更新主表状态 源系统为25配料完成 现在-【已发送设备-30】
mesPullingOrder.setPullOrderStatus(MesExtEnumUtil.PULL_ORDER_STATUS.SPS_PULL.getValue());
ConvertBean.serviceModelUpdate(mesPullingOrder, "WS.SPS");
mesPullingOrderInfoRepository.update(mesPullingOrder);
String message = "更新SPS状态成功已发送SPS信息给设备! id:" + mesPullingOrder.getId() + "Code:" + mesPullingOrder.getPullingOrderNo() + "产线" + assemblyLine + "拉动组" + pullingGroupCode + "";
//查询拉动组明细
DdlPackBean partPackBean = DdlPackBean.getDdlPackBean(mesPullingOrder.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(mesPullingOrder.getPullingOrderNo(), "pullingOrderNo", partPackBean);
List<MesPullingOrderPartInfo> pullingOrderPartInfos = mesPullingOrderPartInfoRepository.findByHqlWhere(partPackBean);
if (!org.apache.shiro.util.CollectionUtils.isEmpty(pullingOrderPartInfos)) {
mesPullingOrder.setPartList(pullingOrderPartInfos);
}
resultMap.put("orderInfo", mesPullingOrder);
resultMap.put("success", true);
resultMap.put("message", message);
return resultMap;
}
private boolean checkRule(MesPullingOrderPartInfo mesPullingOrderInfo, MesPartPullDetail mesPartPullDetail) {
String rule = mesPartPullDetail.getRuleValidation();
if (mesPullingOrderInfo.getScanValidationType() == MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.HOMEMADE_VALIDATE.getValue()) {

@ -1,6 +1,6 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.webservice;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base.MesPullingOrderInfoService;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.MesPullingOrderInfoService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.SpsInfo;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;

Loading…
Cancel
Save