春风项目四线(合箱线、总装线)
wujian
2024-08-06 b4ff0d321d1ffb3e348432b89895441494d40564
fix7-新增LOG
已修改3个文件
21 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java
@@ -328,6 +328,9 @@
        if (StringUtils.isEmpty(engineNo)){
            return R.fail(500,"箱体码不能为空,请重试");
        }
        if (!engineNo.contains(",")){
            return R.fail(500,"箱体码格式有误,请重试");
        }
        ProductNewPassStation checkStation = new ProductNewPassStation();
        checkStation.setBoxCode(engineNo);
        List<ProductNewPassStation> checkList = productNewPassStationService.getProductPassStationList(checkStation);
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
@@ -207,6 +207,7 @@
        List<OmProductionOrdeInfo> omProductionOrdeInfos = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
        if(omProductionOrdeInfos.size() == 0){
            try {
                logger.info("接收工单号:,{}",productionNotice);
                ReceivingServices.insertWebserviceData(factory,productionNotice);
            } catch (Exception e) {
                return error("接收失败!请检查通知单号");
jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java
@@ -25,6 +25,8 @@
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.io.IOUtils;
import com.jcdm.main.om.productionOrde.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
@@ -35,6 +37,8 @@
import java.util.List;
public class ReceivingServices {
    private static final Logger logger = LoggerFactory.getLogger("sys-user");
    @Autowired
//    private static IOmProductionOrdeInfoService omProductionOrdeInfoService;
    private static IOmProductionOrdeInfoService omProductionOrdeInfoService = BeanUtils.getBean(IOmProductionOrdeInfoService.class);
@@ -110,18 +114,25 @@
    
    public static void insertWebserviceData(String factory,String str) {
        String result = getInterfaceInformationXml(ProductionPlanInformationUrl, getProductionPlanInformationXml(factory,str));
        logger.info("messageLocation1,"+result);
        String jsonStr = xmlToJSON2(result);
        logger.info("messageLocation5,"+jsonStr);
        if (StrUtil.isNotBlank(jsonStr)){
            if (!jsonStr.contains("[") && !jsonStr.contains("]")){
                StringBuilder stringBuilder = new StringBuilder(jsonStr);
                stringBuilder.insert(8,"[");
                stringBuilder.insert(jsonStr.length(),"]");
                jsonStr = stringBuilder.toString();
                logger.info("messageLocation6,"+jsonStr);
            }
            Gson gson = new Gson();
            // 将json字符串转换成对象
            ItemList itemList = gson.fromJson(jsonStr, ItemList.class);
            if (ObjectUtil.isNotNull(itemList)){
                logger.info("messageLocation7,"+ itemList);
            }
            for (Item item : itemList.getItem()) {
                logger.info("messageLocation8,"+item);
                OmProductionOrdeInfo ordeInfo = new OmProductionOrdeInfo();
                ordeInfo.setWorkshopCode(item.getWERKS());
                ordeInfo.setProductCode(item.getPLNBEZ());
@@ -172,6 +183,7 @@
        try {
            status = client.executeMethod(postMethod);
        } catch (IOException e) {
            logger.info("errorLocation1,"+e);
            throw new RuntimeException(e);
        }
        if (status == 200) {// 成功
@@ -179,6 +191,7 @@
            try {
                is = postMethod.getResponseBodyAsStream();
            } catch (IOException e) {
                logger.info("errorLocation2,"+e);
                throw new RuntimeException(e);
            }
            // 获取请求结果字符串
@@ -187,6 +200,7 @@
                result = IOUtils.toString(is);
                return result;
            } catch (IOException e) {
                logger.info("errorLocation3,"+e);
                throw new RuntimeException(e);
            }
        }
@@ -224,14 +238,17 @@
                .getAsJsonObject("SOAP:Body")
                .getAsJsonObject("n0:ZPP_CF_MES_005.Response");
        if (ObjectUtil.isNotNull(result)){
            logger.info("messageLocation2,"+result);
            String string = result.get("EV_MESSAGE").toString();
            if (string.contains("查询成功")){
                logger.info("messageLocation3,"+string);
                JsonObject etData = jsonObject2
                        .getAsJsonObject("SOAP:Envelope")
                        .getAsJsonObject("SOAP:Body")
                        .getAsJsonObject("n0:ZPP_CF_MES_005.Response")
                        .getAsJsonObject("ET_DATA");
                data = etData.toString();
                logger.info("messageLocation4,"+data);
            }
        }