From 23855599412c4d61b38d78f0f3abd3430a48b5b1 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期三, 25 六月 2025 11:51:38 +0800 Subject: [PATCH] Merge branch 'mdc_hyjs_master' --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/controller/DispatchFileController.java | 235 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 235 insertions(+), 0 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/controller/DispatchFileController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/controller/DispatchFileController.java new file mode 100644 index 0000000..35234c4 --- /dev/null +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/controller/DispatchFileController.java @@ -0,0 +1,235 @@ +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); + } + +} -- Gitblit v1.9.3