已修改30个文件
已删除1个文件
已添加14个文件
| | |
| | | "test:e2e": "vue-cli-service test:e2e" |
| | | }, |
| | | "dependencies": { |
| | | "avue-plugin-ueditor": "0.1.4", |
| | | "axios": "0.18.0", |
| | | "babel-polyfill": "6.26.0", |
| | | "classlist-polyfill": "1.2.0", |
| | | "crypto-js": "4.1.1", |
| | | "avue-plugin-ueditor": "^0.1.4", |
| | | "axios": "^0.18.0", |
| | | "babel-polyfill": "^6.26.0", |
| | | "classlist-polyfill": "^1.2.0", |
| | | "crypto-js": "^4.1.1", |
| | | "echarts": "4.9.0", |
| | | "element-ui": "2.15.6", |
| | | "instead": "1.0.3", |
| | | "js-base64": "2.5.1", |
| | | "js-cookie": "2.2.0", |
| | | "js-md5": "0.7.3", |
| | | "js-pinyin": "0.2.4", |
| | | "mockjs": "1.0.1-beta3", |
| | | "moment": "2.29.4", |
| | | "node-gyp": "4.0.0", |
| | | "element-ui": "^2.15.6", |
| | | "instead": "^1.0.3", |
| | | "js-base64": "^2.5.1", |
| | | "js-cookie": "^2.2.0", |
| | | "js-md5": "^0.7.3", |
| | | "js-pinyin": "^0.2.4", |
| | | "mockjs": "^1.0.1-beta3", |
| | | "moment": "^2.29.4", |
| | | "node-gyp": "^4.0.0", |
| | | "nprogress": "0.2.0", |
| | | "portfinder": "1.0.23", |
| | | "save": "2.9.0", |
| | | "script-loader": "0.7.2", |
| | | "vue": "2.6.10", |
| | | "vue-axios": "2.1.2", |
| | | "vue-clipboard2": "0.3.3", |
| | | "vue-axios": "^2.1.2", |
| | | "vue-clipboard2": "^0.3.3", |
| | | "vue-echarts": "5.0.0-beta.0", |
| | | "vue-flowchart-editor": "1.0.2", |
| | | "vue-i18n": "8.7.0", |
| | | "vue-router": "3.0.1", |
| | | "vuex": "3.1.1" |
| | | "vue-i18n": "^8.7.0", |
| | | "vue-router": "^3.0.1", |
| | | "vuex": "^3.1.1" |
| | | }, |
| | | "devDependencies": { |
| | | "@vue/cli-plugin-babel": "3.1.1", |
| | | "@vue/cli-plugin-eslint": "3.1.5", |
| | | "@vue/cli-service": "3.1.4", |
| | | "@vue/composition-api": "1.7.2", |
| | | "chai": "4.1.2", |
| | | "@vue/cli-plugin-babel": "^3.5.0", |
| | | "@vue/cli-plugin-eslint": "^3.5.0", |
| | | "@vue/cli-service": "^3.5.0", |
| | | "@vue/composition-api": "^1.7.2", |
| | | "chai": "^4.1.2", |
| | | "node-sass": "6.0.1", |
| | | "sass-loader": "10.0.5", |
| | | "vue-template-compiler": "2.5.17", |
| | | "webpack-bundle-analyzer": "3.0.3" |
| | | "sass-loader": "10.3.1", |
| | | "vue-template-compiler": "2.6.10", |
| | | "webpack-bundle-analyzer": "^3.0.3" |
| | | }, |
| | | "lint-staged": { |
| | | "*.js": [ |
| | |
| | | |
| | | let columnItem = { |
| | | change: (val) => { |
| | | console.log(val) |
| | | if (val.column.field === "drawingno") { |
| | | this.codeattrsecValue = val.value; |
| | | return; |
| | |
| | | // è·å表å详æ
æ°æ® |
| | | getFormDetail() { |
| | | if (this.type === "add") return; |
| | | if(this.templateOid){ |
| | | getFormDetail({templateOid: this.templateOid, oid: this.rowOid}).then( |
| | | (res) => { |
| | | this.form = Object.assign(this.form, res.data.data[0]); |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | return; |
| | | } |
| | | |
| | | }, |
| | | setReferValue(data) { |
| | | if (data.field) { |
| | |
| | | }, |
| | | methods: { |
| | | openDialog() { |
| | | //æ°å¢åä¿®æ¹å
±åè°ç¨ |
| | | this.getFormTemplate(); |
| | | if (this.type === "add") { |
| | | if (this.type === "add" || (this.type !== "add" && this.status === "amend")) { |
| | | this.getCodeRule(); |
| | | return; |
| | | } |
| | | }, |
| | | close() { |
| | |
| | | }, |
| | | // æ¥å£è·åè¡¨åæ°æ® |
| | | getFormTemplate() { |
| | | //æ°å¢åä¿®æ¹å
±åè°ç¨ |
| | | getFormTemplate({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | |
| | | } else { |
| | | this.showResembleQuery = false; |
| | | } |
| | | //ä¼ é表å䏿¹åºåæ°æ® ï¼æ°å¢åä¿®æ¹ï¼ |
| | | this.$nextTick(() => { |
| | | this.$refs.FormTemplate.templateRender( |
| | | res.data.formDefineVO.items |
| | |
| | | that.secVOList = (res.data.data.secVOList || []).filter((item) => |
| | | typeList.includes(item.secType) |
| | | ); |
| | | if (that.secVOList.length > 0 && that.type === "add") { |
| | | if (that.secVOList.length > 0 && that.type === "add" ||(that.type !== "add" && that.status === "amend")) { |
| | | that.showCodeApply = true; |
| | | that.activeName = "codeApply"; |
| | | |
| | |
| | | <template> |
| | | <div class="app" style="display: flex;"> |
| | | <div class="app" style="position: relative;"> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" |
| | | :option="Treeoption" style="width: fit-content;" @node-click="nodeClick"> |
| | | <template slot-scope="{ node }"> |
| | | <span v-html="node.label"></span> |
| | | </template> |
| | | </avue-tree> |
| | | <div style="display: inline-block;"> |
| | | <div style="position: absolute; right: 0px; top: -1px;"> |
| | | <el-link class="refresh-icon" icon="el-icon-refresh" @click="getTreeLists"></el-link> |
| | | </div> |
| | | </div> |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container style="overflow: hidden;"> |
| | | <el-aside style="width:250px"> |
| | | <basic-container> |
| | | <!-- æ ç»ä»¶--> |
| | | <master-tree |
| | | :currentPage="this.currentPage" |
| | |
| | | cols: [ |
| | | {title: 'ç®æ³ç¼å·', field: 'id', width: 200}, |
| | | {title: 'ç®æ³åç§°', field: 'name', width: 150}, |
| | | {title: 'èªå®ä¹æµæ°´Bean', field: 'classFullName', width: 300}, |
| | | {title: 'ç±»å
¨è·¯å¾', field: 'classFullName', width: 300}, |
| | | {title: 'ç±»å', field: 'serialType', width: 300}, |
| | | {title: 'æè¿°', field: 'description'} |
| | | ], |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="description" slot-scope="scope"> |
| | | <avue-text-ellipsis :text="scope.row.description" :height="50"> |
| | | <small slot="more">...</small> |
| | | </avue-text-ellipsis> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | |
| | | { |
| | | label: "æè¿°", |
| | | prop: "description", |
| | | width:'300' |
| | | span: 24, |
| | | minRows: 20, |
| | | type: "textarea", |
| | | slot: true, |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | }, |
| | | underscoreName(key) { |
| | | return key.replace(/([A-Z])/g, "_$1").toLowerCase(); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getUsualLogs(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "delimiterConfig" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "paddingCharacter" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "usableCharacter" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | import {exportBlob} from "@/api/common"; |
| | | import {getDeptTree, getDeptLazyTree} from "@/api/system/dept"; |
| | | import {getRoleTree} from "@/api/system/role"; |
| | | import {getPostList} from "@/api/system/post"; |
| | | //import {getPostList} from "@/api/system/post"; |
| | | import {mapGetters} from "vuex"; |
| | | import website from '@/config/website'; |
| | | import {getToken} from '@/util/auth'; |
| | |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | getPostList(tenantId).then(res => { |
| | | const column = this.findObject(this.option.group, "postId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | // getPostList(tenantId).then(res => { |
| | | // const column = this.findObject(this.option.group, "postId"); |
| | | // column.dicData = res.data.data; |
| | | // }); |
| | | }, |
| | | submitRole() { |
| | | const roleList = this.$refs.treeRole.getCheckedKeys().join(","); |
| | |
| | | proxy: { |
| | | '/api': { |
| | | //æ¬å°æå¡æ¥å£å°å |
| | | target: 'http://127.0.0.1:37000', |
| | | // target: 'http://127.0.0.1:37000', |
| | | // target: 'http://192.168.1.51:37000', |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | | target: 'http://dev.vci-tech.com:37000', |
| | | //yxc |
| | | // target: 'http:// 192.168.0.104:37000', |
| | | // target: 'http:// 192.168.0.100:37000', |
| | | // target: 'http://192.168.0.105:37000', |
| | | // target: 'http://192.168.0.103:37000', |
| | | // target: 'http://192.168.1.63:37000', |
| | |
| | | * 模æ¿çä¸»é® |
| | | */ |
| | | private String templateOid; |
| | | |
| | | /** |
| | | * ç¼ç è§åçä¸»é® |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.starter.constant.CodeTableNameConstant; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * ç¸ä¼¼æ¥è¯¢è§åæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @author xj |
| | | * @date 2023-11-30 |
| | | */ |
| | | @TableName(CodeTableNameConstant.PL_CODE_RULE_CHARACTER) |
| | | @ApiModel(value = "CodeRuleCharacter对象", description = "ç¼ç è§åå符é") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | public class CodeRuleCharacter extends BaseModel{ |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 4615707119066298941L; |
| | | /*** |
| | | * åè§åoid |
| | | */ |
| | | @NotBlank(message = "è§åç主é®ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "è§åç主é®ä¸è½ä¸ºç©º") |
| | | private String codeRuleId; |
| | | /** |
| | | * å符é |
| | | */ |
| | | @ApiModelProperty(value = "å符é") |
| | | private String chartValue; |
| | | /*** |
| | | * å符类å |
| | | */ |
| | | @ApiModelProperty(value = "å符类å") |
| | | @NotBlank(message = "å符类åä¸è½ä¸ºç©º") |
| | | private String chartType; |
| | | |
| | | /*** |
| | | * åç¬¦ç±»åæ¾ç¤ºå¼ |
| | | */ |
| | | @ApiModelProperty(value = "åç¬¦ç±»åæ¾ç¤ºå¼") |
| | | @TableField(exist = false) |
| | | private String chartTypeText; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ç¸ä¼¼æ¥è¯¢è§åæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @author xj |
| | | * @date 2023-11-30 |
| | | */ |
| | | @Data |
| | | public class CodeRuleCharacterVO extends BaseModel { |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 4615707119066298949L; |
| | | /*** |
| | | * è§åoid |
| | | */ |
| | | private String codeRuleId; |
| | | /** |
| | | * å符é |
| | | */ |
| | | private String chartValue; |
| | | /*** |
| | | * å符类å |
| | | */ |
| | | private String chartType; |
| | | /*** |
| | | * åç¬¦ç±»åæ¾ç¤ºå¼ |
| | | */ |
| | | private String chartTypeText; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "codeRuleId": "1729702446013485056", |
| | | "chartValue": "abckzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", |
| | | "chartType": "charset" |
| | | } |
| | |
| | | this.userStatus = userStatus; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "åºæ¬ä¿¡æ¯:{" + |
| | | "ç¨æ·ç¼å·='" + code + '\'' + |
| | | ", ç¨æ·å¹³å°=" + userType + |
| | | ", è´¦å·='" + account + '\'' + |
| | | ", æµç§°='" + name + '\'' + |
| | | ", çå='" + realName + '\'' + |
| | | ", é®ç®±='" + email + '\'' + |
| | | ", çµè¯='" + phone + '\'' + |
| | | ", çæ¥=" + birthday + |
| | | ", æ§å«=" + sex + |
| | | ", å¯çº§='" + secretGrade + '\'' + |
| | | ", ç¨æ·ç¶æ=" + userStatus + |
| | | '}'; |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * è§å¾å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @Getter |
| | | @Setter |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "UserVO对象", description = "UserVO对象") |
| | | public class UserVO extends User { |
| | |
| | | * è´¦å·æ¯å¦åç¨ 0为å¯ç¨ï¼1为å¯ç¨ |
| | | */ |
| | | private String userStatusText; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ç¨æ·ä¿¡æ¯{[" + |
| | | super.toString()+ "]" + |
| | | ", roleName='" + roleName + '\'' + |
| | | ", tenantName='" + tenantName + '\'' + |
| | | ", userTypeName='" + userTypeName + '\'' + |
| | | ", deptName='" + deptName + '\'' + |
| | | ", postName='" + postName + '\'' + |
| | | ", sexName='" + sexName + '\'' + |
| | | ", userStatusText='" + userStatusText + '\'' + |
| | | '}'; |
| | | } |
| | | |
| | | } |
| | |
| | | public static final String PL_CODE_RULE = "PL_CODE_RULE"; |
| | | |
| | | /** |
| | | * ç¼ç è§åå符é |
| | | */ |
| | | public static final String PL_CODE_RULE_CHARACTER = "PL_CODE_RULE_CHARACTER"; |
| | | |
| | | /** |
| | | * ç¼ç è§åçæµæ°´å¼ |
| | | */ |
| | | public static final String PL_CODE_SERIALVALUE = "PL_CODE_SERIALVALUE"; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.starter.util; |
| | | |
| | | import org.springblade.core.log.annotation.GrantLog; |
| | | import org.springblade.core.log.annotation.OperateLog; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author ludc |
| | | * @date 2023/11/29 12:39 |
| | | */ |
| | | @Configuration |
| | | public class SaveLogUtil { |
| | | |
| | | /** |
| | | * æä½æ¥å¿æå
¥æä½ |
| | | * @param res |
| | | */ |
| | | @OperateLog |
| | | public boolean operateLog(String type,boolean isException/*æ¯å¦è§¦åäºå¼å¸¸*/,String res){ |
| | | return true; |
| | | } |
| | | |
| | | } |
| | |
| | | * ç³»ç»æ¥å£ç±»å |
| | | */ |
| | | public static final String SYS_INTEGRATION_LOG_TYPE="sysIntegrationLogType"; |
| | | |
| | | /*** |
| | | * ç³»ç»æ¥å£ç±»å |
| | | */ |
| | | public static final String CODE_RULE_CHARACTER_TYPE="code_rule_character_type"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.controller; |
| | | |
| | | import com.vci.ubcs.code.service.ICodeRuleCharacterService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleCharacterVO; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /*** |
| | | * è§åå符éé
ç½® |
| | | * @author xj |
| | | * @date 2023-11-30 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/codeRuleCharacterController") |
| | | public class CodeRuleCharacterController { |
| | | @Resource |
| | | private ICodeRuleCharacterService iCodeRuleCharacterService; |
| | | /** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ® |
| | | * @param codeRuleId è§åoid |
| | | * @return æ°æ®å
容 |
| | | */ |
| | | @GetMapping("/list") |
| | | public R<List<Map<String,String>>> getDataByOid(@RequestParam("codeRuleId")String codeRuleId,@RequestParam("chartType")String chartType){ |
| | | return R.data(iCodeRuleCharacterService.getDataByRuleId(codeRuleId,chartType)); |
| | | } |
| | | /** |
| | | * ä¿åè§å对象 |
| | | * @param codeRuleCharacterVO è§åå符对象 |
| | | * @return æ°æ®å
容 |
| | | */ |
| | | @PostMapping("/addSave") |
| | | public R addSave(@RequestBody CodeRuleCharacterVO codeRuleCharacterVO){ |
| | | return iCodeRuleCharacterService.saveOrUpdate(codeRuleCharacterVO); |
| | | } |
| | | /** |
| | | * ä¿®æ¹è§å对象 |
| | | * @param codeRuleCharacterVO è§åå符对象 |
| | | * @return æ°æ®å
容 |
| | | */ |
| | | @PostMapping("/editSave") |
| | | public R editSave(@RequestBody CodeRuleCharacterVO codeRuleCharacterVO){ |
| | | return iCodeRuleCharacterService.saveOrUpdate(codeRuleCharacterVO); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è§å对象 |
| | | * @param codeRuleCharacterVO è§åå符对象 |
| | | * @return æ°æ®å
容 |
| | | */ |
| | | @PostMapping("/delete") |
| | | public R delete(@RequestBody CodeRuleCharacterVO codeRuleCharacterVO){ |
| | | return iCodeRuleCharacterService.saveOrUpdate(codeRuleCharacterVO); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | */ |
| | | @Autowired |
| | | private MdmIOService mdmIOService; |
| | | |
| | | /** |
| | | * æ¥å¿ä¿åå·¥å
·ç±» |
| | | */ |
| | | @Autowired |
| | | private SaveLogUtil saveLogUtil; |
| | | |
| | | /** |
| | | * ä¸è½½æ¹éç³è¯·ç导å
¥æ¨¡æ¿ |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¹éç³è¯·ç¼ç çä¿¡æ¯ |
| | | * æ¹éç³è¯·ç¼ç çä¿¡æ¯ï¼å½ååç±»ä¸æ¹éç³è¯·ï¼ |
| | | * @param secDTOList ç³è¯·ç¼ç çä¿¡æ¯ï¼å¿
é¡»å
å«ç 段åå类主é®çä¿¡æ¯ |
| | | * @param file æä»¶çå
容 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥å岿°æ® |
| | | * 导å
¥å岿°æ®(ä»é¡¶å±å类导ç) |
| | | * @param codeClassifyOid åç±»çä¸»é® |
| | | * @param classifyAttr å类路å¾ä½¿ç¨ç屿§ |
| | | * @param file æä»¶çå
容 |
| | |
| | | @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.getMessage()); |
| | | throw e; |
| | | } |
| | | return R.success(s); |
| | | } |
| | | |
| | | /** |
| | |
| | | public DataGrid<Map<String,String>> gridResemble(String codeClassifyOid,String redisOid){ |
| | | return mdmIOService.gridDatas(codeClassifyOid,redisOid); |
| | | } |
| | | |
| | | /*** |
| | | * 导å
¥æ°æ® |
| | | * @param codeImprotSaveDatVO//æ°æ®å¯¹è±¡ |
| | |
| | | public R deleteDatas(String redisOid,String codeClassifyOid,String dataOids){ |
| | | return mdmIOService.deleteDatas(redisOid,codeClassifyOid,dataOids); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éä¿åæµç¨æ§è¡é¡µé¢ä¿®æ¹çå
容 |
| | | * @param orderDTOList ç¼ç ç¸å
³çä¿¡æ¯ï¼ä¸éè¦ç 段çä¿¡æ¯ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.enumpack; |
| | | |
| | | import com.vci.ubcs.starter.annotation.VciEnum; |
| | | import com.vci.ubcs.starter.web.constant.MdmEnumIdConstant; |
| | | import com.vci.ubcs.starter.web.enumpck.BaseEnum; |
| | | |
| | | /** |
| | | * ç¼ç è§åç æ®µå符æ§å¶ç±»å |
| | | * @author weidy |
| | | * @date 2022-1-17 |
| | | */ |
| | | @VciEnum(name = MdmEnumIdConstant.CODE_RULE_CHARACTER_TYPE,text = "ç¼ç è§åç æ®µå符æ§å¶ç±»å",description = "") |
| | | public enum CodeRuleCharacterEnum implements BaseEnum { |
| | | /** |
| | | * å¯ç¨å符é |
| | | */ |
| | | CODE_RULE_CHARACTER_CHARSET("charset","å¯ç¨å符é"), |
| | | |
| | | /** |
| | | * å¯ç¨å符é |
| | | */ |
| | | CODE_RULE_CHARACTER_FILLERCHAR("fillerChar","å¯ç¨å符é"), |
| | | |
| | | /** |
| | | * è¡¥ä½å符 |
| | | */ |
| | | CODE_RULE_CHARACTER_SEPARATOR("separator","è¡¥ä½å符"), |
| | | /** |
| | | *ååç¼å符 |
| | | */ |
| | | CODE_RULE_CHARACTER_PREFIX("prefix","ååç¼å符"); |
| | | /** |
| | | * æä¸¾çå¼ |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * æä¸¾æ¾ç¤ºææ¬ |
| | | */ |
| | | private String text; |
| | | |
| | | /** |
| | | * è·åæä¸¾å¼ |
| | | * |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | @Override |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 设置æä¸¾å¼ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | */ |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾æ¾ç¤ºææ¬ |
| | | * |
| | | * @return æ¾ç¤ºææ¬ |
| | | */ |
| | | @Override |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¾ç¤ºææ¬ |
| | | * |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æé 彿° |
| | | * |
| | | * @param value å¼ |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | private CodeRuleCharacterEnum(String value, String text) { |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·å对åºçæä¸¾å¼ |
| | | * |
| | | * @param text åç§° |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | public static String getValueByText(String text) { |
| | | for (CodeRuleCharacterEnum wenum : CodeRuleCharacterEnum.values()) { |
| | | if (wenum.getText().equalsIgnoreCase(text)) { |
| | | return wenum.getValue(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return åç§° |
| | | */ |
| | | public static String getTextByValue(String value) { |
| | | for (CodeRuleCharacterEnum wenum : CodeRuleCharacterEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum.getText(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·åæä¸¾å¯¹è±¡ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return æä¸¾å¯¹è±¡ï¼ä¸å卿¶åè¿ånull |
| | | */ |
| | | public static CodeRuleCharacterEnum forValue(String value) { |
| | | for (CodeRuleCharacterEnum wenum : CodeRuleCharacterEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.code.entity.CodeRuleCharacter; |
| | | |
| | | public interface CodeRuleCharacterMapper extends BaseMapper<CodeRuleCharacter>{ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.vci.ubcs.code.entity.CodeAllCode; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.entity.CodeResembleRule; |
| | | import com.vci.ubcs.code.entity.CodeRuleCharacter; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleCharacterVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /*** |
| | | * è§åå符éé
ç½® |
| | | * @author xj |
| | | * @date 2023-11-30 |
| | | */ |
| | | public interface ICodeRuleCharacterService extends IService<CodeRuleCharacter> { |
| | | |
| | | /** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ® |
| | | * @param codeRuleId |
| | | * @param chartType |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<Map<String,String>> getDataByRuleId(String codeRuleId,String chartType)throws VciBaseException; |
| | | |
| | | /*** |
| | | * ä¿åç¼ç è§åå符é |
| | | * @param codeRuleCharacterVO |
| | | * @return |
| | | */ |
| | | R saveOrUpdate(CodeRuleCharacterVO codeRuleCharacterVO)throws VciBaseException; |
| | | |
| | | } |
| | |
| | | * @param file excelæä»¶çä¿¡æ¯ |
| | | * @return æé误信æ¯çexcel |
| | | */ |
| | | CodeImProtRusultVO batchImportCode(CodeOrderDTO orderDTO, File file); |
| | | CodeImProtRusultVO batchImportCode(CodeOrderDTO orderDTO, File file) throws Exception; |
| | | |
| | | /*** |
| | | *æ¹éç³è¯·ç¼ç æ°æ® |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | // ä¸ä¸ºç©ºå°±éè¦è¯¥å½ååç±»ä¸ææååç±»çisParticipateCheck |
| | | if(!codeClassifies.isEmpty()){ |
| | | List<String> oids = codeClassifies.stream().map(CodeClassify::getOid).collect(Collectors.toList()); |
| | | updateAttr = codeClassifyMapper.update( |
| | | null, |
| | | Wrappers.<CodeClassify>update() |
| | | LambdaUpdateWrapper<CodeClassify> updateWrapper = Wrappers.<CodeClassify>update() |
| | | .lambda().in(CodeClassify::getOid, oids) |
| | | .set(CodeClassify::getIsParticipateCheck, codeClassifyEntity.getIsParticipateCheck()) |
| | | ); |
| | | .set(CodeClassify::getIsParticipateCheck, codeClassifyEntity.getIsParticipateCheck()); |
| | | // ç¶åç±»çä¸å¡ç±»ååäºæ´æ¹ï¼ææååç±»çé½å¾è¿è¡æ´æ¹ |
| | | if(!codeClassifyEntity.getBtmTypeId().equals(detail.getBtmTypeId())){ |
| | | updateWrapper.set(CodeClassify::getBtmTypeId,codeClassifyEntity.getBtmTypeId()) |
| | | .set(CodeClassify::getBtmTypeName,codeClassifyEntity.getBtmTypeName()); |
| | | } |
| | | updateAttr = codeClassifyMapper.update(null,updateWrapper); |
| | | |
| | | } |
| | | |
| | | // //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥,åç±»æ°æ®ç¹æ®å¤çãåªæå¯ç¨ç¶æçåç±»ææ¨é |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.nacos.common.utils.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.base.Joiner; |
| | | import com.vci.ubcs.code.entity.CodeRuleCharacter; |
| | | import com.vci.ubcs.code.mapper.CodeRuleCharacterMapper; |
| | | import com.vci.ubcs.code.service.ICodeRuleCharacterService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleCharacterVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /*** |
| | | * ç¼ç è§åå符éæå¡ |
| | | * @author xj |
| | | * @date 2023-11-30 |
| | | */ |
| | | @Service |
| | | public class CodeRuleCharacterServiceImpl extends ServiceImpl<CodeRuleCharacterMapper, CodeRuleCharacter> implements ICodeRuleCharacterService { |
| | | |
| | | @Autowired |
| | | private CodeRuleCharacterMapper codeRuleCharacterMapper; |
| | | /*** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ® |
| | | * @param codeRuleId |
| | | * @param chartType |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public List<Map<String, String>> getDataByRuleId(String codeRuleId,String chartType) throws VciBaseException { |
| | | List<Map<String,String>> charValueList=new ArrayList<>(); |
| | | CodeRuleCharacter codeRuleCharacter=codeRuleCharacterMapper.selectOne(Wrappers.<CodeRuleCharacter>query().lambda().eq(CodeRuleCharacter::getCodeRuleId,codeRuleId).eq(CodeRuleCharacter::getChartType,chartType)); |
| | | List<Character> characterList=codeRuleCharacter.getChartValue().chars().mapToObj(c -> (char) c).collect(Collectors.toList()); |
| | | for (int i = 0; i < characterList.size(); i += 15) { |
| | | final int startIndex = i; |
| | | final int endIndex = Math.min(i + 15, characterList.size()); |
| | | List<Character> subList = characterList.subList(startIndex, endIndex); |
| | | Map<String, String> chartMap=new HashMap<>(); |
| | | // è°ç¨æå
¥æ°æ®åºçæ¹æ³ |
| | | for (int j=1;j<subList.size()+1;j++){ |
| | | String characterValue=subList.get(j-1)==null?"":subList.get(j-1).toString(); |
| | | chartMap.put(String.valueOf(j),String.valueOf(characterValue)); |
| | | } |
| | | charValueList.add(chartMap); |
| | | } |
| | | return charValueList; |
| | | } |
| | | /*** |
| | | * åç¬¦éæ°æ®ä¿å |
| | | * @param codeRuleCharacterVO |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public R saveOrUpdate(CodeRuleCharacterVO codeRuleCharacterVO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeRuleCharacterVO.getCodeRuleId(),"ç¼ç è§åid",codeRuleCharacterVO.getChartType(),"å符éç±»å"); |
| | | CodeRuleCharacter codeRuleCharacter=codeRuleCharacterMapper.selectOne(Wrappers.<CodeRuleCharacter>query().lambda().eq(CodeRuleCharacter::getCodeRuleId,codeRuleCharacterVO.getCodeRuleId()).eq(CodeRuleCharacter::getChartType,codeRuleCharacterVO.getChartType())); |
| | | if(codeRuleCharacter!=null&& StringUtils.isNotBlank(codeRuleCharacter.getOid())) { |
| | | List<Character> oldCharacterList = StringUtils.isBlank(codeRuleCharacter.getChartValue())?new ArrayList<>():codeRuleCharacter.getChartValue().chars().mapToObj(c -> (char) c).collect(Collectors.toList()); |
| | | List<Character> newCharacterList = StringUtils.isBlank(codeRuleCharacterVO.getChartValue())?new ArrayList<>():codeRuleCharacterVO.getChartValue().chars().mapToObj(c -> (char) c).collect(Collectors.toList()); |
| | | List<Character> intersectList = intersect(oldCharacterList, newCharacterList); |
| | | if (intersectList.size() > 0) { |
| | | String ss = Joiner.on(",").join(intersectList); |
| | | throw new VciBaseException("ç³»ç»ä¸åå¨ç¸åºçå符:ã" + ss + "ã"); |
| | | } |
| | | List<Character> allCharacterList = union(oldCharacterList, newCharacterList); |
| | | String str = allCharacterList.stream().map(integer -> Func.isNotEmpty(integer)?integer.toString():"").collect(Collectors.joining()); |
| | | codeRuleCharacter.setChartValue(str); |
| | | codeRuleCharacterMapper.updateById(codeRuleCharacter); |
| | | }else{ |
| | | codeRuleCharacter=new CodeRuleCharacter(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeRuleCharacter,"character"); |
| | | codeRuleCharacter.setCodeRuleId(codeRuleCharacterVO.getCodeRuleId()); |
| | | codeRuleCharacter.setChartType(codeRuleCharacterVO.getChartType()); |
| | | codeRuleCharacter.setChartValue(codeRuleCharacterVO.getChartValue()); |
| | | codeRuleCharacterMapper.insert(codeRuleCharacter); |
| | | } |
| | | return R.status(true); |
| | | } |
| | | /** |
| | | * 交é |
| | | * @param list1 |
| | | * @param list2 |
| | | * @return |
| | | */ |
| | | private static List<Character> intersect(List<Character> list1, List<Character> list2) { |
| | | List<Character> intersect = list1.stream().filter(item -> list2.contains(item)).collect(Collectors.toList()); |
| | | return intersect; |
| | | } |
| | | |
| | | /** |
| | | * å¹¶éï¼å»éï¼ |
| | | * @param list1 |
| | | * @param list2 |
| | | * @return |
| | | */ |
| | | private static List<Character> union(List<Character> list1, List<Character> list2) { |
| | | list1.addAll(list2); |
| | | return list1.stream().distinct().collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.vci.ubcs.starter.revision.model.TreeWrapperOptions; |
| | | import com.vci.ubcs.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.starter.util.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.starter.util.SaveLogUtil; |
| | | import com.vci.ubcs.starter.util.UBCSSqlKeyword; |
| | | import com.vci.ubcs.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.ubcs.starter.web.constant.RegExpConstant; |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.annotation.OperateLog; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cache.Cache; |
| | |
| | | */ |
| | | @Autowired |
| | | private IMDMIFlowAttrClient imdmiFlowAttrClient; |
| | | |
| | | // @Autowired |
| | | // private CodeOsbtmtypeMapper codeOsbtmtypeMapper;---- |
| | | // private CodeOsbtmtypeMapper codeOsbtmtypeMapper; |
| | | |
| | | /** |
| | | * æ¥å¿ä¿åå·¥å
·ç±» |
| | | */ |
| | | @Autowired |
| | | private SaveLogUtil saveLogUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | @Transactional |
| | | @Override |
| | | public void changeStatus(BaseModelDTO baseModelDTO) { |
| | | try { |
| | | VciBaseUtil.alertNotNull(baseModelDTO, "æ°æ®ä¿¡æ¯", baseModelDTO.getOid(), "主é®", baseModelDTO.getBtmname(), "ä¸å¡ç±»å", baseModelDTO.getLcStatus(), "ç®æ ç¶æ"); |
| | | List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid()); |
| | | List<BaseModel> baseModels = new ArrayList<>(); |
| | |
| | | codeCbo.setLcStatus(baseModelDTO.getLcStatus()); |
| | | } |
| | | codeAllCodeService.updateBatchById(codeCbos); |
| | | |
| | | //è®°å½æ¥å¿ä¿¡æ¯ |
| | | saveLogUtil.operateLog( |
| | | CodeDefaultLC.getTextByValue(baseModelDTO.getLcStatus()), |
| | | false, |
| | | JSON.toJSONString(baseModels) |
| | | ); |
| | | }catch (Exception e){ |
| | | // æå
¥æ´æ¹æ¥å¿è®°å½ |
| | | saveLogUtil.operateLog(CodeDefaultLC.getTextByValue(baseModelDTO.getLcStatus()),true,e.getMessage()); |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | R r = updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo)); |
| | | |
| | | if(!r.isSuccess()){ |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | |
| | | oldCbo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | oldCbo.setLastModifyTime(new Date()); |
| | | try { |
| | | // ä¿®æ¹çæ¬¡å· |
| | | updateBatchByBaseModel(oldCbo.getBtmname(), Collections.singletonList(oldCbo)); |
| | | // æå
¥æ°çæ°æ® |
| | | insertBatchByType(cbo.getBtmname(), Collections.singletonList(cbo)); |
| | | // è®°å½æ°æ®æ´æ¹æ¥å¿ |
| | | saveLogUtil.operateLog("æ°æ®æ´æ¹",false, StringUtil.format("{}\nä¿®æ¹ä¸º:\n{}",JSON.toJSONString(Collections.singletonList(oldCbo)),JSON.toJSONString(Collections.singletonList(cbo)))); |
| | | } catch (Exception vciError) { |
| | | // è®°å½æ°æ®æ´æ¹æ¥éæ¶çæ¥å¿ |
| | | saveLogUtil.operateLog("æ°æ®æ´æ¹",true,vciError.getMessage()); |
| | | throw new VciBaseException("æ°æ®æ´æ¹ä¿ååºéäº", new String[0], vciError); |
| | | } |
| | | |
| | | batchSaveSelectChar(templateVO, Collections.singletonList(cbo)); |
| | | } |
| | | |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.util.LocalFileUtil; |
| | | import com.vci.ubcs.starter.util.SaveLogUtil; |
| | | import com.vci.ubcs.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.ubcs.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.UserSecretEnum; |
| | |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.CopyOnWriteArraySet; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.alibaba.druid.util.FnvHash.Constants.LIMIT; |
| | |
| | | */ |
| | | @Resource |
| | | private IWebSecretClient secretService; |
| | | /** |
| | | * æ¥å¿ä¿åå·¥å
·ç±» |
| | | */ |
| | | @Autowired |
| | | private SaveLogUtil saveLogUtil; |
| | | |
| | | /** |
| | | * 导åºçå䏿¡ |
| | |
| | | * @return æé误信æ¯çexcelçæä»¶ |
| | | */ |
| | | @Override |
| | | public CodeImProtRusultVO batchImportCode(CodeOrderDTO orderDTO, File file) { |
| | | public CodeImProtRusultVO batchImportCode(CodeOrderDTO orderDTO, File file) throws Exception { |
| | | VciBaseUtil.alertNotNull(orderDTO,"ç¼ç ç³è¯·ç¸å
³çæ°æ®",orderDTO.getCodeClassifyOid(),"主é¢åºå类主é®"); |
| | | ReadExcelOption reo = new ReadExcelOption(); |
| | | reo.setReadAllSheet(true); |
| | |
| | | */ |
| | | @Override |
| | | public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) throws Throwable{ |
| | | try { |
| | | VciBaseUtil.alertNotNull(codeClassifyOid,"åç±»ç主é®"); |
| | | ReadExcelOption reo = new ReadExcelOption(); |
| | | reo.setReadAllSheet(true); |
| | |
| | | boolean isCreateUUid=false; |
| | | boolean isExport=false; |
| | | //long start = System.currentTimeMillis(); |
| | | // è®°å½å¯¼å
¥æåçæ»æ° |
| | | List<Integer> importCount = new ArrayList<>(); |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(codeClassifyOid); |
| | | for(int i=0;i<sheetDataSetList.size()-1;i++) { |
| | | if (CollectionUtils.isEmpty(sheetDataSetList) || CollectionUtils.isEmpty(sheetDataSetList.get(i).getRowData()) |
| | | || sheetDataSetList.get(i).getRowData().size() < 1) { |
| | |
| | | // 5.4 è·åæµæ°´ç 段çå¼ï¼å»é¤å¡«å
çå符ï¼çæµæ°´å·æ¯å¤å°ï¼ç¶åå°æµæ°´å·åç°å¨çæå¤§æµæ°´å·å¤æï¼å°äºå°±ç´æ¥å½å
¥ï¼å¤§äºåä¿®æ¹æå¤§æµæ°´å· |
| | | // 5.5 åå¨ä¼ä¸ç¼ç å°allcodeä¸ |
| | | //æ¥è¯¢åç±»åæ¨¡æ¿ |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(codeClassifyOid); |
| | | |
| | | //å
æ¾å°æ¯ä¸è¡çæ é¢ï¼ç¶åæ ¹æ®æ 颿¥è·å对åºç屿§ |
| | | SheetDataSet dataSet = sheetDataSetList.get(i); |
| | |
| | | try { |
| | | // TODO å¤çº¿ç¨æµé®é¢ |
| | | productCodeService.productCodeAndSaveData(classifyFullInfo, finalTemplateVO, ruleVOMap.get(ruleOid), null, dataCBOList); |
| | | importCount.add(dataCBOList.size()); |
| | | } catch (Throwable e) { |
| | | log.error("æ¹é产çç¼ç çæ¶ååºéäº", e); |
| | | thisCbos.stream().forEach(cbo -> { |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + ";ç³»ç»é误ï¼å卿°æ®çæ¶ååºéäº:"+e.getMessage()); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | }); |
| | |
| | | if(StringUtils.isNotBlank(excelFileName)) { |
| | | codeImProtRusultVO.setFilePath(excelFileName); |
| | | codeImProtRusultVO.setFileOid(""); |
| | | saveLogUtil.operateLog("å岿°æ®å¯¼å
¥",true, StringUtil.format("é误信æ¯ï¼{}",JSON.toJSONString(shetNameMap)) ); |
| | | }else{ |
| | | saveLogUtil.operateLog("å岿°æ®å¯¼å
¥",false, StringUtil.format("导å
¥å°åç±»{}ä¸ï¼å¯¼å
¥æåæ»æ°ä¸ºï¼{}", JSON.toJSONString(classifyFullInfo),importCount.get(0))); |
| | | } |
| | | if(isCreateUUid){ |
| | | codeImProtRusultVO.setRedisUuid(uuid); |
| | | } |
| | | |
| | | return codeImProtRusultVO; |
| | | }catch (Exception e){ |
| | | saveLogUtil.operateLog("å岿°æ®å¯¼å
¥",true,e.getMessage()); |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /*private void converBaseModels(List<ClientBusinessObject> clientBusinessObjects,List<BaseModel>dataCBOList){ |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * æ¹éå¤çç³è¯·æ°æ® |
| | | * @param orderDTO |
| | |
| | | * @param dataSet |
| | | * @return |
| | | */ |
| | | private String batchImportCodes(CodeOrderDTO orderDTO,CodeClassifyTemplateVO templateVO,SheetDataSet dataSet,Map<String,String> errorMap,boolean isEnumType){ |
| | | private String batchImportCodes(CodeOrderDTO orderDTO,CodeClassifyTemplateVO templateVO,SheetDataSet dataSet,Map<String,String> errorMap,boolean isEnumType) throws Exception { |
| | | List<String> codeList=new ArrayList<>(); |
| | | String uuid = ""; |
| | | try { |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | //è§åç主é®éè¦å»è·å |
| | | CodeRuleVO ruleVO = engineService.getCodeRuleByClassifyFullInfo(classifyFullInfo); |
| | |
| | | batchSwitchDateAttrOnOrder(attrVOS,cboList,errorMap); |
| | | //æåå¼ç»åè§å |
| | | batchSwitchComponentAttrOnOrder(attrVOS,cboList); |
| | | String uuid=VciBaseUtil.getPk(); |
| | | uuid=VciBaseUtil.getPk(); |
| | | Map<String, ClientBusinessObject> rowIndexCboMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue((IMPORT_ROW_INDEX)), t -> t)); |
| | | |
| | | if(errorMap.size()>0) { |
| | |
| | | engineService.batchSaveSelectChar(templateVO, dataCBOList); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("æ¹äºç³è¯·æ¶å¤±è´¥"); |
| | | log.error("æ¹éç³è¯·æ¶å¤±è´¥"); |
| | | throw e; |
| | | } |
| | | } |
| | | } |
| | | if(!isCreateUUid){ |
| | | return uuid=""; |
| | | } |
| | | saveLogUtil.operateLog("æ¹éç³è¯·ç¼ç ",false, StringUtil.format("æ¹é导å
¥ç³è¯·æåå
±{}æ¡æ°æ®ï¼çæçç å¼å¦ä¸ã{}ã",codeList.size(),codeList)); |
| | | }catch (Exception e){ |
| | | saveLogUtil.operateLog("æ¹éç³è¯·ç¼ç ",true,e.getMessage()); |
| | | throw e; |
| | | } |
| | | return uuid; |
| | | } |
| | | |
| | |
| | | serialDb = killFillChar(subSecValue,secVO.getCodeFillSeparator(), |
| | | OsCodeFillTypeEnum.LEFT.getValue().equalsIgnoreCase(secVO.getCodeFillType())); |
| | | } |
| | | Double newSerialDb= CustomSerialEnum.getDoubleCustomSerialValue(secValue,secVO.getCustomCodeSerialType()); |
| | | Double newSerialDb= CustomSerialEnum.getDoubleCustomSerialValue(serialDb,secVO.getCustomCodeSerialType()); |
| | | HashMap<String, String> thisUnitMaxMap = maxSerialMap.getOrDefault(serialUnitString, new HashMap<>()); |
| | | Double maxValue=newSerialDb; |
| | | if(thisUnitMaxMap.containsKey(secOid)){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.wrapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.vci.ubcs.code.entity.CodeRuleCharacter; |
| | | import com.vci.ubcs.code.enumpack.CodeRuleCharacterEnum; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleCharacterVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * ç¼ç å符å
è£
ç±»,è¿åè§å¾å±æéçåæ®µ |
| | | * @author xj |
| | | * @date 2023-11-30 |
| | | */ |
| | | public class CodeRuleCharacterWapper extends BaseEntityWrapper<CodeRuleCharacter, CodeRuleCharacterVO> { |
| | | public static CodeRuleCharacterWapper build() { |
| | | return new CodeRuleCharacterWapper(); |
| | | } |
| | | @Override |
| | | public CodeRuleCharacterVO entityVO(CodeRuleCharacter entity) { |
| | | entity.setChartTypeText(CodeRuleCharacterEnum.getTextByValue(entity.getChartType())); |
| | | CodeRuleCharacterVO VO = Objects.requireNonNull(BeanUtil.copy(entity, CodeRuleCharacterVO.class)); |
| | | return VO; |
| | | } |
| | | |
| | | /*** |
| | | * æ°ç»å¯¹è±¡è½¬æ¢ |
| | | * @param entitys |
| | | * @return |
| | | */ |
| | | public List<CodeRuleCharacterVO> entityVOs(Collection<CodeRuleCharacter> entitys) { |
| | | if(CollectionUtils.isEmpty(entitys)) {return new ArrayList<>();} |
| | | List<CodeRuleCharacterVO> vos=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(entitys)) { |
| | | entitys.stream().forEach(vo -> { |
| | | vos.add(entityVO(vo)); |
| | | }); |
| | | } |
| | | return vos; |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * æ°ç»å¯¹è±¡è½¬æ¢ |
| | | * @param vos |
| | | * @return |
| | | */ |
| | | public List<CodeRuleCharacter> voentitys(Collection<CodeRuleCharacterVO> vos) { |
| | | if(CollectionUtils.isEmpty(vos)) {return new ArrayList<>();} |
| | | List<CodeRuleCharacter>entitys =new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(vos)) { |
| | | vos.stream().forEach(vo -> { |
| | | entitys.add(voentity(vo)); |
| | | }); |
| | | } |
| | | return entitys; |
| | | } |
| | | |
| | | /*** |
| | | * æ°ç»å¯¹è±¡è½¬æ¢ |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public CodeRuleCharacter voentity( CodeRuleCharacterVO vo) { |
| | | CodeRuleCharacter entity = Objects.requireNonNull(BeanUtil.copy(vo, CodeRuleCharacter.class)); |
| | | return entity; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.vci.ubcs.code.mapper.CodeRuleCharacterMapper"> |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="CodeResembleRuleResultMap" type="com.vci.ubcs.code.entity.CodeRuleCharacter"> |
| | | <id property="oid" column="OID"/> |
| | | <result property="btmname" column="BTMNAME"/> |
| | | <result property="revisionOid" column="REVISIONOID"/> |
| | | <result property="nameOid" column="NAMEOID"/> |
| | | <result property="lastR" column="LASTR"/> |
| | | <result property="firstR" column="FIRSTR"/> |
| | | <result property="lastV" column="LASTV"/> |
| | | <result property="firstV" column="FIRSTV"/> |
| | | <result property="creator" column="CREATOR"/> |
| | | <result property="createTime" column="CREATETIME"/> |
| | | <result property="lastModifier" column="LASTMODIFIER"/> |
| | | <result property="lastModifyTime" column="LASTMODIFYTIME"/> |
| | | <result property="revisionRule" column="REVISIONVALUE"/> |
| | | <result property="versionRule" column="VISIONRULE"/> |
| | | <result property="revisionValue" column="REVISIONRULE"/> |
| | | <result property="versionValue" column="VERSIONVALUE"/> |
| | | <result property="revisionSeq" column="REVISIONSEQ"/> |
| | | <result property="versionSeq" column="VERSIONSEQ"/> |
| | | <result property="lctid" column="LCTID"/> |
| | | <result property="lcStatus" column="LCSTATUS"/> |
| | | <result property="ts" column="TS"/> |
| | | <result property="id" column="ID"/> |
| | | <result property="name" column="NAME"/> |
| | | <result property="description" column="DESCRIPTION"/> |
| | | <result property="owner" column="OWNER"/> |
| | | <result property="copyFromVersion" column="COPYFROMVERSION"/> |
| | | <result property="codeRuleId" column="CODERULEID"/> |
| | | <result property="chartValue" column="CHARTVALUE"/> |
| | | <result property="chartType" column="CHARTTYPE"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | </update > |
| | | |
| | | <select id="getNextRevision" resultType="map" > |
| | | select max(revisionSeq) + 1 revisionSeq, |
| | | max(RevisionValue) + 1 revisionVal, |
| | | max(VersionSeq) + 1 VersionSeq, |
| | | max(VersionValue) + 1 VersionVal |
| | | select max(revisionSeq) + 1 REVISIONSEQ, |
| | | max(RevisionValue) + 1 REVISIONVAL, |
| | | max(VersionSeq) + 1 VERSIONSEQ, |
| | | max(VersionValue) + 1 VERSIONVAL |
| | | from ${tableName} |
| | | where nameoid = #{nameoid} |
| | | </select> |
| | | |
| | | <select id="getCurrentRevision" resultType="map" > |
| | | select max(revisionSeq) revisionSeq, |
| | | max(RevisionValue) revisionVal, |
| | | max(VersionSeq) VersionSeq, |
| | | max(VersionValue) VersionVal |
| | | select max(revisionSeq) REVISIONSEQ, |
| | | max(RevisionValue) REVISIONVAL, |
| | | max(VersionSeq) VERSIONSEQ, |
| | | max(VersionValue) VERSIONVAL |
| | | from ${tableName} |
| | | where nameoid = #{nameoid} |
| | | </select> |
| | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collector; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | |
| | | return R.status(roleService.submit(role)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤ |
| | | */ |
| | |
| | | public R grant(@RequestBody GrantVO grantVO) { |
| | | CacheUtil.clear(SYS_CACHE); |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | boolean temp = roleService.grant(grantVO.getRoleIds(), grantVO.getMenuIds(), grantVO.getDataScopeIds(), grantVO.getApiScopeIds()); |
| | | boolean temp = false; |
| | | try { |
| | | temp = roleService.grant(grantVO.getRoleIds(), grantVO.getMenuIds(), grantVO.getDataScopeIds(), grantVO.getApiScopeIds()); |
| | | // æå
¥æææ¥å¿ |
| | | roleService.grantLog(roleService.getGrantRoleResString(grantVO.getRoleIds()),false); |
| | | }catch (Exception e){ |
| | | // å¤±è´¥æ¶æå
¥å¼å¸¸ä¿¡æ¯å°æ¥å¿ä¸ |
| | | roleService.grantLog(e.getMessage(),true); |
| | | throw e; |
| | | } |
| | | return R.status(temp); |
| | | } |
| | | |
| | |
| | | List<TreeNode> grantTree(BladeUser user); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idè·åèåæ å½¢ç»æ |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | List<TreeNode> grantTreeByRoleIds(List<Long> roleId); |
| | | |
| | | /** |
| | | * é¡¶é¨èåæ å½¢ç»æ |
| | | * |
| | | * @param user |
| | |
| | | boolean grant(@NotEmpty List<Long> roleIds, List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds); |
| | | |
| | | /** |
| | | * è§è²æéé
ç½®æ¥å¿è®°å½ |
| | | * @param roleRes |
| | | * @return |
| | | */ |
| | | boolean grantLog(String roleRes, boolean isException); |
| | | |
| | | /** |
| | | * è·åè§è²æææ¥å¿çä¿¡æ¯ |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | String getGrantRoleResString(List<Long> roleId); |
| | | |
| | | /** |
| | | * è·åè§è²ID |
| | | * |
| | | * @param tenantId |
| | |
| | | return ForestNodeMerger.merge(tenantPackageTree(menuTree, user.getTenantId())); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idè·åèåæ å½¢ç»æ |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TreeNode> grantTreeByRoleIds(List<Long> roleId) { |
| | | List<TreeNode> menuTree = baseMapper.grantTreeByRole(roleId); |
| | | return ForestNodeMerger.merge(menuTree); |
| | | } |
| | | |
| | | @Override |
| | | public List<TreeNode> grantTopTree(BladeUser user) { |
| | | List<TreeNode> menuTree = user.getTenantId().equals(NacosConfigCache.getAdminUserInfo().getTenantId()) ? baseMapper.grantTopTree() : baseMapper.grantTopTreeByRole(Func.toLongList(user.getRoleId())); |
| | |
| | | */ |
| | | package com.vci.ubcs.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.system.mapper.RoleMapper; |
| | | import com.vci.ubcs.system.service.IMenuService; |
| | | import com.vci.ubcs.system.service.IRoleMenuService; |
| | | import com.vci.ubcs.system.service.IRoleScopeService; |
| | | import com.vci.ubcs.system.service.IRoleService; |
| | | import com.vci.ubcs.system.vo.DeptVO; |
| | | import com.vci.ubcs.system.wrapper.RoleWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.log.annotation.GrantLog; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | | import org.springblade.core.tool.node.TreeNode; |
| | | import org.springblade.core.tool.utils.CollectionUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import com.vci.ubcs.system.entity.Role; |
| | | import com.vci.ubcs.system.entity.RoleMenu; |
| | | import com.vci.ubcs.system.entity.RoleScope; |
| | | import com.vci.ubcs.system.vo.RoleVO; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | private final IRoleMenuService roleMenuService; |
| | | private final IRoleScopeService roleScopeService; |
| | | private final IMenuService menuService; |
| | | |
| | | @Override |
| | | public IPage<RoleVO> selectRolePage(IPage<RoleVO> page, RoleVO role) { |
| | |
| | | return grantRoleMenu(roleIds, menuIds) && grantDataScope(roleIds, dataScopeIds) && grantApiScope(roleIds, apiScopeIds); |
| | | } |
| | | |
| | | /** |
| | | * è§è²æéé
ç½®æ¥å¿è®°å½ |
| | | * @param roleRes |
| | | * @return |
| | | */ |
| | | @Override |
| | | @GrantLog("grantRole") |
| | | public boolean grantLog(String roleRes, boolean isException) { |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * è·åè§è²æææ¥å¿çä¿¡æ¯ |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String getGrantRoleResString(List<Long> roleId) { |
| | | // è·åå°èåä¿¡æ¯ï¼åè·åå°è§è²ä¿¡æ¯ï¼è¿è¡æ¼æ¥ |
| | | List<TreeNode> menuTree = menuService.grantTreeByRoleIds(roleId); |
| | | List<String> roleNames = this.baseMapper.getRoleNames(new Long[]{roleId.get(0)}); |
| | | String res = roleNames.get(0) + "ææä¸º:{" + JSON.toJSONString(menuTree)+"}"; |
| | | return res; |
| | | } |
| | | |
| | | private boolean grantRoleMenu(List<Long> roleIds, List<Long> menuIds) { |
| | | // 鲿¢è¶æé
ç½®è¶
管è§è² |
| | | Long administratorCount = baseMapper.selectCount(Wrappers.<Role>query().lambda().eq(Role::getRoleAlias, RoleConstant.ADMINISTRATOR).in(Role::getId, roleIds)); |
| | |
| | | */ |
| | | @PostMapping("/grant") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "æé设置", notes = "ä¼ å
¥roleIdéå以åmenuIdéå") |
| | | @ApiOperation(value = "æé设置", notes = "ä¼ å
¥userIdséå以åroleIdséå") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R grant(@ApiParam(value = "userIdéå", required = true) @RequestParam String userIds, |
| | | @ApiParam(value = "roleIdéå", required = true) @RequestParam String roleIds) { |
| | | boolean temp = userService.grant(userIds, roleIds); |
| | | boolean temp = false; |
| | | try { |
| | | temp = userService.grant(userIds, roleIds); |
| | | // æå
¥æææ¥å¿ |
| | | userService.grantLog(UserWrapper.build().entityVO(userService.getById(userIds)).toString(),false); |
| | | }catch (Exception e){ |
| | | // æå
¥æææ¥å¿ |
| | | userService.grantLog(e.getMessage(),true); |
| | | throw e; |
| | | } |
| | | return R.status(temp); |
| | | } |
| | | |
| | |
| | | ExcelUtil.export(response, "ç¨æ·æ°æ®æ¨¡æ¿", "ç¨æ·æ°æ®è¡¨", list, UserExcel.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹æ³¨åç¨æ· |
| | | */ |
| | |
| | | public R registerGuest(User user, Long oauthId) { |
| | | return R.status(userService.registerGuest(user, oauthId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * é
ç½®ç¨æ·å¹³å°ä¿¡æ¯ |
| | |
| | | boolean grant(String userIds, String roleIds); |
| | | |
| | | /** |
| | | * è®°å½æææ¥å¿ |
| | | * @param res |
| | | * @return |
| | | */ |
| | | boolean grantLog(String res, boolean isException); |
| | | |
| | | /** |
| | | * åå§åå¯ç |
| | | * |
| | | * @param userIds |
| | |
| | | import com.vci.ubcs.system.user.vo.UserVO; |
| | | import com.vci.ubcs.system.user.wrapper.UserWrapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.log.annotation.GrantLog; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @GrantLog("grantUser") |
| | | public boolean updateUser(User user) { |
| | | String tenantId = user.getTenantId(); |
| | | Long userCount = baseMapper.selectCount( |
| | |
| | | .eq(User::getAccount, user.getAccount()) |
| | | .notIn(User::getId, user.getId()) |
| | | ); |
| | | // 夿æ¯å¦è¢«ä¿®æ¹ä¸ºå·²åå¨çç¨æ·å |
| | | if (userCount > 0L) { |
| | | throw new ServiceException(StringUtil.format("å½åç¨æ· [{}] å·²åå¨!", user.getAccount())); |
| | | } |
| | |
| | | |
| | | private boolean submitUserDept(User user) { |
| | | List<Long> deptIdList = Func.toLongList(user.getDeptId()); |
| | | if(deptIdList.isEmpty()){ |
| | | return true; |
| | | } |
| | | List<UserDept> userDeptList = new ArrayList<>(); |
| | | deptIdList.forEach(deptId -> { |
| | | UserDept userDept = new UserDept(); |
| | |
| | | return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toLongList(userIds))); |
| | | } |
| | | |
| | | /** |
| | | * æææ¥å¿æå
¥æä½ |
| | | * @param res |
| | | */ |
| | | @Override |
| | | @GrantLog("grantUser") |
| | | public boolean grantLog(String res, boolean isException){ |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean resetPassword(String userIds) { |
| | | User user = new User(); |