34~58PwrdevHistorydataGwController.java;30行
| | |
| | | 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, ""); |
| | |
| | | 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); |
| | | //校验当前用户是否为管理员且只存在于一个包机组 |
| | |
| | | */ |
| | | @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); |
| | | //一年只会有一个计划,删除年度的计划. 审核通过的不能删除 |
| | |
| | | //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); |
| | |
| | | //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); |
| | |
| | | // 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()); |
| | |
| | | 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; |
| | | |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | } |
| | | 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()); |
| | |
| | | } 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); |
| | | } |
| | | |
| | |
| | | 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; |
| | | |
| | |
| | | //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); |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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("-"); |
| | |
| | | existDefaultYear = true; |
| | | |
| | | yearTimeMap.remove(DateUtil.YYYY_MM_TABLE.format(endTimeDate)); |
| | | yearTimeMap.remove(ThreadLocalUtil.format(endTimeDate,2)); |
| | | } |
| | | //调整下顺序,将default调整到首位 |
| | | if(existDefaultYear){ |
| | |
| | | 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) |
| | |
| | | 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) { |
| | |
| | | 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; |