SPS 生成webservice从MES换到PCN

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

@ -21,6 +21,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.config;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.webservice.DcsForEquipmentServer;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.webservice.WebServiceServerSPS;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
@ -56,4 +57,11 @@ public class WebServiceConfig {
endpoint.publish("/DCSForEquipmentService");
return endpoint;
}
@Bean
public Endpoint endpointSpsEqu() {
EndpointImpl endpoint = new EndpointImpl(bus, new WebServiceServerSPS());
endpoint.publish("/mes-service-spsEqu");
return endpoint;
}
}

@ -0,0 +1,73 @@
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;
}
}

@ -0,0 +1,43 @@
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.pojo.model.SpsInfo;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import java.util.HashMap;
import java.util.Map;
/**
* @Description : soapUI http://10.193.30.22:8300/i3plus-pcn/mes-service-spsEqu?wsdl
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/10/22 9:29
* @Modify:
**/
@WebService(targetNamespace = "http://tempuri.org/services/SyncSPSForEquipmentService")
public class WebServiceServerSPS {
public static final Logger LOGGER = LoggerFactory.getLogger(WebServiceServerSPS.class);
@WebMethod(action = "SyncSPSForEquipmentService", operationName = "SyncSPSForEquipmentService")
public Map syncSPSForEquipment(@WebParam(name = "info") SpsInfo spsInfo) {
LOGGER.info("syncSPSForEquipment主数据:{}", spsInfo);
MesPullingOrderInfoService bean = (MesPullingOrderInfoService) SpringContextsUtil.getBean("mesPullingOrderInfoService");
if (StringUtil.isEmpty(spsInfo.getOrganizeCode())) {
Map<String,Object> resultMap = new HashMap();
resultMap.put("success", false);
String message = "SPS拉动数据已扫描数据为空请检查拉动单数据";
resultMap.put("message", message);
return resultMap;
}
return bean.doSPSForEquipment("", "", spsInfo.getOrganizeCode());
}
}

@ -0,0 +1,20 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
import lombok.Data;
/**
* @Description : SpsInfo
* @Author :gsz
* @Date 2024/8/30 9:16
* @Modify
**/
@Data
public class SpsInfo {
//产线
private String assemblyLine;
//拉动单号
private String pullingGroupCode;
//工厂号
private String organizeCode ;
}
Loading…
Cancel
Save