| | |
| | | package com.ruoyi.app.patrolplan.service.impl; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public Results updateArdAppPatrolplan(Map<String,Object> para) { |
| | | public Results BeforeUpdateArdAppPatrolplan(Map<String,Object> para) { |
| | | if(para.get("id").toString().isEmpty()){ |
| | | return Results.error("ID无效!"); |
| | | } |
| | |
| | | return Results.succeed(jsonObject); |
| | | } |
| | | |
| | | @Override |
| | | public Results updateArdAppPatrolplan(Map<String,Object> para){ |
| | | if(para.get("id").toString().isEmpty()){ |
| | | return Results.error("ID无效!"); |
| | | } |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | //查询该条记录 |
| | | ArdAppPatrolplan planList = ardAppPatrolplanMapper.selectById(para.get("id").toString()); |
| | | String userId = SecurityUtils.getUserId(); |
| | | SysUser sysUser = sysUserMapper.selectUserById(userId); |
| | | String userName = sysUser.getNickName(); |
| | | planList.setDelName(userName); |
| | | planList.setDelTime(dateFormat.format(new Date())); |
| | | int result = ardAppPatrolplanMapper.updateById(planList); |
| | | if(result<1){ |
| | | return Results.error("修改失败,原数据停用出错!"); |
| | | } |
| | | int num = insertArdAppPatrolplan(para); |
| | | if(num==1){ |
| | | return Results.succeed("修改成功,已重新部署任务!"); |
| | | }else { |
| | | return Results.error("修改失败,重新部署任务失败!"); |
| | | } |
| | | } |
| | | |
| | | } |