¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.dncFlow.entity.DispatchFile; |
| | | import org.jeecg.modules.dncFlow.service.IDispatchFileService; |
| | | import org.jeecg.modules.dncFlow.vo.DispatchFileFlowTaskVo; |
| | | import org.jeecg.modules.flowable.domain.dto.FlowTaskDto; |
| | | import org.jeecg.modules.flowable.service.IHisWorkTaskService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: ncç¨åºä¸çµåå¾çç¾æ´¾ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="ncç¨åºä¸çµåå¾çç¾æ´¾") |
| | | @RestController |
| | | @RequestMapping("/dncFlow/dispatchFile") |
| | | @Slf4j |
| | | public class DispatchFileController extends JeecgController<DispatchFile, IDispatchFileService> { |
| | | @Autowired |
| | | private IDispatchFileService dispatchFileService; |
| | | |
| | | @Autowired |
| | | private IHisWorkTaskService hisWorkTaskService; |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param dispatchFile |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<DispatchFile>> queryPageList(DispatchFile dispatchFile, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<DispatchFile> queryWrapper = QueryGenerator.initQueryWrapper(dispatchFile, req.getParameterMap()); |
| | | Page<DispatchFile> page = new Page<DispatchFile>(pageNo, pageSize); |
| | | IPage<DispatchFile> pageList = dispatchFileService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æä»¶æ¥è¯¢å®¡ç¾æµç¨ |
| | | * @param attributionId,attributionType,docId |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-æä»¶æ¥è¯¢å®¡ç¾æµç¨") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-æä»¶æ¥è¯¢å®¡ç¾æµç¨", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-æä»¶æ¥è¯¢å®¡ç¾æµç¨") |
| | | @GetMapping(value = "/queryDispatchDocFile") |
| | | public Result<?> queryDispatchDocFile(@RequestParam(name="attributionId") String attributionId, |
| | | @RequestParam(name="attributionType") String attributionType, |
| | | @RequestParam(name="docId") String docId){ |
| | | return dispatchFileService.queryDispatchDocFile(attributionId,attributionType,docId); |
| | | } |
| | | |
| | | /** |
| | | * éæ°å¯å¨ |
| | | * @param dispatchFileFlowTaskVo |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-éæ°å¯å¨") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-éæ°å¯å¨", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-éæ°å¯å¨") |
| | | @PostMapping(value = "/saveDispatchFile") |
| | | public Result<?> saveDispatchFile(@RequestBody DispatchFileFlowTaskVo dispatchFileFlowTaskVo){ |
| | | return dispatchFileService.reStartDispatchFile(dispatchFileFlowTaskVo); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å®¡æ¹æä½ |
| | | * @param dispatchFileFlowTaskVo |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-å®¡æ¹æä½") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-å®¡æ¹æä½", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-å®¡æ¹æä½") |
| | | @PostMapping(value = "/approval") |
| | | public Result<?> approval(@RequestBody DispatchFileFlowTaskVo dispatchFileFlowTaskVo){ |
| | | return dispatchFileService.auditDispatchFile(dispatchFileFlowTaskVo); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå®¡æ¹æä½ |
| | | * @param dispatchFileFlowTaskVo |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå®¡æ¹æä½") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå®¡æ¹æä½", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå®¡æ¹æä½") |
| | | @PostMapping(value = "/approvalBatch") |
| | | public Result<?> approvalBatch(@RequestBody DispatchFileFlowTaskVo dispatchFileFlowTaskVo) throws InvocationTargetException, IllegalAccessException { |
| | | return dispatchFileService.auditBatchDispatchFile(dispatchFileFlowTaskVo); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "è·å工使µåå²ä»»å¡", response = FlowTaskDto.class) |
| | | @GetMapping(value = "/queryHisTaskList") |
| | | public Result<?> queryHisTaskList(@RequestParam(name = "procInstId") String procInstId) { |
| | | return Result.OK(hisWorkTaskService.queryHisTaskByProcInstId(procInstId)); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param dispatchFile |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-æ·»å ") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-æ·»å ", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody DispatchFile dispatchFile) { |
| | | dispatchFileService.save(dispatchFile); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param dispatchFile |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-ç¼è¾") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-ç¼è¾", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody DispatchFile dispatchFile) { |
| | | dispatchFileService.updateById(dispatchFile); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idå é¤") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idå é¤", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | dispatchFileService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå é¤") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå é¤", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.dispatchFileService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idæ¥è¯¢", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<DispatchFile> queryById(@RequestParam(name="id",required=true) String id) { |
| | | DispatchFile dispatchFile = dispatchFileService.getById(id); |
| | | if(dispatchFile==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(dispatchFile); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¡ç¾åºæ¬ä¿¡æ¯ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "æ¥è¯¢å®¡ç¾åºæ¬ä¿¡æ¯", notes = "æ¥è¯¢å®¡ç¾åºæ¬ä¿¡æ¯") |
| | | @GetMapping(value = "/selectVoById") |
| | | public Result<?> selectVoById(@RequestParam(name="id") String id){ |
| | | return dispatchFileService.queryDispatchFile(id); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param dispatchFile |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, DispatchFile dispatchFile) { |
| | | return super.exportXls(request, dispatchFile, DispatchFile.class, "ncç¨åºä¸çµåå¾çç¾æ´¾"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("nc_dispatch_file:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, DispatchFile.class); |
| | | } |
| | | |
| | | } |