OPC
懒羊羊
2023-12-13 21fde820e495c08cfa0ba277685468baa5bf9118
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/kb/greaseBoard/GreaseBoardController.java
@@ -3,11 +3,13 @@
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.gm.greaseManage.entity.GreaseManage;
import cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam;
import cn.stylefeng.guns.modular.gm.greaseManage.model.result.GreaseManageResult;
import cn.stylefeng.guns.modular.gm.greaseManage.service.GreaseManageService;
import cn.stylefeng.guns.modular.kb.utils.IPUtil;
import cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult;
import cn.stylefeng.guns.modular.sc.kanbanConf.model.params.KanbanConfParam;
import cn.stylefeng.guns.modular.sc.kanbanConf.service.KanbanConfService;
import cn.stylefeng.guns.plcserver.opc.unit.OPCUnit;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.kernel.model.response.ResponseData;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -154,6 +156,26 @@
        return ResponseData.success(list);
    }
    @ResponseBody
    @CrossOrigin
    @RequestMapping("/testhandleOilState")
    public long handleOilState(){
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
        String currentDate = format.format(new Date());
        GreaseManageParam param = new GreaseManageParam();
        param.setLocationCode("OP050");
        List<GreaseManageResult> list = greaseManageService.findListBySpec(param);
        if(list.size()>0) {
            String duaDate = list.get(0).getDuaDate();
//
            long  daysBetween = Long.parseLong(getRemainder(currentDate,duaDate));
//            long daysBetween = ChronoUnit.DAYS.between(date1, date2);
//            return daysBetween;
        }
        return  0;
    }
    public static String boldText(String param){
        return "<span style='font-size: 20px' class='colorRed'>"+param+"</span>";
    }
@@ -173,7 +195,7 @@
        DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
        LocalDate localDate1 = LocalDate.parse(currentDate, dateFormatter);
        LocalDate localDate2 = LocalDate.parse(tableDate, dateFormatter);
        long days = ChronoUnit.DAYS.between(localDate2, localDate1);
        long days = ChronoUnit.DAYS.between(localDate1, localDate2);
        return String.valueOf(days);
    }
@@ -194,7 +216,7 @@
                locationCode = "OP050";
                break;
            case "Z":
                locationCode = "BOP30/40";
                locationCode = "BOP030/040";
                break;
            default:
                break;