src/main/java/com/wgcloud/controller/FailureLoggingController.java
@@ -6,6 +6,7 @@ import com.wgcloud.entity.FailureLogging; import com.wgcloud.service.FailureLoggingService; import com.wgcloud.service.LogInfoService; import com.wgcloud.service.WorkLoggingService; import com.wgcloud.util.HostUtil; import com.wgcloud.util.PageUtil; import com.wgcloud.util.staticvar.StaticKeys; @@ -40,7 +41,8 @@ private FailureLoggingService failureLoggingService; @Resource private LogInfoService logInfoService; @Resource private WorkLoggingService workLoggingService; /** * 根据条件查询设备列表 * @@ -76,9 +78,11 @@ if (StringUtils.isEmpty(failureLogging.getId())) { failureLoggingService.save(failureLogging); failureLoggingService.saveLog(request, StaticKeys.LOG_ADD, failureLogging); workLoggingService.save(failureLogging); } else { failureLoggingService.updateById(failureLogging); failureLoggingService.saveLog(request, StaticKeys.LOG_UPDATE, failureLogging); workLoggingService.update(failureLogging); } } catch (Exception e) { logger.error("保存设备更换数据错误", e); src/main/java/com/wgcloud/controller/InspectionTaskController.java
New file @@ -0,0 +1,289 @@ package com.wgcloud.controller; import com.github.pagehelper.PageInfo; import com.wgcloud.entity.InspectionTask; import com.wgcloud.entity.TaskInfo; import com.wgcloud.service.InspectionTaskService; import com.wgcloud.service.LogInfoService; import com.wgcloud.service.TaskInfoService; import com.wgcloud.service.WorkLoggingService; import com.wgcloud.util.DateUtil; import com.wgcloud.util.PageUtil; import com.wgcloud.util.staticvar.StaticKeys; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.*; /** * @author kdq * @version 1.0.0 * @ClassName InspectionTaskController.java * @Description TODO * @createTime 2023年02月16日 14:22:00 */ @Controller @RequestMapping("/inspectionTask") public class InspectionTaskController { private static final Logger logger = LoggerFactory.getLogger(InspectionTaskController.class); @Resource private InspectionTaskService inspectionTaskService; @Resource private LogInfoService logInfoService; @Resource private WorkLoggingService workLoggingService; @Resource private TaskInfoService taskInfoService; /** * 根据条件查询设备列表 * * @param model * @param request * @return */ @RequestMapping(value = "list") public String failureList(InspectionTask inspectionTask, Model model, HttpServletRequest request) { Map<String, Object> params = new HashMap<String, Object>(); try { StringBuffer url = new StringBuffer(); // if (!StringUtils.isEmpty(InspectionTask.getOldDeviceName())) { // url.append("&oldDeviceName=").append(InspectionTask.getOldDeviceName()); // } PageInfo pageInfo = inspectionTaskService.selectByParams(params, inspectionTask.getPage(), inspectionTask.getPageSize()); PageUtil.initPageNumber(pageInfo, model); model.addAttribute("pageUrl", "/inspectionTask/list?1=1" + url.toString()); model.addAttribute("page", pageInfo); model.addAttribute("inspectionTask", inspectionTask); }catch (Exception e){ logger.error("查询设备更换列表错误", e); logInfoService.save("查询资产信息错误", e.toString(), StaticKeys.LOG_XTCZ); } return "inspectionTask/list"; } @RequestMapping(value = "save") public String saveInspectionTask(InspectionTask inspectionTask, Model model, HttpServletRequest request) { try { if (StringUtils.isEmpty(inspectionTask.getId())) { inspectionTaskService.save(inspectionTask); inspectionTaskService.saveLog(request, StaticKeys.LOG_ADD, inspectionTask); workLoggingService.save(inspectionTask); long l = subDaysByDate2(inspectionTask.getStartDate(), inspectionTask.getEndDate()); if(l>0){ for (long i = 0; i < l; i++) { TaskInfo taskInfo = new TaskInfo(); taskInfo.setTaskId(inspectionTask.getId()); if(i == 0){ taskInfo.setTaskDate(inspectionTask.getStartDate()); }else { String s = daysAgoOrAfter(inspectionTask.getStartDate(), new Long(i).intValue()); taskInfo.setTaskDate(s); } taskInfo.setIsOk(0); taskInfoService.save(taskInfo); } } } else { inspectionTaskService.updateById(inspectionTask); inspectionTaskService.saveLog(request, StaticKeys.LOG_UPDATE, inspectionTask); workLoggingService.update(inspectionTask); } } catch (Exception e) { logger.error("保存设备更换数据错误", e); logInfoService.save("保存设备更换数据错误", e.toString(), StaticKeys.LOG_XTCZ); } return "redirect:/inspectionTask/list"; } @RequestMapping(value = "save2") public String save2(TaskInfo taskInfo) { try { taskInfoService.updateById(taskInfo); } catch (Exception e) { logger.error("修改任务详情错误", e); logInfoService.save("修改任务详情错误", e.toString(), StaticKeys.LOG_XTCZ); } return "redirect:/inspectionTask/detail?id="+taskInfo.getTaskId(); } /** * 添加 * * @param model * @param request * @return */ @RequestMapping(value = "edit") public String edit(Model model, HttpServletRequest request) { String errorMsg = "添加设备"; String id = request.getParameter("id"); InspectionTask inspectionTask = new InspectionTask(); try { if (StringUtils.isEmpty(id)) { model.addAttribute("inspectionTask", inspectionTask); return "inspectionTask/add"; } inspectionTask = inspectionTaskService.selectById(id); model.addAttribute("inspectionTask", inspectionTask); } catch (Exception e) { logger.error(errorMsg, e); logInfoService.save(errorMsg, e.toString(), StaticKeys.LOG_XTCZ); } return "inspectionTask/add"; } /** * 添加 * * @param model * @param request * @return */ @RequestMapping(value = "edit2") public String edit2(Model model, HttpServletRequest request) { String errorMsg = "修改任务详情"; String id = request.getParameter("id"); TaskInfo taskInfo = new TaskInfo(); try { if (StringUtils.isEmpty(id)) { model.addAttribute("taskInfo", taskInfo); return "inspectionTask/infoedit"; } taskInfo = taskInfoService.selectById(id); model.addAttribute("taskInfo", taskInfo); } catch (Exception e) { logger.error(errorMsg, e); logInfoService.save(errorMsg, e.toString(), StaticKeys.LOG_XTCZ); } return "inspectionTask/infoedit"; } /** * 查看该应用统计图 * * @param model * @param request * @return */ @RequestMapping(value = "view") public String viewChart(Model model, HttpServletRequest request) { String errorMsg = "查看设备更换错误"; String id = request.getParameter("id"); InspectionTask inspectionTask = new InspectionTask(); try { inspectionTask = inspectionTaskService.selectById(id); model.addAttribute("inspectionTask", inspectionTask); } catch (Exception e) { logger.error(errorMsg, e); logInfoService.save(errorMsg, e.toString(), StaticKeys.LOG_XTCZ); } return "inspectionTask/view"; } /** * 删除设备 * * @param * @param model * @param request * @param redirectAttributes * @return */ @RequestMapping(value = "del") public String delete(Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) { String errorMsg = "删除更换设备错误"; InspectionTask inspectionTask = new InspectionTask(); try { if (!StringUtils.isEmpty(request.getParameter("id"))) { String[] ids = request.getParameter("id").split(","); for (String id : ids) { inspectionTask = inspectionTaskService.selectById(id); inspectionTaskService.saveLog(request, StaticKeys.LOG_DEL, inspectionTask); } inspectionTaskService.deleteById(ids); } } catch (Exception e) { logger.error(errorMsg, e); logInfoService.save(errorMsg, e.toString(), StaticKeys.LOG_XTCZ); } return "redirect:/inspectionTask/list"; } /** * 查看任务详情 * * @param model * @param request * @return */ @RequestMapping(value = "detail") public String detail(Model model, HttpServletRequest request) { try { String id = request.getParameter("id"); List<TaskInfo> allByTaskId = taskInfoService.getAllByTaskId(id); model.addAttribute("taskInfos", allByTaskId); }catch (Exception e){ logger.error("查询任务详情错误", e); logInfoService.save("查询任务详情错误", e.toString(), StaticKeys.LOG_XTCZ); } return "inspectionTask/taskinfo"; } /** * 获取两个日期相差的天数 方法二 * * @param startDate 开始日期的字符串 * @param endDate 结束日期的字符串 * @return 相差天数,如果解析失败则返回-1 **/ private long subDaysByDate2(String startDate, String endDate) { long sub; try { DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); LocalDate start = LocalDate.parse(startDate, dateTimeFormatter); LocalDate end = LocalDate.parse(endDate, dateTimeFormatter); sub = end.toEpochDay() - start.toEpochDay(); } catch (DateTimeParseException e) { sub = -1; } return sub; } private String daysAgoOrAfter(String startDate,int amount){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date d = new Date(); try { d= sdf.parse(startDate); } catch (ParseException e) { e.printStackTrace(); } Calendar mon = Calendar.getInstance(); mon.setTime(d); mon.add(Calendar.DATE,amount); Date time = mon.getTime(); String format = sdf.format(time); return format; } } src/main/java/com/wgcloud/entity/TaskInfo.java
@@ -1,5 +1,7 @@ package com.wgcloud.entity; import lombok.Data; /** * @author kdq * @version 1.0.0 @@ -7,6 +9,7 @@ * @Description TODO * @createTime 2022年12月12日 15:33:00 */ @Data public class TaskInfo extends BaseEntity{ /** @@ -31,7 +34,7 @@ /** * 任务完成详情 * 任务详情 */ private String content; src/main/java/com/wgcloud/entity/WorkLogging.java
@@ -32,6 +32,6 @@ /** * 操作日志 */ private String content; private String contentText; } src/main/java/com/wgcloud/mapper/InspectionTaskMapper.java
@@ -35,4 +35,6 @@ public void insertList(List<InspectionTask> recordList) throws Exception; public int deleteById(String[] id) throws Exception; void updateById(InspectionTask inspectionTask); } src/main/java/com/wgcloud/mapper/TaskInfoMapper.java
@@ -32,4 +32,8 @@ public int deleteById(String[] id) throws Exception; List<TaskInfo> getAllByTaskId(String id); void updateById(TaskInfo taskInfo); } src/main/java/com/wgcloud/service/InspectionTaskService.java
@@ -1,10 +1,22 @@ package com.wgcloud.service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.wgcloud.entity.FailureLogging; import com.wgcloud.entity.InspectionTask; import com.wgcloud.entity.TaskInfo; import com.wgcloud.mapper.InspectionTaskMapper; import com.wgcloud.util.DateUtil; import com.wgcloud.util.HostUtil; import com.wgcloud.util.UUIDUtil; import com.wgcloud.util.staticvar.StaticKeys; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.List; import java.util.Map; /** * @author kdq @@ -18,8 +30,46 @@ @Autowired private InspectionTaskMapper inspectionTaskMapper; @Autowired private LogInfoService logInfoService; public void save(InspectionTask inspectionTask) throws Exception { inspectionTask.setId(UUIDUtil.getUUID()); inspectionTask.setCreateTime(DateUtil.getCurrentDateTime()); inspectionTaskMapper.save(inspectionTask); } public PageInfo selectByParams(Map<String, Object> params, Integer currPage, Integer pageSize)throws Exception { PageHelper.startPage(currPage, pageSize); List<InspectionTask> list = inspectionTaskMapper.selectByParams(params); PageInfo<InspectionTask> pageInfo = new PageInfo<InspectionTask>(list); return pageInfo; } /** * 保存操作日志 * * @param request 获取当前登录用户 * @param action 操作标识 */ public void saveLog(HttpServletRequest request, String action, InspectionTask inspectionTask) { if (null == inspectionTask) { return; } logInfoService.save(HostUtil.getAccountByRequest(request).getAccount() + action + "巡检任务:" + inspectionTask.getTitle(), "创建时间:" + inspectionTask.getCreateTime()+",周期:"+inspectionTask.getStartDate()+"-"+inspectionTask.getEndDate(), StaticKeys.LOG_XTCZ); } public InspectionTask selectById(String id)throws Exception { return inspectionTaskMapper.selectById(id); } public void deleteById(String[] ids)throws Exception { inspectionTaskMapper.deleteById(ids); } public void updateById(InspectionTask inspectionTask) throws Exception { inspectionTaskMapper.updateById(inspectionTask); } } src/main/java/com/wgcloud/service/TaskInfoService.java
@@ -1,12 +1,17 @@ package com.wgcloud.service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.wgcloud.entity.FailureLogging; import com.wgcloud.entity.InspectionTask; import com.wgcloud.entity.TaskInfo; import com.wgcloud.mapper.TaskInfoMapper; import com.wgcloud.util.UUIDUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; /** * @author kdq @@ -22,10 +27,30 @@ private TaskInfoMapper taskInfoMapper; public void save(TaskInfo taskInfo) throws Exception { taskInfo.setId(UUIDUtil.getUUID()); taskInfoMapper.save(taskInfo); } public void saveAll(List<TaskInfo> taskInfos) throws Exception { taskInfoMapper.insertList(taskInfos); } public List<TaskInfo> getAllByTaskId(String id) { return taskInfoMapper.getAllByTaskId(id); } public PageInfo selectByParams(Map<String, Object> params, Integer currPage, Integer pageSize) throws Exception { PageHelper.startPage(currPage, pageSize); List<TaskInfo> list = taskInfoMapper.selectByParams(params); PageInfo<TaskInfo> pageInfo = new PageInfo<TaskInfo>(list); return pageInfo; } public TaskInfo selectById(String id) throws Exception { return taskInfoMapper.selectById(id); } public void updateById(TaskInfo taskInfo) { taskInfoMapper.updateById(taskInfo); } } src/main/java/com/wgcloud/service/WorkLoggingService.java
@@ -37,9 +37,23 @@ public void save(FailureLogging failureLogging) throws Exception { WorkLogging workLogging = new WorkLogging(); workLogging.setId(UUIDUtil.getUUID()); workLogging.setWorkDate(failureLogging.getPersonDate()); workLogging.setWorkDate(DateUtil.getCurrentDate()); workLogging.setUsername(failureLogging.getPersonName()); workLogging.setContent("更换ip为"+failureLogging.getOldDeviceIp()+"的"+failureLogging.getOldDeviceModel()+",替换为"+failureLogging.getNewDeviceIp()+"的"+failureLogging.getNewDeviceModel()); workLogging.setContentText("更换ip为"+failureLogging.getOldDeviceIp()+"的"+failureLogging.getOldDeviceModel()+",替换为"+failureLogging.getNewDeviceIp()+"的"+failureLogging.getNewDeviceModel()); workLoggingMapper.save(workLogging); } /** * 保存更换设备日志 * @param failureLogging * @throws Exception */ public void update(FailureLogging failureLogging) throws Exception { WorkLogging workLogging = new WorkLogging(); workLogging.setId(UUIDUtil.getUUID()); workLogging.setWorkDate(DateUtil.getCurrentDate()); workLogging.setUsername(failureLogging.getPersonName()); workLogging.setContentText("修改ip为"+failureLogging.getOldDeviceIp()+"的"+failureLogging.getOldDeviceModel()+"设备,修改为"+failureLogging.getNewDeviceIp()+"的"+failureLogging.getNewDeviceModel()); workLoggingMapper.save(workLogging); } @@ -51,9 +65,23 @@ public void save(InspectionTask inspectionTask) throws Exception { WorkLogging workLogging = new WorkLogging(); workLogging.setId(UUIDUtil.getUUID()); workLogging.setWorkDate(inspectionTask.getCreateTime()); workLogging.setWorkDate(DateUtil.getCurrentDate()); workLogging.setUsername("管理员"); workLogging.setContent("创立"+inspectionTask.getStartDate()+"-"+inspectionTask.getEndDate()+"的任务,标题为"+inspectionTask.getTitle()); workLogging.setContentText("创立"+inspectionTask.getStartDate()+"到"+inspectionTask.getEndDate()+"的任务,标题为"+inspectionTask.getTitle()); workLoggingMapper.save(workLogging); } /** * 保存创立任务日志 * @param * @throws Exception */ public void update(InspectionTask inspectionTask) throws Exception { WorkLogging workLogging = new WorkLogging(); workLogging.setId(UUIDUtil.getUUID()); workLogging.setWorkDate(DateUtil.getCurrentDate()); workLogging.setUsername("管理员"); workLogging.setContentText("修改"+inspectionTask.getStartDate()+"到"+inspectionTask.getEndDate()+"的任务"); workLoggingMapper.save(workLogging); } } src/main/resources/mybatis/mapper/InspectionTaskMapper.xml
@@ -22,6 +22,34 @@ </if> </sql> <update id="updateById" parameterType="com.wgcloud.entity.InspectionTask"> UPDATE INSPECTION_TASK <set> <if test="title != null"> TITLE = #{title}, </if> <if test="type != null"> TYPE = #{type}, </if> <if test="period != null"> PERIOD = #{period}, </if> <if test="scope != null"> SCOPE = #{scope}, </if> <if test="startDate != null"> START_DATE = #{startDate}, </if> <if test="endDate != null"> END_DATE = #{endDate}, </if> <if test="createTime != null"> CREATE_TIME = #{createTime}, </if> </set> WHERE ID = #{id} </update> <select id="selectById" resultMap="resultMap" parameterType="java.lang.String"> SELECT src/main/resources/mybatis/mapper/TaskInfoMapper.xml
@@ -18,6 +18,21 @@ <![CDATA[ AND TASK_ID = #{taskId} ]]> </if> </sql> <update id="updateById" parameterType="com.wgcloud.entity.TaskInfo"> update TASK_INFO <set> <if test="taskDate != null"> TASK_DATE = #{taskDate}, </if> <if test="isOk != null"> IS_OK = #{isOk}, </if> <if test="content != null"> CONTENT = #{content}, </if> </set> WHERE ID = #{id} </update> <select id="selectById" resultMap="resultMap" parameterType="java.lang.String"> SELECT @@ -87,5 +102,12 @@ </where> </select> <select id="getAllByTaskId" resultMap="resultMap"> SELECT <include refid="tableColumnList" /> FROM TASK_INFO WHERE TASK_ID=#{id} </select> </mapper> src/main/resources/mybatis/mapper/WorkLoggingMapper.xml
@@ -5,7 +5,7 @@ <id column="ID" property="id" jdbcType="CHAR" /> <result column="USERNAME" property="username" jdbcType="CHAR" /> <result column="WORK_DATE" property="workDate" jdbcType="TIMESTAMP" /> <result column="CONTENT" property="content" jdbcType="CHAR" /> <result column="CONTENT_TEXT" property="contentText" jdbcType="CHAR" /> </resultMap> <sql id="tableColumnList"> @@ -69,14 +69,14 @@ <trim prefix="(" suffix=")" suffixOverrides="," > <if test="id != null" >ID,</if> <if test="username != null" >USERNAME,</if> <if test="workDate != null" >WORK_DATE</if> <if test="content != null" >CONTENT</if> <if test="workDate != null" >WORK_DATE,</if> <if test="contentText != null" >CONTENT_TEXT</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides="," > <if test="id != null" >#{id},</if> <if test="username != null" >#{username},</if> <if test="workDate != null" >#{workDate},</if> <if test="content != null" >#{content}</if> <if test="contentText != null" >#{contentText}</if> </trim> </insert> src/main/resources/static/js/inspectiontask.js
New file @@ -0,0 +1,39 @@ function add() { window.location.href = "/tssw/inspectionTask/edit"; } function add2() { window.location.href = "/tssw/inspectionTask/infoEdit"; } function searchByAccount() { window.location.href = "/tssw/inspectionTask/list"; } function view(id) { window.location.href = "/tssw/inspectionTask/view?id="+id; } function edit(id){ window.location.href = "/tssw/inspectionTask/edit?id="+id; } function edit2(id){ window.location.href = "/tssw/inspectionTask/edit2?id="+id; } function del(id) { if(confirm('你确定要删除吗?')) { window.location.href = "/tssw/inspectionTask/del?id=" + id; } } function detail(id) { window.location.href = "/tssw/inspectionTask/detail?id="+id; } function cancel(){ history.back(); } src/main/resources/templates/common/aside.html
@@ -431,10 +431,10 @@ <ul class="nav nav-treeview"> <li class="nav-item"> <th:block th:if="${session.menuActive eq '81'}"> <a th:href="@{'/failurelogging/tuopuListHost'}" class="nav-link active"> <a th:href="@{'/inspectionTask/list'}" class="nav-link active"> </th:block> <th:block th:unless="${session.menuActive eq '81'}"> <a th:href="@{'/failurelogging/tuopuListHost'}" class="nav-link"> <a th:href="@{'/inspectionTask/list'}" class="nav-link"> </th:block> <i class="nav-icon far fa-circle text-info"></i> <p>巡检计划</p> src/main/resources/templates/common/footer.html
@@ -2,7 +2,7 @@ <footer class="main-footer"> <input type="hidden" id="serverInfoIdentify" th:value="${application.serverInfoId}"/> <th:block th:if="${application.copyRight eq 'true'}"> <strong>Copyright ©2017-<span id="copyyear">now</span> <a target="_blank" href="http://www.wgstart.com">www.wgstart.com</a>.</strong> <strong>Copyright ©2017-<span id="copyyear">now</span> <a target="_blank" href="http://www.10086.cn/">中国移动</a></strong> All Rights Reserved. </th:block> <th:block th:if="${application.copyRight eq 'false'}"> </th:block> src/main/resources/templates/failurelogging/list.html
@@ -96,7 +96,6 @@ <button type="button" th:onclick="edit([[${item.id}]])" class="btn bg-gradient-primary btn-sm">编辑</button> <button type="button" th:onclick="del([[${item.id}]])" class="btn bg-gradient-danger btn-sm">删除</button> </th:block> <button type="button" th:onclick="view([[${item.id}]])" class="btn bg-gradient-primary btn-sm">查看</button></td> </tr> </th:block> src/main/resources/templates/inspectiontask/add.html
New file @@ -0,0 +1,173 @@ <!DOCTYPE html> <html> <head> <div th:replace="common/header.html"></div> </head> <body th:class="${application.sidebarCollapse}"> <div th:replace="common/chart.html"></div> <div class="wrapper"> <div th:replace="common/navbar.html"></div> <div th:replace="common/aside.html"></div> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper" style="font-size:0.90rem"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1></h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item active"></li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-10"> <div class="card card-primary"> <div class="card-header"> <h3 class="card-title">添加巡检计划</h3> <div class=" float-sm-right"> <a href="javascript:history.back()">返回</a> </div> </div> <!-- /.card-header --> <!-- form start --> <form role="form" id="form1" th:action="@{'/inspectionTask/save'}"> <input type="hidden" name="id" th:value="${inspectionTask.id}"/> <div class="card-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label><font color="red">*</font>标题</label> <input type="text" autocomplete="off" th:value="${inspectionTask.title}" class="validate[required,maxSize[50]] form-control" name="title" id="title" placeholder=""> </div> <div class="form-group"> <label>类型</label> <input type="text" autocomplete="off" th:value="${inspectionTask.type}" class="validate[maxSize[50]] form-control" name="type" id="type" placeholder=""> </div> <div class="form-group"> <label>周期</label> <input type="text" autocomplete="off" th:value="${inspectionTask.period}" class="validate[maxSize[50]] form-control" name="period" id="period" placeholder=""> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>开始时间</label> <input type="text" autocomplete="off" th:value="${inspectionTask.startDate}" class="validate[maxSize[50]] form-control" name="startDate" id="startDate" placeholder=""> </div> <div class="form-group"> <label>结束时间</label> <input type="text" autocomplete="off" th:value="${inspectionTask.endDate}" class="validate[maxSize[50]] form-control" name="endDate" id="endDate" placeholder=""> </div> <div class="form-group"> <label>任务范围</label> <input type="text" autocomplete="off" th:value="${inspectionTask.scope}" class="validate[maxSize[50]] form-control" name="scope" id="scope" placeholder=""> </div> </div> </div> </div> <!-- /.card-body --> <div class="card-footer"> <button type="submit" class="btn btn-primary btn-sm" style="margin-right:10px;">保 存</button> <button type="button" th:onclick="goback()" class="btn bg-gradient-danger btn-sm">返 回</button> </div> </form> <!-- /.card-body --> </div> <!-- /.card --> </div> </div> </div> </section> </div> <div th:replace="common/footer.html"></div> </div> <!-- ./wrapper --> <link rel="stylesheet" th:href="@{'/static/js/jQuery/validationEngine.jquery.css'}" type="text/css"/> <script th:src="@{'/static/js/jQuery/jquery.validationEngine-zh_CN.js'}" type="text/javascript" charset="utf-8"></script> <script th:src="@{'/static/js/jQuery/jquery.validationEngine.js'}" type="text/javascript" charset="utf-8"></script> <script th:inline="javascript"> $(document).ready(function(){ $("#form1").validationEngine(); var caigouDateResponse =[[${inspectionTask.startDate}]]; var caigouDateResponse2 =[[${inspectionTask.endDate}]]; var caigouDate = $('#startDate'); var caigouDate2 = $('#endDate'); if(caigouDate!=null && caigouDate != undefined){ caigouDate.daterangepicker({ singleDatePicker: true, showDropdowns: true, // timePicker: true, // timePicker24Hour : true, // autoUpdateInput: false, "opens": "center", "locale": { format: 'YYYY-MM-DD', applyLabel: "应用", cancelLabel: "取消", daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'], monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], } }); if(caigouDateResponse=='' || caigouDateResponse==null){ caigouDate.val(""); } } if(caigouDate2!=null && caigouDate2 != undefined){ caigouDate2.daterangepicker({ singleDatePicker: true, showDropdowns: true, // timePicker: true, // timePicker24Hour : true, // autoUpdateInput: false, "opens": "center", "locale": { format: 'YYYY-MM-DD', applyLabel: "应用", cancelLabel: "取消", daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'], monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], } }); if(caigouDateResponse2=='' || caigouDateResponse2==null){ caigouDate2.val(""); } } }); function goback() { history.back(); } </script> </body> </html> src/main/resources/templates/inspectiontask/infoedit.html
New file @@ -0,0 +1,110 @@ <!DOCTYPE html> <html> <head> <div th:replace="common/header.html"></div> </head> <body th:class="${application.sidebarCollapse}"> <div th:replace="common/chart.html"></div> <div class="wrapper"> <div th:replace="common/navbar.html"></div> <div th:replace="common/aside.html"></div> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper" style="font-size:0.90rem"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1></h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item active"></li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-10"> <div class="card card-primary"> <div class="card-header"> <h3 class="card-title">修改任务</h3> <div class=" float-sm-right"> <a href="javascript:history.back()">返回</a> </div> </div> <!-- /.card-header --> <!-- form start --> <form role="form" id="form1" th:action="@{'/inspectionTask/save2'}"> <input type="hidden" name="id" th:value="${taskInfo.id}"/> <input type="hidden" name="taskId" th:value="${taskInfo.taskId}"/> <div class="card-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label><font color="red">*</font>任务时间</label> <input type="text" autocomplete="off" th:value="${taskInfo.taskDate}" class="validate[required,maxSize[50]] form-control" name="taskDate" id="taskDate" placeholder=""> </div> <div class="form-group"> <label>是否完成</label> <select class="validate[required] form-control" name="isOk" id="isOk"> <option value="0">未完成</option> <option value="1">完成</option> </select> </div> <div class="form-group"> <label>任务详情</label> <input type="text" autocomplete="off" th:value="${taskInfo.content}" class="validate[maxSize[50]] form-control" name="content" id="content" placeholder=""> </div> </div> </div> </div> <!-- /.card-body --> <div class="card-footer"> <button type="submit" class="btn btn-primary btn-sm" style="margin-right:10px;">保 存</button> <button type="button" th:onclick="goback()" class="btn bg-gradient-danger btn-sm">返 回</button> </div> </form> <!-- /.card-body --> </div> <!-- /.card --> </div> </div> </div> </section> </div> <div th:replace="common/footer.html"></div> </div> <!-- ./wrapper --> <link rel="stylesheet" th:href="@{'/static/js/jQuery/validationEngine.jquery.css'}" type="text/css"/> <script th:src="@{'/static/js/jQuery/jquery.validationEngine-zh_CN.js'}" type="text/javascript" charset="utf-8"></script> <script th:src="@{'/static/js/jQuery/jquery.validationEngine.js'}" type="text/javascript" charset="utf-8"></script> <script th:inline="javascript"> function goback() { history.back(); } </script> </body> </html> src/main/resources/templates/inspectiontask/list.html
New file @@ -0,0 +1,117 @@ <!DOCTYPE html> <html> <head> <div th:replace="common/header.html"></div> </head> <body th:class="${application.sidebarCollapse}"> <div th:replace="common/chart.html"></div> <div class="wrapper"> <div th:replace="common/navbar.html"></div> <div th:replace="common/aside.html"></div> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper" style="font-size:0.90rem"> <!-- Content Header (Page header) --> <section class="content-header" style="height:38px"> <div class="container-fluid"> <div class="row mb-2" style="margin-top: -7px;"> <div class="col-sm-6"></div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="javascript:history.back()">返回上级</a></li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <h3 class="card-title"><i class="nav-icon fas fa-server"></i> 巡检任务列表</h3> <div class=" float-sm-right"> <!-- SEARCH FORM --> <form class="form-inline ml-3" th:action="@{'/inspectionTask/list'}"> <th:block th:if="${session.LOGIN_KEY.role != 'guest'}"> <button type="button" onclick="delChecks('/inspectionTask/del')" class="btn bg-danger btn-sm" style="margin-right:5px;">删除</button> <button type="button" onclick="add()" class="btn btn-primary btn-sm" style="margin-right:5px;">添加</button> </th:block> </form> </div> </div> <!-- /.card-header --> <div class="card-body"> <table class="table table-bordered table-hover"> <thead> <tr> <th style="width: 20px"> <input type="checkbox" value="" name="checkall" id="checkall"></th> <th style="width: 60px">序号</th> <th>标题</th> <th>类型</th> <th>周期</th> <th>任务范围</th> <th>开始时间</th> <th>结束时间</th> <th>操作</th> </tr> </thead> <tbody> <th:block th:each="item,iterStat : ${page.list}"> <tr> <td><input type="checkbox" th:value="${item.id}" name="todo2" th:id="${item.id}+'_check'"/></td> <td th:text="${iterStat.index+1}">1</td> <td th:text="${item.title}">Update software</td> <td th:text="${item.type}">Update software</td> <td th:text="${item.period}">Update software</td> <td th:text="${item.scope}">Update software</td> <td th:text="${item.startDate}">Update software</td> <td th:text="${item.endDate}">Update software</td> <td> <th:block th:if="${session.LOGIN_KEY.role != 'guest'}"> <button type="button" th:onclick="edit([[${item.id}]])" class="btn bg-gradient-primary btn-sm">编辑</button> <button type="button" th:onclick="del([[${item.id}]])" class="btn bg-gradient-danger btn-sm">删除</button> <button type="button" th:onclick="detail([[${item.id}]])" class="btn bg-gradient-primary btn-sm">任务详情</button> </th:block> </tr> </th:block> </tbody> </table> </div> <!-- /.card-body --> <div th:replace="common/page.html"></div> </div> <!-- /.card --> </div> </div> </div> </section> </div> <div th:replace="common/footer.html"></div> </div> <!-- ./wrapper --> <script th:src="@{'/static/js/inspectiontask.js?v=3.3.9'}"></script> <script th:inline="javascript"> </script> </body> </html> src/main/resources/templates/inspectiontask/taskinfo.html
New file @@ -0,0 +1,100 @@ <!DOCTYPE html> <html> <head> <div th:replace="common/header.html"></div> </head> <body th:class="${application.sidebarCollapse}"> <div th:replace="common/chart.html"></div> <div class="wrapper"> <div th:replace="common/navbar.html"></div> <div th:replace="common/aside.html"></div> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper" style="font-size:0.90rem"> <!-- Content Header (Page header) --> <section class="content-header" style="height:38px"> <div class="container-fluid"> <div class="row mb-2" style="margin-top: -7px;"> <div class="col-sm-6"></div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="javascript:history.back()">返回上级</a></li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-body"> <table class="table table-bordered table-hover"> <thead> <tr> <th style="width: 20px"> <input type="checkbox" value="" name="checkall" id="checkall"></th> <th style="width: 60px">序号</th> <th title="任务时间">任务时间</th> <th title="是否完成">是否完成</th> <th title="任务详情">任务详情</th> <th title="操作">操作</th> </tr> </thead> <tbody> <th:block th:each="item,iterStat : ${taskInfos}"> <tr> <td><input type="checkbox" th:value="${item.id}" name="todo2" th:id="${item.id}+'_check'"/></td> <td th:text="${iterStat.index+1}" >1</td> <td th:text="${item.taskDate}" width="180px"></td> <td width="100px"> <th:block th:if="${item.isOk == 1}"> <span class="badge bg-primary">完成</span> </th:block> <th:block th:if="${item.isOk == 0}"> <span class="badge bg-danger">未完成</span> </th:block> </td> <td th:text="${item.content}"></td> <td width="200px"> <th:block th:if="${session.LOGIN_KEY.role != 'guest'}"> <button type="button" th:onclick="edit2([[${item.id}]])" class="btn bg-gradient-primary btn-sm">编辑</button> </th:block> </tr> </th:block> </tbody> </table> </div> </div> <!-- /.card --> </div> </div> </div> </section> </div> <div th:replace="common/footer.html"></div> </div> <!-- ./wrapper --> <script th:src="@{'/static/js/inspectiontask.js?v=3.3.9'}"></script> <script th:inline="javascript"> </script> </body> </html> src/main/resources/templates/inspectiontask/view.html
New file @@ -0,0 +1,131 @@ <!DOCTYPE html> <html> <head> <div th:replace="common/header.html"></div> </head> <body th:class="${application.sidebarCollapse}"> <div th:replace="common/chart.html"></div> <div class="wrapper"> <div th:replace="common/navbar.html"></div> <div th:replace="common/aside.html"></div> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper" style="font-size:0.90rem"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1></h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item active"></li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-10"> <div class="card card-primary"> <div class="card-header"> <h3 class="card-title">查看资产</h3> <div class=" float-sm-right"> <a href="javascript:history.back()">返回</a> </div> </div> <!-- /.card-header --> <!-- form start --> <form role="form" id="form1" th:action="@{'/equipment/save'}"> <input type="hidden" name="id" th:value="${equipment.id}"/> <div class="card-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label><font color="red">*</font>设备名称</label> <div th:text="${equipment.name}" ></div> </div> <div class="form-group"> <label>规格型号</label> <div th:text="${equipment.xinghao}" ></div> </div> <div class="form-group"> <label>使用人员</label> <div th:text="${equipment.person}" ></div> </div> <div class="form-group"> <label>供应商</label> <div th:text="${equipment.gongyingshang}" ></div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label><font color="red">*</font>设备编号</label> <div th:text="${equipment.code}" ></div> </div> <div class="form-group"> <label>使用部门</label> <div th:text="${equipment.dept}" ></div> </div> <div class="form-group"> <label>采购日期</label> <div th:text="${equipment.caigouDate}" ></div> </div> <div class="form-group"> <label>采购价格(元)</label> <div th:text="${equipment.price}" ></div> </div> </div> </div> <div class="form-group"> <label>备注</label> <div th:text="${equipment.remark}" ></div> </div> </div> <!-- /.card-body --> </form> <!-- /.card-body --> </div> <!-- /.card --> </div> </div> </div> </section> </div> <div th:replace="common/footer.html"></div> </div> <!-- ./wrapper --> <link rel="stylesheet" th:href="@{'/static/js/jQuery/validationEngine.jquery.css'}" type="text/css"/> <script th:src="@{'/static/js/jQuery/jquery.validationEngine-zh_CN.js'}" type="text/javascript" charset="utf-8"></script> <script th:src="@{'/static/js/jQuery/jquery.validationEngine.js'}" type="text/javascript" charset="utf-8"></script> <script th:inline="javascript"> function goback() { history.back(); } </script> </body> </html> src/main/resources/templates/login/login.html
@@ -60,7 +60,7 @@ <th:block th:if="${application.copyRight eq 'true'}"> <center> <div style="color:#2196f3">©2017-<span id="copyyear">now</span> <a target="_blank" href='http://www.wgstart.com'> www.wgstart.com</a> . All Rights Reserved. Version 3.4.2</div> <div style="color:#2196f3">©2017-<span id="copyyear">now</span> <a target="_blank" href='http://www.10086.cn/'> 中国移动</a> All Rights Reserved. Version 3.4.2</div> </center> </th:block> <link rel="stylesheet" th:href="@{'/static/js/jQuery/validationEngine.jquery.css'}" type="text/css"/> wgcloud-server.iml
@@ -4,10 +4,6 @@ <facet type="web" name="Web"> <configuration> <webroots /> <sourceRoots> <root url="file://$MODULE_DIR$/src/main/java" /> <root url="file://$MODULE_DIR$/src/main/resources" /> </sourceRoots> </configuration> </facet> <facet type="Spring" name="Spring"> @@ -20,7 +16,6 @@ <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/target" /> </content> <orderEntry type="inheritedJdk" />