From abd832383e0a6941352215a1b150a6fb0c50e7dc Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期五, 24 十一月 2023 10:18:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java | 76 ++++++++++++++++++++++++++++----------
1 files changed, 56 insertions(+), 20 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 62f129c..0b83f96 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
@@ -5,14 +5,16 @@
import com.alibaba.nacos.common.utils.StringUtils;
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.CodeDeleteBatchDTO;
+import com.vci.ubcs.code.dto.CodeExportAttrDTO;
import com.vci.ubcs.code.dto.CodeOrderDTO;
import com.vci.ubcs.code.dto.CodeOrderSecDTO;
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.omd.vo.BtmTypeVO;
+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;
@@ -33,6 +35,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import java.rmi.ServerException;
import java.util.*;
@RestController
@@ -41,9 +44,9 @@
@Api(value = "缂栫爜鏁版嵁绠$悊", tags = "缂栫爜鏁版嵁绠$悊")
public class MdmEngineController {
-// /**
-// * 鏃ュ織
-// */
+ /**
+ * 鏃ュ織
+ */
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* 涓绘暟鎹紩鎿庢湇鍔�
@@ -55,6 +58,7 @@
*/
@Autowired
private MdmIOService mdmIOService;
+
/**
* 涓嬭浇鎵归噺鐢宠鐨勫鍏ユā鏉�
@@ -77,6 +81,7 @@
ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null);
}
}
+
/**
* 涓嬭浇鎵归噺鐢宠鐨勫鍏ユā鏉�
* @param codeClassifyOid 鍒嗙被鐨勪富閿�
@@ -97,8 +102,25 @@
}
ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null);
}
+ }
-
+ /**
+ * 瀵煎嚭涓婚搴撶殑鏁版嵁
+ * @param exportAttrDTO 瀵煎嚭鐨勭浉鍏抽厤缃�
+ */
+ @VciBusinessLog(operateName = "瀵煎嚭涓婚搴撶殑鏁版嵁")
+ @PostMapping("/exportCode")
+ public void exportCode(CodeExportAttrDTO exportAttrDTO, HttpServletResponse response) throws IOException {
+ String excelName = mdmIOService.exportCode(exportAttrDTO);
+ try {
+ 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);
+ }
}
/**
@@ -211,13 +233,12 @@
codeImProtRusultVO.setFilePath(errorFile);
R r = R.fail("瀵煎叆澶辫触");
r.setData(codeImProtRusultVO);
-
-
return r;
}finally {
file1.delete();
}
}
+
/**
* 瀵煎叆鍘嗗彶鏁版嵁
* @param codeClassifyOid 鍒嗙被鐨勪富閿�
@@ -259,7 +280,6 @@
R r = R.fail("瀵煎叆澶辫触");
r.setData(codeImProtRusultVO);
-
return r;
}finally {
file1.delete();
@@ -272,11 +292,10 @@
* @return 鎵ц缁撴灉
*/
@PostMapping("changeStatus")
- public R changeStatus(BaseModelDTO baseModelDTO) {
+ public R changeStatus(@RequestBody BaseModelDTO baseModelDTO) {
engineService.changeStatus(baseModelDTO);
return R.success("鎿嶄綔鎴愬姛锛�");
}
-
/**
* 鐢宠缂栫爜淇濆瓨
@@ -288,7 +307,6 @@
public R addSaveCode(@RequestBody CodeOrderDTO orderDTO) throws Exception {
return R.success(engineService.addSaveCode(orderDTO));
}
-
/**
* 浣跨敤妯℃澘鐨勪富閿幏鍙栬〃鍗曠殑瀹氫箟
@@ -370,7 +388,6 @@
//TODO鍚庣画鍙互瀹氫箟鏌ヨ妯℃澘鏉ユ煡璇�
return engineService.gridTableDataByClassifyOid(codeClassifyOid,templateOid,queryObject.getConditionMap(),queryObject.getPageHelper());
}
-
/***
* 鑾峰彇鍒嗙被瀵硅薄
@@ -510,12 +527,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;
}
/**
@@ -524,7 +541,7 @@
* @return 缂栫爜瑙勫垯鐨勫唴瀹�
*/
@GetMapping("/getCodeRuleByClassifyOid")
-// @VciUnCheckRight
+ // @VciUnCheckRight
public R<CodeRuleVO> getCodeRuleByClassifyOid(String codeClassifyOid){
return R.data(engineService.getCodeRuleByClassifyOid(codeClassifyOid));
}
@@ -627,6 +644,16 @@
return engineService.getUIInfoByClassifyOid(codeClassifyOid,functionId);
}
+ /**
+ * 浣跨敤鍒嗙被鑾峰彇琛ㄦ牸鐨勫畾涔�
+ * @param codeClassifyOid 鍒嗙被涓婚敭
+ * @param functionId 鍔熻兘鐨勭紪鍙�
+ * @return UI鐩稿叧鐨勪俊鎭紙浠呭寘鍚〃鏍硷級
+ */
+ @GetMapping("/getFlowdUIInfoByClassifyOid")
+ public MdmUIInfoVO getUIInfoByClassifyOid(String codeClassifyOid,String functionId,String templateId,String taskId,String modelKey){
+ return engineService.getFlowUIInfoByClassifyOid(codeClassifyOid,functionId,templateId,taskId,modelKey);
+ }
@GetMapping("/thisistest")
@ResponseBody
@@ -695,8 +722,8 @@
* @param referConfigVO 鍙傜収鐨勯厤缃俊鎭�
* @return 鎵ц鐨勭粨鏋�
*/
- @GetMapping("/defaultReferDataGrid")
- public IPage<BaseModel> defaultReferDataGrid(UIFormReferVO referConfigVO, BaseQueryObject baseQueryObject){
+ @RequestMapping(value = "/defaultReferDataGrid",method = {RequestMethod.POST, RequestMethod.GET})
+ public IPage<BaseModelVO> defaultReferDataGrid(UIFormReferVO referConfigVO, BaseQueryObject baseQueryObject){
return engineService.referDataGrid(referConfigVO,baseQueryObject);
}
@@ -710,4 +737,13 @@
return engineService.referTree(referConfigVO,queryObject);
}
+ /**
+ * 娴佺▼涓彉鏇寸姸鎬佺殑绠�鏄撴帴鍙�
+ * @param flowDTO 娴佺▼涓惡甯︾殑body
+ * @return
+ */
+ @PostMapping("/processChangeStatus")
+ public R processChangeStatus(@RequestBody FlowStatusDTO flowDTO){
+ return engineService.processChangeStatus(flowDTO);
+ }
}
--
Gitblit v1.9.3