9 files modified
42 files added
| | |
| | | /** |
| | | * nacos dev 地址 |
| | | */ |
| | | String NACOS_DEV_ADDR = "192.168.0.100:8848"; |
| | | String NACOS_DEV_ADDR = "192.168.0.200:8848"; |
| | | |
| | | /** |
| | | * nacos prod 地址 |
| | |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | |
| | | //自定义注册 |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", "zhongrijian"); |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", "zhongrijian"); |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", "guoshilong"); |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", "guoshilong"); |
| | | |
| | | PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile)); |
| New file |
| | |
| | | package cn.gistack.sm.exam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlan; |
| | | import cn.gistack.sm.exam.service.IExamPlanService; |
| | | import cn.gistack.sm.exam.vo.ExamPlanVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: 考核方案 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "考核方案") |
| | | @RestController |
| | | @RequestMapping("/exam/examPlan") |
| | | @AllArgsConstructor |
| | | public class ExamPlanController extends BladeController { |
| | | private final IExamPlanService examPlanService; |
| | | // private final IQuartzJobService quartzJobService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param examPlan |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-分页列表查询", notes = "考核方案-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(ExamPlan examPlan, Query query) { |
| | | IPage<ExamPlan> pageList = examPlanService.page(Condition.getPage(query), Condition.getQueryWrapper(examPlan)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examPlan |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-自定义分页列表查询", notes = "考核方案-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(ExamPlan examPlan, Query query) { |
| | | IPage<ExamPlanVO> examPlanVOIPage = examPlanService.selectExamPlanPage(Condition.getPage(query), examPlan); |
| | | return R.data(examPlanVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param examPlan |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-添加", notes = "考核方案-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody ExamPlan examPlan) { |
| | | return R.data(examPlanService.save(examPlan)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param examPlan |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-编辑", notes = "考核方案-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public R edit(@RequestBody ExamPlan examPlan) { |
| | | return R.data(examPlanService.updateById(examPlan)); |
| | | } |
| | | |
| | | /** |
| | | * 启用/禁用 |
| | | * |
| | | * @param examPlan |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-启用/禁用", notes = "考核方案-编辑") |
| | | @RequestMapping(value = "/enableOrDisable", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public R<?> enableOrDisable(@RequestBody ExamPlan examPlan) { |
| | | if (StringUtils.isEmpty(examPlan.getId().toString()) || null == examPlan.getStatus()) { |
| | | return R.fail("参数错误!"); |
| | | } |
| | | return R.data(examPlanService.enableOrDisable(examPlan.getId().toString(), examPlan.getStatus())); |
| | | } |
| | | |
| | | // /** |
| | | // * 立即执行 |
| | | // * |
| | | // * @param id |
| | | // * @return |
| | | // */ |
| | | // //@RequiresRoles("admin") |
| | | // @GetMapping("/execute") |
| | | // public R<?> execute(@RequestParam(name = "id", required = true) String id) { |
| | | // ExamPlan examPlan = examPlanService.getById(id); |
| | | // if (examPlan == null) { |
| | | // return R.fail("未找到对应实体"); |
| | | // } |
| | | // try { |
| | | // quartzJobService.execute(examPlan); |
| | | // } catch (Exception e) { |
| | | // //e.printStackTrace(); |
| | | // log.info("定时任务 立即执行失败>>" + e.getMessage()); |
| | | // return R.fail("执行失败!"); |
| | | // } |
| | | // return R.success("执行成功!"); |
| | | // } |
| | | |
| | | /** |
| | | * 添加所有 |
| | | * |
| | | * @param examPlan |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-添加所有", notes = "考核方案-添加所有") |
| | | @PostMapping(value = "/addAll") |
| | | public R<?> addAll(@RequestBody ExamPlanVO examPlan) { |
| | | return R.data(examPlanService.saveAll(examPlan)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑所有 |
| | | * |
| | | * @param examPlan |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-编辑所有", notes = "考核方案-编辑所有") |
| | | @RequestMapping(value = "/editAll", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public R<?> editAll(@RequestBody ExamPlanVO examPlan) { |
| | | return R.data(examPlanService.updateAll(examPlan)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-通过id删除", notes = "考核方案-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | | return R.data(examPlanService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-批量删除", notes = "考核方案-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | return R.data(this.examPlanService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "考核方案-通过id查询", notes = "考核方案-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | ExamPlan examPlan = examPlanService.getById(id); |
| | | return R.data(examPlan); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlanUser; |
| | | import cn.gistack.sm.exam.service.IExamPlanUserService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: 考核名录 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="考核名录") |
| | | @RestController |
| | | @RequestMapping("/exam/examPlanUser") |
| | | @AllArgsConstructor |
| | | public class ExamPlanUserController extends BladeController { |
| | | private IExamPlanUserService examPlanUserService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | */ |
| | | @ApiOperation(value="考核名录-分页列表查询", notes="考核名录-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R<?> queryPageList(ExamPlanUser examPlanUser, Query query) { |
| | | IPage<ExamPlanUser> pageList = examPlanUserService.page(Condition.getPage(query), Condition.getQueryWrapper(examPlanUser)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param examPlanUser |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核名录-添加", notes="考核名录-添加") |
| | | @PostMapping(value = "/add") |
| | | public R<?> add(@RequestBody ExamPlanUser examPlanUser) { |
| | | return R.data(examPlanUserService.save(examPlanUser)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param examPlanUser |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核名录-编辑", notes="考核名录-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R<?> edit(@RequestBody ExamPlanUser examPlanUser) { |
| | | return R.data(examPlanUserService.updateById(examPlanUser)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核名录-通过id删除", notes="考核名录-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<?> delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(examPlanUserService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核名录-批量删除", notes="考核名录-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.examPlanUserService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核名录-通过id查询", notes="考核名录-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | ExamPlanUser examPlanUser = examPlanUserService.getById(id); |
| | | return R.data(examPlanUser); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlan; |
| | | import cn.gistack.sm.exam.entity.ExamRating; |
| | | import cn.gistack.sm.exam.service.IExamRatingService; |
| | | import cn.gistack.sm.exam.vo.ExamRatingVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: 考核评定 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="考核评定") |
| | | @RestController |
| | | @RequestMapping("/exam/examRating") |
| | | @AllArgsConstructor |
| | | public class ExamRatingController extends BladeController { |
| | | private IExamRatingService examRatingService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | */ |
| | | @ApiOperation(value="考核评定-分页列表查询", notes="考核评定-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(ExamRating examRating, Query query) { |
| | | IPage<ExamRating> pageList = examRatingService.page(Condition.getPage(query), Condition.getQueryWrapper(examRating)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examRating |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核评定-自定义分页列表查询", notes="考核评定-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(ExamRatingVO examRating,Query query) { |
| | | return R.data(examRatingService.selectExamRatingPage(Condition.getPage(query),examRating)); |
| | | } |
| | | |
| | | /** |
| | | * 获取全部 |
| | | */ |
| | | @ApiOperation(value="考核评定-获取全部", notes="考核评定-获取全部") |
| | | @GetMapping(value = "/all") |
| | | public R getAll(ExamRating examRating) { |
| | | return R.data(examRatingService.list(Condition.getQueryWrapper(examRating))); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param examRating |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核评定-添加", notes="考核评定-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody ExamRating examRating) { |
| | | return R.data(examRatingService.save(examRating)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param examRating |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核评定-编辑", notes="考核评定-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody ExamRating examRating) { |
| | | return R.data(examRatingService.updateById(examRating)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核评定-通过id删除", notes="考核评定-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(examRatingService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核评定-批量删除", notes="考核评定-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.examRatingService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核评定-通过id查询", notes="考核评定-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | ExamRating examRating = examRatingService.getById(id); |
| | | return R.data(examRating); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamScore; |
| | | import cn.gistack.sm.exam.service.IExamScoreService; |
| | | import cn.gistack.sm.exam.vo.ExamScoreVO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: 巡检次数得分标准 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="巡检次数得分标准") |
| | | @RestController |
| | | @RequestMapping("/exam/examScore") |
| | | @AllArgsConstructor |
| | | public class ExamScoreController extends BladeController { |
| | | private IExamScoreService examScoreService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param examScore |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-分页列表查询", notes="巡检次数得分标准-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(ExamScore examScore, Query query) { |
| | | IPage<ExamScore> pageList = examScoreService.page(Condition.getPage(query), Condition.getQueryWrapper(examScore)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examScore |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-自定义分页列表查询", notes="巡检次数得分标准-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(ExamScoreVO examScore, Query query) { |
| | | return R.data(examScoreService.selectExamScorePage(Condition.getPage(query),examScore)); |
| | | } |
| | | |
| | | /** |
| | | * 获取全部 |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-获取全部", notes="巡检次数得分标准-获取全部") |
| | | @GetMapping(value = "/all") |
| | | public R getAll(ExamScore examScore) { |
| | | return R.data(examScoreService.list(Condition.getQueryWrapper(examScore))); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param examScore |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-添加", notes="巡检次数得分标准-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody ExamScore examScore) { |
| | | return R.data(examScoreService.save(examScore)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param examScore |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-编辑", notes="巡检次数得分标准-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody ExamScore examScore) { |
| | | return R.data(examScoreService.updateById(examScore)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-通过id删除", notes="巡检次数得分标准-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(examScoreService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-批量删除", notes="巡检次数得分标准-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.examScoreService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡检次数得分标准-通过id查询", notes="巡检次数得分标准-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | ExamScore examScore = examScoreService.getById(id); |
| | | return R.data(examScore); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamTarget; |
| | | import cn.gistack.sm.exam.service.IExamTargetService; |
| | | import cn.gistack.sm.exam.vo.ExamTargetVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: 考核指标 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="考核指标") |
| | | @RestController |
| | | @RequestMapping("/exam/examTarget") |
| | | @AllArgsConstructor |
| | | public class ExamTargetController extends BladeController { |
| | | private IExamTargetService examTargetService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param examTarget |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核指标-分页列表查询", notes="考核指标-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(ExamTarget examTarget, Query query) { |
| | | IPage<ExamTarget> pageList = examTargetService.page(Condition.getPage(query), Condition.getQueryWrapper(examTarget)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examTarget |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核指标-自定义分页列表查询", notes="考核指标-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(ExamTargetVO examTarget, Query query) { |
| | | return R.data( examTargetService.selectExamTargetPage(Condition.getPage(query),examTarget)); |
| | | } |
| | | |
| | | /** |
| | | * 获取全部 |
| | | */ |
| | | @ApiOperation(value="考核指标-获取全部", notes="考核指标-获取全部") |
| | | @GetMapping(value = "/all") |
| | | public R getAll(ExamTarget examTarget) { |
| | | return R.data( examTargetService.list(Condition.getQueryWrapper(examTarget))); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param examTarget |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核指标-添加", notes="考核指标-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody ExamTarget examTarget) { |
| | | return R.data(examTargetService.save(examTarget)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param examTarget |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核指标-编辑", notes="考核指标-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody ExamTarget examTarget) { |
| | | return R.data(examTargetService.updateById(examTarget)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核指标-通过id删除", notes="考核指标-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(examTargetService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核指标-批量删除", notes="考核指标-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.examTargetService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考核指标-通过id查询", notes="考核指标-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | ExamTarget examTarget = examTargetService.getById(id); |
| | | return R.data(examTarget); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * @Description: 考核方案 |
| | | */ |
| | | @Data |
| | | @TableName(value = "sm_exam_plan") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="sm_exam_plan对象", description="考核方案") |
| | | public class ExamPlan extends BaseEntity { |
| | | |
| | | /**考核方案名*/ |
| | | @ApiModelProperty(value = "考核方案名") |
| | | private String name; |
| | | /**考核周期*/ |
| | | @ApiModelProperty(value = "考核周期") |
| | | private String examPeriod; |
| | | @ApiModelProperty(value = "cron表达式") |
| | | private String cronExpression; |
| | | /**生效人员*/ |
| | | @ApiModelProperty(value = "生效人员") |
| | | private String examRole; |
| | | /**职责*/ |
| | | @ApiModelProperty(value = "职责") |
| | | private Integer duty; |
| | | /**生效时间开始*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "生效时间开始") |
| | | private Date effectiveTimeStart; |
| | | /**生效时间结束*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "生效时间结束") |
| | | private Date effectiveTimeEnd; |
| | | /**备注*/ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * @Description: 考核名录 |
| | | */ |
| | | @Data |
| | | @TableName("sm_exam_plan_user") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="sm_exam_plan_user对象", description="考核名录") |
| | | public class ExamPlanUser extends BaseEntity { |
| | | |
| | | /**姓名*/ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String userId; |
| | | /**职责*/ |
| | | @ApiModelProperty(value = "职责") |
| | | private String roleName; |
| | | /**考核方案*/ |
| | | @ApiModelProperty(value = "考核方案") |
| | | private String epId; |
| | | /**考核总分*/ |
| | | @ApiModelProperty(value = "考核总分") |
| | | private java.math.BigDecimal epCountScore; |
| | | /**子得分*/ |
| | | @ApiModelProperty(value = "子得分") |
| | | @TableField(typeHandler = FastjsonTypeHandler.class) |
| | | private Object scoreInfo; |
| | | /**权重*/ |
| | | @ApiModelProperty(value = "权重") |
| | | private String weightInfo; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * @Description: 考核评定 |
| | | */ |
| | | @Data |
| | | @TableName("sm_exam_plan_rating") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="sm_exam_plan_rating对象", description="考核评定") |
| | | public class ExamRating { |
| | | |
| | | /**主键*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键") |
| | | private String id; |
| | | /**方案id*/ |
| | | @ApiModelProperty(value = "方案id") |
| | | private String planId; |
| | | /**评级等级*/ |
| | | @ApiModelProperty(value = "评级等级") |
| | | private String level; |
| | | /**评分起点(>)*/ |
| | | @ApiModelProperty(value = "评分起点(>)") |
| | | private String min; |
| | | /**评分起点(<)*/ |
| | | @ApiModelProperty(value = "评分起点(<)") |
| | | private String max; |
| | | /**评分说明*/ |
| | | @ApiModelProperty(value = "评分说明") |
| | | private String description; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * @Description: 巡检次数得分标准 |
| | | */ |
| | | @Data |
| | | @TableName("sm_exam_plan_score") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="sm_exam_plan_score对象", description="巡检次数得分标准") |
| | | public class ExamScore { |
| | | |
| | | /**主键*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键") |
| | | private String id; |
| | | /**方案id*/ |
| | | @ApiModelProperty(value = "方案id") |
| | | private String planId; |
| | | /**开始范围*/ |
| | | @ApiModelProperty(value = "开始范围") |
| | | private Integer rangeStart; |
| | | /**结束范围*/ |
| | | @ApiModelProperty(value = "结束范围") |
| | | private Integer rangeEnd; |
| | | /**得分*/ |
| | | @ApiModelProperty(value = "得分") |
| | | private String score; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @Description: 考核指标 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("sm_exam_plan_target") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="sm_exam_plan_target对象", description="考核指标") |
| | | public class ExamTarget { |
| | | |
| | | /**主键*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键") |
| | | private String id; |
| | | /**考核方案id*/ |
| | | @ApiModelProperty(value = "考核方案id") |
| | | private String planId; |
| | | /**指标名称(数据字典)*/ |
| | | @ApiModelProperty(value = "指标名称(数据字典)") |
| | | private Integer targetId; |
| | | /**权重百分比*/ |
| | | @ApiModelProperty(value = "权重百分比") |
| | | private Double weight; |
| | | /**计分形式*/ |
| | | @ApiModelProperty(value = "计分形式") |
| | | private Integer scoreRule; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlan; |
| | | import cn.gistack.sm.exam.vo.ExamPlanVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | /** |
| | | * @Description: 考核方案 |
| | | */ |
| | | public interface ExamPlanMapper extends BaseMapper<ExamPlan> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examPlan 考核方案 vo 对象 |
| | | * @return |
| | | */ |
| | | List<ExamPlanVO> selectExamPlanPage(@Param("examPlan") ExamPlan examPlan); |
| | | |
| | | /** |
| | | * 设置启用或者禁用 |
| | | * @param id id |
| | | * @param value 值 |
| | | * @return |
| | | */ |
| | | Boolean enableOrDisable(@Param("id") String id, @Param("value") Integer value); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.exam.mapper.ExamPlanMapper"> |
| | | |
| | | <resultMap id="selectExamPlan" type="cn.gistack.sm.exam.vo.ExamPlanVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="exam_period" property="examPeriod"/> |
| | | <result column="cron_expression" property="cronExpression"/> |
| | | <result column="exam_role" property="examRole"/> |
| | | <result column="duty" property="duty"/> |
| | | <result column="effective_time_start" property="effectiveTimeStart"/> |
| | | <result column="effective_time_end" property="effectiveTimeEnd"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="status" property="status"/> |
| | | <result column="examPeriodText" property="examPeriodText"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <!--分页列表查询--> |
| | | <select id="selectExamPlanPage" resultType="cn.gistack.sm.exam.vo.ExamPlanVO"> |
| | | select plan.id,plan.name,plan.exam_period,plan.cron_expression,plan.exam_role,plan.duty,plan.effective_time_start,plan.effective_time_end,plan.remark,plan.status, |
| | | biz.dict_value examPeriodText |
| | | from sm_exam_plan plan |
| | | LEFT JOIN blade_dict_biz biz ON biz.dict_key = plan.exam_period AND biz.code = 'EXAM_PERIOD' |
| | | where plan.is_deleted = 0 |
| | | <if test="examPlan.name !=null and examPlan.name !=''"> |
| | | AND plan.name LIKE CONCAT('%',#{examPlan.name},'%') |
| | | </if> |
| | | <if test="examPlan.examPeriod !=null and examPlan.examPeriod !=''"> |
| | | AND plan.exam_period = #{examPlan.examPeriod} |
| | | </if> |
| | | <if test="examPlan.status !=null and examPlan.status !='' "> |
| | | AND plan.status = #{examPlan.status} |
| | | </if> |
| | | order by plan.id desc |
| | | </select> |
| | | |
| | | <!-- 设置启用或者禁用--> |
| | | <update id="enableOrDisable"> |
| | | update sm_exam_plan |
| | | <set > |
| | | status = #{value} |
| | | </set> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.exam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlanUser; |
| | | import cn.gistack.sm.exam.vo.ExamPlanUserVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @Description: 考核名录 |
| | | */ |
| | | public interface ExamPlanUserMapper extends BaseMapper<ExamPlanUser> { |
| | | |
| | | /** |
| | | * 用户考核数据 |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<ExamPlanUserVO> selectUserAssessData(@Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.exam.mapper.ExamPlanUserMapper"> |
| | | |
| | | <!-- 用户考核数据--> |
| | | <select id="selectUserAssessData" resultType="cn.gistack.sm.exam.vo.ExamPlanUserVO"> |
| | | select user.id userId,user.realname,role.role_name roleName, |
| | | ( |
| | | SELECT count(*) FROM sm_patrol_info spi |
| | | WHERE spi.inspection_person LIKE CONCAT('%',user.id,'%') |
| | | and spi.check_date >= #{startTime} |
| | | and spi.check_date <= #{endTime} |
| | | ) AS xjCount, -- 巡检次数 |
| | | 0 AS dbCount, -- 督办次数 |
| | | 0 AS sjclCount -- 事件处理次数 |
| | | from sys_user user |
| | | LEFT JOIN sys_user_role userRole ON user.id = userRole.user_id |
| | | LEFT JOIN sys_role role ON role.id = userRole.role_id |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.exam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamRating; |
| | | import cn.gistack.sm.exam.vo.ExamRatingVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | /** |
| | | * @Description: 考核评定 |
| | | */ |
| | | public interface ExamRatingMapper extends BaseMapper<ExamRating> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examRating 考核评定 vo 对象 |
| | | * @return |
| | | */ |
| | | List<ExamRatingVO> selectExamRatingPage(@Param("examRating") ExamRatingVO examRating); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.exam.mapper.ExamRatingMapper"> |
| | | |
| | | <!--分页列表查询--> |
| | | <select id="selectExamRatingPage" resultType="cn.gistack.sm.exam.vo.ExamRatingVO"> |
| | | select |
| | | sm_exam_plan_rating.* |
| | | from sm_exam_plan_rating |
| | | where 1=1 |
| | | order by sm_exam_plan_rating.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.exam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamScore; |
| | | import cn.gistack.sm.exam.vo.ExamScoreVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | /** |
| | | * @Description: 巡检次数得分标准 |
| | | */ |
| | | public interface ExamScoreMapper extends BaseMapper<ExamScore> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examScore 巡检次数得分标准 vo 对象 |
| | | * @return |
| | | */ |
| | | List<ExamScoreVO> selectExamScorePage(@Param("examScore") ExamScoreVO examScore); |
| | | |
| | | /** |
| | | * 根据巡检次数和方案id得到具体的分数 |
| | | * @param planId 方案id |
| | | * @param count 巡检次数 |
| | | * @return 分数 |
| | | */ |
| | | Integer getExamScoreByPlanIdAndCount(@Param("planId") String planId,@Param("count") int count); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.exam.mapper.ExamScoreMapper"> |
| | | |
| | | <!--分页列表查询--> |
| | | <select id="selectExamScorePage" resultType="cn.gistack.sm.exam.vo.ExamScoreVO"> |
| | | select |
| | | sm_exam_plan_score.* |
| | | from sm_exam_plan_score |
| | | where 1=1 |
| | | order by sm_exam_plan_score.id desc |
| | | </select> |
| | | <!--根据巡检次数和方案id得到具体的分数--> |
| | | <select id="getExamScoreByPlanIdAndCount" resultType="java.lang.Integer"> |
| | | select |
| | | IFNULL(MAX(eps.score),0) AS score |
| | | from sm_exam_plan_score eps |
| | | WHERE eps.range_start <= #{count} AND eps.range_end >= #{count} AND eps.plan_id = #{planId} |
| | | LIMIT 0,1 |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.exam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamTarget; |
| | | import cn.gistack.sm.exam.vo.ExamTargetVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | /** |
| | | * @Description: 考核指标 |
| | | */ |
| | | public interface ExamTargetMapper extends BaseMapper<ExamTarget> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examTarget 考核指标 vo 对象 |
| | | * @return |
| | | */ |
| | | List<ExamTargetVO> selectExamTargetPage(@Param("examTarget") ExamTargetVO examTarget); |
| | | |
| | | /** |
| | | * 获取方案指标对象 |
| | | * @param planId 方案id |
| | | * @param type 1巡检 2.督办 3.事件处理 |
| | | * @return 指标对象 |
| | | */ |
| | | ExamTargetVO getExamTargetByPlandId(@Param("planId") String planId,@Param("type") String type); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.exam.mapper.ExamTargetMapper"> |
| | | |
| | | <!--分页列表查询--> |
| | | <select id="selectExamTargetPage" resultType="cn.gistack.sm.exam.vo.ExamTargetVO"> |
| | | select |
| | | sm_exam_plan_target.* |
| | | from sm_exam_plan_target |
| | | where 1=1 |
| | | order by sm_exam_plan_target.id desc |
| | | </select> |
| | | |
| | | <select id="getExamTargetByPlandId" resultType="cn.gistack.sm.exam.vo.ExamTargetVO"> |
| | | select |
| | | ept.* |
| | | from sm_exam_plan_target ept |
| | | where 1=1 AND ept.plan_id = #{planId} AND ept.target_id = #{type} |
| | | limit 1 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.exam.service; |
| | | |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlan; |
| | | import cn.gistack.sm.exam.vo.ExamPlanVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * @Description: 考核方案 |
| | | */ |
| | | public interface IExamPlanService extends BaseService<ExamPlan> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examPlan 考核方案 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | IPage<ExamPlanVO> selectExamPlanPage(IPage<ExamPlanVO> page, ExamPlan examPlan); |
| | | |
| | | Boolean saveAll(ExamPlanVO examPlan); |
| | | |
| | | Boolean updateAll(ExamPlanVO examPlan); |
| | | |
| | | /** |
| | | * 设置启用或者禁用 |
| | | * @param id |
| | | * @param value |
| | | */ |
| | | Boolean enableOrDisable(String id,Integer value); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service; |
| | | |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlanUser; |
| | | import cn.gistack.sm.exam.vo.ExamPlanUserVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 考核名录 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-12-07 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IExamPlanUserService extends BaseService<ExamPlanUser> { |
| | | |
| | | /** |
| | | * 用户考核数据 |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<ExamPlanUserVO> selectUserAssessData(String startTime, String endTime); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamRating; |
| | | import cn.gistack.sm.exam.vo.ExamRatingVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | /** |
| | | * @Description: 考核评定 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IExamRatingService extends IService<ExamRating> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examRating 考核评定 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | IPage<ExamRatingVO> selectExamRatingPage(IPage<ExamRatingVO> page, ExamRatingVO examRating); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service; |
| | | |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamScore; |
| | | import cn.gistack.sm.exam.vo.ExamScoreVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @Description: 巡检次数得分标准 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IExamScoreService extends IService<ExamScore> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examScore 巡检次数得分标准 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | IPage<ExamScoreVO> selectExamScorePage(IPage<ExamScoreVO> page, ExamScoreVO examScore); |
| | | |
| | | int getExamScoreByPlanIdAndCount(String planId,int count); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service; |
| | | |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamTarget; |
| | | import cn.gistack.sm.exam.vo.ExamTargetVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @Description: 考核指标 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IExamTargetService extends IService<ExamTarget> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examTarget 考核指标 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | IPage<ExamTargetVO> selectExamTargetPage(IPage<ExamTargetVO> page, ExamTargetVO examTarget); |
| | | |
| | | /** |
| | | * 获取方案指标对象 |
| | | * @param planId 方案id |
| | | * @param type 1巡检 2.督办 3.事件处理 |
| | | * @return 指标对象 |
| | | */ |
| | | ExamTargetVO getExamTargetByPlandId(String planId, String type); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service.impl; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlan; |
| | | import cn.gistack.sm.exam.entity.ExamRating; |
| | | import cn.gistack.sm.exam.entity.ExamScore; |
| | | import cn.gistack.sm.exam.entity.ExamTarget; |
| | | import cn.gistack.sm.exam.mapper.ExamPlanMapper; |
| | | import cn.gistack.sm.exam.service.IExamPlanService; |
| | | import cn.gistack.sm.exam.service.IExamRatingService; |
| | | import cn.gistack.sm.exam.service.IExamScoreService; |
| | | import cn.gistack.sm.exam.service.IExamTargetService; |
| | | import cn.gistack.sm.exam.vo.ExamPlanVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 考核方案 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | @Transactional |
| | | @AllArgsConstructor |
| | | public class ExamPlanServiceImpl extends BaseServiceImpl<ExamPlanMapper, ExamPlan> implements IExamPlanService { |
| | | IExamTargetService targetService; |
| | | IExamScoreService examScoreService; |
| | | IExamRatingService ratingService; |
| | | |
| | | private final static String JOBCLASSNAME = "org.jeecg.modules.SM.exam.quartz.job.ExamPlanUserJob"; |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examPlan 考核方案 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ExamPlanVO> selectExamPlanPage(IPage<ExamPlanVO> page, ExamPlan examPlan){ |
| | | return page.setRecords(baseMapper.selectExamPlanPage(examPlan)); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean saveAll(ExamPlanVO entity) { |
| | | boolean savePlan = this.save(entity); |
| | | entity.getScoreList().forEach(item->{ |
| | | item.setPlanId(entity.getId().toString()); |
| | | }); |
| | | entity.getRatingList().forEach(item->{ |
| | | item.setPlanId(entity.getId().toString()); |
| | | }); |
| | | entity.getTargetList().forEach(item->{ |
| | | item.setPlanId(entity.getId().toString()); |
| | | }); |
| | | boolean saveTarget = targetService.saveBatch(entity.getTargetList()); |
| | | boolean saveScore = examScoreService.saveBatch(entity.getScoreList()); |
| | | boolean saveRating = ratingService.saveBatch(entity.getRatingList()); |
| | | |
| | | return savePlan&&saveTarget&&saveScore&&saveRating; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateAll(ExamPlanVO examPlan) { |
| | | boolean upPlan = this.updateById(examPlan); |
| | | |
| | | this.deleteAll(examPlan.getId().toString()); |
| | | |
| | | examPlan.getTargetList().forEach(target->{ |
| | | if (StringUtils.isEmpty(target.getPlanId())){ |
| | | target.setPlanId(examPlan.getId().toString()); |
| | | } |
| | | targetService.save(target); |
| | | }); |
| | | |
| | | examPlan.getRatingList().forEach(rating->{ |
| | | if (StringUtils.isEmpty(rating.getPlanId())){ |
| | | rating.setPlanId(examPlan.getId().toString()); |
| | | } |
| | | ratingService.save(rating); |
| | | }); |
| | | |
| | | examPlan.getScoreList().forEach(score->{ |
| | | if (StringUtils.isEmpty(score.getPlanId())){ |
| | | score.setPlanId(examPlan.getId().toString()); |
| | | } |
| | | examScoreService.save(score); |
| | | }); |
| | | |
| | | |
| | | return upPlan; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean enableOrDisable(String id, Integer value) { |
| | | boolean res = baseMapper.enableOrDisable(id,value); |
| | | if (value == 1) { |
| | | ExamPlan examPlan = baseMapper.selectById(id); |
| | | // quartzJobService.schedulerAdd(id, JOBCLASSNAME, examPlan.getCronExpression(), examPlan.getId()); |
| | | } else { |
| | | // quartzJobService.schedulerDelete(id); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public void deleteAll(String planId){ |
| | | List<ExamTarget> targetList = targetService.list(Condition.getQueryWrapper(new ExamTarget().setPlanId(planId))); |
| | | targetList.forEach(target->{ |
| | | targetService.removeById(target.getId()); |
| | | }); |
| | | |
| | | List<ExamRating> ratingList = ratingService.list(Condition.getQueryWrapper(new ExamRating().setPlanId(planId))); |
| | | ratingList.forEach(rating->{ |
| | | ratingService.removeById(rating.getId()); |
| | | }); |
| | | |
| | | List<ExamScore> scoreList = examScoreService.list(Condition.getQueryWrapper(new ExamScore().setPlanId(planId))); |
| | | scoreList.forEach(score->{ |
| | | examScoreService.removeById(score.getId()); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service.impl; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlanUser; |
| | | import cn.gistack.sm.exam.mapper.ExamPlanUserMapper; |
| | | import cn.gistack.sm.exam.service.IExamPlanUserService; |
| | | import cn.gistack.sm.exam.vo.ExamPlanUserVO; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 考核名录 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-12-07 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class ExamPlanUserServiceImpl extends BaseServiceImpl<ExamPlanUserMapper, ExamPlanUser> implements IExamPlanUserService { |
| | | |
| | | @Override |
| | | public List<ExamPlanUserVO> selectUserAssessData(String startTime, String endTime) { |
| | | return baseMapper.selectUserAssessData(startTime,endTime); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service.impl; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamRating; |
| | | import cn.gistack.sm.exam.mapper.ExamRatingMapper; |
| | | import cn.gistack.sm.exam.service.IExamRatingService; |
| | | import cn.gistack.sm.exam.vo.ExamRatingVO; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | /** |
| | | * @Description: 考核评定 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class ExamRatingServiceImpl extends ServiceImpl<ExamRatingMapper, ExamRating> implements IExamRatingService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examRating 考核评定 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ExamRatingVO> selectExamRatingPage(IPage<ExamRatingVO> page, ExamRatingVO examRating){ |
| | | return page.setRecords(baseMapper.selectExamRatingPage(examRating)); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service.impl; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamScore; |
| | | import cn.gistack.sm.exam.mapper.ExamScoreMapper; |
| | | import cn.gistack.sm.exam.service.IExamScoreService; |
| | | import cn.gistack.sm.exam.vo.ExamScoreVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Description: 巡检次数得分标准 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class ExamScoreServiceImpl extends ServiceImpl<ExamScoreMapper, ExamScore> implements IExamScoreService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examScore 巡检次数得分标准 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ExamScoreVO> selectExamScorePage(IPage<ExamScoreVO> page, ExamScoreVO examScore){ |
| | | return page.setRecords(baseMapper.selectExamScorePage(examScore)); |
| | | } |
| | | |
| | | @Override |
| | | public int getExamScoreByPlanIdAndCount(String planId, int count) { |
| | | return baseMapper.getExamScoreByPlanIdAndCount(planId,count); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.service.impl; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamTarget; |
| | | import cn.gistack.sm.exam.mapper.ExamTargetMapper; |
| | | import cn.gistack.sm.exam.service.IExamTargetService; |
| | | import cn.gistack.sm.exam.vo.ExamTargetVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Description: 考核指标 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class ExamTargetServiceImpl extends ServiceImpl<ExamTargetMapper, ExamTarget> implements IExamTargetService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * |
| | | * @param examTarget 考核指标 vo 对象 |
| | | * @param page 分页对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ExamTargetVO> selectExamTargetPage(IPage<ExamTargetVO> page, ExamTargetVO examTarget){ |
| | | return page.setRecords(baseMapper.selectExamTargetPage(examTarget)); |
| | | } |
| | | |
| | | @Override |
| | | public ExamTargetVO getExamTargetByPlandId(String planId, String type) { |
| | | return baseMapper.getExamTargetByPlandId(planId,type); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName ExamPlanUserVO |
| | | * @Description TODO |
| | | * @Author aix |
| | | * @Date 2022/12/8 15:31 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class ExamPlanUserVO { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | String userId; |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | String realname; |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | String roleName; |
| | | /** |
| | | * 巡检次数 |
| | | */ |
| | | int xjCount; |
| | | /** |
| | | * 督办次数 |
| | | */ |
| | | int dbCount; |
| | | /** |
| | | * 事件处理次数 |
| | | */ |
| | | int sjclCount; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | String startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | String endTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.vo; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamPlan; |
| | | import cn.gistack.sm.exam.entity.ExamRating; |
| | | import cn.gistack.sm.exam.entity.ExamScore; |
| | | import cn.gistack.sm.exam.entity.ExamTarget; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 考核方案 vo |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | public class ExamPlanVO extends ExamPlan{ |
| | | |
| | | /** |
| | | * 指标集合 |
| | | */ |
| | | private List<ExamTarget> targetList; |
| | | |
| | | /** |
| | | * 巡检得分标准集合 |
| | | */ |
| | | private List<ExamScore> scoreList; |
| | | |
| | | /** |
| | | * 评分集合 |
| | | */ |
| | | private List<ExamRating> ratingList; |
| | | |
| | | private String examPeriodText; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.vo; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamRating; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description: 考核评定 vo |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | public class ExamRatingVO extends ExamRating implements Serializable{ |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.vo; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamScore; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description: 巡检次数得分标准 vo |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | public class ExamScoreVO extends ExamScore implements Serializable{ |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.exam.vo; |
| | | |
| | | import cn.gistack.sm.exam.entity.ExamTarget; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description: 考核指标 vo |
| | | * @Author: jeecg-boot |
| | | * @Date: 2022-11-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | public class ExamTargetVO extends ExamTarget implements Serializable{ |
| | | |
| | | } |
| | |
| | | public R getPatrolGroupTree() { |
| | | return R.data(patrolGroupService.getPatrolGroupTree()); |
| | | } |
| | | |
| | | /** |
| | | * 根据项id查询组id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据项id查询组id", notes = "根据项id查询组id") |
| | | @GetMapping(value = "/getPatrolGroupByItemId") |
| | | public R getPatrolGroupByItemId(String itemId) { |
| | | return R.data(patrolGroupService.getPatrolGroupByItemId(itemId)); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.controller; |
| | | |
| | | import cn.gistack.sm.patrol.entity.PatrolRecord; |
| | | import cn.gistack.sm.patrol.entity.PatrolType; |
| | | import cn.gistack.sm.patrol.service.IPatrolRecordService; |
| | | import cn.gistack.sm.patrol.vo.PatrolRecordVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 巡查记录 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="巡查记录") |
| | | @RestController |
| | | @RequestMapping("/patrol/patrolRecord") |
| | | @AllArgsConstructor |
| | | public class PatrolRecordController extends BladeController { |
| | | private IPatrolRecordService patrolRecordService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | */ |
| | | @ApiOperation(value="巡查类型-分页列表查询", notes="巡查类型-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(PatrolRecord patrolRecord, Query query) { |
| | | IPage<PatrolRecord> pageList = patrolRecordService.selectPatrolRecord(Condition.getPage(query),patrolRecord); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有巡查类型 |
| | | */ |
| | | @ApiOperation(value="获取所有巡查类型", notes="获取所有巡查类型") |
| | | @GetMapping(value = "/all") |
| | | public R getAll(){ |
| | | List<PatrolRecord> list = patrolRecordService.list(); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | */ |
| | | @ApiOperation(value="巡查类型-添加", notes="巡查类型-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody PatrolRecord patrolRecord) { |
| | | return R.data(patrolRecordService.save(patrolRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | */ |
| | | @ApiOperation(value="巡查类型-编辑", notes="巡查类型-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody PatrolRecord patrolRecord) { |
| | | return R.data(patrolRecordService.updateById(patrolRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡查类型-通过id删除", notes="巡查类型-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(patrolRecordService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡查类型-批量删除", notes="巡查类型-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(patrolRecordService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡查类型-通过id查询", notes="巡查类型-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | PatrolRecordVO patrolRecordVO = patrolRecordService.getDetail(id); |
| | | return R.data(patrolRecordVO); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * 巡查记录 |
| | | */ |
| | | @Data |
| | | @TableName( value = "sm_patrol_record",autoResultMap = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="sm_patrol_type对象", description="巡查类型") |
| | | public class PatrolRecord extends BaseEntity { |
| | | /** |
| | | * 任务id |
| | | */ |
| | | @ApiModelProperty("任务id") |
| | | private String taskId; |
| | | |
| | | /** |
| | | * 指标项id |
| | | */ |
| | | @ApiModelProperty("指标项id") |
| | | private String itemId; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | @ApiModelProperty("巡检类型") |
| | | private String patrolType; |
| | | |
| | | /** |
| | | * 影响设备 |
| | | */ |
| | | @ApiModelProperty("影响设备") |
| | | private String deviceIds; |
| | | |
| | | /** |
| | | * 巡查现场图片 |
| | | */ |
| | | @ApiModelProperty("巡查现场图片") |
| | | @TableField(value = "images",typeHandler = FastjsonTypeHandler.class) |
| | | private Object images; |
| | | |
| | | /** |
| | | * 巡查内容 |
| | | */ |
| | | @ApiModelProperty("巡查内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 巡检人员巡逻轨迹 |
| | | */ |
| | | @ApiModelProperty(value = "巡检人员巡逻轨迹") |
| | | private String patrolRoute; |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<TreeNode> getPatrolGroupItemTree(); |
| | | |
| | | List<PatrolGroup> getPatrolGroupByItemId(String itemId); |
| | | } |
| | |
| | | false AS hasChildren |
| | | FROM sm_patrol_group_item spgi where spgi.is_deleted = 0 |
| | | </select> |
| | | <select id="getPatrolGroupByItemId" resultType="cn.gistack.sm.patrol.entity.PatrolGroup"> |
| | | |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.patrol.mapper; |
| | | |
| | | import cn.gistack.sm.patrol.entity.PatrolRecord; |
| | | import cn.gistack.sm.patrol.vo.PatrolRecordVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PatrolRecordMapper extends BaseMapper<PatrolRecord> { |
| | | List<PatrolRecord> selectPatrolRecord(@Param("patrolRecord") PatrolRecord patrolRecord); |
| | | |
| | | PatrolRecordVO getDetail(@Param("id") String id); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.patrol.mapper.PatrolRecordMapper"> |
| | | |
| | | <resultMap id="selectPatrolRecordList" type="cn.gistack.sm.patrol.vo.PatrolRecordVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="patrol_type" property="patrolType"/> |
| | | <result column="device_ids" property="deviceIds"/> |
| | | <result column="images" property="images" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result column="content" property="content"/> |
| | | <result column="status" property="status"/> |
| | | <result column="item_id" property="itemId"/> |
| | | <result column="task_id" property="taskId"/> |
| | | <result column="patrol_route" property="patrolRoute"/> |
| | | <result column="taskRoute" property="taskRoute"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectPatrolRecord" resultMap="selectPatrolRecordList"> |
| | | SELECT record.id,record.patrol_type,record.device_ids, |
| | | record.images, |
| | | record.content,record.status,record.item_id,record.task_id,record.patrol_route,route.ROUTE_COORDINATES taskRoute |
| | | FROM SM_PATROL_RECORD record |
| | | LEFT JOIN sm_patrol_type type ON type.id = record.patrol_type |
| | | LEFT JOIN sm_patrol_task task ON task.id = record.task_id |
| | | LEFT JOIN sm_patrol_route route ON route.id = task.route_id |
| | | WHERE record.is_deleted = 0 |
| | | <if test="patrolRecord.status !=null and patrolRecord.status != '' "> |
| | | AND record.status = #{patrolRecord.status} |
| | | </if> |
| | | <if test="patrolRecord.patrolType !=null and patrolRecord.patrolType !=''"> |
| | | AND record.patrolType = #{patrolRecord.patrolType} |
| | | </if> |
| | | </select> |
| | | <select id="getDetail" resultMap="selectPatrolRecordList"> |
| | | SELECT record.id,record.patrol_type,record.device_ids, |
| | | record.images, |
| | | record.content,record.status,record.item_id,record.task_id,record.patrol_route,route.ROUTE_COORDINATES taskRoute |
| | | FROM SM_PATROL_RECORD record |
| | | LEFT JOIN sm_patrol_type type ON type.id = record.patrol_type |
| | | LEFT JOIN sm_patrol_task task ON task.id = record.task_id |
| | | LEFT JOIN sm_patrol_route route ON route.id = task.route_id |
| | | WHERE record.is_deleted = 0 |
| | | AND record.id =#{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!--查询巡查人员统计数据信息--> |
| | | <select id="getPatrolTaskStatistic" resultType="cn.gistack.sm.patrol.vo.PatrolTaskStatisticsVO"> |
| | | SELECT |
| | | spt.patrol_type as patrolType, |
| | | spt.task_type as patrolType, |
| | | spt2.name as patrolTypeName, |
| | | count(*) as number |
| | | FROM BLADEX.sm_patrol_task spt |
| | |
| | | * @return |
| | | */ |
| | | Object getPatrolGroupTree(); |
| | | |
| | | List<PatrolGroup> getPatrolGroupByItemId(String itemId); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.service; |
| | | |
| | | import cn.gistack.sm.patrol.entity.PatrolRecord; |
| | | import cn.gistack.sm.patrol.entity.PatrolType; |
| | | import cn.gistack.sm.patrol.vo.PatrolRecordVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | public interface IPatrolRecordService extends BaseService<PatrolRecord> { |
| | | IPage<PatrolRecord> selectPatrolRecord(IPage<PatrolRecord> page, PatrolRecord patrolRecord); |
| | | |
| | | PatrolRecordVO getDetail(String id); |
| | | } |
| | |
| | | // 数据处理 |
| | | return NodeTreeUtil.getNodeTree(patrolGroupTree,patrolGroupItemTree); |
| | | } |
| | | |
| | | @Override |
| | | public List<PatrolGroup> getPatrolGroupByItemId(String itemId) { |
| | | return baseMapper.getPatrolGroupByItemId(itemId); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.service.impl; |
| | | |
| | | import cn.gistack.sm.patrol.entity.PatrolRecord; |
| | | import cn.gistack.sm.patrol.entity.PatrolType; |
| | | import cn.gistack.sm.patrol.mapper.PatrolRecordMapper; |
| | | import cn.gistack.sm.patrol.service.IPatrolRecordService; |
| | | import cn.gistack.sm.patrol.vo.PatrolRecordVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class PatrolRecordServiceImpl extends BaseServiceImpl<PatrolRecordMapper, PatrolRecord> implements IPatrolRecordService { |
| | | @Override |
| | | public IPage<PatrolRecord> selectPatrolRecord(IPage<PatrolRecord> page, PatrolRecord patrolRecord) { |
| | | return page.setRecords(baseMapper.selectPatrolRecord(patrolRecord)); |
| | | } |
| | | |
| | | @Override |
| | | public PatrolRecordVO getDetail(String id) { |
| | | return baseMapper.getDetail(id); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.vo; |
| | | |
| | | import cn.gistack.sm.patrol.entity.PatrolRecord; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PatrolRecordVO extends PatrolRecord { |
| | | |
| | | private String taskRoute; |
| | | } |
| | |
| | | * 任务类型名称 |
| | | */ |
| | | private String patrolTypeName; |
| | | |
| | | /** |
| | | * 巡查路线 |
| | | */ |
| | | private String routeRange; |
| | | } |