From 4470052c3b6bdeb18e45987f8aa293d1e93d0552 Mon Sep 17 00:00:00 2001
From: Ludc <2870569285@qq.com>
Date: 星期二, 18 十一月 2025 11:59:12 +0800
Subject: [PATCH] 所有文件上传接口增加文件安全校验逻辑。
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java | 458 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 427 insertions(+), 31 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
index f8d3d40..623570c 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
@@ -1,19 +1,22 @@
package com.vci.ubcs.code.controller;
-
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.utils.StringUtils;
-import com.vci.ubcs.code.dto.CodeDeleteBatchDTO;
-import com.vci.ubcs.code.dto.CodeOrderDTO;
-import com.vci.ubcs.code.dto.CodeOrderSecDTO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.vci.ubcs.code.applyjtcodeservice.vo.BaseModelVO;
+import com.vci.ubcs.code.dto.*;
import com.vci.ubcs.code.dto.datapush.BaseModelDTO;
import com.vci.ubcs.code.service.MdmEngineService;
import com.vci.ubcs.code.service.MdmIOService;
import com.vci.ubcs.code.vo.pagemodel.*;
+import com.vci.ubcs.common.validator.ComprehensiveFileValidator;
+import com.vci.ubcs.flow.core.dto.FlowStatusDTO;
import com.vci.ubcs.starter.annotation.VciBusinessLog;
import com.vci.ubcs.starter.revision.model.BaseModel;
import com.vci.ubcs.starter.revision.model.TreeQueryObject;
import com.vci.ubcs.starter.util.LocalFileUtil;
+import com.vci.ubcs.starter.util.SaveLogUtil;
import com.vci.ubcs.starter.web.pagemodel.*;
import com.vci.ubcs.starter.web.util.ControllerUtil;
import com.vci.ubcs.starter.web.util.LangBaseUtil;
@@ -33,25 +36,39 @@
import java.util.*;
@RestController
-//@AllArgsConstructor
@RequestMapping("/mdmEngineController")
@Api(value = "缂栫爜鏁版嵁绠$悊", tags = "缂栫爜鏁版嵁绠$悊")
public class MdmEngineController {
-// /**
-// * 鏃ュ織
-// */
+ /**
+ * 鏃ュ織
+ */
private Logger logger = LoggerFactory.getLogger(getClass());
+
/**
* 涓绘暟鎹紩鎿庢湇鍔�
*/
@Autowired
private MdmEngineService engineService;
+
/**
* 涓绘暟鎹鍏ュ鍑烘湇鍔�
*/
@Autowired
private MdmIOService mdmIOService;
+
+ /**
+ * 鏃ュ織淇濆瓨宸ュ叿绫�
+ */
+ @Autowired
+ private SaveLogUtil saveLogUtil;
+
+ /**
+ * 鏂囦欢瀹夊叏妫�鏌�
+ */
+ @Autowired
+ private ComprehensiveFileValidator fileValidator;
+
/**
* 涓嬭浇鎵归噺鐢宠鐨勫鍏ユā鏉�
@@ -75,15 +92,155 @@
}
}
+ /**
+ * 涓嬭浇鎵归噺鐢宠鐨勫鍏ユā鏉�
+ * @param codeClassifyOid 鍒嗙被鐨勪富閿�
+ * @param response 鍝嶅簲瀵硅薄
+ * @throws IOException 鎶涘嚭寮傚父
+ */
+ @GetMapping("/downloadExcelBatchEdit")
+ @VciBusinessLog(operateName = "涓嬭浇鎵归噺鐢宠缂栫爜鐨勫鍏ユā鏉�")
+ public void downloadImportExcelBatchEdit(String codeClassifyOid, HttpServletResponse response) throws IOException{
+ String excelName = mdmIOService.downloadImportExcelBatchEdit(codeClassifyOid);
+ try {
+ ControllerUtil.writeFileToResponse(response,excelName);
+ } catch (Throwable e) {
+ //濡傛灉鍑洪敊,鎶婇敊璇俊鎭啓鍒皌ext
+ String msg = LangBaseUtil.getErrorMsg(e);
+ if(StringUtils.isBlank(msg)){
+ msg = "鏈煡閿欒";
+ }
+ ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null);
+ }
+ }
/**
- * 鎵归噺鐢宠缂栫爜鐨勪俊鎭�
+ * 瀵煎叆鎵归噺缂栬緫鏁版嵁
+ * @param codeClassifyOid 鍒嗙被鐨勪富閿�
+ * @param classifyAttr 鍒嗙被璺緞浣跨敤鐨勫睘鎬�
+ * @param file 鏂囦欢鐨勫唴瀹�
+ */
+ @VciBusinessLog(operateName = "瀵煎叆鎵归噺缂栬緫鏁版嵁")
+ @PostMapping("/batchImportEdit")
+ public R batchImportEdit(String codeClassifyOid, String classifyAttr,MultipartFile file,HttpServletResponse response) throws Throwable {
+ // 浣跨敤鏂囦欢瀹夊叏楠岃瘉鍣�
+ ComprehensiveFileValidator.UploadValidationResult validationResult = fileValidator.validateFile(file);
+ if (!validationResult.isValid()) {
+ return R.fail(validationResult.getMessage());
+ }
+
+ String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + file.getOriginalFilename();
+ File file1 = new File(excelFileName);
+ try {
+ file.transferTo(new File(excelFileName));
+ CodeImProtRusultVO codeImProtRusultVO =mdmIOService.batchImportEdit(codeClassifyOid, classifyAttr,file1);
+ if(StringUtils.isNotBlank(codeImProtRusultVO.getFilePath())||StringUtils.isNotBlank(codeImProtRusultVO.getRedisUuid())){
+ //鏀惧埌map閲�
+ R result = R.fail("瀵煎叆澶辫触");
+ if(StringUtils.isNotBlank(codeImProtRusultVO.getFilePath())) {
+ String filedUUid = ControllerUtil.putErrorFile(codeImProtRusultVO.getFilePath());
+ codeImProtRusultVO.setFileOid(filedUUid);
+ }
+ result.setData(codeImProtRusultVO);
+ return result;
+ }else {
+ return R.success("鎿嶄綔鎴愬姛锛�");
+ }
+ }catch (Throwable e) {
+ logger.error("瀵煎叆閿欒",e);
+ String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "閿欒.txt";
+ LocalFileUtil.writeContentToFile(LangBaseUtil.getErrorMsg(e),errorFile);
+ String uuid=ControllerUtil.putErrorFile(errorFile);
+ CodeImProtRusultVO codeImProtRusultVO =new CodeImProtRusultVO();
+ codeImProtRusultVO.setRedisUuid("");
+ codeImProtRusultVO.setFileOid(uuid);
+ codeImProtRusultVO.setFilePath(errorFile);
+ R r = R.fail("瀵煎叆澶辫触");
+ r.setData(codeImProtRusultVO);
+ return r;
+ }finally {
+ file1.delete();
+ }
+ }
+
+ /**
+ * 涓嬭浇鎵归噺鐢宠鐨勫鍏ユā鏉�
+ * @param codeClassifyOid 鍒嗙被鐨勪富閿�
+ * @param response 鍝嶅簲瀵硅薄
+ * @throws IOException 鎶涘嚭寮傚父
+ */
+ @GetMapping("/downloadTopImportExcel")
+ @VciBusinessLog(operateName = "涓嬭浇鎵归噺鐢宠缂栫爜鐨勫鍏ユā鏉�")
+ public void downloadTopImportExcel(String codeClassifyOid,HttpServletResponse response) throws IOException{
+ String excelName = mdmIOService.downloadTopImportExcel(codeClassifyOid);
+ try {
+ ControllerUtil.writeFileToResponse(response,excelName);
+ } catch (Throwable e) {
+ //濡傛灉鍑洪敊,鎶婇敊璇俊鎭啓鍒皌ext
+ String msg = LangBaseUtil.getErrorMsg(e);
+ if(StringUtils.isBlank(msg)){
+ msg = "鏈煡閿欒";
+ }
+ ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null);
+ }
+ }
+
+ /**
+ * 瀵煎嚭涓婚搴撶殑鏁版嵁
+ * @param exportAttrDTO 瀵煎嚭鐨勭浉鍏抽厤缃�
+ */
+ @VciBusinessLog(operateName = "瀵煎嚭涓婚搴撶殑鏁版嵁")
+ @PostMapping("/exportCode")
+ public void exportCode(CodeExportAttrDTO exportAttrDTO, HttpServletResponse response) throws IOException {
+ try {
+ String excelName = mdmIOService.exportCode(exportAttrDTO);
+ ControllerUtil.writeFileToResponse(response,excelName);
+ } catch (Throwable e) {
+ //濡傛灉鍑洪敊,鎶婇敊璇俊鎭啓鍒皌ext
+ String msg = LangBaseUtil.getErrorMsg(e);
+ String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "閿欒.txt";
+ LocalFileUtil.writeContentToFile(msg,errorFile);
+ ControllerUtil.writeFileToResponse(response,errorFile);
+ }
+ }
+
+ /**
+ * 涓嬭浇鍘嗗彶鏁版嵁瀵煎叆妯℃澘
+ * @param codeClassifyOid 鍒嗙被鐨勪富閿�
+ * @param response 鍝嶅簲瀵硅薄
+ * @throws IOException 鎶涘嚭寮傚父
+ */
+ @GetMapping("/downloadImportExcelHistory")
+ @VciBusinessLog(operateName = "涓嬭浇鍘嗗彶鏁版嵁瀵煎叆妯℃澘")
+ public void downloadImportExcelHistory(String codeClassifyOid,HttpServletResponse response) throws IOException{
+ String excelName = mdmIOService.createImportExcel(codeClassifyOid,true);
+ //String excelName = mdmIOService.downloadTopImportExcel(codeClassifyOid);
+ try {
+ ControllerUtil.writeFileToResponse(response,excelName);
+ } catch (Throwable e) {
+ //濡傛灉鍑洪敊,鎶婇敊璇俊鎭啓鍒皌ext
+ String msg = LangBaseUtil.getErrorMsg(e);
+ if(StringUtils.isBlank(msg)){
+ msg = "鏈煡閿欒";
+ }
+ ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null);
+ }
+ }
+
+ /**
+ * 鎵归噺鐢宠缂栫爜鐨勪俊鎭紙褰撳墠鍒嗙被涓婃壒閲忕敵璇凤級
* @param secDTOList 鐢宠缂栫爜鐨勪俊鎭紝蹇呴』鍖呭惈鐮佹鍜屽垎绫讳富閿殑淇℃伅
* @param file 鏂囦欢鐨勫唴瀹�
*/
@VciBusinessLog(operateName = "鎵归噺鐢宠缂栫爜鐨勪俊鎭�")
@PostMapping("/batchImportCode")
public R batchImportCode(String secDTOList, String codeClassifyOid, MultipartFile file, HttpServletResponse response) throws Throwable {
+ // 浣跨敤鏂囦欢瀹夊叏楠岃瘉鍣�
+ ComprehensiveFileValidator.UploadValidationResult validationResult = fileValidator.validateFile(file);
+ if (!validationResult.isValid()) {
+ return R.fail(validationResult.getMessage());
+ }
+
CodeOrderDTO orderDTO = new CodeOrderDTO();
orderDTO.setCodeClassifyOid(codeClassifyOid);
if(StringUtils.isNotBlank(secDTOList)){
@@ -126,18 +283,118 @@
// return null;
}
+ /**
+ * 瀵煎叆鍘嗗彶鏁版嵁
+ * @param codeClassifyOid 鍒嗙被鐨勪富閿�
+ * @param classifyAttr 鍒嗙被璺緞浣跨敤鐨勫睘鎬�
+ * @param file 鏂囦欢鐨勫唴瀹�
+ */
+ @VciBusinessLog(operateName = "瀵煎叆缂栫爜鐨勫巻鍙叉暟鎹�")
+ @PostMapping("/batchImportHistoryData")
+ public R batchImportHistoryData(String codeClassifyOid, String classifyAttr,MultipartFile file,HttpServletResponse response) throws Throwable {
+ // 浣跨敤鏂囦欢瀹夊叏楠岃瘉鍣�
+ ComprehensiveFileValidator.UploadValidationResult validationResult = fileValidator.validateFile(file);
+ if (!validationResult.isValid()) {
+ return R.fail(validationResult.getMessage());
+ }
+
+ String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + file.getOriginalFilename();
+ File file1 = new File(excelFileName);
+ try {
+ file.transferTo(new File(excelFileName));
+ CodeImProtRusultVO codeImProtRusultVO =mdmIOService.batchImportHistoryData(codeClassifyOid, classifyAttr,file1);
+ if(StringUtils.isNotBlank(codeImProtRusultVO.getFilePath())||StringUtils.isNotBlank(codeImProtRusultVO.getRedisUuid())){
+ //鏀惧埌map閲�
+ R result = R.fail("瀵煎叆澶辫触");
+ if(StringUtils.isNotBlank(codeImProtRusultVO.getFilePath())) {
+ String filedUUid = ControllerUtil.putErrorFile(codeImProtRusultVO.getFilePath());
+ codeImProtRusultVO.setFileOid(filedUUid);
+ }
+ result.setData(codeImProtRusultVO);
+ return result;
+ }else {
+ return R.success("鎿嶄綔鎴愬姛锛�");
+ }
+ }catch (Throwable e) {
+ logger.error("瀵煎叆閿欒",e);
+ String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "閿欒.txt";
+ LocalFileUtil.writeContentToFile(LangBaseUtil.getErrorMsg(e),errorFile);
+ String uuid=ControllerUtil.putErrorFile(errorFile);
+ CodeImProtRusultVO codeImProtRusultVO =new CodeImProtRusultVO();
+ codeImProtRusultVO.setRedisUuid("");
+ codeImProtRusultVO.setFileOid(uuid);
+ codeImProtRusultVO.setFilePath(errorFile);
+ R r = R.fail("瀵煎叆澶辫触");
+ r.setData(codeImProtRusultVO);
+ return r;
+ }finally {
+ file1.delete();
+ }
+ }
+
+ /**
+ * 瀵煎叆鍘嗗彶鏁版嵁(浠庨《灞傚垎绫诲鐨�)
+ * @param codeClassifyOid 鍒嗙被鐨勪富閿�
+ * @param classifyAttr 鍒嗙被璺緞浣跨敤鐨勫睘鎬�
+ * @param file 鏂囦欢鐨勫唴瀹�
+ */
+ @VciBusinessLog(operateName = "鎵归噺鐢宠缂栫爜鐨勪俊鎭�")
+ @PostMapping("/batchTopImportCode")
+ public R batchTopImportCode(String codeClassifyOid, String classifyAttr,MultipartFile file,HttpServletResponse response) throws Throwable {
+ // 浣跨敤鏂囦欢瀹夊叏楠岃瘉鍣�
+ ComprehensiveFileValidator.UploadValidationResult result = fileValidator.validateFile(file);
+ if (!result.isValid()) {
+ return R.fail(result.getMessage());
+ }
+
+ String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + file.getOriginalFilename();
+ File file1 = new File(excelFileName);
+ try {
+ file.transferTo(new File(excelFileName));
+ CodeImProtRusultVO codeImProtRusultVO =mdmIOService.batchTopImportCode(codeClassifyOid, classifyAttr,file1);
+ if(StringUtils.isNotBlank(codeImProtRusultVO.getFilePath())||StringUtils.isNotBlank(codeImProtRusultVO.getRedisUuid())){
+ //鏀惧埌map閲�
+ R r = R.fail("瀵煎叆澶辫触锛�");
+ if(StringUtils.isNotBlank(codeImProtRusultVO.getFilePath())) {
+ String filedUUid = ControllerUtil.putErrorFile(codeImProtRusultVO.getFilePath());
+ codeImProtRusultVO.setFileOid(filedUUid);
+ r = R.success("瀵煎叆鎴愬姛锛�");
+ }
+ r.setData(codeImProtRusultVO);
+ return r;
+ }else {
+ return R.success("瀵煎叆鎴愬姛锛�");
+ }
+ }catch (Throwable e) {
+ e.printStackTrace();
+ logger.error("瀵煎叆閿欒",e);
+ String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "閿欒.txt";
+ LocalFileUtil.writeContentToFile(LangBaseUtil.getErrorMsg(e),errorFile);
+ String uuid=ControllerUtil.putErrorFile(errorFile);
+ CodeImProtRusultVO codeImProtRusultVO =new CodeImProtRusultVO();
+ codeImProtRusultVO.setRedisUuid("");
+ codeImProtRusultVO.setFileOid(uuid);
+ codeImProtRusultVO.setFilePath(errorFile);
+
+ R r = R.fail("瀵煎叆澶辫触");
+ r.setData(codeImProtRusultVO);
+
+ return r;
+ }finally {
+ file1.delete();
+ }
+ }
/**
* 淇敼鐘舵��
* @param baseModelDTO 鏁版嵁浼犺緭瀵硅薄
* @return 鎵ц缁撴灉
*/
- @PostMapping("changeStatus")
- public R changeStatus(BaseModelDTO baseModelDTO) {
+ @PostMapping("/changeStatus")
+ public R changeStatus(@RequestBody BaseModelDTO baseModelDTO) {
engineService.changeStatus(baseModelDTO);
return R.success("鎿嶄綔鎴愬姛锛�");
}
-
/**
* 鐢宠缂栫爜淇濆瓨
@@ -147,9 +404,16 @@
@PostMapping("/addSaveCode")
@VciBusinessLog(operateName = "鐢宠鍗曚釜缂栫爜")
public R addSaveCode(@RequestBody CodeOrderDTO orderDTO) throws Exception {
- return R.success(engineService.addSaveCode(orderDTO));
+ String s = null;
+ try {
+ s = engineService.addSaveCode(orderDTO);
+ saveLogUtil.operateLog("缂栫爜鐢宠",false,orderDTO.toString());
+ }catch (Exception e){
+ saveLogUtil.operateLog("缂栫爜鐢宠",true,e.toString());
+ throw e;
+ }
+ return R.success(s);
}
-
/**
* 浣跨敤妯℃澘鐨勪富閿幏鍙栬〃鍗曠殑瀹氫箟
@@ -232,8 +496,7 @@
return engineService.gridTableDataByClassifyOid(codeClassifyOid,templateOid,queryObject.getConditionMap(),queryObject.getPageHelper());
}
-
- /***
+ /**
* 鑾峰彇鍒嗙被瀵硅薄
* @param redisOid
* @return
@@ -244,7 +507,7 @@
return R.data(codeImportTemplateVOs);
}
- /***
+ /**
* 浠巖edis缂撳瓨閲岃幏鍙栧埌瀵煎叆姝g‘鐨勬暟鎹�
* @param codeClassifyOid
* @param redisOid
@@ -255,8 +518,8 @@
return mdmIOService.gridDatas(codeClassifyOid,redisOid);
}
- /***
- * 浠巖edis缂撳瓨閲岃幏鍙栧埌瀵煎叆姝g‘鐨勬暟鎹�
+ /**
+ * 浠巖edis缂撳瓨閲岃幏鍙栧埌瀵煎叆琛岀浉浼奸」鐨勬暟鎹�
* @param dataOid
* @param redisOid
* @return
@@ -266,7 +529,7 @@
return mdmIOService.gridRowResemble(dataOid,redisOid);
}
- /***
+ /**
* 浠巖edis缂撳瓨閲岃幏鍙栧埌瀵煎叆鍏锋湁鐩镐技椤圭殑鏁版嵁
* @param codeClassifyOid
* @param redisOid
@@ -275,6 +538,28 @@
@GetMapping("/gridResemble")
public DataGrid<Map<String,String>> gridResemble(String codeClassifyOid,String redisOid){
return mdmIOService.gridDatas(codeClassifyOid,redisOid);
+ }
+
+ /**
+ * 瀵煎叆鏁版嵁
+ * @param codeImprotSaveDatVO//鏁版嵁瀵硅薄
+ * @return
+ */
+ @PostMapping("/batchImportData")
+ public R batchImportData(@RequestBody CodeImprotParmaDatVO codeImprotSaveDatVO){
+ return mdmIOService.batchImportData(codeImprotSaveDatVO.getCodeImprotSaveDatVOList(),codeImprotSaveDatVO.getClassifyAttr(),codeImprotSaveDatVO.getImprot());
+ }
+
+ /**
+ * 鏍规嵁鏁版嵁oid浠庣紦瀛樹腑绉婚櫎鏁版嵁
+ * @param redisOid redisid
+ * @param codeClassifyOid 瀛樺偍瑙勫垯鐨刼id
+ * @param dataOids 鎵�闇�鍒犻櫎鐨勬暟鎹�
+ * @return
+ */
+ @GetMapping("/deleteDatas")
+ public R deleteDatas(String redisOid,String codeClassifyOid,String dataOids){
+ return mdmIOService.deleteDatas(redisOid,codeClassifyOid,dataOids);
}
/**
@@ -341,7 +626,7 @@
@PostMapping("/upSaveCode")
public R upSaveCode(@RequestBody CodeOrderDTO orderDTO){
engineService.upSaveCode(orderDTO);
- return R.success("鎿嶄綔鎴愬姛锛�");
+ return R.success("鎿嶄綔鎴愬姛锛�");
}
/**
@@ -351,12 +636,12 @@
* @return 鍒嗙被鐮佸�肩殑鍐呭
*/
@GetMapping("/listCodeClassifyValueBySecOid")
- public DataGrid<CodeClassifyValueVO> listCodeClassifyValueBySecOid(String classifySecOid, String parentClassifyValueOid){
+ public IPage<CodeClassifyValueVO> listCodeClassifyValueBySecOid(String classifySecOid, String parentClassifyValueOid){
List<CodeClassifyValueVO> valueVOS = engineService.listCodeClassifyValueBySecOid(classifySecOid, parentClassifyValueOid);
- DataGrid<CodeClassifyValueVO> dataGrid = new DataGrid<>();
- dataGrid.setData(valueVOS);
- dataGrid.setTotal(valueVOS==null?0:valueVOS.size());
- return dataGrid;
+ IPage<CodeClassifyValueVO> valueVOIPage = new Page<>();
+ valueVOIPage.setRecords(valueVOS);
+ valueVOIPage.setTotal(valueVOS==null?0:valueVOS.size());
+ return valueVOIPage;
}
/**
@@ -365,7 +650,7 @@
* @return 缂栫爜瑙勫垯鐨勫唴瀹�
*/
@GetMapping("/getCodeRuleByClassifyOid")
-// @VciUnCheckRight
+ // @VciUnCheckRight
public R<CodeRuleVO> getCodeRuleByClassifyOid(String codeClassifyOid){
return R.data(engineService.getCodeRuleByClassifyOid(codeClassifyOid));
}
@@ -420,7 +705,7 @@
* @param idPath 缂栧彿鐨勮矾寰�
* @return UI鐩稿叧鐨勪俊鎭紙浠呭寘鍚〃鍗�)
*/
-// @VciUnCheckRight
+ // @VciUnCheckRight
@GetMapping("/getFormDefineByClassifyIdPath")
public MdmUIInfoVO getFormDefineByClassifyIdPath(String idPath){
return engineService.getFormDefineByClassifyIdPath(idPath);
@@ -468,6 +753,16 @@
return engineService.getUIInfoByClassifyOid(codeClassifyOid,functionId);
}
+ /**
+ * 浣跨敤鍒嗙被鑾峰彇琛ㄦ牸鐨勫畾涔�
+ * @param codeClassifyOid 鍒嗙被涓婚敭
+ * @param functionId 鍔熻兘鐨勭紪鍙�
+ * @return UI鐩稿叧鐨勪俊鎭紙浠呭寘鍚〃鏍硷級
+ */
+ @GetMapping("/getFlowdUIInfoByClassifyOid")
+ public MdmUIInfoVO getFlowUIInfoByClassifyOid(String codeClassifyOid,String functionId,String templateId,String taskId,String modelKey){
+ return engineService.getFlowUIInfoByClassifyOid(codeClassifyOid,functionId,templateId,taskId,modelKey);
+ }
@GetMapping("/thisistest")
@ResponseBody
@@ -536,9 +831,9 @@
* @param referConfigVO 鍙傜収鐨勯厤缃俊鎭�
* @return 鎵ц鐨勭粨鏋�
*/
- @GetMapping("/defaultReferDataGrid")
- public DataGrid defaultReferDataGrid(UIFormReferVO referConfigVO, PageHelper pageHelper){
- return engineService.referDataGrid(referConfigVO,pageHelper);
+ @RequestMapping(value = "/defaultReferDataGrid",method = {RequestMethod.POST, RequestMethod.GET})
+ public IPage<BaseModelVO> defaultReferDataGrid(UIFormReferVO referConfigVO, BaseQueryObject baseQueryObject){
+ return engineService.referDataGrid(referConfigVO,baseQueryObject);
}
/**
@@ -551,4 +846,105 @@
return engineService.referTree(referConfigVO,queryObject);
}
+ /**
+ * 娴佺▼涓彉鏇寸姸鎬佺殑绠�鏄撴帴鍙�
+ * @param flowDTO 娴佺▼涓惡甯︾殑body
+ * @return
+ */
+ @PostMapping("/processChangeStatus")
+ public R processChangeStatus(@RequestBody FlowStatusDTO flowDTO){
+ return engineService.processChangeStatus(flowDTO);
+ }
+
+ /**
+ * 鏍囧噯鐢宠鍜屼慨璁㈢敤
+ * @param codeBZApplyDTO 缂栫爜鐢宠鐩稿叧鐨勪俊鎭紝闇�瑕佹湁灞炴�у拰鐮佹鐩稿叧鐨勪俊鎭�
+ * @return 鎵ц缁撴灉
+ */
+ @PostMapping("/addSaveBZ")
+ @VciBusinessLog(operateName = "鐢宠鍗曚釜缂栫爜")
+ public R addSaveBZ (@RequestBody CodeBZApplyDTO codeBZApplyDTO) throws Exception {
+ return R.success(engineService.addSaveBZ(codeBZApplyDTO));
+ }
+
+ /**
+ * 涓嬭浇鎵归噺鐢宠鐨勫鍏ユā鏉�
+ * @param codeClassifyOid 鍒嗙被鐨勪富閿�
+ * @param response 鍝嶅簲瀵硅薄
+ * @throws IOException 鎶涘嚭寮傚父
+ */
+ @GetMapping("/exportGroupCodeExcel")
+ @VciBusinessLog(operateName = "瀵煎嚭闆嗗洟鐮�")
+ public void exportGroupCodeExcel(String codeClassifyOid, HttpServletResponse response) throws IOException {
+ try {
+ String excelName = mdmIOService.exportGroupCodeExcel(codeClassifyOid);
+ ControllerUtil.writeFileToResponse(response,excelName);
+ } catch (Throwable e) {
+ //濡傛灉鍑洪敊,鎶婇敊璇俊鎭啓鍒皌ext
+ String msg = LangBaseUtil.getErrorMsg(e);
+ if(StringUtils.isBlank(msg)){
+ msg = "鏈煡閿欒";
+ }
+ String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "閿欒.txt";
+ LocalFileUtil.writeContentToFile(msg,errorFile);
+ ControllerUtil.writeFileToResponse(response,errorFile);
+ // return R.fail(msg);
+ }
+ // return R.status(true);
+ }
+
+ /**
+ * 闆嗗洟鐮佸鍏�
+ * @param codeClassifyOid
+ * @param file
+ * @param response
+ * @return
+ */
+ @PostMapping("/importGroupCode")
+ public R importGroupCode(String codeClassifyOid,MultipartFile file,HttpServletResponse response){
+ // 浣跨敤鏂囦欢瀹夊叏楠岃瘉鍣�
+ ComprehensiveFileValidator.UploadValidationResult result = fileValidator.validateFile(file);
+ if (!result.isValid()) {
+ return R.fail(result.getMessage());
+ }
+
+ String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + file.getOriginalFilename();
+ File file1 = new File(excelFileName);
+ try {
+ file.transferTo(new File(excelFileName));
+ String excelName=mdmIOService.importGroupCode(codeClassifyOid,file1);
+ if(StringUtils.isNotBlank(excelName)) {
+ ControllerUtil.writeFileToResponse(response,excelName);
+ return R.fail("闆嗗洟鐮佸鍏ュ嚭鐜伴棶棰橈紝璇锋煡鐪嬫枃浠�");
+ }else{
+ return R.status(true);
+ }
+ }catch (Throwable e) {
+ logger.error("瀵煎叆閿欒",e);
+ String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "閿欒.txt";
+ LocalFileUtil.writeContentToFile(LangBaseUtil.getErrorMsg(e),errorFile);
+ String uuid=ControllerUtil.putErrorFile(errorFile);
+ CodeImProtRusultVO codeImProtRusultVO =new CodeImProtRusultVO();
+ codeImProtRusultVO.setRedisUuid("");
+ codeImProtRusultVO.setFileOid(uuid);
+ codeImProtRusultVO.setFilePath(errorFile);
+ R r = R.fail("闆嗗洟鐮佸鍏ュけ璐�");
+ r.setData(codeImProtRusultVO);
+ return r;
+ }finally {
+ file1.delete();
+ }
+
+ }
+
+ /**
+ * 鑾峰彇缁熻鍒嗘瀽鏁版嵁
+ * @param btmNames 涓氬姟绫诲瀷
+ * @return
+ */
+ @GetMapping("/getStatisticAnalysis")
+ @VciBusinessLog(operateName = "鑾峰彇缁熻鍒嗘瀽鏁版嵁")
+ public R getStatisticAnalysis(String btmNames) {
+ return engineService.getStatisticAnalysis(btmNames);
+ }
}
--
Gitblit v1.9.3