lxw
2023-10-25 7baed9209086324dba79d14407579b52628616c8
34~58PwrdevHistorydataGwController.java;30行
10个文件已修改
50 ■■■■■ 已修改文件
src/main/java/com/whyc/service/AlarmManualClearService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattDischargePlanTempService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattdischargePlanService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/CheckDialogService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/Fbs9100StateService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/UserLogService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorkflowMainService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetMainService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/util/DateUtil.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/util/ThreadLocalUtil.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/AlarmManualClearService.java
@@ -99,7 +99,8 @@
        try {
            for (int i = 0; i < file.size(); i++) {
                String fileFileName = file.get(i).getOriginalFilename();
                String filePath = root + DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(date)+"_"+fileFileName;
                //String filePath = root + DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(date)+"_"+fileFileName;
                String filePath = root + ThreadLocalUtil.format(date,7)+"_"+fileFileName;
                createFilefolderIFNotExist(filePath);
                file.get(i).transferTo(new File(filePath));
                String httpFilePath = filePath.replace(fileDirName, "");
src/main/java/com/whyc/service/BattDischargePlanTempService.java
@@ -257,7 +257,8 @@
    public Response generateDischargePlan2(Float resetCapPercent, String startTimeStr) throws ParseException {
        int userId = ActionUtil.getUser().getUId().intValue();
        List<BattDischargePlanTemp> tempList = new LinkedList<>();
        Date startTime = DateUtil.YYYY_MM_DD_HH_MM_SS.parse(startTimeStr);
        //Date startTime = DateUtil.YYYY_MM_DD_HH_MM_SS.parse(startTimeStr);
        Date startTime = ThreadLocalUtil.parse(startTimeStr,1);
        Calendar planTime = Calendar.getInstance();
        planTime.setTime(startTime);
        //校验当前用户是否为管理员且只存在于一个包机组
@@ -1026,7 +1027,8 @@
     */
    @Transactional
    public Response deleteDischargePlanTemp(String startTimeStr) throws ParseException {
        Date startTime = DateUtil.YYYY_MM_DD_HH_MM_SS.parse(startTimeStr);
       // Date startTime = DateUtil.YYYY_MM_DD_HH_MM_SS.parse(startTimeStr);
        Date startTime = ThreadLocalUtil.parse(startTimeStr,1);
        Calendar planTime = Calendar.getInstance();
        planTime.setTime(startTime);
        //一年只会有一个计划,删除年度的计划. 审核通过的不能删除
@@ -1067,7 +1069,8 @@
        //1.提交到单据审批流程
        WorkflowMain main = new WorkflowMain();
        String orderId = mainService.getNextOrderId("FDJH");
        String title = "放电计划审批单-"+DateUtil.YYYY_MM_DD_HH_MM_SS.format(now);
        //String title = "放电计划审批单-"+DateUtil.YYYY_MM_DD_HH_MM_SS.format(now);
        String title = "放电计划审批单-"+ThreadLocalUtil.format(now,1);
        Integer mainStatus = WorkflowEnum.MAIN_STATUS_DEALING.getValue();
        Integer mainType = WorkflowEnum.MAIN_TYPE_DISCHARGE_PLAN.getValue();
        main.setOrderId(orderId);
@@ -1126,7 +1129,8 @@
        //1.提交到单据审批流程
        WorkflowMain main = new WorkflowMain();
        String orderId = mainService.getNextOrderId("FDJH");
        String title = "放电计划审批单-"+DateUtil.YYYY_MM_DD_HH_MM_SS.format(now);
        //String title = "放电计划审批单-"+DateUtil.YYYY_MM_DD_HH_MM_SS.format(now);
        String title = "放电计划审批单-"+ThreadLocalUtil.format(now,1);
        Integer mainStatus = WorkflowEnum.MAIN_STATUS_DEALING.getValue();
        Integer mainType = WorkflowEnum.MAIN_TYPE_DISCHARGE_PLAN.getValue();
        main.setOrderId(orderId);
src/main/java/com/whyc/service/BattdischargePlanService.java
@@ -277,7 +277,8 @@
            // map.put("nodeNumMap", nodeNumMap);
            map.put("nodeMap", nodeMap);
            map.put("disNumAll", disNumAll);
            map.put("nowTime", ActionUtil.sdf.format(new Date()));
            //map.put("nowTime", ActionUtil.sdf.format(new Date()));
            map.put("nowTime", ThreadLocalUtil.format(new Date(),1));
            planRes.setII(1, stateList.size() > 0, map, "今日放电任务统计");
        } catch (Exception e) {
            planRes.set(1, false, "出现异常" + e.getMessage());
src/main/java/com/whyc/service/CheckDialogService.java
@@ -6,6 +6,7 @@
import com.whyc.mapper.CheckDialogMapper;
import com.whyc.pojo.CheckDialog;
import com.whyc.util.ActionUtil;
import com.whyc.util.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -24,11 +25,8 @@
        if(checkDialog==null){
            CheckDialog cd=new CheckDialog();
            cd.setDevId(devId);
            try {
                cd.setTestStartTime(ActionUtil.sdf.parse(testStartTime));
            } catch (ParseException e) {
                e.printStackTrace();
            }
            //cd.setTestStartTime(ActionUtil.sdf.parse(testStartTime));
            cd.setTestStartTime(ThreadLocalUtil.parse(testStartTime,1));
            mapper.insert(cd);
        }else{
            UpdateWrapper wrapper1=new UpdateWrapper();
src/main/java/com/whyc/service/Fbs9100StateService.java
@@ -248,7 +248,8 @@
                Set<Integer> workStateSet = workStateMap.keySet();
                boolean commError = false;
                for (Fbs9100State state : fbs9100States) {
                    if (time.compareTo(DateUtil.YYYY_MM_DD_HH_MM_SS.parse(state.getRecordDatetime())) > 0) {
                    //if (time.compareTo(DateUtil.YYYY_MM_DD_HH_MM_SS.parse(state.getRecordDatetime())) > 0) {
                    if (time.compareTo(ThreadLocalUtil.parse(state.getRecordDatetime(),1)) > 0) {
                        resultMap.put("通讯故障数量", resultMap.get("通讯故障数量") + 1);
                        commError = true;
                        break;
@@ -340,7 +341,8 @@
            }
            map.put("stateNumMap", stateNumMap);
            map.put("stateMap", stateMap);
            map.put("nowTime", ActionUtil.sdf.format(new Date()));
            //map.put("nowTime", ActionUtil.sdf.format(new Date()));
            map.put("nowTime", ThreadLocalUtil.format(new Date(),1));
            return new Response().setII(1, true, map, "今日放电站点统计");
        } catch (Exception e) {
            return new Response().set(1, false, "出现异常" + e.getMessage());
src/main/java/com/whyc/service/UserLogService.java
@@ -230,7 +230,8 @@
        } else {
            columnTitleArr = new String[]{"Operator Name", "Operator Type", "Operator Time", "Operator IP", "Operator EVENT", "Specific parameters"};
        }
        String now = DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(new Date());
        //String now = DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(new Date());
        String now = ThreadLocalUtil.format(new Date(),7);
        ExcelUtil.exportExcel("UserLog-" + now, "sheet1", columnTitleArr, value, new HSSFWorkbook(), response);
    }
src/main/java/com/whyc/service/WorkflowMainService.java
@@ -15,6 +15,7 @@
import com.whyc.pojo.WorkflowMain;
import com.whyc.util.ActionUtil;
import com.whyc.util.DateUtil;
import com.whyc.util.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -253,7 +254,8 @@
        //1.提交到单据审批流程
        WorkflowMain main = new WorkflowMain();
        String orderId = getNextOrderId(mainTypeEn);
        String title = mainTypeCN+"审批单-"+ DateUtil.YYYY_MM_DD_HH_MM_SS.format(now);
        //String title = mainTypeCN+"审批单-"+ DateUtil.YYYY_MM_DD_HH_MM_SS.format(now);
        String title = mainTypeCN+"审批单-"+ ThreadLocalUtil.format(now,1);
        Integer mainStatus = WorkflowEnum.MAIN_STATUS_DEALING.getValue();
        main.setOrderId(orderId);
        main.setTitle(title);
src/main/java/com/whyc/service/WorksheetMainService.java
@@ -8,6 +8,7 @@
import com.whyc.pojo.WorksheetLink;
import com.whyc.pojo.WorksheetMain;
import com.whyc.util.DateUtil;
import com.whyc.util.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -36,7 +37,8 @@
        WorksheetAlarm worksheetAlarm = main.getWorksheetAlarm();
        //存入主表信息,子表信息,附表告警信息
        Date date = new Date();
        String formatDate = DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(date);
        //String formatDate = DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(date);
        String formatDate = ThreadLocalUtil.format(date,7);
        main.setTitle("告警派工单-"+user.getUName()+"-"+formatDate);
        main.setCreateUserId(user.getUId());
        main.setBeginTime(date);
src/main/java/com/whyc/util/DateUtil.java
@@ -165,7 +165,8 @@
        startTimeCalendar.setTime(startTime);
        Calendar endTimeCalendar = Calendar.getInstance();
        Date endTime = DateUtil.YYYY_MM_DD_HH_MM_SS.parse(endTimeStr);
        //Date endTime = DateUtil.YYYY_MM_DD_HH_MM_SS.parse(endTimeStr);
        Date endTime = ThreadLocalUtil.parse(endTimeStr,1);
        endTimeCalendar.setTime(endTime);
        /*String[] startTimeSplit = startTimeStr.split("-");
@@ -583,6 +584,7 @@
            existDefaultYear = true;
            yearTimeMap.remove(DateUtil.YYYY_MM_TABLE.format(endTimeDate));
            yearTimeMap.remove(ThreadLocalUtil.format(endTimeDate,2));
        }
        //调整下顺序,将default调整到首位
        if(existDefaultYear){
src/main/java/com/whyc/util/ThreadLocalUtil.java
@@ -11,6 +11,7 @@
    public static ThreadLocal<SimpleDateFormat> sdfwithtime = ThreadLocal.withInitial(() -> new SimpleDateFormat("HH:mm:ss"));
    public static ThreadLocal<SimpleDateFormat> sdfwithTABLE=ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyy-MM"));
    public static ThreadLocal<SimpleDateFormat> sdfwithtime_yyyyMMdd_HH_mm_ss=ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss"));
    public static ThreadLocal<SimpleDateFormat> YYYY_MM_DD_HH_MM_SS_UNION=ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmmss"));
    /*
    * flag:1(sdf),2(sdfwithOutday),3(sdfwithday),4(sdfwithtime)
@@ -23,7 +24,6 @@
                case 2:date=sdfwithOutday.get().parse(timeStr);break;
                case 3:date=sdfwithday.get().parse(timeStr);break;
                case 4:date=sdfwithtime.get().parse(timeStr);break;
                case 5:date=sdfwithTABLE.get().parse(timeStr);break;
                default:date=sdf.get().parse(timeStr);
            }
        } catch (ParseException e) {
@@ -40,6 +40,7 @@
            case 4:timeStr=sdfwithtime.get().format(date);break;
            case 5:timeStr=sdfwithTABLE.get().format(date);break;
            case 6:timeStr=sdfwithtime_yyyyMMdd_HH_mm_ss.get().format(date);break;
            case 7:timeStr=YYYY_MM_DD_HH_MM_SS_UNION.get().format(date);break;
            default:timeStr=sdf.get().format(date);
        }
        return timeStr;