-
admin
2024-05-23 982c840def83ad765529635258599b5924499548
-
已修改7个文件
64 ■■■■ 文件已修改
jcdm-admin/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/util/TimeUtil.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/doman/RestFulOrder.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-admin/src/main/resources/application.yml
@@ -97,7 +97,7 @@
  # 令牌密钥
  secret: abcdefghijklmnopqrstuvwxyz
  # 令牌有效期(默认30分钟)
  expireTime: 30
  expireTime: 1440
## MyBatis配置
#mybatis:
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -4,6 +4,8 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import cn.hutool.core.util.StrUtil;
@@ -19,6 +21,7 @@
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper;
import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService;
import com.jcdm.main.plcserver.util.TimeUtil;
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
import org.aspectj.weaver.loadtime.Aj;
@@ -399,6 +402,7 @@
    @Override
    public AjaxResult updateTighteningFormula(BsFormulaChildInfo bsFormulaChildInfo) {
        Boolean b = true;
        BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
        getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
        getMaterTwo.setOperationType("2");
@@ -420,10 +424,15 @@
            return AjaxResult.error("扫描结果NG,请重新扫描!");
        }else {
            List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery);
            if(bsFormulaChildInfos.get(0).getSpareField2()!=null&&bsFormulaChildInfos.get(0).getSpareField3()!=null){
                String tightenArray = bsFormulaChildInfo.getTightenTheArray().replace("[", "").replace("]", "").replace(" ", "");
                String[] tightenDataParts = tightenArray.split(",");
                b = TimeUtil.isNumberInRange(Double.parseDouble(tightenDataParts[0]),Double.parseDouble(bsFormulaChildInfos.get(0).getSpareField2()),Double.parseDouble(bsFormulaChildInfos.get(0).getSpareField3()));
            }
            if(b){
            bsFormulaChildInfos.get(0).setResults("OK");
            bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray());
            bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0));
            Integer stepNumber = Integer.valueOf(bsFormulaChildInfos.get(0).getStepSort());
            try {
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber").value(stepNumber+1).build());
@@ -449,6 +458,15 @@
                    }
                }
            }
            }else {
                List<BsFormulaChildInfo> bsFormulaChildInfos1 = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery);
                bsFormulaChildInfos1.get(0).setResults("NG");
                String originalString = bsFormulaChildInfo.getTightenTheArray();
                String modifiedString = originalString.replaceFirst("OK", "NG");
                bsFormulaChildInfos1.get(0).setCollectData(modifiedString);
                bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos1.get(0));
                return AjaxResult.error("扫描结果NG,请重新扫描!");
            }
        }
        return AjaxResult.success("扫描成功!");
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -370,6 +370,7 @@
    public void sendToFactoryMes(String stationCode,String productNum ){
        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
//        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        ParentVO vo =new ParentVO();
        List<ChildVO> checkList = new ArrayList<>();
        List<DaParamCollection> list = this.list(new LambdaQueryWrapper<DaParamCollection>()
@@ -421,6 +422,7 @@
    public void pushGeelycvMesFeedback(String packID, String stationCode) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
//        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        String totalResult = "0";
        List<DaParamCollection> paramList = daParamCollectionService.list(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getSfcCode, packID).eq(DaParamCollection::getLocationCode, stationCode));
        if(paramList.size() > 0){
jcdm-main/src/main/java/com/jcdm/main/plcserver/util/TimeUtil.java
@@ -7,16 +7,43 @@
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TimeUtil {
    public static void main(String[] args) {
        String dateString = "Tue May 14 18:25:18 CST 2024";
//        System.out.println(test(dateString));
        String str = "OP330";
        System.out.println(str.substring(0,5));
//        String str = "OP330";
//        System.out.println(str.substring(0,5));
//        String tightenData = "[9.077463,12.0,OK,OK]";
//        tightenData = tightenData.replace("[", "").replace("]", "").replace(" ", "");
//        String[] tightenDataParts = tightenData.split(",");
//        for (int i = 0; i < tightenDataParts.length; i++) {
//            System.out.println(tightenDataParts[i]);
//        }
        String originalString = "[3.6,7.8,OK,OK]";
        String modifiedString = originalString.replaceFirst("OK", "NG");
        System.out.println(modifiedString); // 输出: [3.6,7.8,NG,OK]
//        System.out.println(isNumberInRange(7.7, 7.5, 8.5));
//        System.out.println(test( stringProcessing("DateTime{utcTime=133601559184960000, javaDate=Tue May 14 18:25:18 CST 2024}")));
    }
    public static String replaceNumber(String input) {
        String regex = ",(\\d+),";
        String replacement = ",NG,";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(input);
        return matcher.replaceAll(replacement);
    }
    // 检查一个数是否在两个数定义的区间内(不包含边界)
    public static boolean isNumberInRange(Double number, Double start, Double end) {
        return number >= start && number <= end;
    }
    public static String stringProcessing(String dateTimeStr){
        String result = "";
        // 找到 "javaDate=" 的位置
jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java
@@ -9,7 +9,7 @@
    public static void main(String[] args) {
        String str = "uuuuuu11uuuuuuuuuuuuuuu";
        System.out.println(str.length());
//        getWorkReportResultFeedback()
//        getWorkReportResultFeedback() https://imes-uat-group.geelycv-test.com
    }
    public static final String getRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration";
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/doman/RestFulOrder.java
@@ -8,5 +8,5 @@
    private String stationCode;
    private String materialCode;
    private String productionOrderNum;
//    private Long planQty;
    private Long planQty;
}
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
@@ -54,8 +54,9 @@
    private IDaPassingStationCollectionService passingStationCollectionService;
    String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
//    String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
    /**
     * 导出点检任务列表
@@ -162,7 +163,7 @@
            order.setProductNum(omProductionOrdeInfo.getProductNum());
            order.setMaterialCode(omProductionOrdeInfo.getMaterialCode());
            order.setStationCode(omProductionOrdeInfo.getStationCode());
//            order.setPlanQty(omProductionOrdeInfo.getPlanQty());
            order.setPlanQty(omProductionOrdeInfo.getPlanQty());
            restFulOrders.add(order);
        }
        return AjaxResult.success(restFulOrders);