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/CodeFixedValueController.java | 143 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 143 insertions(+), 0 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java new file mode 100644 index 0000000..67b2d73 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java @@ -0,0 +1,143 @@ +package com.vci.ubcs.code.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.vci.ubcs.code.dto.CodeFixedValueDTO; +import com.vci.ubcs.code.entity.CodeFixedValue; +import com.vci.ubcs.code.service.ICodeFixedValueService; +import com.vci.ubcs.code.vo.pagemodel.CodeFixedValueVO; +import com.vci.ubcs.starter.web.util.VciBaseUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; + + +/** + * 鍥哄畾鐮佹鐨勭爜鍊兼帶鍒跺櫒 + * + * @author ludc + * @date 2022-01-24 + */ +@RestController +@RequestMapping("/codeFixedValueController") +@Api(value = "鍥哄畾鐮佹鐨勭爜鍊兼帶鍒跺櫒", tags = "鍥哄畾鐮佹鐨勭爜鍊兼帶鍒跺櫒") +public class CodeFixedValueController { + + /** + * 鍥哄畾鐮佹鐨勭爜鍊� 鏈嶅姟 + */ + @Autowired + private ICodeFixedValueService codeFixedValueService; + + /** + * 鍥哄畾鐮佹鐨勭爜鍊煎垪琛� + * @param codeFixedValueVO query 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑 + * @return 鍥哄畾鐮佹鐨勭爜鍊兼樉绀哄璞″垪琛� + */ + @GetMapping("/gridCodeFixedValue") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "鍥哄畾鐮佹鐨勭爜鍊煎垪琛�", notes = "CodeFixedValueVO") + public R<IPage<CodeFixedValueVO>> gridCodeFixedValue(CodeFixedValueVO codeFixedValueVO, Query query){ + return R.data(codeFixedValueService.gridCodeFixedValue(codeFixedValueVO, Condition.getPage(query.setAscs("orderNum")))); + } + + /** + * 澧炲姞 鍥哄畾鐮佹鐨勭爜鍊� + * @param codeFixedValueDTO 鍥哄畾鐮佹鐨勭爜鍊兼暟鎹紶杈撳璞� + * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞� + */ + @PostMapping( "/addSave") + public R addSave(@RequestBody CodeFixedValueDTO codeFixedValueDTO){ + boolean resBoolean = codeFixedValueService.addSave(codeFixedValueDTO); + return R.status(resBoolean); + } + + /** + * 淇敼 鍥哄畾鐮佹鐨勭爜鍊� + * @param codeFixedValueDTO 鍥哄畾鐮佹鐨勭爜鍊兼暟鎹紶杈撳璞� + * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞� + */ + @PutMapping("/editSave") + public R editSave(@RequestBody CodeFixedValueDTO codeFixedValueDTO){ + boolean resBoolean = codeFixedValueService.editSave(codeFixedValueDTO); + return R.status(resBoolean); + } + + /** + * 鍒犻櫎鍥哄畾鐮佹鐨勭爜鍊� + * @param codeFixedValueDTO 鍥哄畾鐮佹鐨勭爜鍊兼暟鎹紶杈撳璞★紝oid鍜宼s闇�瑕佷紶杈� + * @return 鍒犻櫎缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐� + */ + @DeleteMapping( "/deleteData") + public R delCodeFixedValue(@Valid @RequestBody CodeFixedValueDTO codeFixedValueDTO) { + return codeFixedValueService.deleteCodeFixedValue(codeFixedValueDTO); + } + + /** + * 涓婚敭鑾峰彇鍥哄畾鐮佹鐨勭爜鍊� + * @param oid 涓婚敭 + * @return 鍥哄畾鐮佹鐨勭爜鍊兼樉绀哄璞� + */ + @GetMapping("/getObjectByOid") + public R<CodeFixedValueVO> getObjectByOid(String oid){ + CodeFixedValueVO codeFixedValueVO = codeFixedValueService.getObjectByOid(oid); + return R.data(codeFixedValueVO); + } + + /** + * 涓婚敭鎵归噺鑾峰彇鍥哄畾鐮佹鐨勭爜鍊� + * @param oids 涓婚敭锛屽涓互閫楀彿鍒嗛殧锛屼絾鏄彈鎬ц兘褰卞搷锛屽缓璁竴娆℃煡璇笉瓒呰繃10000涓� + * @return 鍥哄畾鐮佹鐨勭爜鍊兼樉绀哄璞� + */ + @GetMapping("/listDataByOids") + public R<Collection<CodeFixedValueVO>> listCodeFixedValueByOids(String oids){ + Collection<CodeFixedValueVO> voCollection = codeFixedValueService.listCodeFixedValueByOids(VciBaseUtil.str2List(oids)); + return R.data(voCollection); + } + + /** + * 鍙傜収鍥哄畾鐮佹鐨勭爜鍊煎垪琛� + * @param codeFixedValueVO query 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑 + * @return 鍥哄畾鐮佹鐨勭爜鍊兼樉绀哄璞″垪琛紝鐢熸晥鐨勫唴瀹� + */ + @GetMapping("/refDataGrid") + public R<IPage<CodeFixedValueVO>> refDataGridCodeFixedValue(CodeFixedValueVO codeFixedValueVO, Query query){ + return R.data(codeFixedValueService.refDataGridCodeFixedValue(codeFixedValueVO,Condition.getPage(query.setAscs("ordernum")))); + } + + /** + * 鎵归噺娣诲姞鍥哄畾鐮佹鐨勭爜鍊硷紝濡傛灉淇濆瓨鐨勯泦鍚堜腑涓嶅瓨鍦ㄥ凡鍦ㄦ暟鎹簱涓殑鐮佸�煎垯鍒犻櫎銆備富瑕佹槸淇濆瓨鐮佸�肩殑搴忓彿 + * @param param 鍙傛暟锛屽寘鎷琩toList 椤甸潰浼犺緭瀵硅薄闆嗗悎 codefixedsecoid 鍥哄畾鐮佹涓婚敭 + * @return 鎵ц缁撴灉 + */ + @PostMapping("/saveOrder") + public R batchSave4Order(@RequestBody Map<String,Object> param){ + JSONArray json = JSONArray.parseArray(String.valueOf(param.get("dtoList"))); + List<CodeFixedValueDTO> dtoList = new ArrayList<>(); + for (int i = 0; i < json.size(); i++) { + CodeFixedValueDTO codeFixedValueDTO = JSONObject.toJavaObject(JSONObject.parseObject(JSONObject.toJSONString(json.get(i))), CodeFixedValueDTO.class); + dtoList.add(codeFixedValueDTO); + } + String codefixedsecoid = (String) param.get("codeFixedSecOid"); + VciBaseUtil.alertNotNull(codefixedsecoid,"鍥哄畾鐮佹鐨勪富閿�"); + if (CollectionUtils.isEmpty(dtoList)){ + return R.status(codeFixedValueService.batchDeleteBySecOid(codefixedsecoid)); + } + return codeFixedValueService.batchSave4Order(dtoList,codefixedsecoid); + } + +} -- Gitblit v1.9.3