¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dnc.entity.ProcessInfo; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.QueryListResponseResult; |
| | | import org.jeecg.modules.dnc.response.ResponseResult; |
| | | import org.jeecg.modules.dnc.service.IProcessInfoService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "æ°å»ºå·¥åºè¡¨") |
| | | @RestController |
| | | @RequestMapping("/nc/process") |
| | | public class ProcessController extends JeecgController<ProcessInfo, IProcessInfoService> { |
| | | @Autowired |
| | | private IProcessInfoService processInfoService; |
| | | |
| | | @AutoLog(value = "æ°å»ºå·¥åºè¡¨-æ°å¢æç¼è¾å·¥åºåºæ¬ä¿¡æ¯") |
| | | @ApiOperation(value = "æ°å»ºå·¥åºè¡¨-æ°å¢æç¼è¾å·¥åºåºæ¬ä¿¡æ¯", notes = "æ°å»ºå·¥åºè¡¨-æ°å¢æç¼è¾å·¥åºåºæ¬ä¿¡æ¯") |
| | | @PostMapping("/addOrEdit") |
| | | public ResponseResult addOrEdit(@RequestBody ProcessInfo processInfo) { |
| | | boolean b = processInfoService.addOrEdit(processInfo); |
| | | if(b) { |
| | | return new ResponseResult(CommonCode.SUCCESS); |
| | | } |
| | | return new ResponseResult(CommonCode.FAIL); |
| | | } |
| | | |
| | | @AutoLog(value = "æ°å»ºå·¥åºè¡¨-æ ¹æ®å·¥åºåç§°æ¨¡ç³æ¥è¯¢") |
| | | @ApiOperation(value = "æ°å»ºå·¥åºè¡¨-æ ¹æ®å·¥åºåç§°æ¨¡ç³æ¥è¯¢", notes = "æ°å»ºå·¥åºè¡¨-æ ¹æ®å·¥åºåç§°æ¨¡ç³æ¥è¯¢") |
| | | @GetMapping("/find/list") |
| | | public QueryListResponseResult<ProcessInfo> findByProcessName(@RequestParam(value = "processName", required = false) String processName) { |
| | | if(!ValidateUtil.validateString(processName)) |
| | | return new QueryListResponseResult(CommonCode.SUCCESS, Collections.emptyList()); |
| | | List<ProcessInfo> list = processInfoService.findByProcessName(processName); |
| | | if(list == null) |
| | | list = Collections.emptyList(); |
| | | return new QueryListResponseResult(CommonCode.SUCCESS, list); |
| | | } |
| | | |
| | | |
| | | @AutoLog(value = "æ°å»ºå·¥åºè¡¨-å·¥åºå表") |
| | | @ApiOperation(value = "æ°å»ºå·¥åºè¡¨-å·¥åºå表", notes = "æ°å»ºå·¥åºè¡¨-å·¥åºå表") |
| | | @GetMapping("/find/all") |
| | | public QueryListResponseResult<ProcessInfo> findAll() { |
| | | List<ProcessInfo> list = processInfoService.list(); |
| | | if(list == null) |
| | | list = Collections.emptyList(); |
| | | return new QueryListResponseResult(CommonCode.SUCCESS, list); |
| | | } |
| | | } |