cl
2024-05-23 ba1a7a9ef126296e2798e313dc5b43f775a1123c
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/kb/greaseBoard/GreaseBoardController.java
@@ -3,6 +3,7 @@
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;
@@ -154,6 +155,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 +194,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 +215,7 @@
                locationCode = "OP050";
                break;
            case "Z":
                locationCode = "BOP30/40";
                locationCode = "BOP030/040";
                break;
            default:
                break;
@@ -206,31 +227,31 @@
        String Month = "";
        switch (str) {
            case "A":
                Month = "1";
                Month = "01";
                break;
            case "B":
                Month = "2";
                Month = "02";
                break;
            case "C":
                Month = "3";
                Month = "03";
                break;
            case "D":
                Month = "4";
                Month = "04";
                break;
            case "E":
                Month = "5";
                Month = "05";
                break;
            case "F":
                Month = "6";
                Month = "06";
                break;
            case "G":
                Month = "7";
                Month = "07";
                break;
            case "H":
                Month = "8";
                Month = "08";
                break;
            case "I":
                Month = "9";
                Month = "09";
                break;
            case "J":
                Month = "10";