| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | import com.ruoyi.doublePrevention.service.RiskService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | |
| | | import com.ruoyi.project.tr.riskEvaluationPlan.service.IRiskEvaluationPlanService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IRiskCheckPointService riskCheckPointService; |
| | | |
| | | @Autowired |
| | | private RiskService riskService; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | |
| | | /** |
| | | * 检查点隐患登记--保存 |
| | | * todo-2022 手机端-暂时未改动 |
| | | */ |
| | | @Log(title = "检查点隐患登记--保存", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/editPointDangerRegisterSave") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult editPointDangerRegisterSave(HiddenDangerCheckPoint hiddenDangerCheckPoint) { |
| | | hiddenDangerCheckPoint.setRegisterCreateTime(DateUtils.getNowDate());//设置隐患登记上报创建时间 |
| | | hiddenDangerCheckPoint.setRegisterUserId(getSysUser().getUserId());//设置隐患登记上报创建人ID |
| | |
| | | hiddenDangerCheckPoint.setCreateTime(DateUtils.getNowDate()); |
| | | hiddenDangerCheckPoint.setCompanyId(getSysUser().getCompanyId()); |
| | | i = hiddenDangerCheckPointService.insertHiddenDangerCheckPoint(hiddenDangerCheckPoint); |
| | | |
| | | // todo-2022 此处插入附属表 |
| | | //获取Id返回值 |
| | | hiddenDangerCheckPoint.getId(); |
| | | int result = riskService.insertDangerInfo(hiddenDangerCheckPoint.getId(), hiddenDangerCheckPoint); |
| | | if (result< 1){ |
| | | throw new RuntimeException("添加隐患附属信息失败"); |
| | | } |
| | | |
| | | } else { |
| | | hiddenDangerCheckPoint.setUpdateBy(getSysUser().getLoginName()); |
| | | hiddenDangerCheckPoint.setUpdateTime(DateUtils.getNowDate()); |
| | | i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint); |
| | | |
| | | // todo-2022 此处修改附属表 |
| | | int result = riskService.updateDangerInfo(hiddenDangerCheckPoint); |
| | | if (result < 1){ |
| | | throw new RuntimeException("修改失败"); |
| | | } |
| | | } |
| | | hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送 |
| | | return toAjax(i); |