| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineMngQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineMngDto; |
| | | import com.gkhy.safePlatform.targetDuty.service.ExamineMngService; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.sql.Timestamp; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * 绩效考核管理-安全考核管理(ExamineMng)表控制层 |
| | |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.examineMngService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping(value = "/addOrUpdate") |
| | | public ResultVO update(@RequestBody ExamineMng examineMng) { |
| | | public ResultVO update(Authentication authentication, @RequestBody ExamineMng examineMng) { |
| | | // 获取当前用户 |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | examineMng.setExamineDepartmentId(currentUser.getDepId()); |
| | | examineMng.setExaminePersonId(currentUser.getUid()); |
| | | if (examineMng.getId() == null) { |
| | | return new ResultVO<>(ResultCodes.OK,examineMngService.save(examineMng)); |
| | | } else { |
| | |
| | | * @param ids 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping(value = "/delete") |
| | | public ResultVO delete(String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")) |
| | | .collect(Collectors.toList()); |
| | | @RequestMapping(value = "/delete",method = RequestMethod.POST) |
| | | public ResultVO delete(@RequestBody Long[] ids) { |
| | | if(ids == null){ |
| | | return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL); |
| | | } |
| | | List<Long> idList = Arrays.asList(ids); |
| | | this.examineMngService.removeByIds(idList); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | |
| | | examineTemplateSaveOrUpdate.setExamineDate(new Timestamp(new java.util.Date().getTime())); |
| | | examineTemplateSaveOrUpdate.setExamineTotalNumber("3"); |
| | | examineTemplateSaveOrUpdate.setMemo("4"); |
| | | examineTemplateSaveOrUpdate.setExaminePersonId("5"); |
| | | examineTemplateSaveOrUpdate.setExaminePersonId(5L); |
| | | examineTemplateSaveOrUpdate.setBeExaminedPersonId("6"); |
| | | examineTemplateSaveOrUpdate.setExamineDepartmentId(7L); |
| | | examineTemplateSaveOrUpdate.setBeExaminedDepartmentId(8L); |
| | |
| | | |
| | | System.out.println(JSONObject.toJSONString(examineTemplateSaveOrUpdate)); |
| | | } |
| | | } |
| | | } |