admin
7 天以前 87dd7f637b095f6b7284bbcff708aaea82a28b3f
优化
已修改3个文件
119 ■■■■■ 文件已修改
jcdm-admin/src/main/resources/application-druid.yml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/kb/stationTerminal/index.vue 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-admin/src/main/resources/application-druid.yml
@@ -16,14 +16,14 @@
        druid:
            # 主库数据源
            master:
#                url: jdbc:sqlserver://192.168.0.189:1433;DataBaseName=Jcdm042-Mes
#                url: jdbc:sqlserver://183.134.244.158:1433;DataBaseName=Jcdm035-Mes
                url: jdbc:sqlserver://192.168.20.250:1433;DataBaseName=Jcdm035-Mes
                url: jdbc:sqlserver://192.168.0.189:1433;DataBaseName=Jcdm035-Mes
#                url: jdbc:sqlserver://10.103.238.10:1433;DataBaseName=Jcdm035-Mes
#                url: jdbc:sqlserver://192.168.20.250:1433;DataBaseName=Jcdm035-Mes
                username: sa
#                password: JCDM@2023
                password: JCDM@2023
#                password: admin@123
#                password: 1!deshine
                password: 123456
#                password: 123456
            # 从库数据源
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java
@@ -21,10 +21,13 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * 设备产品过程参数采集Controller
@@ -84,12 +87,12 @@
        DaParamCollection OP130_ThreePhaseResistance3 = daParamCollectionService.getOne(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getParamCode, "OP130_ThreePhaseResistance3").eq(DaParamCollection::getSfcCode,daParamCollection.getProductNum()));
        DaParamCollection OP130_BalanceDegree2 = daParamCollectionService.getOne(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getParamCode, "OP130_ThreePhaseResistance2").eq(DaParamCollection::getSfcCode,daParamCollection.getProductNum()));
        DaParamCollection OP130_BalanceDegree1 = daParamCollectionService.getOne(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getParamCode, "OP130_ThreePhaseResistance1").eq(DaParamCollection::getSfcCode,daParamCollection.getProductNum()));
        info.setParam27(OP130_ThreePhaseResistance3.getParamValue()+","+OP130_BalanceDegree2.getParamValue()+","+OP130_BalanceDegree1.getParamValue());
        info.setParam27(getParam27(OP130_ThreePhaseResistance3.getParamValue()+","+OP130_BalanceDegree2.getParamValue()+","+OP130_BalanceDegree1.getParamValue()));
        DaParamCollection OP130_28_BalanceDegree1 = daParamCollectionService.getOne(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getParamCode, "OP130_BalanceDegree1").eq(DaParamCollection::getSfcCode,daParamCollection.getProductNum()));
        DaParamCollection OP130_28_BalanceDegree2 = daParamCollectionService.getOne(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getParamCode, "OP130_BalanceDegree2").eq(DaParamCollection::getSfcCode,daParamCollection.getProductNum()));
        DaParamCollection OP130_28_BalanceDegree3 = daParamCollectionService.getOne(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getParamCode, "OP130_BalanceDegree3").eq(DaParamCollection::getSfcCode,daParamCollection.getProductNum()));
        info.setParam28(OP130_28_BalanceDegree1.getParamValue()+","+OP130_28_BalanceDegree2.getParamValue()+","+OP130_28_BalanceDegree3.getParamValue());
        info.setParam28(getParam28(OP130_28_BalanceDegree1.getParamValue()+","+OP130_28_BalanceDegree2.getParamValue()+","+OP130_28_BalanceDegree3.getParamValue()));
        info.setParam29(getParam29(daParamCollection.getProductNum()));
@@ -219,16 +222,53 @@
    }
    public static void main(String[] args) {
        String input = "4.257426";
        String param27 = "49.260002,49.122525,49.06235235";
        String param28 = "0.163,0.061,0.224";
        // 按逗号分割字符串
        String[] parts = param27.split(",");
        // 确定起始位置和结束位置
        int startIndex = 13; // 起始位置
        int endIndex = 26;   // 结束位置
        // 创建一个 DecimalFormat 实例,用于格式化数字
        DecimalFormat df = new DecimalFormat("#.00");
        // 截取字符串
        String extracted = input.substring(0, 4);
        // 遍历分割后的数组,并格式化每个元素
//        for (String part : parts) {
//            double value = Double.parseDouble(part);
//            String formattedValue = df.format(value);
//            System.out.println(formattedValue);
//        }
        System.out.println(getReviewerDate());
        String result = Arrays.stream(parts)
                .map(part -> df.format(Double.parseDouble(part)))
                .collect(Collectors.joining(","));
        System.out.println(result);
        System.out.println(getParam28(param28));
    }
    public static String getParam28(String input) {
        // 分割字符串
        String[] parts = input.split(",");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < parts.length; i++) {
            // 在每个部分后面加上 %
            sb.append(parts[i]).append("%");
            if (i < parts.length - 1) {
                sb.append(",");
            }
        }
        return sb.toString();
    }
    public String getParam27(String param){
        String[] parts = param.split(",");
        DecimalFormat df = new DecimalFormat("#.00");
        String result = Arrays.stream(parts)
                .map(part -> df.format(Double.parseDouble(part)))
                .collect(Collectors.joining(","));
        return result;
    }
    /**
jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -451,31 +451,34 @@
           this.headContent.processesCode === "OP210" || this.headContent.processesCode === "OP220" ||
          this.headContent.processesCode === "OP230"
        ){
          if(this.materialCode.length>25){
            let code = this.materialCode.substring(13,26);
            // this.headContent.sfcCode = code;
            this.queryParams.productNum = code;
            this.getList();
            this.cakeLamp.scanFinish = 1
            this.cakeLamp.startWork = 1
            this.cakeLamp.InPlace = 1
            const param = {
              processesCode: this.headContent.processesCode,
              productCode: this.workpieceInformation.productCode,
              sfcBarcode:code,
          if(this.materialCode.substring(35,56).includes("SSW001.001#HHW001.001")){
            if(this.materialCode.length>25){
              let code = this.materialCode.substring(13,26);
              // this.headContent.sfcCode = code;
              this.queryParams.productNum = code;
              this.getList();
              this.cakeLamp.scanFinish = 1
              this.cakeLamp.startWork = 1
              this.cakeLamp.InPlace = 1
              const param = {
                processesCode: this.headContent.processesCode,
                productCode: this.workpieceInformation.productCode,
                sfcBarcode:code,
              }
              fistSetpNumber(param).then(response => {
                console.log("fistSetpNumber------"+response.msg)
              });
              this.$message("扫描物料编码"+this.materialCode);
              this.materialCode="";
              this.setFocus();
            }else{
              this.$message("扫描物料编码错误!"+this.materialCode);
              this.materialCode="";
              this.setFocus();
            }
            fistSetpNumber(param).then(response => {
              console.log("fistSetpNumber------"+response.msg)
            });
            this.$message("扫描物料编码"+this.materialCode);
            this.materialCode="";
            this.setFocus();
          }else{
            this.$message("扫描物料编码错误!"+this.materialCode);
            this.materialCode="";
            this.setFocus();
          }else {
            this.$message("版本号校验错误,请检查!"+this.materialCode);
          }
        }
      }else{
        if(this.headContent.sfcCode === '' || this.headContent.sfcCode === null){
@@ -796,7 +799,7 @@
          if(self.headContent.processesCode === "OP165"){
            // self.test1()
            // self.test2()
            self.text = 'P9900200461#T'+self.headContent.sfcCode+'#V993983#SSW002.005#HHW001.001#NMCU#'
            self.text = 'P9900200461#T'+self.headContent.sfcCode+'#V993983#SSW001.001#HHW001.001#NMCU'
          }
        }else if (event.data.includes("[")) {//拧紧