From 3534b13391b2a6152d0f91b72fda343b13a947cb Mon Sep 17 00:00:00 2001 From: ludc <ludc@vci-tech.com> Date: 星期三, 22 一月 2025 15:55:27 +0800 Subject: [PATCH] 分类码段码值管理查询去除null的情况,分类码段生成编码时去除码值为null的情况 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleController.java | 146 +++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 119 insertions(+), 27 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleController.java index ed02431..b9d1367b 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleController.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleController.java @@ -21,18 +21,24 @@ import com.vci.ubcs.code.dto.CodeRuleDTO; import com.vci.ubcs.code.entity.CodeRule; import com.vci.ubcs.code.service.ICodeRuleService; +import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; import com.vci.ubcs.code.wrapper.CodeRuleWrapper; +import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; +import com.vci.ubcs.starter.web.util.VciBaseUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.rmi.ServerException; +import java.util.Collection; +import java.util.Map; /** * 缂栫爜瑙勫垯 鎺у埗鍣� @@ -58,25 +64,16 @@ CodeRule detail = codeRuleService.getOne(Condition.getQueryWrapper(codeRule)); return R.data(CodeRuleWrapper.build().entityVO(detail)); } - /** - * 缂栫爜瑙勫垯 鍒嗛〉 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "鍒嗛〉", notes = "浼犲叆codeRuleVO") - public R<IPage<CodeRuleVO>> list(CodeRule codeRule, Query query) { - IPage<CodeRule> pages = codeRuleService.page(Condition.getPage(query), Condition.getQueryWrapper(codeRule)); - return R.data(CodeRuleWrapper.build().pageVO(pages)); - } /** * 缂栫爜瑙勫垯 鑷畾涔夊垎椤� + * @return baseQueryObject */ - @GetMapping("/gridCodeRule") + @GetMapping(value = "/gridCodeRule") @ApiOperationSupport(order = 3) @ApiOperation(value = "鍒嗛〉", notes = "浼犲叆CodeRule") - public R<IPage<CodeRuleVO>> page(CodeRuleVO CodeRule, Query query) { - IPage<CodeRuleVO> pages = codeRuleService.selectPlCodeRulePage(Condition.getPage(query.setDescs("CREATETIME")), CodeRule); + public R<IPage<CodeRuleVO>> gridCodeRule(BladeQueryObject bladeQueryObject) { + IPage<CodeRuleVO> pages = codeRuleService.gridCodeRule(bladeQueryObject.getQuery().setDescs("CREATETIME"), bladeQueryObject.getConditionMap()); return R.data(pages); } @@ -89,7 +86,7 @@ @ApiOperationSupport(order = 4) @ApiOperation(value = "鏂板", notes = "浼犲叆CodeRule") public R save(@Valid @RequestBody CodeRuleDTO codeRuleDTO) { - return R.status(codeRuleService.addSave(codeRuleDTO)); + return codeRuleService.addSave(codeRuleDTO); } /** @@ -101,17 +98,7 @@ @ApiOperationSupport(order = 5) @ApiOperation(value = "淇敼", notes = "浼犲叆CodeRule") public R update(@Valid @RequestBody CodeRuleDTO codeRuleDTO) { - return R.status(codeRuleService.editSave(codeRuleDTO)); - } - - /** - * 缂栫爜瑙勫垯 鏂板鎴栦慨鏀� - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "鏂板鎴栦慨鏀�", notes = "浼犲叆CodeRule") - public R submit(@Valid @RequestBody CodeRule codeRule) { - return R.status(codeRuleService.saveOrUpdate(codeRule)); + return codeRuleService.editSave(codeRuleDTO); } /** @@ -120,8 +107,113 @@ * @return 鍒犻櫎缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐� */ @DeleteMapping( "/deleteData") - public R delCodeRule(@Valid @RequestBody CodeRuleDTO codeRuleDTO) { + @ApiOperationSupport(order = 7) + @ApiOperation(value = "鍒犻櫎", notes = "浼犲叆codeRuleDTO") + public R delCodeRule(@RequestBody CodeRuleDTO codeRuleDTO) { return codeRuleService.deleteCodeRule(codeRuleDTO); } + /** + * 涓婚敭鑾峰彇涓绘暟鎹紪鐮佽鍒� + * @param oid 涓婚敭 + * @return 涓绘暟鎹紪鐮佽鍒欐樉绀哄璞� + */ + @GetMapping("/getObjectByOid") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "涓婚敭鑾峰彇涓绘暟鎹紪鐮佽鍒�", notes = "浼犲叆oid") + public R<CodeRuleVO> getObjectByOid(@Valid @RequestParam String oid){ + CodeRuleVO codeRuleVO = codeRuleService.getObjectByOid(oid); + return R.data(codeRuleVO); + } + + /** + * 涓婚敭鎵归噺鑾峰彇涓绘暟鎹紪鐮佽鍒� + * @param oids 涓婚敭锛屽涓互閫楀彿鍒嗛殧锛屼絾鏄彈鎬ц兘褰卞搷锛屽缓璁竴娆℃煡璇笉瓒呰繃10000涓� + * @return 涓绘暟鎹紪鐮佽鍒欐樉绀哄璞� + */ + @GetMapping("/listDataByOids") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "涓婚敭鎵归噺鑾峰彇涓绘暟鎹紪鐮佽鍒�", notes = "浼犲叆oids") + public R<Collection<CodeRuleVO>> listCodeRuleByOids(@Valid @RequestParam String oids){ + Collection<CodeRuleVO> voCollection = codeRuleService.listCodeRuleByOids(VciBaseUtil.str2List(oids)); + return R.data(voCollection); + } + + /** + * 鍙傜収涓绘暟鎹紪鐮佽鍒欏垪琛� + * @param bladeQueryObject + * @return 涓绘暟鎹紪鐮佽鍒欐樉绀哄璞″垪琛紝鐢熸晥鐨勫唴瀹� + */ + @GetMapping("/refDataGrid") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "鍙傜収涓绘暟鎹紪鐮佽鍒欏垪琛�", notes = "浼犲叆oids") + public R<IPage<CodeRuleVO>> refDataGridCodeRule(BladeQueryObject bladeQueryObject){ + return R.data(codeRuleService.refDataGridCodeRule(bladeQueryObject)); + } + + /** + * 鏌ョ湅涓绘暟鎹紪鐮佽鍒欑殑浣跨敤鑼冨洿 + * @param oid 涓婚敭 + * @return 浣跨敤鑼冨洿 + */ + @GetMapping("/listUseRange") + @ApiOperationSupport(order = 11) + @ApiOperation(value = "鏌ョ湅涓绘暟鎹紪鐮佽鍒欑殑浣跨敤鑼冨洿", notes = "浼犲叆oid") + public R<Collection<CodeClassifyVO>> listUseRange(@Valid @RequestParam String oid){ + return R.data(codeRuleService.listUseRangeInCodeClassify(oid)); + } + + /** + * 鍋滅敤涓庡惎鐢ㄧ紪鐮佽鍒� + * @param map 灏佽鍙傛暟锛屽寘鎷琽id 缂栫爜瑙勫垯涓婚敭 update 鏇存柊鐘舵�佺殑鎿嶄綔 + * @return 鎵ц缁撴灉 + */ + @PostMapping ("/updateStatus") + @ApiOperationSupport(order = 12) + @ApiOperation(value = "鍋滅敤涓庡惎鐢ㄧ紪鐮佽鍒�", notes = "浼犲叆map") + public R updateStatus(@Valid @RequestBody Map<String,String> map){ + if (CollectionUtils.isEmpty(map)){ + return R.fail("鍙傛暟閿欒"); + } + String oid = map.get("oid"); + String update = map.get("update"); + return codeRuleService.updateStatus(oid,update); + } + + /** + * 鍏嬮殕缂栫爜瑙勫垯 + * @param codeRuleDTO 涓绘暟鎹紪鐮佽鍒欐暟鎹紶杈撳璞★紝oid鍜宼s闇�瑕佷紶杈� + * @return 涓绘暟鎹紪鐮佽鍒欐樉绀哄璞� + */ + @PostMapping("/clone") + @ApiOperationSupport(order = 13) + @ApiOperation(value = "鍏嬮殕缂栫爜瑙勫垯", notes = "浼犲叆codeRuleDTO") + public R cloneCodeRule(@RequestBody CodeRuleDTO codeRuleDTO) throws ServerException { + return codeRuleService.cloneCodeRule(codeRuleDTO); + } + + /** + * 缂栫爜瑙勫垯娓呯┖鎵�鏈夊凡鐢熸垚鐨勭紪鐮� + * @param oid 缂栫爜瑙勫垯涓婚敭 + * @return 鎵ц缁撴灉 + */ + @DeleteMapping("/clearAllCode") + @ApiOperationSupport(order = 14) + @ApiOperation(value = "缂栫爜瑙勫垯娓呯┖鎵�鏈夊凡鐢熸垚鐨勭紪鐮�", notes = "浼犲叆oid") + public R clearAllCode(String oid){ + return codeRuleService.clearAllCode(oid); + } + + /** + * 妫�鏌ョ浉浼肩紪鐮佽鍒� + * @param oid + * @return 鎵ц缁撴灉 + */ + @GetMapping("/checkLikeCodeRule") + @ApiOperationSupport(order = 15) + @ApiOperation(value = "妫�鏌ョ浉浼肩紪鐮佽鍒�", notes = "浼犲叆oid") + public R checkLikeCodeRule(@Valid @RequestParam String oid){ + return codeRuleService.checkLikeCodeRule(oid); + } + } -- Gitblit v1.9.3