From 274e31b26d5eba7977018048366dde0000588dc7 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期一, 10 四月 2023 11:37:50 +0800
Subject: [PATCH] 近义词维护、编码定义、模板池等功能的代码实现功能

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeButtonServiceImpl.java |  117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeButtonServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeButtonServiceImpl.java
new file mode 100644
index 0000000..1b04b5a
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeButtonServiceImpl.java
@@ -0,0 +1,117 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 搴勯獮 (smallchill@163.com)
+ */
+package com.vci.ubcs.code.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
+import com.vci.ubcs.code.entity.CodeButtonEntity;
+import com.vci.ubcs.code.enumpack.FrameworkDataLCStatus;
+import com.vci.ubcs.code.mapper.CodeButtonMapper;
+import com.vci.ubcs.code.service.ICodeButtonService;
+import com.vci.ubcs.code.vo.CodeButtonVO;
+import org.springblade.core.tool.api.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 妯℃澘鎵╁睍姹� 鏈嶅姟瀹炵幇绫�
+ *
+ * @author yuxc
+ * @since 2023-03-29
+ */
+@Service
+public class CodeButtonServiceImpl implements ICodeButtonService {
+
+	@Autowired
+	CodeButtonMapper codeButtonMapper;
+
+	@Override
+	public IPage<CodeButtonVO> selectcodebuttonPage(IPage<CodeButtonVO> page, CodeButtonVO codebutton) {
+		return page.setRecords(codeButtonMapper.selectcodebuttonPage(page, codebutton));
+	}
+
+    @Override
+    public R enableCodeButton(String id) {
+		CodeButtonEntity codebutton = codeButtonMapper.selectById(id);
+		return changeLcStatus(codebutton,true);
+    }
+	/**
+	 * 鍋滅敤
+	 *
+	 * @param oid 鏁版嵁浼犺緭瀵硅薄
+	 * @return 鎵ц缁撴灉
+	 */
+	@Override
+	public R disableOrgDuty(String oid) {
+		CodeButtonEntity codebutton = codeButtonMapper.selectById(oid);
+		return changeLcStatus(codebutton,false);
+	}
+
+//	@Override
+//	public R deleteCodeButton(String ids) {
+////		VciBaseUtil.alertNotNull(codeButtonDTO,"涓绘暟鎹腑鐨勬寜閽墿灞曟暟鎹璞�",codeButtonDTO.getOid(),"涓绘暟鎹腑鐨勬寜閽墿灞曠殑涓婚敭");
+//		if(StringUtils.isEmpty(ids)){
+//			return R.fail("浼犲叆闈炴硶鏁版嵁锛�");
+//		}
+//		CodeButtonEntity codebutton = codeButtonMapper.selectById(ids);
+//
+//		CodeButtonDO codeButtonDO = selectByOid(codeButtonDTO.getOid());
+//		BaseResult baseResult = checkIsCanDeleteForDO(codeButtonDTO,codeButtonDO);
+//		if(baseResult.isSuccess()) {
+//		}else{
+//			return baseResult;
+//		}
+//		//鎵ц鍒犻櫎鎿嶄綔
+//		BatchCBO batchCBO = codeButtonMapper.deleteByPrimaryKey(codeButtonDO.getOid());
+//		return (batchCBO!=null && batchCBO.getDeleteCbos() !=null &&batchCBO.getDeleteCbos().size() > 0)?BaseResult.successMsg(DELETE_SUCCESS):BaseResult.fail(DELETE_FAIL);
+//	}
+
+	/**
+	 * 淇敼鐢熷懡鍛ㄦ湡鐨勭姸鎬侊紝濡傚仠鐢ㄥ拰鍚敤
+	 * @param buttonDTO 鏁版嵁浼犺緭瀵硅薄锛屽繀椤昏鏈塷id鍜宼s
+	 * @param disable 鏄惁涓哄仠鐢�
+	 * @return 鎵ц鐨勭粨鏋�
+	 */
+	private R changeLcStatus(CodeButtonEntity buttonDTO, boolean disable){
+//		VciBaseUtil.alertNotNull(buttonDTO,"鏁版嵁瀵硅薄",buttonDTO.getOid(),"涓婚敭");
+		if(disable){
+			buttonDTO.setLcstatus(FrameworkDataLCStatus.ENABLED.getValue());
+		}else{
+			buttonDTO.setLcstatus(FrameworkDataLCStatus.DISABLED.getValue());
+		}
+		return SqlHelper.retBool(codeButtonMapper.updateById(buttonDTO))?
+			R.success(FrameworkDataLCStatus.ENABLED.getValue()):R.fail(FrameworkDataLCStatus.DISABLED.getValue());
+	}
+
+//	/**
+//	 * 鏍¢獙鏄惁鍙互鍒犻櫎锛屽鏋滃瓨鍦ㄤ笅绾э紝骞朵笖涓嬬骇鏈夋暟鎹紩鐢ㄥ垯涓嶈兘鍒犻櫎
+//	 * @param codeButtonDTO 鏁版嵁浼犺緭瀵硅薄
+//	 * @param codeButtonDO 鏁版嵁搴撲腑鐨勬暟鎹璞�
+//	 * @return success涓簍rue涓哄彲浠ュ垹闄わ紝false琛ㄧず鏈夋暟鎹紩鐢紝obj涓簍rue琛ㄧず鏈変笅绾�
+//	 */
+//	private R checkIsCanDeleteForDO(CodeButtonEntity codeButtonDTO, CodeButtonVO codeButtonDO) {
+//		CodeButtonVO buttonDO = new CodeButtonVO();
+//		BeanUtil.convert(codeButtonDTO,buttonDO);
+//		boService.checkTs(buttonDO);
+//		if(!checkIsLinked(codeButtonDO.getOid())) {
+//			return BaseResult.success();
+//		}else{
+//			return BaseResult.fail(DATA_LINKED_NOT_DELETE,new String[]{""});
+//		}
+//	}
+
+}

--
Gitblit v1.9.3