春风项目四线(合箱线、总装线)
yyt
2024-05-06 bbc5784cc34d65e64d639d949e75b978fe07bdb3
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java
@@ -1,15 +1,7 @@
package com.jcdm.main.da.passingStationCollection.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import com.jcdm.common.constant.Constants;
import com.alibaba.fastjson2.JSONObject;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.common.utils.StringUtils;
import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
@@ -21,9 +13,17 @@
import com.jcdm.main.da.passingStationCollection.vo.DaPassingStationVO;
import com.jcdm.main.rm.repairRecord.domain.RmRepairRecord;
import com.jcdm.main.rm.repairRecord.mapper.RmRepairRecordMapper;
import com.jcdm.main.websocket.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
 * 产品过站采集Service业务层处理
@@ -223,19 +223,32 @@
        }
    }
    @Override
    public String SelectSN(String SNcode){
        return "1";
    public String SelectSN(String SNcode,String node) {
        try {
            Map<String, Object> params = new HashMap<>();
            params.put("SN_CODE",SNcode);
            params.put("Node",node);
            params.put("Success","");
            daPassingStationCollectionMapper.SelectSN(params);
            return (String)params.get("Success");
        } catch (Exception e) {
            return "数据查询失败!";
        }
    }
//        --订单排产
//        select * from bs_order_scheduling where engine_no='2V91Y-F RA182118'
//
//        --工艺路线子表信息
//        select * from bs_technology_route_child_info where route_code='H_191S'
//
//        --返修数据
//        select * from rm_repair_record where box_code='2V91Y-F RA182118'
//
//        --过站采集
//        select * from da_passing_station_collection --where sfc_code='2V91Y-F RA182118'
    public String sendMessage(String message) throws Exception{
        Map<String,Object> map = new HashMap<>();
        // 获取当前日期和时间
        LocalDateTime nowDateTime = LocalDateTime.now();
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        System.out.println(dateTimeFormatter.format(nowDateTime));
        map.put("server_time",dateTimeFormatter.format(nowDateTime));
        map.put("server_code","200");
        map.put("server_message",message);
        JSONObject jsonObject =  new JSONObject(map);
        WebSocketServer.sendAllMessage(jsonObject.toString());
        return jsonObject.toString();
    }
}