春风项目四线(合箱线、总装线)
wujian
2024-07-19 1e30745cafcea3f57518b6f05b8f2a72454f8d8e
fix4
已修改5个文件
236 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-quartz/src/main/java/com/jcdm/quartz/task/RyTask.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/components/itemSelect/single.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/cfkb/connectingRodUp/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/pr/tightenReport/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java
@@ -25,6 +25,7 @@
import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection;
import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService;
@@ -75,6 +76,9 @@
    private IDaTileMatchCollectionService daTileMatchCollectionService;
    @Resource
    private ProductNewPassStationService productNewPassStationService;
    @Resource
    private IDaPassingStationCollectionService daPassingStationCollectionService;
    @Autowired
    MiloService miloService;
@@ -314,97 +318,120 @@
    public R engineNoIsInModel(String engineNo,String model,String orderNo) throws Exception {
        if (StringUtils.isEmpty(engineNo)){
            return R.ok(500,"箱体码为空或已存在,请重试");
            return R.fail(500,"箱体码为空或已存在,请重试");
        }
        ProductNewPassStation checkStation = new ProductNewPassStation();
        checkStation.setBoxCode(engineNo);
        List<ProductNewPassStation> checkList = productNewPassStationService.getProductPassStationList(checkStation);
        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
        bsOrderScheduling.setOrderNo(orderNo);
        List<BsOrderScheduling> allList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
        List<BsOrderScheduling> dlist = allList.stream().filter(x->x.getProductionStatus().equals(Constants.WAIT_PRODUCTION)).collect(Collectors.toList());
        List<BsOrderScheduling> collect = allList.stream().filter(x -> x.getProductionStatus().equals(Constants.ORDER_STATUS_ING)
                        ||x.getProductionStatus().equals(Constants.FINISH_PRODUCTION)).collect(Collectors.toList());
                ||x.getProductionStatus().equals(Constants.FINISH_PRODUCTION)).collect(Collectors.toList());
        BsOrderScheduling OrderScheduling=dlist.get(0);
//        DaParamCollection daParamCollection = new DaParamCollection();
//        daParamCollection.setParamValue(engineNo);
//        daParamCollection.setLocationCode("OP010");
//        List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection);
//        if (CollUtil.isNotEmpty(list)){
//            return R.ok(500,"已存在此箱体码,请勿重复扫描");
//        }
        OmProductionOrdeInfo info = new OmProductionOrdeInfo();
        info.setWorkOrderNo(orderNo);
        List<OmProductionOrdeInfo> omProductionOrdeInfos = productionOrdeInfoService.selectOmProductionOrdeInfoList(info);
        if (CollUtil.isNotEmpty(omProductionOrdeInfos)){
            OmProductionOrdeInfo omProductionOrdeInfo = omProductionOrdeInfos.get(0);
            Long planQty = omProductionOrdeInfo.getPlanQty();
            if (planQty<collect.size()){
                return R.ok(500,"超出计划数量,请检查后重试");
        if (CollUtil.isNotEmpty(checkList)){
            //重复扫码
            ProductNewPassStation productNewPassStation = checkList.get(0);
            String sfcCode = productNewPassStation.getSfcCode();
            DaPassingStationCollection passingStationCollection = new DaPassingStationCollection();
            passingStationCollection.setSfcCode(sfcCode);
            List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionService.selectDaPassingStationCollectionList(passingStationCollection);
            if (CollUtil.isNotEmpty(daPassingStationCollections)){
                //过站后重新上线
                //OPC操作
                logger.info("过站后重新上线,{}",sfcCode);
                ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP010.Code", sfcCode);
                OPCUaSubscription.miloService.writeToOpcUa(entity);//写SN
                return R.ok();
            } else {
                //OPC操作
                logger.info("当前站重新扫码,{}",sfcCode);
                ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP010.Code", sfcCode);
                OPCUaSubscription.miloService.writeToOpcUa(entity);//写SN
                return R.ok();
            }
        }
        //插入数据
        DaParamCollection saveData = new DaParamCollection();
        saveData.setSfcCode(OrderScheduling.getEngineNo());
        saveData.setParamValue(engineNo);
        saveData.setLocationCode("OP010");
        saveData.setParamCode("XTM");
        saveData.setParamName("箱体");
        daParamCollectionService.insertDaParamCollection(saveData);
        }else {
        DaTileMatchCollection MatchCollection = new DaTileMatchCollection();
        MatchCollection.setSfcCode(OrderScheduling.getEngineNo());
        MatchCollection.setParamValue(engineNo);
        MatchCollection.setLocationCode("OP010");
        MatchCollection.setParamCode("XTM");
        MatchCollection.setParamName("箱体");
        daTileMatchCollectionService.insertDaTileMatchCollection(MatchCollection);
            if (CollUtil.isNotEmpty(dlist)){
                BsOrderScheduling OrderScheduling=dlist.get(0);
        if (StrUtil.isNotBlank(OrderScheduling.getEngineNo())){
            String snCode = OrderScheduling.getEngineNo();
            if (snCode.startsWith("280") || snCode.startsWith("380")){
                ProductNewPassStation productNewPassStation = new ProductNewPassStation();
                UUID uuid = UUID.randomUUID();
                productNewPassStation.setId(uuid.getMostSignificantBits());
                productNewPassStation.setFinishFlag("0");
                productNewPassStation.setSfcCode(OrderScheduling.getEngineNo());
                productNewPassStation.setCreateTime(new Date());
                productNewPassStation.setBoxCode(engineNo);
                if (snCode.startsWith("280")){
                    productNewPassStation.setProductType("280");
                } else {
                    productNewPassStation.setProductType("380");
                OmProductionOrdeInfo info = new OmProductionOrdeInfo();
                info.setWorkOrderNo(orderNo);
                List<OmProductionOrdeInfo> omProductionOrdeInfos = productionOrdeInfoService.selectOmProductionOrdeInfoList(info);
                if (CollUtil.isNotEmpty(omProductionOrdeInfos)){
                    OmProductionOrdeInfo omProductionOrdeInfo = omProductionOrdeInfos.get(0);
                    Long planQty = omProductionOrdeInfo.getPlanQty();
                    if (planQty<collect.size()){
                        return R.ok(500,"超出计划数量,请检查后重试");
                    }
                }
                productNewPassStationService.insertPassStation(productNewPassStation);
                //插入数据
                DaParamCollection saveData = new DaParamCollection();
                saveData.setSfcCode(OrderScheduling.getEngineNo());
                saveData.setParamValue(engineNo);
                saveData.setLocationCode("OP010");
                saveData.setParamCode("XTM");
                saveData.setParamName("箱体");
                daParamCollectionService.insertDaParamCollection(saveData);
                DaTileMatchCollection MatchCollection = new DaTileMatchCollection();
                MatchCollection.setSfcCode(OrderScheduling.getEngineNo());
                MatchCollection.setParamValue(engineNo);
                MatchCollection.setLocationCode("OP010");
                MatchCollection.setParamCode("XTM");
                MatchCollection.setParamName("箱体");
                daTileMatchCollectionService.insertDaTileMatchCollection(MatchCollection);
                if (StrUtil.isNotBlank(OrderScheduling.getEngineNo())){
                    String snCode = OrderScheduling.getEngineNo();
                    if (snCode.startsWith("280") || snCode.startsWith("380")){
                        ProductNewPassStation productNewPassStation = new ProductNewPassStation();
                        UUID uuid = UUID.randomUUID();
                        productNewPassStation.setId(uuid.getMostSignificantBits());
                        productNewPassStation.setFinishFlag("0");
                        productNewPassStation.setSfcCode(OrderScheduling.getEngineNo());
                        productNewPassStation.setCreateTime(new Date());
                        productNewPassStation.setBoxCode(engineNo);
                        if (snCode.startsWith("280")){
                            productNewPassStation.setProductType("280");
                        } else {
                            productNewPassStation.setProductType("380");
                        }
                        productNewPassStationService.insertPassStation(productNewPassStation);
                    }
                }
                //更新上线数量
                int onlineNum = 0;
                List<BsOrderScheduling> onlineNumList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling)
                        .stream().filter(x -> Constants.ORDER_STATUS_ING.equals(x.getProductionStatus())||x.getProductionStatus().equals(Constants.FINISH_PRODUCTION)).collect(Collectors.toList());
                if (CollUtil.isNotEmpty(onlineNumList)){
                    onlineNum = onlineNumList.size();
                }
                OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo();
                omProductionOrdeInfo.setWorkOrderNo(orderNo);
                List<OmProductionOrdeInfo> omList = productionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
                if (CollUtil.isNotEmpty(omList)){
                    OmProductionOrdeInfo omInfo = omList.get(0);
                    String s = String.valueOf(onlineNum);
                    long l = Long.parseLong(s);
                    omInfo.setActualOnlineQty(l);
                    productionOrdeInfoService.updateOmProductionOrdeInfo(omInfo);
                }
                //OPC操作
                ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP010.Code", OrderScheduling.getEngineNo());
                OPCUaSubscription.miloService.writeToOpcUa(entity);//写SN
                OrderScheduling.setProductionStatus("2");
                bsOrderSchedulingService.updateBsOrderScheduling(OrderScheduling);
                return R.ok();
            }
        }
        //更新上线数量
        int onlineNum = 0;
        List<BsOrderScheduling> onlineNumList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling)
                .stream().filter(x -> Constants.ORDER_STATUS_ING.equals(x.getProductionStatus())||x.getProductionStatus().equals(Constants.FINISH_PRODUCTION)).collect(Collectors.toList());
        if (CollUtil.isNotEmpty(onlineNumList)){
            onlineNum = onlineNumList.size();
        }
        OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo();
        omProductionOrdeInfo.setWorkOrderNo(orderNo);
        List<OmProductionOrdeInfo> omList = productionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
        if (CollUtil.isNotEmpty(omList)){
            OmProductionOrdeInfo omInfo = omList.get(0);
            String s = String.valueOf(onlineNum);
            long l = Long.parseLong(s);
            omInfo.setActualOnlineQty(l);
            productionOrdeInfoService.updateOmProductionOrdeInfo(omInfo);
        }
        //OPC操作
        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP010.Code", OrderScheduling.getEngineNo());
        OPCUaSubscription.miloService.writeToOpcUa(entity);//写SN
        OrderScheduling.setProductionStatus("2");
        bsOrderSchedulingService.updateBsOrderScheduling(OrderScheduling);
        return R.ok();
    }
}
jcdm-quartz/src/main/java/com/jcdm/quartz/task/RyTask.java
@@ -1,9 +1,12 @@
package com.jcdm.quartz.task;
import cn.hutool.core.collection.CollUtil;
import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
import com.jcdm.main.om.productionOrde.service.impl.OmProductionOrdeInfoServiceImpl;
import com.jcdm.main.webservice.service.ReceivingServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -11,7 +14,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * 定时任务调度测试
@@ -25,6 +31,11 @@
    private DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl;
    @Autowired
    private IBsOrderSchedulingService bsOrderSchedulingService;
    @Resource
    private OmProductionOrdeInfoServiceImpl omProductionOrdeInfoService;
    private static final Logger logger = LoggerFactory.getLogger("sys-user");
    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
    {
@@ -38,8 +49,37 @@
    public void ryNoParams()
    {
        logger.info("执行定时任务开始");
        String a=passingStationCollectionServiceImpl.SelectSN("88","OP010");
        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
        bsOrderScheduling.setRemarks("1");
        List<BsOrderScheduling> bsOrderSchedulingList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
        if (CollUtil.isNotEmpty(bsOrderSchedulingList)){
            Map<String, List<BsOrderScheduling>> map = bsOrderSchedulingList.stream().collect(Collectors.groupingBy(BsOrderScheduling::getOrderNo));
            OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo();
            for (String s : map.keySet()) {
                List<BsOrderScheduling> bsOrderSchedulings = map.get(s);
                if (CollUtil.isNotEmpty(bsOrderSchedulings)){
                    BsOrderScheduling scheduling = bsOrderSchedulings.get(0);
                    int size = bsOrderSchedulings.size();
                    omProductionOrdeInfo.setPlanQty((long)size);
                    omProductionOrdeInfo.setActualQty((long)0);
                    omProductionOrdeInfo.setWorkOrderNo(s);
                    omProductionOrdeInfo.setProductCode(scheduling.getModel());
                    omProductionOrdeInfo.setOrderStatus("2");
                    omProductionOrdeInfo.setTypeZ(scheduling.getModel());
                    omProductionOrdeInfoService.insertOmProductionOrdeInfo(omProductionOrdeInfo);
                    logger.info("插入工单,{}",s);
                }
            }
            for (BsOrderScheduling scheduling : bsOrderSchedulingList) {
                scheduling.setRemarks("0");
                bsOrderSchedulingService.updateBsOrderScheduling(scheduling);
            }
        }
        System.out.println("执行过程返回:" + a);
        logger.info("定时任务执行结束");
    }
    String url = "http://podqapp.cfmoto.com.cn:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_BC_001_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES";
jcdm-ui/src/components/itemSelect/single.vue
@@ -10,18 +10,18 @@
      <!--物料数据-->
      <el-col :span="24" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="物料编码" prop="itemCode">
          <el-form-item label="物料编码" prop="materialCode">
            <el-input
              v-model="queryParams.itemCode"
              v-model="queryParams.materialCode"
              placeholder="请输入物料编码"
              clearable
              style="width: 240px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="物料名称" prop="itemName">
          <el-form-item label="物料名称" prop="materialName">
            <el-input
              v-model="queryParams.itemName"
              v-model="queryParams.materialName"
              placeholder="请输入物料名称"
              clearable
              style="width: 240px"
@@ -114,8 +114,8 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        itemCode: undefined,
        itemName: undefined,
        materialCode: undefined,
        materialName: undefined,
        itemTypeId: 0,
        typeL: 1,
      },
jcdm-ui/src/views/main/cfkb/connectingRodUp/index.vue
@@ -166,6 +166,7 @@
                this.queryParams.scanObject2 = resultMessage[0]
                this.queryParams.productSeries = resultMessage[2]
              } else if (resultMessage[1] === "clean"){
                this.queryParams.productSeries = ''
                this.queryParams.scanObject1 = ""
                this.queryParams.scanObject2 = ""
                this.queryParams.words = ""
jcdm-ui/src/views/main/pr/tightenReport/index.vue
@@ -148,7 +148,7 @@
    }
  },
  created() {
    this.getList();
    // this.getList();
  },
  methods: {