已修改53个文件
已重命名2个文件
已添加21个文件
| | |
| | | proxy: { |
| | | '/api': { |
| | | //æ¬å°æå¡æ¥å£å°å |
| | | target: 'http://192.168.3.7:37000', |
| | | target: 'http://localhost:37000', |
| | | //target: 'http://dev.vci-tech.com:37000', |
| | | //è¿ç¨æ¼ç¤ºæå¡å°å,å¯ç¨äºç´æ¥å¯å¨é¡¹ç® |
| | | //target: 'https://saber.bladex.vip/api', |
| | |
| | | Integer IS_DEFAULT = 1; |
| | | |
| | | /** |
| | | * æ¯é»è®¤å¯ç çç¥å¼ |
| | | */ |
| | | Long STRATEGY_UPDATE_STATUS = 0L; |
| | | |
| | | /** |
| | | * æ¯é»è®¤å¯ç çç¥å¼ |
| | | */ |
| | | Long NOT_STRATEGY_UPDATE_STATUS = 0L; |
| | | |
| | | /** |
| | | * 䏿¯é»è®¤å¯ç çç¥å¼ |
| | | */ |
| | | Integer NOT_DEFAULT = 0; |
| | |
| | | * nacos dev å°å |
| | | */ |
| | | //String NACOS_DEV_ADDR = "dev.vci-tech.com:38848"; |
| | | String NACOS_DEV_ADDR = "192.168.93.140:38848"; |
| | | String NACOS_DEV_ADDR = "192.168.93.154:38848"; |
| | | |
| | | /** |
| | | * nacos prod å°å |
| | |
| | | cloud: |
| | | routes: |
| | | - name: æææ¨¡å |
| | | uri: 127.0.0.1 |
| | | uri: 127.0.0.1:37000 |
| | | location: /blade-auth/v2/api-docs |
| | | - name: å·¥ä½å°æ¨¡å |
| | | uri: 127.0.0.1 |
| | | uri: 127.0.0.1:37000 |
| | | location: /blade-desk/v2/api-docs |
| | | - name: ç³»ç»æ¨¡å |
| | | uri: 127.0.0.1 |
| | | uri: 127.0.0.1:37000 |
| | | location: /blade-system/v2/api-docs |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.dto; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeAllCode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ æ°æ®ä¼ è¾å¯¹è±¡å®ä½ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeCodeAllcodeDTO extends CodeAllCode { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| | |
| | | /* |
| | | * 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.dto; |
| | | |
| | | |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.entity.CodeRule; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * ç¼ç è§å æ°æ®ä¼ è¾å¯¹è±¡å®ä½ç±» |
| | | * |
| | | * @author weidy |
| | | * @date 2022-01-24 |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | public class CodeRuleDTO extends BaseModelVO { |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeRuleDTO extends CodeRule { |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 4615707117067738769L; |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeRuleDTO{" + |
| | | "elements=" + elements + |
| | | '}'+ super.toString(); |
| | | "elements=" + elements + |
| | | '}'+ super.toString(); |
| | | } |
| | | |
| | | } |
| | |
| | | /* |
| | | * 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.dto; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeSynonymEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * è¿ä¹è¯ç»´æ¤ æ°æ®ä¼ è¾å¯¹è±¡å®ä½ç±» |
| | | * åä¹è¯é
ç½®æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * |
| | | * @author yuxc |
| | | * @since 2023-04-04 |
| | | * @author weidy |
| | | * @date 2022-02-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeSynonymDTO extends CodeSynonymEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | public class CodeSynonymDTO extends BaseModelVO { |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 4615707117393017144L; |
| | | |
| | | /** |
| | | * æå±ç¼ç è§å |
| | | */ |
| | | private String codeclassifytemplateoid; |
| | | |
| | | /** |
| | | * æå±ç¼ç è§åæ¾ç¤ºææ¬ |
| | | */ |
| | | private String codeclassifytemplateoidName; |
| | | /** |
| | | * æºå¼ |
| | | */ |
| | | private String sourcevalue; |
| | | |
| | | /** |
| | | * åä¹è¯ |
| | | */ |
| | | private String synonymvalue; |
| | | |
| | | |
| | | /** |
| | | * è·å æå±ç¼ç è§å |
| | | */ |
| | | public String getCodeclassifytemplateoid (){ |
| | | return codeclassifytemplateoid; |
| | | } |
| | | |
| | | /** |
| | | * 设置 æå±ç¼ç è§å |
| | | */ |
| | | public void setCodeclassifytemplateoid (String codeclassifytemplateoid){ |
| | | this.codeclassifytemplateoid = codeclassifytemplateoid; |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±ç¼ç è§åæ¾ç¤ºææ¬ |
| | | */ |
| | | public String getCodeclassifytemplateoidName (){ |
| | | return codeclassifytemplateoidName; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå±ç¼ç è§åæ¾ç¤ºææ¬ |
| | | */ |
| | | public void setCodeclassifytemplateoidName (String codeclassifytemplateoidName){ |
| | | this.codeclassifytemplateoidName = codeclassifytemplateoidName; |
| | | } |
| | | /** |
| | | * è·å æºå¼ |
| | | */ |
| | | public String getSourcevalue (){ |
| | | return sourcevalue; |
| | | } |
| | | |
| | | /** |
| | | * 设置 æºå¼ |
| | | */ |
| | | public void setSourcevalue (String sourcevalue){ |
| | | this.sourcevalue = sourcevalue; |
| | | } |
| | | |
| | | /** |
| | | * è·å åä¹è¯ |
| | | */ |
| | | public String getSynonymvalue (){ |
| | | return synonymvalue; |
| | | } |
| | | |
| | | /** |
| | | * 设置 åä¹è¯ |
| | | */ |
| | | public void setSynonymvalue (String synonymvalue){ |
| | | this.synonymvalue = synonymvalue; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeSynonymDTO{" + |
| | | "codeclassifytemplateoid='" + codeclassifytemplateoid +"',"+ |
| | | "codeclassifytemplateoidName='" + codeclassifytemplateoidName +"'," + |
| | | "sourcevalue='" + sourcevalue +"',"+ |
| | | "synonymvalue='" + synonymvalue +"',"+ |
| | | "}" + super.toString(); |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | using = ToStringSerializer.class |
| | | ) |
| | | @ApiModelProperty("主é®id") |
| | | @TableId(value = "OID") |
| | | @TableId(value = "OID",type = IdType.ASSIGN_UUID) |
| | | private String oid; |
| | | |
| | | private String id; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.com.vci.starter.annotation.Transient; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | /** |
| | | * å
³é®å±æ§æ¥éè§å å®ä½ç±» |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * ç¼ç è§åçæµæ°´å¼ |
| | | * @author ludc |
| | | * @date 2022-3-1 |
| | | */ |
| | | @Data |
| | | @TableName("PL_CODE_CODESERIALVALUE") |
| | | @ApiModel(value = "CodeSerialValue对象", description = "ç¼ç è§åçæµæ°´å¼") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeSerialValue extends BaseModel { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 4585738864706015777L; |
| | | /** |
| | | * ç¼ç è§åçä¸»é® |
| | | */ |
| | | //@VciUseRefer(MdmBtmTypeConstant.CODE_RULE) |
| | | private String codeRuleOid; |
| | | |
| | | /*** |
| | | * æµæ°´ä¾èµ |
| | | */ |
| | | private String serialUnit; |
| | | |
| | | /** |
| | | * ç æ®µçä¸»é® |
| | | */ |
| | | private String codeSecOid; |
| | | |
| | | /** |
| | | * æå¤§æµæ°´å· |
| | | */ |
| | | private String maxSerial; |
| | | |
| | | public String getCodeRuleOid() { |
| | | return codeRuleOid; |
| | | } |
| | | |
| | | public void setCodeRuleOid(String codeRuleOid) { |
| | | this.codeRuleOid = codeRuleOid; |
| | | } |
| | | |
| | | public String getSerialUnit() { |
| | | return serialUnit; |
| | | } |
| | | |
| | | public void setSerialUnit(String serialUnit) { |
| | | this.serialUnit = serialUnit; |
| | | } |
| | | |
| | | public String getCodeSecOid() { |
| | | return codeSecOid; |
| | | } |
| | | |
| | | public void setCodeSecOid(String codeSecOid) { |
| | | this.codeSecOid = codeSecOid; |
| | | } |
| | | |
| | | public String getMaxSerial() { |
| | | return maxSerial; |
| | | } |
| | | |
| | | public void setMaxSerial(String maxSerial) { |
| | | this.maxSerial = maxSerial; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeSerialValueDO{" + |
| | | "codeRuleOid='" + codeRuleOid + '\'' + |
| | | ", serialUnit='" + serialUnit + '\'' + |
| | | ", codeSecOid='" + codeSecOid + '\'' + |
| | | ", maxSerial='" + maxSerial + '\'' + |
| | | "} " + super.toString(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | |
| | | //package com.vci.starter.revision.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.code.bo.TreeWrapperOptions; |
| | | import com.vci.ubcs.code.entity.BaseModel; |
| | | import com.vci.ubcs.com.vci.starter.util.VciBaseUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.ubcs.com.vci.starter.web.service.VciSecretServiceI; |
| | | import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Component |
| | | public class RevisionModelUtil implements VciSecretServiceI { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | public static volatile Map<String, Map<String, String>> modelColumnAnnotationMap = new ConcurrentHashMap(); |
| | | // public static volatile Map<String, VciBtmType> modelAnnotationMap = new ConcurrentHashMap(); |
| | | public static boolean CHECK_IDEMPOTENCE = false; |
| | | |
| | | public void copyFromDTOIgnore(Object dto, BaseModel baseModel) { |
| | | VciBaseUtil.alertNotNull(new Object[]{dto, "æ°æ®ä¼ è¾å¯¹è±¡", baseModel, "æ°æ®åºä¸çæ°æ®å¯¹è±¡"}); |
| | | BaseModel tempModel = new BaseModel(); |
| | |
| | | baseModel.setDescription(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField("description", dto))); |
| | | tempModel = null; |
| | | } |
| | | |
| | | public <T, R> List<Tree> doList2Trees(List<T> doList, TreeWrapperOptions wrapperOptions, Function<T, R> f) { |
| | | if (CollectionUtils.isEmpty(doList)) { |
| | | return new ArrayList(); |
| | |
| | | tree.setText((String)textValues.stream().collect(Collectors.joining(wrapperOptions.getTextValueSep()))); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(wrapperOptions.getParentFieldName())) { |
| | | if (StringUtils.isNotBlank(wrapperOptions.getParentFieldName())) { |
| | | tree.setParentId(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField(wrapperOptions.getParentFieldName(), doObject))); |
| | | } |
| | | |
| | |
| | | wrapperOptions.setParentOid(""); |
| | | } |
| | | |
| | | if (!StringUtil.isBlank(tree.getParentId()) && (!StringUtil.isNotBlank(wrapperOptions.getParentOid()) || !wrapperOptions.getParentOid().equalsIgnoreCase(tree.getParentId()))) { |
| | | if (!StringUtils.isBlank(tree.getParentId()) && (!StringUtils.isNotBlank(wrapperOptions.getParentOid()) || !wrapperOptions.getParentOid().equalsIgnoreCase(tree.getParentId()))) { |
| | | children.add(tree); |
| | | } else { |
| | | allTree.add(tree); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.enumpck; |
| | | |
| | | public interface BaseEnum { |
| | | String getValue(); |
| | | |
| | | String getText(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.enumpck; |
| | | |
| | | //package com.vci.web.enumpck; |
| | | |
| | | |
| | | /** |
| | | * ç¼ç çè¡¥ä½æ¹å¼ |
| | | * @author weidy |
| | | * @date 2020/3/28 |
| | | */ |
| | | //@VciEnum(name = EnumIdConstant.CODE_FILL_TYPE,text = "ç¼ç è¡¥ä½æ¹å¼",description = "ä¸è¡¥ä½ï¼å·¦è¡¥ä½ï¼å³è¡¥ä½") |
| | | public enum OsCodeFillTypeEnum implements BaseEnum { |
| | | |
| | | /** |
| | | * ä¸è¡¥ä½ |
| | | */ |
| | | NONE("code_fill_none","ä¸è¡¥ä½"), |
| | | |
| | | /** |
| | | * å·¦è¡¥ä½ |
| | | */ |
| | | LEFT("code_fill_left","左补ä½"), |
| | | |
| | | /** |
| | | * å³è¡¥ä½ |
| | | */ |
| | | RIGHT("code_fill_right","å³è¡¥ä½"); |
| | | |
| | | /** |
| | | * æä¸¾çå¼ |
| | | */ |
| | | 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 OsCodeFillTypeEnum(String value, String text) { |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·å对åºçæä¸¾å¼ |
| | | * |
| | | * @param text åç§° |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | public static String getValueByText(String text) { |
| | | for (OsCodeFillTypeEnum wenum : OsCodeFillTypeEnum.values()) { |
| | | if (wenum.getText().equalsIgnoreCase(text)) { |
| | | return wenum.getValue(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return åç§° |
| | | */ |
| | | public static String getTextByValue(String value) { |
| | | for (OsCodeFillTypeEnum wenum : OsCodeFillTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum.getText(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·åæä¸¾å¯¹è±¡ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return æä¸¾å¯¹è±¡ï¼ä¸å卿¶åè¿ånull |
| | | */ |
| | | public static OsCodeFillTypeEnum forValue(String value) { |
| | | for (OsCodeFillTypeEnum wenum : OsCodeFillTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.pagemodel; |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class BaseQueryObject implements Serializable { |
| | | @JSONField( |
| | | serialize = false, |
| | | deserialize = false |
| | | ) |
| | | private static final long serialVersionUID = 5608634730007623041L; |
| | | @JSONField |
| | | private Map<String, String> conditionMap = new HashMap(); |
| | | @JSONField |
| | | private int page = 1; |
| | | @JSONField |
| | | private String sort; |
| | | @JSONField |
| | | private String order; |
| | | @JSONField |
| | | private int limit = 25; |
| | | |
| | | public BaseQueryObject() { |
| | | } |
| | | |
| | | public BaseQueryObject(Map<String, String> conditionMap) { |
| | | this.setConditionMap(conditionMap); |
| | | } |
| | | |
| | | public BaseQueryObject(int limit) { |
| | | this.setLimit(limit); |
| | | } |
| | | |
| | | public BaseQueryObject(Map<String, String> conditionMap, int limit) { |
| | | this.setConditionMap(conditionMap); |
| | | this.setLimit(limit); |
| | | } |
| | | |
| | | public Map<String, String> getConditionMap() { |
| | | return this.conditionMap; |
| | | } |
| | | |
| | | public Map<String, String> getConditionMapByNick(String nick) { |
| | | if (this.conditionMap != null) { |
| | | Map<String, String> conditionMapHasNick = new HashMap(); |
| | | this.conditionMap.forEach((k, v) -> { |
| | | if (!k.contains(".")) { |
| | | conditionMapHasNick.put(nick + "." + k, v); |
| | | } else { |
| | | conditionMapHasNick.put(k, v); |
| | | } |
| | | |
| | | }); |
| | | return conditionMapHasNick; |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public void setConditionMap(Map<String, String> conditionMap) { |
| | | this.conditionMap = conditionMap; |
| | | } |
| | | |
| | | public int getPage() { |
| | | return this.page; |
| | | } |
| | | |
| | | public void setPage(int page) { |
| | | this.page = page; |
| | | } |
| | | |
| | | public String getSort() { |
| | | return this.sort; |
| | | } |
| | | |
| | | public void setSort(String sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | public String getOrder() { |
| | | return this.order; |
| | | } |
| | | |
| | | public void setOrder(String order) { |
| | | this.order = order; |
| | | } |
| | | |
| | | public int getLimit() { |
| | | return this.limit; |
| | | } |
| | | |
| | | public void setLimit(int limit) { |
| | | this.limit = limit; |
| | | } |
| | | |
| | | @JSONField( |
| | | serialize = false, |
| | | deserialize = false |
| | | ) |
| | | public PageHelper getPageHelper() { |
| | | PageHelper pageHelper = new PageHelper(this.limit); |
| | | pageHelper.setPage(this.getPage()); |
| | | pageHelper.setSort(this.getSort()); |
| | | pageHelper.setOrder(this.getOrder()); |
| | | return pageHelper; |
| | | } |
| | | |
| | | public BaseQueryObject addSort(String sort, String order) { |
| | | this.setSort(StringUtils.isBlank(this.getSort()) ? sort : this.getSort() + "," + sort); |
| | | this.setOrder(StringUtils.isBlank(this.getOrder()) ? order : this.getOrder() + "," + order); |
| | | return this; |
| | | } |
| | | |
| | | public BaseQueryObject addCondition(String key, String value) { |
| | | if (this.getConditionMap() == null) { |
| | | this.conditionMap = new HashMap(); |
| | | } |
| | | |
| | | this.conditionMap.put(key, value); |
| | | return this; |
| | | } |
| | | |
| | | public BaseQueryObject page(PageHelper pageHelper) { |
| | | this.setSort(pageHelper.getSort()); |
| | | this.setOrder(pageHelper.getOrder()); |
| | | this.setPage(pageHelper.getPage()); |
| | | this.setLimit(pageHelper.getLimit()); |
| | | return this; |
| | | } |
| | | |
| | | @JSONField( |
| | | serialize = false, |
| | | deserialize = false |
| | | ) |
| | | public Map<String, String> getFeignRequestMap() { |
| | | Map<String, String> feignRequestMap = new HashMap(); |
| | | if (this.conditionMap != null) { |
| | | this.getConditionMap().forEach((k, v) -> { |
| | | feignRequestMap.put("conditionMap[\"" + k + "\"]", v); |
| | | }); |
| | | } |
| | | |
| | | feignRequestMap.put("page", this.getPage() + ""); |
| | | feignRequestMap.put("limit", this.getLimit() + ""); |
| | | feignRequestMap.put("sort", this.getSort()); |
| | | feignRequestMap.put("order", this.getOrder()); |
| | | return feignRequestMap; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BaseQueryObject{conditionMap=" + this.conditionMap + ", page=" + this.page + ", sort='" + this.sort + '\'' + ", order='" + this.order + '\'' + ", limit=" + this.limit + '}'; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | |
| | | //package com.vci.starter.web.pagemodel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class KeyValue implements Serializable { |
| | | private static final long serialVersionUID = 7708882804529442626L; |
| | | private String key; |
| | | private String value; |
| | | private Map<String, Object> attributes = new HashMap(); |
| | | |
| | | public KeyValue() { |
| | | |
| | | } |
| | | |
| | | public String getKey() { |
| | | return this.key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return this.value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public Map<String, Object> getAttributes() { |
| | | return this.attributes; |
| | | } |
| | | |
| | | public void setAttributes(Map<String, Object> attributes) { |
| | | this.attributes = attributes; |
| | | } |
| | | |
| | | public void addAttr(String attr, Object attrValue) { |
| | | this.attributes.put(attr, attrValue); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "KeyValue{key='" + this.key + '\'' + ", value='" + this.value + '\'' + ", attributes=" + this.attributes + '}'; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.pagemodel; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | public class PageHelper implements Serializable { |
| | | private static final long serialVersionUID = -588765760880887850L; |
| | | private int page; |
| | | private String sort; |
| | | private String order; |
| | | private int start = 0; |
| | | private int limit = 25; |
| | | private boolean queryTotal = true; |
| | | private String ordersql; |
| | | private String nick; |
| | | public final String asc = "asc"; |
| | | public final String desc = "desc"; |
| | | private Set<String> unNickField = new HashSet(); |
| | | |
| | | public PageHelper() { |
| | | } |
| | | |
| | | public PageHelper(int limit) { |
| | | this.limit = limit; |
| | | this.page = 1; |
| | | } |
| | | |
| | | public PageHelper(int limit, boolean queryTotal) { |
| | | this.limit = limit; |
| | | this.queryTotal = queryTotal; |
| | | } |
| | | |
| | | public PageHelper(String sort) { |
| | | this.sort = sort; |
| | | this.limit = -1; |
| | | this.order = "asc"; |
| | | } |
| | | |
| | | public PageHelper(String sort, String order) { |
| | | this.sort = sort; |
| | | this.limit = -1; |
| | | this.order = order; |
| | | } |
| | | |
| | | public PageHelper(int limit, String sort, String order) { |
| | | this.limit = limit; |
| | | this.sort = sort; |
| | | this.order = order; |
| | | } |
| | | |
| | | public PageHelper(int limit, int page, String sort, String order) { |
| | | this.limit = limit; |
| | | this.page = page; |
| | | this.sort = sort; |
| | | this.order = order; |
| | | } |
| | | |
| | | public int getPage() { |
| | | return this.page; |
| | | } |
| | | |
| | | public void setPage(int page) { |
| | | this.page = page; |
| | | if (page > 0 && this.limit > 0) { |
| | | this.start = (this.page - 1) * this.limit; |
| | | } |
| | | |
| | | } |
| | | |
| | | public void setSort(String sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | public String getOrder() { |
| | | return this.order; |
| | | } |
| | | |
| | | public void setOrder(String order) { |
| | | this.order = order; |
| | | } |
| | | |
| | | public int getStart() { |
| | | return this.limit <= 0 ? 0 : (this.page - 1) * this.limit + 1; |
| | | } |
| | | |
| | | public boolean isQueryTotal() { |
| | | return this.queryTotal; |
| | | } |
| | | |
| | | public void setQueryTotal(boolean queryTotal) { |
| | | this.queryTotal = queryTotal; |
| | | } |
| | | |
| | | public int getLimit() { |
| | | return this.limit; |
| | | } |
| | | |
| | | public void setLimit(int limit) { |
| | | this.limit = limit; |
| | | if (this.page > 0 && this.limit > 0) { |
| | | this.start = (this.page - 1) * this.limit + 1; |
| | | } |
| | | |
| | | } |
| | | |
| | | public void addSort(String sort, String order) { |
| | | this.setSort(StringUtils.isBlank(this.getSort()) ? sort : this.getSort() + "," + sort); |
| | | this.setOrder(StringUtils.isBlank(this.getOrder()) ? order : this.getOrder() + "," + order); |
| | | } |
| | | |
| | | public void addAsc(String field) { |
| | | this.addSort(field, "asc"); |
| | | } |
| | | |
| | | public void addDefaultAsc(String field) { |
| | | if (StringUtils.isBlank(this.getSort()) && StringUtils.isBlank(this.getOrder())) { |
| | | this.addAsc(field); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void addDefaultDesc(String field) { |
| | | if (StringUtils.isBlank(this.getSort()) && StringUtils.isBlank(this.getOrder())) { |
| | | this.addDesc(field); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void addDesc(String field) { |
| | | this.addSort(field, "desc"); |
| | | } |
| | | |
| | | public String getSort() { |
| | | return this.sort; |
| | | } |
| | | |
| | | public void setStart(int start) { |
| | | this.start = start; |
| | | } |
| | | |
| | | public String getOrdersql() { |
| | | if ((this.ordersql == null || this.ordersql.trim().length() == 0) && this.sort != null && this.sort.trim().length() > 0 && this.order != null && this.order.trim().length() > 0) { |
| | | if (this.sort.indexOf(",") > -1) { |
| | | String[] sortArray = this.sort.split(","); |
| | | String[] orderArray = this.order.split(","); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | for(int i = 0; i < sortArray.length; ++i) { |
| | | if (StringUtils.isNotBlank(sortArray[i]) && orderArray.length > i && StringUtils.isNotBlank(orderArray[i])) { |
| | | if (sortArray[i].indexOf(".") < 0 && !this.unNickField.contains(sortArray[i].toLowerCase())) { |
| | | sb.append(StringUtils.isBlank(this.getNick()) ? "" : this.getNick() + "."); |
| | | } |
| | | |
| | | sb.append(sortArray[i].toLowerCase()); |
| | | sb.append(" "); |
| | | sb.append(orderArray[i]); |
| | | sb.append(","); |
| | | } |
| | | } |
| | | |
| | | this.ordersql = " order by " + sb.toString(); |
| | | if (this.ordersql.endsWith(",")) { |
| | | this.ordersql = this.ordersql.substring(0, this.ordersql.length() - 1); |
| | | } |
| | | } else { |
| | | this.ordersql = " order by " + this.sort + " " + this.order; |
| | | } |
| | | } |
| | | |
| | | return this.ordersql; |
| | | } |
| | | |
| | | public String getOrderSql(String nick) { |
| | | if ((this.ordersql == null || this.ordersql.trim().length() == 0) && this.sort != null && this.sort.trim().length() > 0 && this.order != null && this.order.trim().length() > 0) { |
| | | if (this.sort.indexOf(",") > -1) { |
| | | String[] sortArray = this.sort.split(","); |
| | | String[] orderArray = this.order.split(","); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | for(int i = 0; i < sortArray.length; ++i) { |
| | | if (StringUtils.isNotBlank(sortArray[i]) && orderArray.length > i && StringUtils.isNotBlank(orderArray[i])) { |
| | | if (sortArray[i].indexOf(".") < 0) { |
| | | sb.append(StringUtils.isBlank(nick) ? "" : nick + "."); |
| | | } |
| | | |
| | | sb.append(sortArray[i].toLowerCase()); |
| | | sb.append(" "); |
| | | sb.append(orderArray[i]); |
| | | sb.append(","); |
| | | } |
| | | } |
| | | |
| | | this.ordersql = " order by " + sb.toString(); |
| | | if (this.ordersql.endsWith(",")) { |
| | | this.ordersql = this.ordersql.substring(0, this.ordersql.length() - 1); |
| | | } |
| | | } else { |
| | | this.ordersql = " order by " + nick + "." + this.sort + " " + this.order; |
| | | } |
| | | } |
| | | |
| | | return this.ordersql; |
| | | } |
| | | |
| | | public String getNick() { |
| | | return this.nick; |
| | | } |
| | | |
| | | public void setNick(String nick) { |
| | | this.nick = nick; |
| | | } |
| | | |
| | | public void setOrdersql(String ordersql) { |
| | | this.ordersql = ordersql; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PageHelper{page=" + this.page + ", sort='" + this.sort + '\'' + ", order='" + this.order + '\'' + ", start=" + this.start + ", limit=" + this.limit + ", queryTotal=" + this.queryTotal + ", ordersql='" + this.ordersql + '\'' + ", nick='" + this.nick + '\'' + ", asc='" + "asc" + '\'' + ", desc='" + "desc" + '\'' + ", unNickField=" + this.unNickField + '}'; |
| | | } |
| | | |
| | | public Set<String> getUnNickField() { |
| | | return this.unNickField; |
| | | } |
| | | |
| | | public void setUnNickField(Set<String> unNickField) { |
| | | this.unNickField = unNickField; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | |
| | | //package com.vci.web.pageModel; |
| | | |
| | | /** |
| | | * åæ®µçæåº |
| | | * @author weidy |
| | | * @date 2022-04-21 |
| | | */ |
| | | public class UIFieldSortVO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 3364856602124197925L; |
| | | |
| | | /** |
| | | * æåºçåæ®µ |
| | | */ |
| | | private String field; |
| | | |
| | | /** |
| | | * æåºçç±»å |
| | | */ |
| | | private String type; |
| | | |
| | | public String getField() { |
| | | return field; |
| | | } |
| | | |
| | | public void setField(String field) { |
| | | this.field = field; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UIFieldSortVO{" + |
| | | "field='" + field + '\'' + |
| | | ", type='" + type + '\'' + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | |
| | | //package com.vci.web.pageModel; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åç
§çé
ç½® |
| | | * @author weidy |
| | | * @date 2021/2/24 |
| | | */ |
| | | public class UIFormReferVO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 1459005348514757537L; |
| | | /** |
| | | * åç
§ççªå£ç±»å |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * æ¾ç¤ºçåæ®µå±æ§ |
| | | */ |
| | | private String textField = "name"; |
| | | |
| | | /** |
| | | * å¼ç屿§ |
| | | */ |
| | | private String valueField = "oid"; |
| | | |
| | | /** |
| | | * æ¯å¦å¤é |
| | | */ |
| | | private boolean muti = false; |
| | | |
| | | /** |
| | | * åå°å°å |
| | | */ |
| | | private String url; |
| | | |
| | | /** |
| | | * æå¡çå°å |
| | | */ |
| | | private String backPath; |
| | | |
| | | /** |
| | | * 请æ±åå°çå½¢å¼ |
| | | */ |
| | | private String method = "GET"; |
| | | |
| | | /** |
| | | * é«åº¦ |
| | | */ |
| | | private Integer height; |
| | | |
| | | //éç¨çåç
§ |
| | | /** |
| | | * åç
§çä¸å¡ç±»å |
| | | */ |
| | | private String referType; |
| | | |
| | | /** |
| | | * åç
§çUIä¸ä¸æ |
| | | */ |
| | | private String referContent; |
| | | |
| | | //æ å½¢çåç
§ |
| | | /** |
| | | * ä¸çº§å段 |
| | | */ |
| | | private String parentFieldName; |
| | | |
| | | /** |
| | | * ä¸çº§å段çå
容对åºç屿§çå¼ |
| | | */ |
| | | private String parentUsedField; |
| | | |
| | | /** |
| | | * ä¸çº§å段çå¼ |
| | | */ |
| | | private String parentValue; |
| | | |
| | | /** |
| | | * å è½½æ¹å¼ |
| | | */ |
| | | private String loadType = "all"; |
| | | |
| | | /** |
| | | * æ¯å¦åªè½éæ©å¶åèç¹ |
| | | */ |
| | | private boolean onlyLeaf = false; |
| | | |
| | | /** |
| | | * è¿æ»¤(级è)屿§ |
| | | */ |
| | | private String useFormKey; |
| | | |
| | | /** |
| | | * è¿æ»¤å±æ§è¯·æ±åæ° |
| | | */ |
| | | private String paramForFormKey; |
| | | |
| | | /** |
| | | * æ å°å
¶ä»å±æ§ |
| | | */ |
| | | private String mapFields; |
| | | |
| | | |
| | | //å表çåç
§ |
| | | |
| | | /** |
| | | * æ¾ç¤ºçå表 |
| | | */ |
| | | private String displayTable; |
| | | |
| | | /** |
| | | * è¡¨æ ¼çèªå®ä¹å®ä¹ |
| | | */ |
| | | private UITableCustomDefineVO tableConfig; |
| | | |
| | | /** |
| | | * ç鿡件 |
| | | */ |
| | | private Map<String,String> where; |
| | | |
| | | /** |
| | | * åå°æåº |
| | | */ |
| | | private boolean remoteSort; |
| | | |
| | | /** |
| | | * åå§åæåº |
| | | */ |
| | | private UIFieldSortVO initSort; |
| | | |
| | | public boolean isRemoteSort() { |
| | | return remoteSort; |
| | | } |
| | | |
| | | public void setRemoteSort(boolean remoteSort) { |
| | | this.remoteSort = remoteSort; |
| | | } |
| | | |
| | | |
| | | public UIFieldSortVO getInitSort() { |
| | | return initSort; |
| | | } |
| | | |
| | | public void setInitSort(UIFieldSortVO initSort) { |
| | | this.initSort = initSort; |
| | | } |
| | | |
| | | public String getParentUsedField() { |
| | | return parentUsedField; |
| | | } |
| | | |
| | | public void setParentUsedField(String parentUsedField) { |
| | | this.parentUsedField = parentUsedField; |
| | | } |
| | | |
| | | public Map<String, String> getWhere() { |
| | | return where; |
| | | } |
| | | |
| | | public void setWhere(Map<String, String> where) { |
| | | this.where = where; |
| | | } |
| | | |
| | | public String getUseFormKey() { |
| | | return useFormKey; |
| | | } |
| | | |
| | | public void setUseFormKey(String useFormKey) { |
| | | this.useFormKey = useFormKey; |
| | | } |
| | | |
| | | public String getParamForFormKey() { |
| | | return paramForFormKey; |
| | | } |
| | | |
| | | public void setParamForFormKey(String paramForFormKey) { |
| | | this.paramForFormKey = paramForFormKey; |
| | | } |
| | | |
| | | public String getMapFields() { |
| | | return mapFields; |
| | | } |
| | | |
| | | public void setMapFields(String mapFields) { |
| | | this.mapFields = mapFields; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getTextField() { |
| | | return textField; |
| | | } |
| | | |
| | | public void setTextField(String textField) { |
| | | this.textField = textField; |
| | | } |
| | | |
| | | public String getValueField() { |
| | | return valueField; |
| | | } |
| | | |
| | | public void setValueField(String valueField) { |
| | | this.valueField = valueField; |
| | | } |
| | | |
| | | public boolean isMuti() { |
| | | return muti; |
| | | } |
| | | |
| | | public void setMuti(boolean muti) { |
| | | this.muti = muti; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getBackPath() { |
| | | return backPath; |
| | | } |
| | | |
| | | public void setBackPath(String backPath) { |
| | | this.backPath = backPath; |
| | | } |
| | | |
| | | public String getMethod() { |
| | | return method; |
| | | } |
| | | |
| | | public void setMethod(String method) { |
| | | this.method = method; |
| | | } |
| | | |
| | | public Integer getHeight() { |
| | | return height; |
| | | } |
| | | |
| | | public void setHeight(Integer height) { |
| | | this.height = height; |
| | | } |
| | | |
| | | public String getReferType() { |
| | | return referType; |
| | | } |
| | | |
| | | public void setReferType(String referType) { |
| | | this.referType = referType; |
| | | } |
| | | |
| | | public String getReferContent() { |
| | | return referContent; |
| | | } |
| | | |
| | | public void setReferContent(String referContent) { |
| | | this.referContent = referContent; |
| | | } |
| | | |
| | | public String getParentFieldName() { |
| | | return parentFieldName; |
| | | } |
| | | |
| | | public void setParentFieldName(String parentFieldName) { |
| | | this.parentFieldName = parentFieldName; |
| | | } |
| | | |
| | | public String getParentValue() { |
| | | return parentValue; |
| | | } |
| | | |
| | | public void setParentValue(String parentValue) { |
| | | this.parentValue = parentValue; |
| | | } |
| | | |
| | | public String getLoadType() { |
| | | return loadType; |
| | | } |
| | | |
| | | public void setLoadType(String loadType) { |
| | | this.loadType = loadType; |
| | | } |
| | | |
| | | public boolean isOnlyLeaf() { |
| | | return onlyLeaf; |
| | | } |
| | | |
| | | public void setOnlyLeaf(boolean onlyLeaf) { |
| | | this.onlyLeaf = onlyLeaf; |
| | | } |
| | | |
| | | public String getDisplayTable() { |
| | | return displayTable; |
| | | } |
| | | |
| | | public void setDisplayTable(String displayTable) { |
| | | this.displayTable = displayTable; |
| | | } |
| | | |
| | | public UITableCustomDefineVO getTableConfig() { |
| | | return tableConfig; |
| | | } |
| | | |
| | | public void setTableConfig(UITableCustomDefineVO tableConfig) { |
| | | this.tableConfig = tableConfig; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UIFormReferVO{" + |
| | | "type='" + type + '\'' + |
| | | ", textField='" + textField + '\'' + |
| | | ", valueField='" + valueField + '\'' + |
| | | ", muti=" + muti + |
| | | ", url='" + url + '\'' + |
| | | ", backPath='" + backPath + '\'' + |
| | | ", method='" + method + '\'' + |
| | | ", height=" + height + |
| | | ", referType='" + referType + '\'' + |
| | | ", referContent='" + referContent + '\'' + |
| | | ", parentFieldName='" + parentFieldName + '\'' + |
| | | ", parentValue='" + parentValue + '\'' + |
| | | ", loadType='" + loadType + '\'' + |
| | | ", onlyLeaf=" + onlyLeaf + |
| | | ", useFormKey='" + useFormKey + '\'' + |
| | | ", paramForFormKey='" + paramForFormKey + '\'' + |
| | | ", mapFields='" + mapFields + '\'' + |
| | | ", displayTable='" + displayTable + '\'' + |
| | | ", tableConfig=" + tableConfig + |
| | | ", where=" + where + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | |
| | | //package com.vci.web.pageModel; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è¡¨æ ¼çèªå®ä¹ |
| | | * @author weidy |
| | | * @date 2021/2/25 |
| | | */ |
| | | public class UITableCustomDefineVO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 431728683965836558L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | private String oid; |
| | | |
| | | /** |
| | | * å页ç对象 |
| | | */ |
| | | private UITablePageVO page; |
| | | |
| | | /** |
| | | * æ¾ç¤ºçå |
| | | */ |
| | | private List<UITableFieldVO> cols; |
| | | |
| | | /** |
| | | * æ¥è¯¢çå |
| | | */ |
| | | private List<UITableFieldVO> queryColumns; |
| | | |
| | | public String getOid() { |
| | | return oid; |
| | | } |
| | | |
| | | public void setOid(String oid) { |
| | | this.oid = oid; |
| | | } |
| | | |
| | | public UITablePageVO getPage() { |
| | | return page; |
| | | } |
| | | |
| | | public void setPage(UITablePageVO page) { |
| | | this.page = page; |
| | | } |
| | | |
| | | public List<UITableFieldVO> getCols() { |
| | | return cols; |
| | | } |
| | | |
| | | public void setCols(List<UITableFieldVO> cols) { |
| | | this.cols = cols; |
| | | } |
| | | |
| | | public List<UITableFieldVO> getQueryColumns() { |
| | | return queryColumns; |
| | | } |
| | | |
| | | public void setQueryColumns(List<UITableFieldVO> queryColumns) { |
| | | this.queryColumns = queryColumns; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UITableCustomDefineVO{" + |
| | | "oid='" + oid + '\'' + |
| | | ", page=" + page + |
| | | ", cols=" + cols + |
| | | ", queryColumns=" + queryColumns + |
| | | '}'; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | //package com.vci.web.pageModel; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å表çåçä¿¡æ¯ |
| | | * @author weidy |
| | | * @date 2021/2/25 |
| | | */ |
| | | public class UITableFieldVO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * åå |
| | | */ |
| | | private String field; |
| | | |
| | | /** |
| | | * æ¾ç¤ºçåç§° |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * åæ®µç±»å |
| | | */ |
| | | private String fieldType; |
| | | |
| | | /** |
| | | * æ¯å¦æåº |
| | | */ |
| | | private boolean sort = false; |
| | | |
| | | /** |
| | | * æåºå段 |
| | | */ |
| | | private String sortField ; |
| | | |
| | | /** |
| | | * éèçåæ®µ |
| | | */ |
| | | private boolean hidden = false; |
| | | |
| | | /** |
| | | * 宽度 |
| | | */ |
| | | private Integer width; |
| | | |
| | | /** |
| | | * æå°ç宽度 |
| | | */ |
| | | private Integer minWidth; |
| | | |
| | | /** |
| | | * åºå®ä½ç½®ï¼æ¯ærightåleft |
| | | */ |
| | | private String fixed; |
| | | |
| | | /** |
| | | * æå çå |
| | | */ |
| | | private Integer colspan = 1; |
| | | |
| | | /** |
| | | * æç«çè¡ |
| | | */ |
| | | private Integer rowspan = 1; |
| | | |
| | | /** |
| | | * 模æ¿ççå
容 |
| | | */ |
| | | private String templet; |
| | | |
| | | /** |
| | | * æ¶é´æ ¼å¼ |
| | | */ |
| | | private String dateFormate; |
| | | |
| | | /** |
| | | * æ¯å¦æä½å |
| | | */ |
| | | private boolean optionField = false; |
| | | |
| | | /** |
| | | * æä½åå
å«çæé® |
| | | */ |
| | | private List<KeyValue> optionButtons; |
| | | |
| | | /** |
| | | * äºä»¶-æ§è¡jsçæ å° |
| | | */ |
| | | private Map<String,String> optionJsMap; |
| | | |
| | | /** |
| | | * æ¯å¦ç¼è¾ |
| | | */ |
| | | private String edit; |
| | | |
| | | /** |
| | | * ç¼è¾çé
ç½® |
| | | */ |
| | | private String editConfig ; |
| | | |
| | | /** |
| | | * 坹齿¹å¼ |
| | | */ |
| | | private String align = "left"; |
| | | |
| | | /** |
| | | * ç¹æ®æ ·å¼ |
| | | */ |
| | | private String style; |
| | | |
| | | /** |
| | | * åå
æ ¼ç¹å»äºä»¶ |
| | | */ |
| | | private String event; |
| | | |
| | | /** |
| | | * ç¦ç¨ææ½å宽 |
| | | */ |
| | | private boolean unresize = false; |
| | | |
| | | /** |
| | | * 䏿èåçåç§° |
| | | */ |
| | | private String comboxKey; |
| | | |
| | | /** |
| | | * 䏿èåçéé¡¹å¼ |
| | | */ |
| | | private List<KeyValue> data = new ArrayList<>(); |
| | | |
| | | /** |
| | | * åç
§æ¾ç¤ºçåæ®µ |
| | | */ |
| | | private String showField; |
| | | |
| | | /** |
| | | * æ¥è¯¢çåæ®µ |
| | | */ |
| | | private String queryField; |
| | | |
| | | /** |
| | | * åç
§çä¿¡æ¯ |
| | | */ |
| | | private UIFormReferVO referConfig; |
| | | |
| | | public Map<String, String> getOptionJsMap() { |
| | | return optionJsMap; |
| | | } |
| | | |
| | | public void setOptionJsMap(Map<String, String> optionJsMap) { |
| | | this.optionJsMap = optionJsMap; |
| | | } |
| | | |
| | | public String getFieldType() { |
| | | return fieldType; |
| | | } |
| | | |
| | | public void setFieldType(String fieldType) { |
| | | this.fieldType = fieldType; |
| | | } |
| | | |
| | | public String getDateFormate() { |
| | | return dateFormate; |
| | | } |
| | | |
| | | public void setDateFormate(String dateFormate) { |
| | | this.dateFormate = dateFormate; |
| | | } |
| | | |
| | | public String getField() { |
| | | return field; |
| | | } |
| | | |
| | | public void setField(String field) { |
| | | this.field = field; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public boolean isSort() { |
| | | return sort; |
| | | } |
| | | |
| | | public void setSort(boolean sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | public String getSortField() { |
| | | return sortField; |
| | | } |
| | | |
| | | public void setSortField(String sortField) { |
| | | this.sortField = sortField; |
| | | } |
| | | |
| | | public boolean isHidden() { |
| | | return hidden; |
| | | } |
| | | |
| | | public void setHidden(boolean hidden) { |
| | | this.hidden = hidden; |
| | | } |
| | | |
| | | public Integer getWidth() { |
| | | return width; |
| | | } |
| | | |
| | | public void setWidth(Integer width) { |
| | | this.width = width; |
| | | } |
| | | |
| | | public Integer getMinWidth() { |
| | | return minWidth; |
| | | } |
| | | |
| | | public void setMinWidth(Integer minWidth) { |
| | | this.minWidth = minWidth; |
| | | } |
| | | |
| | | public String getFixed() { |
| | | return fixed; |
| | | } |
| | | |
| | | public void setFixed(String fixed) { |
| | | this.fixed = fixed; |
| | | } |
| | | |
| | | public Integer getColspan() { |
| | | return colspan; |
| | | } |
| | | |
| | | public void setColspan(Integer colspan) { |
| | | this.colspan = colspan; |
| | | } |
| | | |
| | | public Integer getRowspan() { |
| | | return rowspan; |
| | | } |
| | | |
| | | public void setRowspan(Integer rowspan) { |
| | | this.rowspan = rowspan; |
| | | } |
| | | |
| | | public String getTemplet() { |
| | | return templet; |
| | | } |
| | | |
| | | public void setTemplet(String templet) { |
| | | this.templet = templet; |
| | | } |
| | | |
| | | public boolean isOptionField() { |
| | | return optionField; |
| | | } |
| | | |
| | | public void setOptionField(boolean optionField) { |
| | | this.optionField = optionField; |
| | | } |
| | | |
| | | public List<KeyValue> getOptionButtons() { |
| | | return optionButtons; |
| | | } |
| | | |
| | | public void setOptionButtons(List<KeyValue> optionButtons) { |
| | | this.optionButtons = optionButtons; |
| | | } |
| | | |
| | | public String getEdit() { |
| | | return edit; |
| | | } |
| | | |
| | | public void setEdit(String edit) { |
| | | this.edit = edit; |
| | | } |
| | | |
| | | public String getEditConfig() { |
| | | return editConfig; |
| | | } |
| | | |
| | | public void setEditConfig(String editConfig) { |
| | | this.editConfig = editConfig; |
| | | } |
| | | |
| | | public String getAlign() { |
| | | return align; |
| | | } |
| | | |
| | | public void setAlign(String align) { |
| | | this.align = align; |
| | | } |
| | | |
| | | public String getStyle() { |
| | | return style; |
| | | } |
| | | |
| | | public void setStyle(String style) { |
| | | this.style = style; |
| | | } |
| | | |
| | | public String getEvent() { |
| | | return event; |
| | | } |
| | | |
| | | public void setEvent(String event) { |
| | | this.event = event; |
| | | } |
| | | |
| | | public boolean isUnresize() { |
| | | return unresize; |
| | | } |
| | | |
| | | public void setUnresize(boolean unresize) { |
| | | this.unresize = unresize; |
| | | } |
| | | |
| | | public String getComboxKey() { |
| | | return comboxKey; |
| | | } |
| | | |
| | | public void setComboxKey(String comboxKey) { |
| | | this.comboxKey = comboxKey; |
| | | } |
| | | |
| | | public List<KeyValue> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(List<KeyValue> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public String getShowField() { |
| | | return showField; |
| | | } |
| | | |
| | | public void setShowField(String showField) { |
| | | this.showField = showField; |
| | | } |
| | | |
| | | public UIFormReferVO getReferConfig() { |
| | | return referConfig; |
| | | } |
| | | |
| | | public void setReferConfig(UIFormReferVO referConfig) { |
| | | this.referConfig = referConfig; |
| | | } |
| | | |
| | | public String getQueryField() { |
| | | return queryField; |
| | | } |
| | | |
| | | public void setQueryField(String queryField) { |
| | | this.queryField = queryField; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UITableFieldVO{" + |
| | | "field='" + field + '\'' + |
| | | ", title='" + title + '\'' + |
| | | ", fieldType='" + fieldType + '\'' + |
| | | ", sort=" + sort + |
| | | ", sortField='" + sortField + '\'' + |
| | | ", hidden=" + hidden + |
| | | ", width=" + width + |
| | | ", minWidth=" + minWidth + |
| | | ", fixed='" + fixed + '\'' + |
| | | ", colspan=" + colspan + |
| | | ", rowspan=" + rowspan + |
| | | ", templet='" + templet + '\'' + |
| | | ", dateFormate='" + dateFormate + '\'' + |
| | | ", optionField=" + optionField + |
| | | ", optionButtons=" + optionButtons + |
| | | ", optionJsMap=" + optionJsMap + |
| | | ", edit='" + edit + '\'' + |
| | | ", editConfig='" + editConfig + '\'' + |
| | | ", align='" + align + '\'' + |
| | | ", style='" + style + '\'' + |
| | | ", event='" + event + '\'' + |
| | | ", unresize=" + unresize + |
| | | ", comboxKey='" + comboxKey + '\'' + |
| | | ", data=" + data + |
| | | ", showField='" + showField + '\'' + |
| | | ", queryField='" + queryField + '\'' + |
| | | ", referConfig=" + referConfig + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.pagemodel; |
| | | |
| | | //package com.vci.web.pageModel; |
| | | |
| | | /** |
| | | * è¡¨æ ¼çå页对象 |
| | | * @author weidy |
| | | * @date 2021/2/25 |
| | | */ |
| | | public class UITablePageVO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = -6338518925812603615L; |
| | | /** |
| | | * æ¯é¡µæ¾ç¤ºæ°é |
| | | */ |
| | | private Integer limit = -1; |
| | | |
| | | /** |
| | | * å½åé¡µæ° |
| | | */ |
| | | private Integer page = 1; |
| | | |
| | | public Integer getLimit() { |
| | | return limit; |
| | | } |
| | | |
| | | public void setLimit(Integer limit) { |
| | | this.limit = limit; |
| | | } |
| | | |
| | | public Integer getPage() { |
| | | return page; |
| | | } |
| | | |
| | | public void setPage(Integer page) { |
| | | this.page = page; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UITablePageVO{" + |
| | | "limit=" + limit + |
| | | ", page=" + page + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.com.vci.starter.util.VciBaseUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.enumpck.UserSecretEnum; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.SessionInfo; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | |
| | | public interface VciSecretServiceI { |
| | | |
| | |
| | | // |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.com.vci.starter.util.VciBaseUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class VciBaseUtil { |
| | | |
| | | private static Logger log = LoggerFactory.getLogger(VciBaseUtil.class); |
| | | public static final String NOTIN = "not in"; |
| | | private static String localIp = null; |
| | |
| | | |
| | | public static String getPk() { |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | public static SessionInfo getCurrentUserSessionInfo() throws VciBaseException { |
| | | SessionInfo si = getCurrentUserSessionInfoNotException(); |
| | | if (si == null) { |
| | | throw new VciBaseException("noLogin", new String[]{"没æå½åç¨æ·ä¿¡æ¯"}); |
| | | } else { |
| | | return si; |
| | | } |
| | | } |
| | | |
| | | public static int getIntForBoolean(boolean b) { |
| | |
| | | return listHasList; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | // |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.com.vci.starter.util.VciBaseUtil; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.ParseException; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.util; |
| | | |
| | | //package com.vci.web.util; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.SessionInfo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.beans.IntrospectionException; |
| | | import java.beans.PropertyDescriptor; |
| | | import java.lang.reflect.*; |
| | | import java.math.BigDecimal; |
| | | import java.net.InetAddress; |
| | | import java.net.NetworkInterface; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * éç¨å·¥å
·ç±» |
| | | * @author weidy |
| | | * @date 2021-2-13 |
| | | */ |
| | | @Component |
| | | public class WebUtil extends VciBaseUtil { |
| | | |
| | | /** |
| | | * å
¨é¨æ è®°ï¼å¸¸ç¨è¯æ å½¢å±ç¤ºæ¶ |
| | | */ |
| | | public static final String ALL = "${all}"; |
| | | |
| | | /** |
| | | * æ¯å¦æä¹
å |
| | | */ |
| | | private static ThreadLocal<String> needPersistenceInThread = new ThreadLocal<>(); |
| | | /** |
| | | * æ¥å¿å¯¹è±¡ |
| | | */ |
| | | private static Logger logger = LoggerFactory.getLogger(WebUtil.class); |
| | | |
| | | /** |
| | | * jsonå符串转为对象 |
| | | * @param jsonString jsonçå符串 |
| | | * @param beanClass beançç±» |
| | | * @return bean |
| | | */ |
| | | public static <T> T jsonString2JavaBean(String jsonString,Class<T> beanClass){ |
| | | return (T)JSONObject.parseObject(jsonString, beanClass); |
| | | } |
| | | |
| | | /** |
| | | * ä»jsonå符串ä¸è·å第ä¸ä¸ªå¯¹è±¡ |
| | | * @param jsonString jsonçå符串 |
| | | * @param beanClass Beançç±» |
| | | * @return ä»å表éè·å第ä¸ä¸ªå¯¹è±¡ |
| | | */ |
| | | public static <T> T getFirstObjectFromJson(String jsonString,Class<T> beanClass){ |
| | | if(!isNull(jsonString)) { |
| | | return JSONObject.parseArray(jsonString, beanClass).get(0); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åsessionInfo对象 |
| | | * @return è·åå½åç¨æ·çä¿¡æ¯ |
| | | */ |
| | | public static SessionInfo getSessionInfo(){ |
| | | try{ |
| | | return getCurrentUserSessionInfoNotException(); |
| | | }catch(Exception e){ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åå½å线ç¨ä¸çç¨æ·å¯¹è±¡ |
| | | * @return å½åç¨æ·ä¿¡æ¯ |
| | | * @throws VciBaseException 没æç»å½ä¼æåºå¼å¸¸ |
| | | */ |
| | | public static SessionInfo getCurrentUserSessionInfo() throws VciBaseException{ |
| | | SessionInfo si= getCurrentUserSessionInfoNotException(); |
| | | if(si==null){ |
| | | throw new VciBaseException("noLogin",new String[]{"没æå½åç¨æ·ä¿¡æ¯"}); |
| | | } |
| | | return si; |
| | | } |
| | | |
| | | /** |
| | | * è·åå½å线ç¨ä¸çç¨æ·å¯¹è±¡ |
| | | * @return ç¨æ·å¯¹è±¡ï¼ä½æ¯ä¸æåºå¼å¸¸ |
| | | */ |
| | | public static SessionInfo getCurrentUserSessionInfoNotException() { |
| | | return WebThreadLocalUtil.getCurrentUserSessionInfoInThread().get(); |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ç¨æ·çä¼è¯ä¿¡æ¯å¯¹è±¡ |
| | | * @param sessionInfo ä¼è¯ä¿¡æ¯ |
| | | */ |
| | | public static synchronized void setSessionInfo(SessionInfo sessionInfo){ |
| | | WebThreadLocalUtil.getCurrentUserSessionInfoInThread().set(sessionInfo); |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦è®¾ç½®äºcorbaéè¦ä½¿ç¨çä¸ä¸æä¿¡æ¯ï¼åªé对webServiceç |
| | | */ |
| | | private static volatile boolean isSetContext = false; |
| | | |
| | | /** |
| | | * è·åIPå°åï¼éè¿request |
| | | * @param request 请æ±ç对象 |
| | | * @return ipå°å |
| | | */ |
| | | public static String getClientInfo(HttpServletRequest request){ |
| | | String ip = request.getHeader("X-Forwarded-For"); |
| | | if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("Proxy-Client-IP"); |
| | | } |
| | | if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("WL-Proxy-Client-IP"); |
| | | } |
| | | if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_CLIENT_IP"); |
| | | } |
| | | if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); |
| | | } |
| | | if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getRemoteAddr(); |
| | | } |
| | | if (StringUtils.isBlank(ip) || ip.indexOf("0:0:0:0:0:0:0:1") >-1) {//0:0:0:0:0:0:0:1æ¯æ¬æºå¨è®¿é® |
| | | ip = "127.0.0.1"; |
| | | } |
| | | return ip; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¯å¦æä¹
å |
| | | * @param isPersistence æ¯å¦æä¹
å |
| | | */ |
| | | public static void setPersistence(boolean isPersistence){ |
| | | if(!isPersistence){ |
| | | needPersistenceInThread.set("false"); |
| | | }else{ |
| | | needPersistenceInThread.set(""); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å°å¯¹è±¡è½¬æ¢ä¸ºåç¬¦ä¸²åºæ¥ |
| | | * @return jsonå符串 |
| | | */ |
| | | public static String getJSONStringWithDateFormat(Object obj){ |
| | | return JSONObject.toJSONStringWithDateFormat(obj, VciDateUtil.DateTimeMillFormat, SerializerFeature.WriteDateUseDateFormat); |
| | | } |
| | | |
| | | /** |
| | | * ææ°è½¬æ¢ä¸ºmap |
| | | * @param o 对象 |
| | | * @return map |
| | | */ |
| | | public static Map<String,Object> objectToMap(Object o){ |
| | | Map<String,Object> map = new HashMap<String,Object>(); |
| | | if(o!=null) { |
| | | String jsonString = JSONObject.toJSONStringWithDateFormat(o, VciDateUtil.DateTimeMillFormat, SerializerFeature.WriteDateUseDateFormat); |
| | | if(StringUtils.isNotBlank(jsonString)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if(jsonObject!=null){ |
| | | for(String key : jsonObject.keySet()){ |
| | | map.put(key,jsonObject.get(key)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 对象转æ¢ä¸ºmap |
| | | * @param o 对象 |
| | | * @return map |
| | | */ |
| | | public static Map<String,String> objectToMapString(Object o){ |
| | | Map<String,String> map = new HashMap<String,String>(); |
| | | if(o!=null) { |
| | | String jsonString = JSONObject.toJSONStringWithDateFormat(o, VciDateUtil.DateTimeMillFormat, SerializerFeature.WriteDateUseDateFormat); |
| | | if(StringUtils.isNotBlank(jsonString)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if(jsonObject!=null){ |
| | | for(String key : jsonObject.keySet()){ |
| | | map.put(key,jsonObject.getString(key)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 夿æä¸ªå±æ§æ¯å¦ä¸ºç©º |
| | | * @param obj 对象 |
| | | * @param f åæ®µ |
| | | * @return trueæ¯ä¸ç©º |
| | | */ |
| | | public static boolean isNotNullForField(Object obj,Field f){ |
| | | if(!"serialVersionUID".equalsIgnoreCase(f.getName()) &&!"DEFAULT_INITIAL_CAPACITY".equalsIgnoreCase(f.getName())&&null!=obj && !WebUtil.isNullOrNullString(obj.toString())) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ°ç»è½¬æ¢ä¸ºå符串 |
| | | * @param array æ°ç» |
| | | * @return å符串 |
| | | */ |
| | | public static String array2String(String[] array) { |
| | | if(null == array || array.length == 0) { |
| | | return ""; |
| | | }else{ |
| | | return Arrays.stream(array).collect(Collectors.joining(",")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 对象转æ¢ä¸ºå符串 |
| | | * @param obj 对象 |
| | | * @return å符串 |
| | | */ |
| | | public static String getString(Object obj){ |
| | | if(obj == null) { |
| | | return ""; |
| | | } |
| | | if(obj instanceof Date) { |
| | | return VciDateUtil.date2Str((Date) obj, VciDateUtil.DateTimeFormat); |
| | | } |
| | | return String.valueOf(obj); |
| | | } |
| | | |
| | | /** |
| | | * æ·è´mapéçå¼ |
| | | * @param source æº |
| | | * @param target ç®æ |
| | | * @param copyField æ·è´ç屿§ |
| | | */ |
| | | public static void copyValueForMap(Map source,Map target,String[] copyField){ |
| | | Map<String,String> copyFieldMap = new HashMap<String,String>(); |
| | | for(String field : copyField) { |
| | | copyFieldMap.put(field, field); |
| | | } |
| | | copyValueForMap(source,target,copyFieldMap); |
| | | } |
| | | /** |
| | | * 为mapæ·è´å¼ |
| | | * @param source æº |
| | | * @param target ç®æ |
| | | * @param copyField keyä¸ºç®æ 对象éçåæ®µï¼ |
| | | */ |
| | | public static void copyValueForMap(Map source,Map target,Map<String,String> copyField){ |
| | | try{ |
| | | Iterator<String> it = copyField.keySet().iterator(); |
| | | while(it.hasNext()){ |
| | | String field = it.next(); |
| | | target.put(field, source.get(copyField.get(field))); |
| | | } |
| | | }catch(Exception e){ |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("æ·è´å¼å°map",e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä»Mapéè·ådoubleç±»å |
| | | * @param field åæ®µåç§° |
| | | * @param record map |
| | | * @return 屿§ |
| | | */ |
| | | public static Double getDoubleFromMap(String field, |
| | | Map<String, Object> record) { |
| | | if(WebUtil.isNullOrNullString(field) || record == null || !record.containsKey(field)) { |
| | | return null; |
| | | }else{ |
| | | Object v = record.get(field); |
| | | if(v instanceof BigDecimal){ |
| | | return ((BigDecimal)v).doubleValue(); |
| | | }else if(v instanceof Double){ |
| | | return ((Double)v).doubleValue(); |
| | | }else{ |
| | | return WebUtil.getDouble((String)v); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·å䏿¯ç©ºå¼çæ å°ï¼ä¸keyæ¯å°å |
| | | * @param map æ å° |
| | | * @return å»é¤ç©ºå¼ç |
| | | */ |
| | | public static Map getNotNullMap(Map map){ |
| | | if(map == null){ |
| | | return new HashMap(); |
| | | } |
| | | Iterator it = map.keySet().iterator(); |
| | | Map unNullMap = new HashMap(); |
| | | while(it.hasNext()){ |
| | | Object key = it.next(); |
| | | String newKey = key.toString().toLowerCase(); |
| | | Object value = map.get(key); |
| | | if(value !=null){ |
| | | if(value instanceof String && WebUtil.isNotNull(value.toString())){ |
| | | unNullMap.put(newKey, value); |
| | | }else if(!(value instanceof String)){ |
| | | unNullMap.put(newKey, value); |
| | | } |
| | | } |
| | | } |
| | | return unNullMap; |
| | | } |
| | | |
| | | /** |
| | | * è·åéåçå
ç´ ç±»å |
| | | * @param field 屿§ |
| | | * @return å
ç´ ç±»å, 䏿¯éåçæ¶åè¿åNull |
| | | */ |
| | | public static Class getCollectionElementClass(Field field) throws VciBaseException{ |
| | | Class fieldClass = null; |
| | | if(field == null){ |
| | | return null; |
| | | } |
| | | if(field.getType().isAssignableFrom(List.class) || |
| | | field.getType().isAssignableFrom(Set.class) || |
| | | field.getType().isAssignableFrom(Vector.class)){ |
| | | Type fc = field.getGenericType(); |
| | | if(fc instanceof ParameterizedType){ |
| | | ParameterizedType pt = (ParameterizedType)fc; |
| | | fieldClass= (Class)pt.getActualTypeArguments()[0]; |
| | | } |
| | | } |
| | | return fieldClass; |
| | | } |
| | | |
| | | /** |
| | | * è·å对象ä¸çææå±æ§ï¼å
æ¬å
¶ç»§æ¿ç屿§ |
| | | * @param c 对象 |
| | | * @return ææç屿§ |
| | | */ |
| | | public static List<Field> getAllFieldForObj(Class c){ |
| | | List<Field> allField = new ArrayList<Field>(); |
| | | for(Class<?> classz = c ; classz != Object.class ; classz = classz.getSuperclass() ){ |
| | | Field[] thisClassField = classz.getDeclaredFields(); |
| | | for(Field field : thisClassField){ |
| | | if(!field.getName().equals("serialVersionUID")){ |
| | | if(!allField.contains(field)){ |
| | | allField.add(field); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return allField; |
| | | } |
| | | |
| | | /** |
| | | * è·åtsçåæ®µ |
| | | * @param c 对象æå±çç±» |
| | | * @return æ¶é´æ³ç对象 |
| | | */ |
| | | public static Field getTsField(Class c){ |
| | | List<Field> allField = getAllFieldForObj(c); |
| | | if(allField!=null&&allField.size()>0){ |
| | | for(Field field : allField){ |
| | | if(field.getName().equals("ts")){ |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·ååæ®µ |
| | | * @param field åæ®µçåç§° |
| | | * @param obj 对象 |
| | | * @return åæ®µå¯¹è±¡ |
| | | */ |
| | | public static Field getFieldForObject(String field,Object obj){ |
| | | if(obj == null){ |
| | | return null; |
| | | } |
| | | return getFieldForObject(field,obj.getClass()); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·ååæ®µ |
| | | * @param fieldName åæ®µçåç§° |
| | | * @param c 对象类å |
| | | * @return åæ®µå¯¹è±¡ |
| | | */ |
| | | public static Field getFieldForObject(String fieldName,Class c){ |
| | | List<Field> allField = getAllFieldForObj(c); |
| | | if(allField!=null&&allField.size()>0){ |
| | | for(Field field : allField){ |
| | | if(field.getName().toLowerCase().equalsIgnoreCase(fieldName.toLowerCase())){ |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ®µçsetter |
| | | * @param c 对象类 |
| | | * @param field åæ®µ |
| | | * @return æ¹æ³ |
| | | */ |
| | | public static Method getSetmethod(Class c,Field field){ |
| | | return getSetmethod(c,field.getName()); |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ®µçsetter |
| | | * @param c 对象类å |
| | | * @param fieldName åæ®µåç§° |
| | | * @return æ¹æ³ |
| | | */ |
| | | public static Method getSetmethod(Class c,String fieldName){ |
| | | if(c!=null&&isNotNull(fieldName)){ |
| | | try { |
| | | PropertyDescriptor pd = new PropertyDescriptor(fieldName, c); |
| | | return pd.getWriteMethod(); |
| | | } catch (SecurityException e) { |
| | | } catch (IntrospectionException e) { |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ®µçgetter |
| | | * @param c 对象类å |
| | | * @param fieldName åæ®µåç§° |
| | | * @return æ¹æ³ |
| | | */ |
| | | public static Method getGetmethod(Class c,String fieldName){ |
| | | if(c!=null&&isNotNull(fieldName)){ |
| | | try { |
| | | PropertyDescriptor pd = new PropertyDescriptor(fieldName, c); |
| | | return pd.getReadMethod(); |
| | | } catch (SecurityException e) { |
| | | } catch (IntrospectionException e) { |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ®µçgetter |
| | | * @param c 对象类å |
| | | * @param field åæ®µ |
| | | * @return æ¹æ³ |
| | | */ |
| | | public static Method getGetmethod(Class c,Field field){ |
| | | return getGetmethod(c,field.getName()); |
| | | } |
| | | |
| | | /** |
| | | * è·å对象转æ¢å符串 |
| | | * @param obj 对象 |
| | | * @return å符串 |
| | | */ |
| | | public static String getStringValueFromObject(Object obj){ |
| | | if(obj == null){ |
| | | return ""; |
| | | }else{ |
| | | if(obj instanceof Integer || obj instanceof Float || obj instanceof Long || obj instanceof Double){ |
| | | return String.valueOf(obj); |
| | | }else if(obj instanceof Date){ |
| | | return VciDateUtil.date2Str((Date)obj, VciDateUtil.DateTimeMillFormat); |
| | | }else{ |
| | | return obj.toString(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 为对象èµå¼ï¼ä¸å¤æç±»åï¼å±æ§æ¯ä»ä¹ç±»åçï¼valueå°±å¿
é¡»æ¯ä»ä¹ç±»å |
| | | * @param fieldName 屿§åç§° |
| | | * @param targetObject 对象 |
| | | * @param value 屿§å¼ |
| | | */ |
| | | public static void setValueToField(String fieldName,Object targetObject,Object value){ |
| | | if(isNotNull(fieldName)){ |
| | | Method setMethod = getSetmethod(targetObject.getClass(), fieldName); |
| | | try { |
| | | if(setMethod != null){ |
| | | setMethod.invoke(targetObject, value); |
| | | }else{ |
| | | Field field = getFieldForObject(fieldName, targetObject); |
| | | if(field !=null){ |
| | | field.setAccessible(true); |
| | | field.set(targetObject, value); |
| | | } |
| | | } |
| | | } catch (IllegalArgumentException e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("WebUtil.setValueToField",e); |
| | | } |
| | | } catch (IllegalAccessException e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("WebUtil.setValueToField",e); |
| | | } |
| | | } catch (InvocationTargetException e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("WebUtil.setValueToField",e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä»å¯¹è±¡ä¸è·å屿§çå¼ |
| | | * @param fieldName 屿§å |
| | | * @param sourceObject 对象 |
| | | * @return å¼ |
| | | */ |
| | | public static Object getValueFromField(String fieldName,Object sourceObject){ |
| | | if(isNotNull(fieldName)){ |
| | | try { |
| | | Method getMethod = getGetmethod(sourceObject.getClass(), fieldName); |
| | | if(getMethod !=null){ |
| | | return getMethod.invoke(sourceObject); |
| | | }else{ |
| | | //è¯´ææ²¡æè®¾ç½®getterï¼æ¯å¦BOåLO对象è¿ç§ |
| | | Field field = getFieldForObject(fieldName, sourceObject); |
| | | if(field !=null){ |
| | | field.setAccessible(true); |
| | | return field.get(sourceObject); |
| | | } |
| | | } |
| | | } catch (SecurityException e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("WebUtil.getValueFromField",e); |
| | | } |
| | | } catch (IllegalAccessException e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("WebUtil.getValueFromField",e); |
| | | } |
| | | } catch (IllegalArgumentException e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("WebUtil.getValueFromField",e); |
| | | } |
| | | } catch (InvocationTargetException e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("WebUtil.getValueFromField",e); |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºæ®éç屿§ |
| | | * @param attrName 屿§çåå |
| | | * @return true |
| | | */ |
| | | public static boolean isNormalAttr(String attrName){ |
| | | attrName = attrName.toLowerCase(); |
| | | if(attrName.indexOf(".")<0 && attrName.indexOf("_")<0 && !attrName.equalsIgnoreCase("lcstatustext")){ |
| | | return true; |
| | | }else{ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å°whereSqléçå
容转åå°æ¥è¯¢mapé |
| | | * @param whereSql sql转æ¢ä¸ºmap |
| | | * @return map |
| | | */ |
| | | public static Map<String,String> whereSql2Map( |
| | | String whereSql) { |
| | | Map<String,String> map = new HashMap<String, String>(); |
| | | if(isNotNull(whereSql)){ |
| | | String[] selects = whereSql.split("and"); |
| | | if(selects!=null&&selects.length>0){ |
| | | for(String s : selects){ |
| | | s = s.trim(); |
| | | map.put(s.substring(0,s.indexOf(" ")).trim(), s.substring(s.indexOf(" ") +1).trim()); |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * æ¬æºçip |
| | | */ |
| | | private static String localIp = null; |
| | | |
| | | /** |
| | | * è·åæ¬æºå°åï¼ä¸æ¯å®¢æ·ç«¯çµèçip,æ¯å½åæå¡æå¨çip |
| | | * @return |
| | | */ |
| | | public static String getLocalIp(){ |
| | | if(localIp == null){ |
| | | try { |
| | | InetAddress inetAddress = getLocalHostLANAddress(); |
| | | if (inetAddress == null) { |
| | | localIp = "127.0.0.1"; |
| | | } else { |
| | | localIp = inetAddress.getHostAddress(); |
| | | } |
| | | }catch (Exception e){ |
| | | localIp = "127.0.0.1"; |
| | | } |
| | | } |
| | | return localIp; |
| | | } |
| | | |
| | | /** |
| | | * ä»ç½ç»æ¥å£ä¸è·åipå°å |
| | | * @return ipå°å |
| | | */ |
| | | private static InetAddress getLocalHostLANAddress(){ |
| | | try { |
| | | InetAddress candidateAddress = null; |
| | | // éåææçç½ç»æ¥å£ |
| | | for (Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces.hasMoreElements(); ) { |
| | | NetworkInterface iface = (NetworkInterface) ifaces.nextElement(); |
| | | // 卿æçæ¥å£ä¸åéåIP |
| | | for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements(); ) { |
| | | InetAddress inetAddr = (InetAddress) inetAddrs.nextElement(); |
| | | if (!inetAddr.isLoopbackAddress()) {// æé¤loopbackç±»åå°å |
| | | if (inetAddr.isSiteLocalAddress()) { |
| | | // 妿æ¯site-localå°åï¼å°±æ¯å®äº |
| | | return inetAddr; |
| | | } else if (candidateAddress == null) { |
| | | // site-localç±»åçå°åæªè¢«åç°ï¼å
è®°å½åéå°å |
| | | candidateAddress = inetAddr; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (candidateAddress != null) { |
| | | return candidateAddress; |
| | | } |
| | | // å¦ææ²¡æåç° non-loopbackå°å.åªè½ç¨ææ¬¡éçæ¹æ¡ |
| | | InetAddress jdkSuppliedAddress = InetAddress.getLocalHost(); |
| | | return jdkSuppliedAddress; |
| | | } catch (Exception e) { |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("è·åæ¬æºip",e); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * oracle in æ¥è¯¢ä¸è½è¶
è¿1000ï¼è½¬æ¢ä¸ä¸éå |
| | | * ç±äºSQLè¯å¥1000个å¯è½å¾é¿ï¼è¶
è¿oracle10gï¼æä»¥çºç²æ§è½åé
为500个æ°ç» |
| | | * @param list éè¦è½¬æ¢çå表å
容 |
| | | * @return åç»åçlist |
| | | */ |
| | | public static <T> Collection<Collection<T>> switchCollectionForOracleIn(Collection<T> list) { |
| | | return switchCollectionForOracleIn(list,500); |
| | | } |
| | | |
| | | /** |
| | | * 转æ¢éåç大å°ï¼è¿ä¸ªç¨å¨feignè°ç¨çæ¶åï¼ä¸è¦å¨sqlæ¥è¯¢çæ¶åä½¿ç¨ |
| | | * @param collection éè¦è½¬æ¢çå表å
容 |
| | | * @param preSize æ¯ä¸ªåç»çå¤§å° |
| | | * @return åç»åçlist |
| | | */ |
| | | public static <T> Collection<Collection<T>> switchCollectionForOracleIn(Collection<T> collection,int preSize) { |
| | | Collection<Collection<T>> listHasList = new ArrayList<Collection<T>>(); |
| | | if(collection == null){ |
| | | return listHasList; |
| | | } |
| | | List<T> newList = new ArrayList<T>(); |
| | | for(Object obj : collection){ |
| | | //为äºè®©listè¿å¯ä»¥æ·»å å
容ï¼å 为使ç¨subliståï¼listä¸è½åAddäº |
| | | newList.add((T)obj); |
| | | } |
| | | int muti = 1; |
| | | if(newList.size() >preSize){ |
| | | int balance = newList.size()%preSize; |
| | | muti = (newList.size() - balance)/preSize + (balance == 0?0:1); |
| | | } |
| | | for(int i = 0 ; i < muti; i ++){ |
| | | int start = i*preSize; |
| | | int end = start + preSize; |
| | | if(i == muti-1 || end >newList.size() ){ |
| | | end = newList.size(); |
| | | } |
| | | List subList = newList.subList(start,end); |
| | | listHasList.add(subList); |
| | | } |
| | | return listHasList; |
| | | } |
| | | |
| | | } |
| | |
| | | String SAVE_USER_LIST = API_PREFIX + "/save-user-list"; |
| | | String REMOVE_USER = API_PREFIX + "/remove-user"; |
| | | String UPDATE_USER = API_PREFIX+"/update-user"; |
| | | String UPDATE_USER_STRATEGY_STATUS = API_PREFIX+"/update-user_strategy_status"; |
| | | |
| | | /** |
| | | * è·åç¨æ·ä¿¡æ¯ |
| | |
| | | @PostMapping(UPDATE_USER) |
| | | R<Boolean> updateUser(@RequestBody User user); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ·å¯ç çç¥æ¯å¦ä¿®æ¹ç¶æ |
| | | * @param userIds |
| | | * @return |
| | | */ |
| | | @PostMapping(UPDATE_USER_STRATEGY_STATUS) |
| | | R<Boolean> updateStrategyStatus(@RequestParam List<Long> userIds); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.entity.CodeAllCode; |
| | | import com.vci.ubcs.code.service.ICodeAllcodeService; |
| | | import com.vci.ubcs.code.service.ICodeAllCodeService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeAllCodeVO; |
| | | import com.vci.ubcs.code.wrapper.CodeAllcodeWrapper; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-code/CodeAllcode") |
| | | @Api(value = "å
¨é¨ç å¼", tags = "å
¨é¨ç 弿¥å£") |
| | | public class CodeAllcodeController extends BladeController { |
| | | public class CodeAllCodeController extends BladeController { |
| | | |
| | | private final ICodeAllcodeService CodeAllcodeService; |
| | | private final ICodeAllCodeService CodeAllcodeService; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ è¯¦æ
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.dto.CodeBasicSecDTO; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.service.ICodeBasicSecService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.code.wrapper.CodeBasicSecWrapper; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯æ§å¶å¨ |
| | | * |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/codeBasicSecController") |
| | | public class CodeBasicSecController { |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯ æå¡ |
| | | */ |
| | | @Autowired |
| | | private ICodeBasicSecService codeBasicSecService; |
| | | |
| | | /** |
| | | * ç¼ç è§å å页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥codeRuleVO") |
| | | public R<IPage<CodeBasicSecVO>> list(CodeBasicSec codeBasicSec, Query query) { |
| | | IPage<CodeBasicSec> pages = codeBasicSecService.page(Condition.getPage(query), Condition.getQueryWrapper(codeBasicSec)); |
| | | return R.data(CodeBasicSecWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯å表 |
| | | * @param codeBasicSecVO åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºç |
| | | * @return ç æ®µåºç¡ä¿¡æ¯æ¾ç¤ºå¯¹è±¡å表 |
| | | */ |
| | | @GetMapping("/gridCodeBasicSec") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥codeRuleVO") |
| | | public R<IPage<CodeBasicSecVO>> gridCodeBasicSec(CodeBasicSecVO codeBasicSecVO, Query query){ |
| | | IPage<CodeBasicSecVO> codeRuleVOIPage = codeBasicSecService.gridCodeBasicSec(Condition.getPage(query.setAscs("ordernum")),codeBasicSecVO); |
| | | return R.data(codeRuleVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * å¢å ç æ®µåºç¡ä¿¡æ¯ |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å¢å ", notes = "codeBasicSecDTO") |
| | | public R addSave(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ |
| | | boolean resBoolean = false; |
| | | try { |
| | | resBoolean = codeBasicSecService.addSave(codeBasicSecDTO); |
| | | } catch (VciBaseException e) { |
| | | return R.fail(e.getCode()); |
| | | } |
| | | return R.data(resBoolean); |
| | | } |
| | | |
| | | /* *//** |
| | | * ä¿®æ¹ ç æ®µåºç¡ä¿¡æ¯ |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | *//* |
| | | @PutMapping("/editSave") |
| | | public R<CodeBasicSecVO> editSave(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ |
| | | CodeBasicSecVO codeBasicSecVO = null; |
| | | try { |
| | | codeBasicSecVO = codeBasicSecService.editSave(codeBasicSecDTO); |
| | | } catch (VciBaseException e) { |
| | | return R.fail(e.getCode()); |
| | | } |
| | | return R.success(codeBasicSecVO); |
| | | } |
| | | |
| | | |
| | | *//** |
| | | * å é¤ç 段åºç¡ä¿¡æ¯ |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | *//* |
| | | @DeleteMapping( "/deleteData") |
| | | public R delCodeBasicSec(CodeBasicSecDTO codeBasicSecDTO) { |
| | | return codeBasicSecService.deleteCodeBasicSec(codeBasicSecDTO); |
| | | } |
| | | |
| | | *//** |
| | | * 主é®è·åç æ®µåºç¡ä¿¡æ¯ |
| | | * @param oid ä¸»é® |
| | | * @return ç æ®µåºç¡ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | *//* |
| | | @GetMapping("/getObjectByOid") |
| | | public R<CodeBasicSecVO> getObjectByOid(String oid){ |
| | | CodeBasicSecVO codeBasicSecVO = codeBasicSecService.getObjectByOid(oid); |
| | | return BaseResult.success(codeBasicSecVO); |
| | | } |
| | | |
| | | *//** |
| | | * 䏻鮿¹éè·åç æ®µåºç¡ä¿¡æ¯ |
| | | * @param oids 主é®ï¼å¤ä¸ªä»¥éå·åéï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return ç æ®µåºç¡ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | *//* |
| | | @GetMapping("/listDataByOids") |
| | | public R<CodeBasicSecVO> listCodeBasicSecByOids(String oids){ |
| | | Collection<CodeBasicSecVO> voCollection = codeBasicSecService.listCodeBasicSecByOids(VciBaseUtil.str2List(oids)); |
| | | R baseResult = R.success(); |
| | | baseResult.setData(voCollection); |
| | | return baseResult; |
| | | } |
| | | |
| | | |
| | | |
| | | *//** |
| | | * åç
§ç 段åºç¡ä¿¡æ¯å表 |
| | | * @param baseQueryObject åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºç |
| | | * @return ç æ®µåºç¡ä¿¡æ¯æ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | *//* |
| | | @GetMapping("/refDataGrid") |
| | | public R<IPage<CodeBasicSecVO>> refDataGridCodeBasicSec(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeBasicSecService.refDataGridCodeBasicSec(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | *//** |
| | | * åæ°åç±»ç æ®µåºç¡ä¿¡æ¯å表 |
| | | * @param baseQueryObject åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºçï¼å¿
é¡»è¦æç¼ç è§åçä¸»é® pkCodeRule |
| | | * @return ç æ®µçä¿¡æ¯ |
| | | *//* |
| | | @GetMapping("/refDataGridClassifySec") |
| | | public R<IPage<CodeBasicSecVO>> refDataGridClassifySec(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeBasicSecService.refDataGridClassifySec(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | *//** |
| | | * å
éç æ®µä¿¡æ¯ |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ï¼oidArrï¼éæ©æºç 段主é®çéåï¼pkCodeRuleï¼ç®æ ç¼ç è§åçä¸»é® |
| | | * @return å
éç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | *//* |
| | | @PostMapping("/clone") |
| | | public R cloneCodeBasicSec(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO.getOidArr(),"éæ©ç æ®µä¸»é®"); |
| | | List<String> oidArr = VciBaseUtil.str2List(codeBasicSecDTO.getOidArr()); |
| | | if (CollectionUtils.isEmpty(oidArr)){ |
| | | return R.fail("éæ©ç æ®µä¸»é®ä¸è½ä¸ºç©º"); |
| | | } |
| | | return codeBasicSecService.cloneCodeBasicSec(oidArr,codeBasicSecDTO.getPkCodeRule()); |
| | | } |
| | | |
| | | *//** |
| | | * æ¥è¯¢ç®æ åç±»ç æ®µæå¨çæ ç»æ |
| | | * @param oid ç®æ åç±»ç æ®µä¸»é® |
| | | * @return åç±»ç æ®µæ ç»æ |
| | | *//* |
| | | @GetMapping("/treeCodeClassifySec") |
| | | public List<Tree> gridCodeClassifySecTree (String oid){ |
| | | VciBaseUtil.alertNotNull(oid,"åç±»ç æ®µä¸»é®"); |
| | | return codeBasicSecService.gridCodeClassifySecTree(oid); |
| | | } |
| | | |
| | | *//** |
| | | * ä¸ç§» |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | *//* |
| | | @PostMapping("/upOrderNum") |
| | | public R upOrderNum(String oid){ |
| | | codeBasicSecService.upOrderNum(oid); |
| | | return R.success(); |
| | | } |
| | | |
| | | *//** |
| | | * ä¸ç§» |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | *//* |
| | | @PostMapping("/downOrderNum") |
| | | public R downOrderNum(String oid){ |
| | | codeBasicSecService.downOrderNum(oid); |
| | | return R.success(); |
| | | }*/ |
| | | |
| | | } |
| | |
| | | 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.com.vci.starter.web.util.VciBaseUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | 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.util.Collection; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç¼ç è§å æ§å¶å¨ |
| | |
| | | CodeRule detail = codeRuleService.getOne(Condition.getQueryWrapper(codeRule)); |
| | | return R.data(CodeRuleWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç è§å å页 |
| | | */ |
| | |
| | | @GetMapping("/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(CodeRuleVO CodeRule, Query query) { |
| | | IPage<CodeRuleVO> pages = codeRuleService.gridCodeRule(Condition.getPage(query.setDescs("CREATETIME")), CodeRule); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç è§å æ°å¢æä¿®æ¹ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥CodeRule") |
| | | public R submit(@Valid @RequestBody CodeRule codeRule) { |
| | | return R.status(codeRuleService.saveOrUpdate(codeRule)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "å é¤", notes = "ä¼ å
¥codeRuleDTO") |
| | | public R delCodeRule(@Valid @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 CodeRule |
| | | * @param query |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "åç
§ä¸»æ°æ®ç¼ç è§åå表", notes = "ä¼ å
¥oids") |
| | | public R<IPage<CodeRuleVO>> refDataGridCodeRule(CodeRuleVO CodeRule, Query query){ |
| | | return R.data(codeRuleService.refDataGridCodeRule(Condition.getPage(query),CodeRule)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥çä¸»æ°æ®ç¼ç è§åç使ç¨èå´ |
| | | * @param oid ä¸»é® |
| | | * @return 使ç¨èå´ |
| | | */ |
| | | @GetMapping("/listUseRange") |
| | | @ApiOperationSupport(order = 11) |
| | | @ApiOperation(value = "æ¥çä¸»æ°æ®ç¼ç è§åç使ç¨èå´", notes = "ä¼ å
¥oid") |
| | | public R<Collection<CodeClassifyVO>> listUseRange(@Valid @RequestParam String oid){ |
| | | Collection<CodeClassifyVO> voList = codeRuleService.listUseRangeInCodeClassify(oid); |
| | | return R.data(voList); |
| | | } |
| | | |
| | | /** |
| | | * åç¨ä¸å¯ç¨ç¼ç è§å |
| | | * @param map å°è£
åæ°ï¼å
æ¬oid ç¼ç è§åä¸»é® 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åtséè¦ä¼ è¾ |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping("/clone") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "å
éç¼ç è§å", notes = "ä¼ å
¥codeRuleDTO") |
| | | public R cloneCodeRule(@RequestBody CodeRuleDTO codeRuleDTO){ |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.enumpack; |
| | | |
| | | import com.vci.ubcs.code.annotation.BaseEnum; |
| | | import com.vci.ubcs.com.vci.starter.web.enumpck.BaseEnum; |
| | | import com.vci.ubcs.code.constant.MdmEnumIdConstant; |
| | | import com.vci.ubcs.com.vci.starter.annotation.VciEnum; |
| | | |
| | |
| | | package com.vci.ubcs.code.lifecycle; |
| | | |
| | | |
| | | import com.vci.ubcs.code.annotation.BaseEnum; |
| | | import com.vci.ubcs.com.vci.starter.web.enumpck.BaseEnum; |
| | | import com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant; |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param plCodeRule |
| | | * @param codeBasicSecVO |
| | | * @return |
| | | */ |
| | | List<CodeRuleVO> selectPlCodeRulePage(IPage page, CodeRuleVO plCodeRule); |
| | | List<CodeBasicSec> selectCodeBasicSecPage(IPage page, @Param("codeBasicSec") CodeBasicSecVO codeBasicSecVO); |
| | | |
| | | List<CodeBasicSec> countByCondition(Map<String,String> condtions); |
| | | Long countByCondition(@Param("conditionMap") Map<String,String> conditionMap); |
| | | |
| | | } |
| | |
| | | /* |
| | | * 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.mapper; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | |
| | | */ |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeClstemplateEntity; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeClstemplateEntity; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeKeyattrrepeatEntity; |
| | | import com.vci.ubcs.code.vo.CodeKeyattrrepeatVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeKeyattrrepeatEntity; |
| | | import com.vci.ubcs.code.vo.CodeKeyattrrepeatVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeSerialValue; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµæ°´ç弿°æ®æä½å± |
| | | * |
| | | * @author ludc |
| | | * @date 2022-03-01 |
| | | */ |
| | | public interface CodeSerialValueMapper { |
| | | |
| | | |
| | | List<CodeSerialValue> selectByCodeRoleId(@Param("codeRuleOid") String codeRuleOid); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeSynonymEntity; |
| | | import com.vci.ubcs.code.vo.CodeSynonymVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeSynonymEntity; |
| | | import com.vci.ubcs.code.vo.CodeSynonymVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å
Œ
±æ¥è©¢mapper |
| | | * |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface CommonsMapper { |
| | | |
| | | @MapKey("count") |
| | | Map<String,String> selectByCount(@Param("tableName") String tableName,@Param("oid") String oid,@Param("btm") String btm); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | public interface ICodeAllcodeService extends IService<CodeAllCode> { |
| | | public interface ICodeAllCodeService extends IService<CodeAllCode> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.code.dto.CodeBasicSecDTO; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.KeyValue; |
| | | |
| | | /** |
| | | * åºå®ç 段çç 弿塿¥å£ |
| | |
| | | public interface ICodeBasicSecService extends IService<CodeBasicSec> { |
| | | |
| | | /** |
| | | * æ¥è¯¢ææçç æ®µåºç¡ä¿¡æ¯ |
| | | * @param codeBasicSecVO æ¥è¯¢æ¡ä»¶ |
| | | * @param page å页åæåº |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | IPage<CodeBasicSecVO> gridCodeBasicSec(IPage<CodeBasicSecVO> page, CodeBasicSecVO codeBasicSecVO) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼ç è§åæ¹éå é¤ç æ®µåºæ¬ä¿¡æ¯ |
| | | * @param codeRuleOid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | boolean batchDeleteSecByCodeRuleOid(String codeRuleOid); |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段åç±»çç±»å夿屿§æ¯å¦æ¯ç©ºç |
| | | * |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æç©ºçåä¼ key-屿§å value-åæ®µå«ä¹ï¼æ²¡æç©ºçåä¼ key-success value-true |
| | | */ |
| | | KeyValue checkAttrNullableBySecType(CodeBasicSecDTO codeBasicSecDTO); |
| | | |
| | | /** |
| | | * å¢å ç æ®µåºç¡ä¿¡æ¯ |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | boolean addSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException; |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeButtonEntity; |
| | | import com.vci.ubcs.code.vo.CodeButtonVO; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | |
| | | */ |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.entity.CodeClstemplateEntity; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç æå¡ç±» |
| | |
| | | */ |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeKeyattrrepeatEntity; |
| | | import com.vci.ubcs.code.vo.CodeKeyattrrepeatVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.vo.CodeKeyattrrepeatVO; |
| | | |
| | | /** |
| | | * å
³é®å±æ§æ¥éè§å æå¡ç±» |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.code.dto.CodeRuleDTO; |
| | | import com.vci.ubcs.code.entity.CodeRule; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.Collection; |
| | |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param plCodeRule |
| | | * @param codeRule |
| | | * @return |
| | | */ |
| | | IPage<CodeRuleVO> selectPlCodeRulePage(IPage<CodeRuleVO> page, CodeRuleVO plCodeRule); |
| | | IPage<CodeRuleVO> gridCodeRule(IPage<CodeRuleVO> page, CodeRuleVO codeRule); |
| | | |
| | | /** |
| | | * æ ¡éªç¼ç è§åçç¶ææ¯å¦å¯ä»¥ç¼è¾æå é¤ |
| | |
| | | */ |
| | | Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid); |
| | | |
| | | /** |
| | | * 主é®è·åä¸»æ°æ®ç¼ç è§å |
| | | * @param oid ä¸»é® |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ°æ®ä¸å卿¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | CodeRuleVO getObjectByOid(String oid) throws VciBaseException; |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·åä¸»æ°æ®ç¼ç è§å |
| | | * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢åºç°å¼å¸¸æ¶ä¼æåº |
| | | */ |
| | | Collection<CodeRuleVO> listCodeRuleByOids(Collection<String> oidCollections) throws VciBaseException; |
| | | |
| | | /** |
| | | * åç
§ä¸»æ°æ®ç¼ç è§åå表 |
| | | * @param codeRule æ¥è¯¢æ¡ä»¶ |
| | | * @param page å页åæåº |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | IPage<CodeRuleVO> refDataGridCodeRule(IPage<CodeRuleVO> page, CodeRuleVO codeRule) throws VciBaseException; |
| | | |
| | | /** |
| | | * åç¨ä¸å¯ç¨ç¼ç è§å |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @param update enable:å¯ç¨ disable:åç¨ release:åå¸ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | R updateStatus(String oid, String update); |
| | | |
| | | /** |
| | | * å
éç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | R cloneCodeRule(CodeRuleDTO codeRuleDTO); |
| | | |
| | | /** |
| | | * ç¼ç è§åæ¸
空ææå·²çæçç¼ç |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | R clearAllCode(String oid); |
| | | |
| | | } |
| | |
| | | */ |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeSynonymEntity; |
| | | import com.vci.ubcs.code.vo.CodeSynonymVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.vo.CodeSynonymVO; |
| | | |
| | | /** |
| | | * è¿ä¹è¯ç»´æ¤ æå¡ç±» |
ÎļþÃû´Ó Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeAllcodeServiceImpl.java ÐÞ¸Ä |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.entity.CodeAllCode; |
| | | import com.vci.ubcs.code.mapper.CodeAllCodeMapper; |
| | | import com.vci.ubcs.code.service.ICodeAllcodeService; |
| | | import com.vci.ubcs.code.service.ICodeAllCodeService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeAllCodeVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Service |
| | | public class CodeAllcodeServiceImpl extends ServiceImpl<CodeAllCodeMapper, CodeAllCode> implements ICodeAllcodeService { |
| | | public class CodeAllCodeAllCodeServiceImpl extends ServiceImpl<CodeAllCodeMapper, CodeAllCode> implements ICodeAllCodeService { |
| | | |
| | | /** |
| | | * æ°æ®æä½å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.code.dto.CodeBasicSecDTO; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValue; |
| | | import com.vci.ubcs.code.entity.CodeFixedValue; |
| | | import com.vci.ubcs.code.enumpack.CodeSecTypeEnum; |
| | | import com.vci.ubcs.code.lifecycle.CodeRuleLC; |
| | | import com.vci.ubcs.code.mapper.CodeBasicSecMapper; |
| | | import com.vci.ubcs.code.mapper.CodeClassifyValueMapper; |
| | | import com.vci.ubcs.code.mapper.CodeFixedValueMapper; |
| | | import com.vci.ubcs.code.service.ICodeBasicSecService; |
| | | import com.vci.ubcs.code.service.ICodeRuleService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.code.wrapper.CodeBasicSecWrapper; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.com.vci.starter.web.enumpck.OsCodeFillTypeEnum; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.SessionInfo; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.UIFormReferVO; |
| | | import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.util.WebUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | */ |
| | | @Resource |
| | | private CodeClassifyValueMapper codeClassifyValueMapper; |
| | | |
| | | @Resource |
| | | @Lazy |
| | | private ICodeRuleService codeRuleService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ææçç æ®µåºç¡ä¿¡æ¯ |
| | | * |
| | | * @param page æ¥è¯¢æ¡ä»¶ |
| | | * @param codeBasicSecVO å页åæåº |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public IPage<CodeBasicSecVO> gridCodeBasicSec(IPage<CodeBasicSecVO> page, CodeBasicSecVO codeBasicSecVO) throws VciBaseException { |
| | | if(Func.isEmpty(codeBasicSecVO.getPkCodeRule()) || Func.isBlank(codeBasicSecVO.getPkCodeRule())){ |
| | | return null; |
| | | } |
| | | List<CodeBasicSec> codeBasicSecs = codeBasicSecMapper.selectCodeBasicSecPage(page, codeBasicSecVO); |
| | | return page.setRecords(CodeBasicSecWrapper.build().listVO(codeBasicSecs)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼ç è§åæ¹éå é¤ç æ®µåºæ¬ä¿¡æ¯ |
| | |
| | | return deletFlag; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段åç±»çç±»å夿屿§æ¯å¦æ¯ç©ºç |
| | | * |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æç©ºçåä¼ key-屿§å value-åæ®µå«ä¹ï¼æ²¡æç©ºçåä¼ key-success value-true |
| | | */ |
| | | @Override |
| | | public KeyValue checkAttrNullableBySecType(CodeBasicSecDTO codeBasicSecDTO) { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO.getSectype(), "ç æ®µåç±»"); |
| | | String secType = codeBasicSecDTO.getSectype(); |
| | | HashMap<String, String> attrMap = JSONObject.parseObject(JSONObject.toJSONString(codeBasicSecDTO), HashMap.class); |
| | | Map<String, String> notNullableAttr = getNotNullableAttr(secType); |
| | | if (notNullableAttr == null) { |
| | | throw new VciBaseException("ç æ®µå类填ååºéï¼è¯·æ¥éªåéè¯"); |
| | | } |
| | | for (String key : notNullableAttr.keySet()) { |
| | | if (StringUtils.isBlank(WebUtil.getStringValueFromObject(attrMap.get(key)))) { |
| | | KeyValue kv = new KeyValue(); |
| | | kv.setKey(key); |
| | | kv.setValue(notNullableAttr.get(key)); |
| | | return kv; |
| | | } |
| | | } |
| | | KeyValue kv = new KeyValue(); |
| | | kv.setKey("success"); |
| | | kv.setValue("true"); |
| | | return kv; |
| | | } |
| | | |
| | | /** |
| | | * å¢å ç æ®µåºç¡ä¿¡æ¯ |
| | | * |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public boolean addSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡",codeBasicSecDTO.getPkCodeRule(),"ç¼ç è§åç主é®"); |
| | | CodeRuleVO ruleVO = codeRuleService.getObjectByOid(codeBasicSecDTO.getPkCodeRule()); |
| | | if(!CodeRuleLC.EDITING.getValue().equalsIgnoreCase(ruleVO.getLcStatus())){ |
| | | throw new VciBaseException("ç¼ç è§åçç¶æä¸æ¯ã" + CodeRuleLC.EDITING.getText() + "ãï¼ä¸å
许修æ¹"); |
| | | } |
| | | KeyValue attrKv = checkAttrNullableBySecType(codeBasicSecDTO); |
| | | if (! "success".equals(attrKv.getKey())){ |
| | | throw new VciBaseException(attrKv.getValue() + "ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeBasicSec codeBasicSecDO = new CodeBasicSec(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDTO, codeBasicSecDO); |
| | | //æåºå·ï¼é»è®¤çäºå½åå·²æçæ°éå 1 |
| | | Long total = codeBasicSecMapper.selectCount(Wrappers.<CodeBasicSec>query() |
| | | .lambda() |
| | | .eq(CodeBasicSec::getPkCodeRule,codeBasicSecDTO.getPkCodeRule())); |
| | | if(total == null){ |
| | | total = 0L; |
| | | } |
| | | codeBasicSecDO.setOrderNum(total.intValue() + 1); |
| | | |
| | | //è¡¥ä½çæ¶åï¼è¦æ§å¶è¡¥ä½å符 |
| | | if((OsCodeFillTypeEnum.LEFT.getValue().equalsIgnoreCase(codeBasicSecDO.getCodeFillType()) |
| | | || OsCodeFillTypeEnum.RIGHT.getValue().equalsIgnoreCase(codeBasicSecDO.getCodeFillType())) |
| | | && StringUtils.isBlank(codeBasicSecDO.getCodeFillSeparator())){ |
| | | throw new VciBaseException("å½è¡¥ä½æ¹å¼ä¸ºå·¦è¡¥ä½æè
å³è¡¥ä½çæ¶åï¼è¡¥ä½å符ä¸è½ä¸ºç©º"); |
| | | } |
| | | //å¼ç¨ç æ®µçæ¶åï¼éè¦å¤æåç
§çä¿¡æ¯æ¯å¦æ£ç¡® |
| | | if(CodeSecTypeEnum.CODE_REFER_SEC.getValue().equalsIgnoreCase(codeBasicSecDO.getSecType())){ |
| | | if(StringUtils.isBlank(codeBasicSecDO.getReferConfig())){ |
| | | throw new VciBaseException("å¼ç¨ç æ®µçæ¶åï¼éè¦å¡«å åç
§é
ç½® çå
容"); |
| | | } |
| | | try{ |
| | | JSONObject.parseObject(codeBasicSecDO.getReferConfig(), UIFormReferVO.class); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("å¼ç¨ç æ®µçæ¶åï¼åç
§é
ç½®çå
å®¹çæ ¼å¼ä¸æ£ç¡®,",new String[0],e); |
| | | } |
| | | } |
| | | boolean resBoolean = codeBasicSecMapper.insert(codeBasicSecDO) > 0; |
| | | SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | /*if(StringUtils.isNotBlank(codeBasicSecDO.getCodeFillSeparator())){ |
| | | charService.save(MdmBtmTypeConstant.CODE_BASIC_SEC,"codefileseparator",codeBasicSecDO.getCodeFillSeparator(),sessionInfo); |
| | | }*/ |
| | | return resBoolean; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段类åè·åä¸å¯ä¸ºç©ºçåæ®µ |
| | | * |
| | | * @param secType ç æ®µç±»å |
| | | * @return ä¸å¯ä¸ºç©ºçåæ®µéå |
| | | */ |
| | | private Map<String, String> getNotNullableAttr(String secType) { |
| | | Map<String, String> attrMap = new HashMap<>(); |
| | | if (CodeSecTypeEnum.CODE_ATTR_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "屿§ç 段åç§°"); |
| | | } else if (CodeSecTypeEnum.CODE_DATE_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "æ¥æç æ®µåç§°"); |
| | | attrMap.put("codeDateFormatStr", "æ¥ææ ¼å¼"); |
| | | } else if (CodeSecTypeEnum.CODE_FIXED_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "åºå®ç 段åç§°"); |
| | | attrMap.put("codeSecLengthType", "ç æ®µé¿åº¦ç±»å"); |
| | | attrMap.put("codeSecLength", "ç æ®µçé¿åº¦"); |
| | | } else if (CodeSecTypeEnum.CODE_LEVEL_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "å±çº§ç 段åç§°"); |
| | | attrMap.put("codeLevelType", "å±çº§ç±»å"); |
| | | attrMap.put("valueCutType", "å符æªåç±»å"); |
| | | } else if (CodeSecTypeEnum.CODE_REFER_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "å¼ç¨ç 段åç§°"); |
| | | } else if (CodeSecTypeEnum.CODE_SERIAL_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "æµæ°´ç 段åç§°"); |
| | | attrMap.put("codeSecLength", "ç æ®µçé¿åº¦"); |
| | | attrMap.put("codeFillType", "ç¼ç è¡¥ä½æ¹å¼"); |
| | | attrMap.put("codeFillLength", "å¡«å
é¿åº¦"); |
| | | attrMap.put("codeFillLimit", "æµæ°´ä¸é"); |
| | | attrMap.put("codeFillFlag", "æµæ°´æ¯å¦è¡¥ç "); |
| | | } else if (CodeSecTypeEnum.CODE_VARIABLE_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "å¯åç æ®µåç§°"); |
| | | attrMap.put("codeSecLength", "ç æ®µçé¿åº¦"); |
| | | attrMap.put("codeFillType", "ç¼ç è¡¥ä½æ¹å¼"); |
| | | } else if (CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "åç±»ç æ®µåç§°"); |
| | | attrMap.put("codeSecLengthType", "ç æ®µé¿åº¦ç±»å"); |
| | | attrMap.put("codeSecLength", "ç æ®µçé¿åº¦"); |
| | | } else { |
| | | attrMap = null; |
| | | } |
| | | return attrMap; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | return page.setRecords(codeButtonMapper.selectcodebuttonPage(page, codebutton)); |
| | | } |
| | | |
| | | @Override |
| | | @Override |
| | | public R enableCodeButton(String id) { |
| | | CodeButtonEntity codebutton = codeButtonMapper.selectById(id); |
| | | return changeLcStatus(codebutton,true); |
ÎļþÃû´Ó Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/ICodeClassifyServiceImpl.java ÐÞ¸Ä |
| | |
| | | import com.vci.ubcs.code.service.ICodeClassifyService; |
| | | import com.vci.ubcs.code.service.ICodeKeyattrrepeatService; |
| | | import com.vci.ubcs.code.service.ICodeRuleService; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeKeyAttrRepeatRuleVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.TreeQueryObject; |
| | | import com.vci.ubcs.com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.core.log.exception.ServiceException; |
| | | import jodd.bean.BeanUtil; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.*; |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | | @Service |
| | | public class ICodeClassifyServiceImpl extends ServiceImpl<CodeClassifyMapper, CodeClassify> implements ICodeClassifyService { |
| | | public class CodeClassifyServiceImpl extends ServiceImpl<CodeClassifyMapper, CodeClassify> implements ICodeClassifyService { |
| | | |
| | | @Resource |
| | | private CodeClassifyMapper codeClassifyMapper; |
| | |
| | | return tree; |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // /** |
| | | // * æ ¹æ®æ å½¢æ¥è¯¢å¯¹è±¡æ¥æ¥è¯¢æ°æ®å¯¹è±¡ |
| | | // * |
| | | // * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ |
| | |
| | | */ |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.entity.CodeClstemplateEntity; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import com.vci.ubcs.code.mapper.CodeClstemplateMapper; |
| | | import com.vci.ubcs.code.service.ICodeClstemplateService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç æå¡å®ç°ç±» |
| | |
| | | */ |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeKeyattrrepeatEntity; |
| | | import com.vci.ubcs.code.mapper.CodeButtonMapper; |
| | | import com.vci.ubcs.code.vo.CodeKeyattrrepeatVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.mapper.CodeKeyattrrepeatMapper; |
| | | import com.vci.ubcs.code.service.ICodeKeyattrrepeatService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import com.vci.ubcs.code.vo.CodeKeyattrrepeatVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * å
³é®å±æ§æ¥éè§å æå¡å®ç°ç±» |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | 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.code.dto.CodeBasicSecDTO; |
| | | import com.vci.ubcs.code.dto.CodeRuleDTO; |
| | | import com.vci.ubcs.code.entity.CodeAllCode; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.entity.CodeRule; |
| | | import com.vci.ubcs.code.entity.*; |
| | | import com.vci.ubcs.code.lifecycle.CodeRuleLC; |
| | | import com.vci.ubcs.code.mapper.CodeRuleMapper; |
| | | import com.vci.ubcs.code.service.ICodeAllcodeService; |
| | | import com.vci.ubcs.code.mapper.CodeSerialValueMapper; |
| | | import com.vci.ubcs.code.mapper.CommonsMapper; |
| | | import com.vci.ubcs.code.service.ICodeAllCodeService; |
| | | import com.vci.ubcs.code.service.ICodeBasicSecService; |
| | | import com.vci.ubcs.code.service.ICodeClassifyService; |
| | | import com.vci.ubcs.code.service.ICodeRuleService; |
| | |
| | | import com.vci.ubcs.code.wrapper.CodeRuleWrapper; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.util.WebUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING; |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_OID_NOT_EXIST; |
| | |
| | | */ |
| | | @Resource |
| | | private CodeRuleMapper codeRuleMapper; |
| | | |
| | | @Resource |
| | | private CommonsMapper commonsMapper; |
| | | @Resource |
| | | private CodeSerialValueMapper codeSerialValueMapper; |
| | | |
| | | /** |
| | | * å
¶ä»æå¡å± |
| | | */ |
| | | @Resource |
| | | @Lazy |
| | | private ICodeClassifyService codeClassifyServcie; |
| | | |
| | | @Resource |
| | | private ICodeAllcodeService codeAllcodeService; |
| | | |
| | | private ICodeAllCodeService codeAllcodeService; |
| | | @Resource |
| | | private ICodeBasicSecService codeBasicSecService; |
| | | |
| | |
| | | private RevisionModelUtil revisionModelUtil; |
| | | |
| | | @Override |
| | | public IPage<CodeRuleVO> selectPlCodeRulePage(IPage<CodeRuleVO> page, CodeRuleVO codeRule) { |
| | | public IPage<CodeRuleVO> gridCodeRule(IPage<CodeRuleVO> page, CodeRuleVO codeRule) { |
| | | //对çå½å¨æçæä¸¾è¿è¡è½¬æ¢ |
| | | if(!StringUtils.isEmpty(codeRule.getLcStatusText())){ |
| | | codeRule.setLcStatus(CodeRuleLC.getValueByText(codeRule.getLcStatusText())); |
| | |
| | | } |
| | | } |
| | | |
| | | List<CodeAllCode> codeDOList = codeAllcodeService.selectByWrapper(Wrappers.<CodeAllCode>query().eq("codeRuleOid", codeRuleDTO.getOid())); |
| | | List<CodeAllCode> codeDOList = codeAllcodeService.selectByWrapper(Wrappers.<CodeAllCode>query().lambda().eq(CodeAllCode::getCodeRuleOid, codeRuleDTO.getOid())); |
| | | if (!CollectionUtils.isEmpty(codeDOList)) { |
| | | return R.fail("ç¼ç è§åå·²çæç¼ç ï¼ä¸å
许å é¤"); |
| | | } |
| | | //æ§è¡å é¤æä½ |
| | | //WebUtil.setPersistence(false); |
| | | boolean resBoolean = codeBasicSecService.batchDeleteSecByCodeRuleOid(codeRule.getOid()); |
| | | resBoolean = codeRuleMapper.deleteById(codeRule.getOid())>0; |
| | | boolean resBoolean1 = codeRuleMapper.deleteById(codeRule.getOid()) > 0; |
| | | //WebUtil.setPersistence(true); |
| | | return R.status(resBoolean); |
| | | return R.status(resBoolean&&resBoolean1); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç è§åæ¸
空ææå·²çæçç¼ç |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public R clearAllCode(String oid) { |
| | | WebUtil.alertNotNull(oid, "ç¼ç è§å主é®"); |
| | | List<CodeAllCode> codeDOList = codeAllcodeService.selectByWrapper(Wrappers.<CodeAllCode>query().lambda().eq(CodeAllCode::getCodeRuleOid, oid)); |
| | | if (CollectionUtils.isEmpty(codeDOList)) { |
| | | return R.fail("å½åç¼ç è§å没æçæç¼ç ,æ 鿏
空"); |
| | | } |
| | | //æ¯å¦éè¦è¿è¡btmä¸ç»ä¸ç夿? |
| | | String btmType = codeDOList.get(0).getCreateCodeBtm(); |
| | | //å¤ç§ç±»åä¸çæ¥è¯¢ |
| | | Set<String> btmTypeSet = codeDOList.stream().filter(s -> { |
| | | return !btmType.equalsIgnoreCase(s.getCreateCodeBtm()); |
| | | }).map(s -> s.getCreateCodeBtm()).collect(Collectors.toSet()); |
| | | List<Map<String,String>> businessDataList = new ArrayList<>(); |
| | | if (btmTypeSet.size() > 1) { |
| | | for (String btm : btmTypeSet) { |
| | | Map<String,String> businessData = commonsMapper.selectByCount("PL_CODE_"+btm,oid,btm); |
| | | businessDataList.add(businessData); |
| | | } |
| | | }else { |
| | | Map<String,String> businessData = commonsMapper.selectByCount("PL_CODE_"+btmType,oid,btmType); |
| | | businessDataList.add(businessData); |
| | | } |
| | | if (CollectionUtils.isEmpty(businessDataList) || StringUtils.isBlank(businessDataList.get(0).get("count"))) { |
| | | //æ ææ¥è¯¢ |
| | | return R.fail("æ¥è¯¢å¤±è´¥"); |
| | | } else if (!"0".equalsIgnoreCase(businessDataList.get(0).get("count"))) { |
| | | return R.fail("ç¼ç è§åçæçç¼ç å·²å¨ä¸å¡æ°æ®ä¸åºç¨ï¼ä¸å
许æ¸
空"); |
| | | } |
| | | //æ²¡ææ°æ®ï¼å¯ä»¥å®å
¨å é¤ |
| | | WebUtil.setPersistence(false); |
| | | //å é¤ç å¼è¡¨ä¸çæ°æ®ï¼ä½ä¸å¤ï¼å¦æææµæ°´çç æ®µï¼éè¦éæ°è®¡ç®æµæ°´ |
| | | List<CodeSerialValue> serialValueList = codeSerialValueMapper.selectByCodeRoleId(oid); |
| | | /*BatchCBO batchCBO = boService.batchDelete(codeDOList); |
| | | batchCBO.getDeleteCbos().addAll(serialValueList); |
| | | WebUtil.setPersistence(true); |
| | | boService.persistenceBatch(batchCBO);*/ |
| | | return R.success("æ¸
空ç 弿åï¼"); |
| | | } |
| | | |
| | | /** |
| | |
| | | return CodeClassifyWrapper.build().listVO(codeClassifies); |
| | | } |
| | | |
| | | /** |
| | | * 主é®è·åä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ°æ®ä¸å卿¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeRuleVO getObjectByOid(String oid) throws VciBaseException { |
| | | CodeRule codeRule = selectByOid(oid); |
| | | return CodeRuleWrapper.build().entityVO(codeRule); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·åä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢åºç°å¼å¸¸æ¶ä¼æåº |
| | | */ |
| | | @Override |
| | | public Collection<CodeRuleVO> listCodeRuleByOids(Collection<String> oidCollections) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oidCollections, "æ°æ®å¯¹è±¡ä¸»é®éå"); |
| | | List<CodeRule> codeRuleDOList = listCodeRuleDOByOidCollections(oidCollections); |
| | | return CodeRuleWrapper.build().listVO(codeRuleDOList); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®éåæ¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param oidCollections 主é®çéå |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | private List<CodeRule> listCodeRuleDOByOidCollections(Collection<String> oidCollections) { |
| | | List<CodeRule> codeRuleDOList = new ArrayList<CodeRule>(); |
| | | if (!CollectionUtils.isEmpty(oidCollections)) { |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | | for (Collection<String> oids : oidCollectionsList) { |
| | | List<CodeRule> tempDOList = codeRuleMapper.selectBatchIds(oids); |
| | | if (!CollectionUtils.isEmpty(tempDOList)) { |
| | | codeRuleDOList.addAll(tempDOList); |
| | | } |
| | | } |
| | | } |
| | | return codeRuleDOList; |
| | | } |
| | | |
| | | /** |
| | | * åç
§ä¸»æ°æ®ç¼ç è§åå表 |
| | | * |
| | | * @param codeRule æ¥è¯¢æ¡ä»¶ |
| | | * @param page å页åæåº |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public IPage<CodeRuleVO> refDataGridCodeRule(IPage<CodeRuleVO> page, CodeRuleVO codeRule) throws VciBaseException { |
| | | return gridCodeRule(page, codeRule); |
| | | } |
| | | |
| | | /** |
| | | * åç¨ä¸å¯ç¨ç¼ç è§å |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @param update enable:å¯ç¨ disable:åç¨ release:åå¸ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public R updateStatus(String oid, String update) { |
| | | int count = 0; |
| | | //å
æ¥è¯¢å¯¹è±¡ |
| | | CodeRule codeRuleDO = selectByOid(oid); |
| | | //å建修æ¹å¯¹è±¡ççwrapperæ¡ä»¶ |
| | | LambdaUpdateWrapper<CodeRule> wrapper = Wrappers.<CodeRule>update() |
| | | .lambda() |
| | | .eq(CodeRule::getOid, oid); |
| | | if ("enable".equalsIgnoreCase(update)) { |
| | | if (!CodeRuleLC.DISABLED.getValue().equals(codeRuleDO.getLcStatus())) { |
| | | return R.fail("éåç¨ç¶æçç¼ç è§åæ éç¹å»å¯ç¨"); |
| | | } |
| | | count = codeRuleMapper.update(null,wrapper.set(CodeRule::getLcStatus, CodeRuleLC.RELEASED.getValue())); |
| | | } else if ("disable".equalsIgnoreCase(update)) { |
| | | if (!CodeRuleLC.RELEASED.getValue().equals(codeRuleDO.getLcStatus())) { |
| | | return R.fail("éåå¸ç¶æçç¼ç è§åæ æ³åç¨"); |
| | | } |
| | | count = codeRuleMapper.update(null,wrapper.set(CodeRule::getLcStatus, CodeRuleLC.DISABLED.getValue())); |
| | | } else if ("release".equalsIgnoreCase(update)) { |
| | | if (!CodeRuleLC.EDITING.getValue().equals(codeRuleDO.getLcStatus())) { |
| | | return R.fail("éç¼è¾ç¶æçç¼ç è§åæ æ³åå¸"); |
| | | } |
| | | count = codeRuleMapper.update(null,wrapper.set(CodeRule::getLcStatus, CodeRuleLC.RELEASED.getValue())); |
| | | } else { |
| | | return R.fail("æä¸æ¯æçæä½ç±»å"); |
| | | } |
| | | if (count > 0) { |
| | | return R.success("æ´æ°ç¶ææå"); |
| | | } else { |
| | | return R.fail("æ´æ°ç¶æå¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å
éç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R cloneCodeRule(CodeRuleDTO codeRuleDTO) { |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | CodeRule codeRuleDO = new CodeRule(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeRuleDTO, codeRuleDO); |
| | | boolean exFlag = codeRuleMapper.insert(codeRuleDO)>0; |
| | | List<CodeBasicSecDTO> secList = codeRuleDTO.getElements(); |
| | | List<CodeBasicSec> codeBasicSecs = new ArrayList<>(); |
| | | secList.forEach(codeBasicSecDTO -> { |
| | | codeBasicSecDTO.setPkCodeRule(codeRuleDO.getOid()); |
| | | KeyValue attrKv = codeBasicSecService.checkAttrNullableBySecType(codeBasicSecDTO); |
| | | if (!"success".equals(attrKv.getKey())) { |
| | | throw new VciBaseException(attrKv.getValue() + "ä¸è½ä¸ºç©º"); |
| | | } |
| | | CodeBasicSec codeBasicSecDO = new CodeBasicSec(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDTO, codeBasicSecDO); |
| | | codeBasicSecDO.setOid(""); |
| | | codeBasicSecDO.setRevisionOid(""); |
| | | codeBasicSecDO.setNameOid(""); |
| | | codeBasicSecs.add(codeBasicSecDO); |
| | | }); |
| | | boolean exFlag1 = this.codeBasicSecService.saveBatch(codeBasicSecs); |
| | | return R.data(exFlag&&exFlag1); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.mapper.CodeSynonymMapper; |
| | | import com.vci.ubcs.code.service.ICodeSynonymService; |
| | | import com.vci.ubcs.code.vo.CodeSynonymVO; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.wrapper; |
| | | |
| | | /* |
| | | * 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) |
| | | */ |
| | | |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ å
è£
ç±»,è¿åè§å¾å±æéçåæ®µ |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | public class CodeBasicSecWrapper extends BaseEntityWrapper<CodeBasicSec, CodeBasicSecVO> { |
| | | |
| | | public static CodeBasicSecWrapper build() { |
| | | return new CodeBasicSecWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public CodeBasicSecVO entityVO(CodeBasicSec codeBasicSec) { |
| | | CodeBasicSecVO codeBasicSecVO = Objects.requireNonNull(BeanUtil.copy(codeBasicSec, CodeBasicSecVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(CodeAllCode.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(CodeAllCode.getUpdateUser()); |
| | | //CodeAllCodeVO.setCreateUserName(createUser.getName()); |
| | | //CodeAllCodeVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return codeBasicSecVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<CodeBasicSecVO> listVO(List<CodeBasicSec> list) { |
| | | return (List)list.stream().map(this::entityVO).collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectPlCodeRulePage" resultMap="CodeRuleResultMap"> |
| | | select * from PL_CODE_RULE where is_deleted = 0 |
| | | <select id="selectCodeBasicSecPage" resultMap="CodeRuleResultMap"> |
| | | |
| | | select PL_CODE_BASICSEC.oid, |
| | | PL_CODE_BASICSEC.revisionoid, |
| | | PL_CODE_BASICSEC.nameoid, |
| | | PL_CODE_BASICSEC.btmname, |
| | | PL_CODE_BASICSEC.lastr, |
| | | PL_CODE_BASICSEC.firstr, |
| | | PL_CODE_BASICSEC.lastv, |
| | | PL_CODE_BASICSEC.firstv, |
| | | PL_CODE_BASICSEC.creator, |
| | | PL_CODE_BASICSEC.createtime, |
| | | PL_CODE_BASICSEC.lastmodifier, |
| | | PL_CODE_BASICSEC.lastmodifytime, |
| | | PL_CODE_BASICSEC.revisionrule, |
| | | PL_CODE_BASICSEC.versionrule, |
| | | PL_CODE_BASICSEC.revisionseq, |
| | | PL_CODE_BASICSEC.revisionvalue, |
| | | PL_CODE_BASICSEC.versionseq, |
| | | PL_CODE_BASICSEC.versionvalue, |
| | | PL_CODE_BASICSEC.lctid, |
| | | PL_CODE_BASICSEC.lcstatus, |
| | | PL_CODE_BASICSEC.ts, |
| | | PL_CODE_BASICSEC.id, |
| | | PL_CODE_BASICSEC.name, |
| | | PL_CODE_BASICSEC.description, |
| | | PL_CODE_BASICSEC.owner, |
| | | PL_CODE_BASICSEC.copyfromversion, |
| | | PL_CODE_BASICSEC.codefillseparator, |
| | | PL_CODE_BASICSEC.codeseclength, |
| | | PL_CODE_BASICSEC.valuecuttype, |
| | | PL_CODE_BASICSEC.codefilltype, |
| | | PL_CODE_BASICSEC.refervalueinfo, |
| | | PL_CODE_BASICSEC.referattributeid, |
| | | PL_CODE_BASICSEC.getvalueclass, |
| | | PL_CODE_BASICSEC.displayflag, |
| | | PL_CODE_BASICSEC.parentclassifysecoid, |
| | | PL_CODE_BASICSEC.serialstep, |
| | | PL_CODE_BASICSEC.serialdependflag, |
| | | PL_CODE_BASICSEC.filtersql, |
| | | PL_CODE_BASICSEC.codedateformatstr, |
| | | PL_CODE_BASICSEC.refercodeclassifyoid, |
| | | PL_CODE_BASICSEC.codeleveltype, |
| | | PL_CODE_BASICSEC.codeseclengthtype, |
| | | PL_CODE_BASICSEC.referattributename, |
| | | PL_CODE_BASICSEC.referbtmname, |
| | | PL_CODE_BASICSEC.codefillflag, |
| | | PL_CODE_BASICSEC.valuecutlength, |
| | | PL_CODE_BASICSEC.codegetvaluetype, |
| | | PL_CODE_BASICSEC.referbtmid, |
| | | PL_CODE_BASICSEC.codefilltypetext, |
| | | PL_CODE_BASICSEC.codelevelvalue, |
| | | PL_CODE_BASICSEC.codefilllength, |
| | | PL_CODE_BASICSEC.customcodeserialclass, |
| | | PL_CODE_BASICSEC.matchclassifyvalueflag, |
| | | PL_CODE_BASICSEC.sectype, |
| | | PL_CODE_BASICSEC.pkcoderule, |
| | | PL_CODE_BASICSEC.ordernum, |
| | | PL_CODE_BASICSEC.referconfig, |
| | | PL_CODE_BASICSEC.serialstart, |
| | | PL_CODE_BASICSEC.componentcodeflag, |
| | | PL_CODE_BASICSEC.serialdependorder, |
| | | PL_CODE_BASICSEC.nullableflag, |
| | | PL_CODE_BASICSEC.codefilllimit, |
| | | btm_codebasicsec_1.name as b__name, |
| | | platformbtm_codeclassify.name as c__name, |
| | | COUNT(*) OVER () "##VCI_COUNT_VCI##" |
| | | from PL_CODE_BASICSEC |
| | | left join PL_CODE_BASICSEC btm_codebasicsec_1 |
| | | on btm_codebasicsec_1.oid = PL_CODE_BASICSEC.parentclassifysecoid |
| | | left join PL_CODE_BASICSEC platformbtm_codeclassify |
| | | on platformbtm_codeclassify.oid = PL_CODE_BASICSEC.refercodeclassifyoid |
| | | where |
| | | and PL_CODE_BASICSEC.pkcoderule = #{codeBasicSec.pkCodeRule} |
| | | </select> |
| | | |
| | | |
| | | <select id="countByCondition" resultType="com.vci.ubcs.code.entity.CodeBasicSec"> |
| | | <select id="countByCondition" resultType="java.lang.Long"> |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.CodeSerialValueMapper"> |
| | | |
| | | <resultMap id="codeSerialValueMap" type="com.vci.ubcs.code.entity.CodeSerialValue"> |
| | | <id property="oid" column="OID"/> |
| | | <result property="revisionOid" column="REVISIONOID"/> |
| | | <result property="nameOid" column="NAMEOID"/> |
| | | <result property="btmname" column="BTMNAME"/> |
| | | <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="REVISIONRULE"/> |
| | | <result property="revisionValue" column="REVISIONVALUE"/> |
| | | <result property="versionSeq" column="VERSIONSEQ"/> |
| | | <result property="versionValue" column="VERSIONVALUE"/> |
| | | <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="codeRuleOid" column="coderuleoid"/> |
| | | <result property="serialUnit" column="serialunit"/> |
| | | <result property="codeSecOid" column="codesecoid"/> |
| | | <result property="maxSerial" column="maxserial"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectByCodeRoleId" resultMap="codeSerialValueMap"> |
| | | select PL_CODE_SERIALVALUE.OID, |
| | | PL_CODE_SERIALVALUE.REVISIONOID, |
| | | PL_CODE_SERIALVALUE.NAMEOID, |
| | | PL_CODE_SERIALVALUE.BTMNAME, |
| | | PL_CODE_SERIALVALUE.LASTR, |
| | | PL_CODE_SERIALVALUE.FIRSTR, |
| | | PL_CODE_SERIALVALUE.LASTV, |
| | | PL_CODE_SERIALVALUE.FIRSTV, |
| | | PL_CODE_SERIALVALUE.CREATOR, |
| | | PL_CODE_SERIALVALUE.CREATETIME, |
| | | PL_CODE_SERIALVALUE.LASTMODIFIER, |
| | | PL_CODE_SERIALVALUE.LASTMODIFYTIME, |
| | | PL_CODE_SERIALVALUE.REVISIONRULE, |
| | | PL_CODE_SERIALVALUE.VERSIONRULE, |
| | | PL_CODE_SERIALVALUE.REVISIONSEQ, |
| | | PL_CODE_SERIALVALUE.REVISIONVALUE, |
| | | PL_CODE_SERIALVALUE.VERSIONSEQ, |
| | | PL_CODE_SERIALVALUE.VERSIONVALUE, |
| | | PL_CODE_SERIALVALUE.LCTID, |
| | | PL_CODE_SERIALVALUE.LCSTATUS, |
| | | PL_CODE_SERIALVALUE.TS, |
| | | PL_CODE_SERIALVALUE.ID, |
| | | PL_CODE_SERIALVALUE.NAME, |
| | | PL_CODE_SERIALVALUE.DESCRIPTION, |
| | | PL_CODE_SERIALVALUE.OWNER, |
| | | PL_CODE_SERIALVALUE.COPYFROMVERSION, |
| | | PL_CODE_SERIALVALUE.coderuleoid, |
| | | PL_CODE_SERIALVALUE.serialunit, |
| | | PL_CODE_SERIALVALUE.codesecoid, |
| | | PL_CODE_SERIALVALUE.maxserial, |
| | | COUNT(*) OVER () "##VCI_COUNT_VCI##" |
| | | from PL_CODE_SERIALVALUE |
| | | where 1 = 1 |
| | | and PL_CODE_SERIALVALUE.coderuleoid = #{codeRuleOid} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.CommonsMapper"> |
| | | |
| | | |
| | | <select id="selectByCount" resultType="java.util.Map"> |
| | | select COUNT(w.OID) count |
| | | from ${tableName} w |
| | | join PL_CODE_ALLCODE c on w.OID = c.CREATECODEOID |
| | | where c.CREATECODEBTM = #{btm} |
| | | and c.CODERULEOID = #{oid} |
| | | and w.LASTR = '1' |
| | | and w.LASTV = '1' |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | |
| | | import com.vci.ubcs.omd.entity.DictBizM; |
| | | import com.vci.ubcs.omd.service.IDictBizService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import com.vci.ubcs.omd.entity.DictBizM; |
| | | import com.vci.ubcs.omd.service.IDictBizService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import com.vci.ubcs.omd.entity.DictBizM; |
| | | import com.vci.ubcs.omd.vo.DictBizMVO; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | 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.common.constant.CommonConstant; |
| | | import com.vci.ubcs.omd.cache.DictBizCache; |
| | | import com.vci.ubcs.omd.entity.DictBizM; |
| | | import com.vci.ubcs.omd.mapper.DictBizMapper; |
| | | import com.vci.ubcs.omd.service.IDictBizService; |
| | | import com.vci.ubcs.omd.vo.DictBizMVO; |
| | | import com.vci.ubcs.omd.wrapper.DictBizWrapper; |
| | | import com.vci.ubcs.common.constant.CommonConstant; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import com.vci.ubcs.omd.cache.DictBizCache; |
| | | import com.vci.ubcs.omd.entity.DictBizM; |
| | | import com.vci.ubcs.omd.vo.DictBizMVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | */ |
| | | package com.vci.ubcs.omd.wrapper; |
| | | |
| | | import com.vci.ubcs.omd.cache.DictBizCache; |
| | | import com.vci.ubcs.omd.entity.DictBizM; |
| | | import com.vci.ubcs.omd.vo.DictBizMVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import com.vci.ubcs.omd.cache.DictBizCache; |
| | | import com.vci.ubcs.omd.entity.DictBizM; |
| | | import com.vci.ubcs.omd.vo.DictBizMVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | return ResponseEntity.ok(this.userPwdstrategyService.submit(userPwdstrategyVO)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | int deleteByUserIds(List<Long> userIds); |
| | | |
| | | /** |
| | | * æ ¹æ®å¯ç çç¥idæ¥è¯¢éç¨äºé»è®¤å¯ç çç¥çç¨æ·id |
| | | * @param strategeyId |
| | | * @return |
| | | */ |
| | | List<Long> queryByUseISDefault(Long strategeyId); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.vci.ubcs.system.entity.UserPwdstrategy; |
| | | import com.vci.ubcs.system.vo.UserPwdstrategyVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·å¯ç çç¥ç®¡ç表(UserPwdstrategy)表æå¡æ¥å£ |
| | | * |
| | |
| | | */ |
| | | Boolean submit(UserPwdstrategyVO userPwdstrategyVO); |
| | | |
| | | |
| | | |
| | | List<Long> queryByUseISDefault(Long strategyId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.common.constant.CommonConstant; |
| | | import com.vci.ubcs.system.entity.Strategy; |
| | | import com.vci.ubcs.system.mapper.StrategyMapper; |
| | | import com.vci.ubcs.system.service.IStrategyService; |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import com.vci.ubcs.system.entity.Strategy; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | |
| | | |
| | | @Resource |
| | | private StrategyMapper strategyMapper; |
| | | |
| | | @Resource |
| | | private UserPwdstrategyServiceImpl userPwdstrategyService; |
| | | |
| | | @Resource |
| | | private IUserClient userClient; |
| | | |
| | | /** |
| | | * éè¿IDæ¥è¯¢åæ¡æ°æ® |
| | |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean submit(Strategy strategy) { |
| | | //èçé»è®¤å¯ç çç¥ |
| | | Long oldIsDefaultStrategy = null; |
| | | //夿æ¯å¦æºå¸¦id |
| | | if(Func.isEmpty(strategy.getId())){ |
| | | //æ§è¡æ°å¢ |
| | |
| | | checkPwdStrategy(strategy); |
| | | //妿å½åæ°å¢è®¾ç½®ä¸ºé»è®¤å¯ç çç¥ï¼éè¦å°å·²åå¨é»è®¤å¯ç çç¥ä¿®æ¹ä¸ºéé»è®¤ |
| | | if(strategy.getIsDefault().equals("1") || strategy.getIsDefault() == 1){ |
| | | //æ¥è¯¢èçé»è®¤å¯ç çç¥ï¼ä¾¿äºä¸é¢ä¿®æ¹ |
| | | oldIsDefaultStrategy = this.queryByIsDefault().getId(); |
| | | this.update(Wrappers.<Strategy>update().lambda() |
| | | .set(Strategy::getIsDefault, CommonConstant.NOT_DEFAULT) |
| | | .eq(Strategy::getIsDefault, CommonConstant.IS_DEFAULT)); |
| | | } |
| | | if(Func.isEmpty(strategy.getCreateTime())){ |
| | | //å建æ¶é´åä¿®æ¹æ¶é´æ·»å |
| | | if(Func.isEmpty(strategy.getCreateTime())||Func.isEmpty(strategy.getUpdateTime())){ |
| | | strategy.setCreateTime(new Date()); |
| | | } |
| | | if(Func.isEmpty(strategy.getUpdateTime())){ |
| | | strategy.setUpdateTime(new Date()); |
| | | } |
| | | boolean temp = super.saveOrUpdate(strategy); |
| | | return temp; |
| | | return temp && updateUserStrategyDefault(temp,oldIsDefaultStrategy); |
| | | }else { |
| | | //æ£éªå¯ç çç¥æ¯å¦ç¬¦åè¦æ± |
| | | checkPwdStrategy(strategy); |
| | | //妿å½åä¿®æ¹è®¾ç½®ä¸ºé»è®¤å¯ç çç¥ï¼éè¦å°å·²åå¨é»è®¤å¯ç çç¥ä¿®æ¹ä¸ºéé»è®¤ |
| | | if(strategy.getIsDefault().equals("1") || strategy.getIsDefault() == 1){ |
| | | //æ¥è¯¢èçé»è®¤å¯ç çç¥ï¼ä¾¿äºä¸é¢ä¿®æ¹ |
| | | oldIsDefaultStrategy = this.queryByIsDefault().getId(); |
| | | this.update(Wrappers.<Strategy>update().lambda() |
| | | .set(Strategy::getIsDefault,CommonConstant.NOT_DEFAULT) |
| | | .eq(Strategy::getIsDefault,CommonConstant.IS_DEFAULT)); |
| | |
| | | throw new ServiceException("é»è®¤å¯ç çç¥å¿
é¡»æä¸ä»
æä¸æ¡!"); |
| | | } |
| | | } |
| | | if(Func.isEmpty(strategy.getUpdateTime())){ |
| | | strategy.setUpdateTime(new Date()); |
| | | } |
| | | strategy.setUpdateTime(new Date()); |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | return super.saveOrUpdate(strategy); |
| | | boolean temp1 = super.saveOrUpdate(strategy); |
| | | boolean temp2 = false; |
| | | if(Func.isNotEmpty(oldIsDefaultStrategy)){ |
| | | temp2 = updateUserStrategyDefault(temp1, oldIsDefaultStrategy); |
| | | } |
| | | return temp1 && temp2; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä½¿ç¨é»è®¤å¯ç çç¥çç¨æ·ç¶æ |
| | | * @param oldIsDefaultStrategy |
| | | */ |
| | | private boolean updateUserStrategyDefault(boolean temp,Long oldIsDefaultStrategy){ |
| | | boolean resBoolean = false; |
| | | /** |
| | | * äº§çæ°çé»è®¤å¯ç çç¥ï¼éè¦å°ä»¥åéç¨é»è®¤å¯ç çç¥çç¨æ·åä¸ä¸ªæ´æ¹æéï¼ç±äºæªåºç°å¨å
³è表ä¸çç¨æ·é½æ¯éç¨çé»è®¤å¯ç çç¥ï¼æä»¥éè¦åä¸ä¸ªè¿æ¥æ¥è¯¢åºç¨æ·id |
| | | */ |
| | | if(temp && Func.isNotEmpty(oldIsDefaultStrategy)){ |
| | | List<Long> userIds = userPwdstrategyService.queryByUseISDefault(oldIsDefaultStrategy); |
| | | if (Func.isNotEmpty(userIds)){ |
| | | resBoolean = userClient.updateStrategyStatus(userIds).getData(); |
| | | } |
| | | } |
| | | return resBoolean; |
| | | } |
| | | |
| | | /** |
| | | * æ£éªå¯ç çç¥æ¯å¦ç¬¦åè¦æ± |
| | | * @param strategy |
| | | */ |
| | | public void checkPwdStrategy(Strategy strategy){ |
| | | private void checkPwdStrategy(Strategy strategy){ |
| | | if(strategy.getRequiredType() > strategy.getCombinationIds().split(",").length){ |
| | | throw new ServiceException("å¿
å¡«ç§ç±»ä¸è½å¤§äºæéæ©çå¯ç ç»åæ¹å¼ç个æ°!"); |
| | | } |
| | | if(strategy.getMaxPwdLen() < strategy.getMinPwdLen()){ |
| | | throw new ServiceException("å¯ç æå¤§é¿åº¦ä¸è½å°äºæå°é¿åº¦!"); |
| | | } |
| | | if(strategy.getMinPwdLen() < strategy.getRequiredType() || strategy.getMaxPwdLen() < strategy.getRequiredType()){ |
| | | if(Func.isNotEmpty(strategy.getRequiredType()) && (strategy.getMinPwdLen() < strategy.getRequiredType() || strategy.getMaxPwdLen() < strategy.getRequiredType())){ |
| | | throw new ServiceException("å¯ç æå°é¿åº¦ä¸è½å°äºå¿
å¡«ç§ç±»çå¼!"); |
| | | } |
| | | //夿å端æ¯å¦æªæäº¤ï¼æ¯å¦é»è®¤å段 |
| | | if(Func.isEmpty(strategy.getIsDefault())){ |
| | | strategy.setIsDefault(0L); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.system.entity.UserPwdstrategy; |
| | | import com.vci.ubcs.system.mapper.UserPwdstrategyMapper; |
| | | import com.vci.ubcs.system.service.IUserPwdstrategyService; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.vci.ubcs.common.constant.CommonConstant; |
| | | import com.vci.ubcs.system.entity.UserPwdstrategy; |
| | | import com.vci.ubcs.system.vo.UserPwdstrategyVO; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean submit(UserPwdstrategyVO userPwdstrategyVO) { |
| | | if(Func.isEmpty(userPwdstrategyVO.getUserIds())){ |
| | | throw new ServiceException("å¿
å¡«åæ°ä¸ºç©º"); |
| | | } |
| | | //å
å é¤ |
| | | int eft = this.userPwdstrategyMapper.deleteByUserIds(userPwdstrategyVO.getUserIds()); |
| | | this.userPwdstrategyMapper.deleteByUserIds(userPwdstrategyVO.getUserIds()); |
| | | //卿°å¢ |
| | | List<UserPwdstrategy> userPwdstrategyList = new ArrayList<>(); |
| | | userPwdstrategyVO.getUserIds().forEach(id->{ |
| | | boolean temp = userPwdstrategyList.add(new UserPwdstrategy(id, userPwdstrategyVO.getPwdstrategyId())); |
| | | if(temp){ |
| | | //å¯ç çç¥æ¹å¨æåä¹åä¿®æ¹ç¨æ·ç¶æ |
| | | User user = new User(); |
| | | user.setId(id); |
| | | user.setStrategyUpdateStatus(CommonConstant.TOP_PARENT_ID); |
| | | userClient.updateUser(user); |
| | | } |
| | | userPwdstrategyList.add(new UserPwdstrategy(id, userPwdstrategyVO.getPwdstrategyId())); |
| | | }); |
| | | return this.saveBatch(userPwdstrategyList); |
| | | //å¯ç çç¥æ¹å¨æåä¹åä¿®æ¹ç¨æ·ç¶æ |
| | | Boolean temp = userClient.updateStrategyStatus(userPwdstrategyVO.getUserIds()).getData(); |
| | | return temp && this.saveBatch(userPwdstrategyList); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> queryByUseISDefault(Long strategyId) { |
| | | if(Func.isEmpty(strategyId)){ |
| | | throw new ServiceException("设置é»è®¤å¯ç çç¥åºé!"); |
| | | } |
| | | return this.userPwdstrategyMapper.queryByUseISDefault(strategyId); |
| | | } |
| | | |
| | | } |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="queryByUseISDefault" resultType="java.lang.Long"> |
| | | SELECT ID |
| | | FROM PL_ORG_USER |
| | | WHERE ID NOT IN (SELECT psup.USER_ID ID |
| | | FROM PL_SYS_USER_PWDSTRATEGY PSUP |
| | | LEFT JOIN PL_SYS_PWDSTRATEGY PSP ON PSUP.PWDSTRATEGY_ID = PSP.ID) |
| | | UNION |
| | | (SELECT psup.USER_ID ID |
| | | FROM PL_SYS_USER_PWDSTRATEGY PSUP |
| | | LEFT JOIN PL_SYS_PWDSTRATEGY PSP ON PSUP.PWDSTRATEGY_ID = PSP.ID |
| | | WHERE PSUP.PWDSTRATEGY_ID = #{strategeyId}) |
| | | </select> |
| | | |
| | | <!--éè¿ä¸»é®ä¿®æ¹æ°æ®--> |
| | | <update id="update"> |
| | | update PL_SYS_USER_PWDSTRATEGY |
| | |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | return R.data(service.updateUser(user)); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(UPDATE_USER_STRATEGY_STATUS) |
| | | public R<Boolean> updateStrategyStatus(@RequestParam List<Long> userIds) { |
| | | return R.data(service.updateByUseStrategyId(userIds)); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | IPage<UserVO> selectUserSearch(UserVO user, Query query); |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯ |
| | | * |
| | |
| | | */ |
| | | Long checkRenAndExpr(Long userId); |
| | | |
| | | /** |
| | | * å å¯ç çç¥ä¿®æ¹æé»è®¤å¯ç çç¥è¢«ä¿®æ¹ï¼æä»¥ç¨æ·ç¶ææéä¹éåç¸åºçæ´æ¹ |
| | | * @param userIds |
| | | * @return |
| | | */ |
| | | boolean updateByUseStrategyId(List<Long> userIds); |
| | | |
| | | } |
| | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implements IUserService { |
| | | |
| | | private static final String GUEST_NAME = "guest"; |
| | | |
| | | private final IUserDeptService userDeptService; |
| | |
| | | return 0L; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateByUseStrategyId(List<Long> userIds) { |
| | | return this.update(Wrappers.<User>lambdaUpdate().in(User::getId, userIds).set(User::getStrategyUpdateStatus,CommonConstant.IS_DEFAULT)); |
| | | } |
| | | |
| | | /** |
| | | * æ¶é´æ ¼å¼è½¬å¤© |
| | | * @param date |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 2023-04-12 09:57:45,417 INFO [background-preinit] o.h.validator.internal.util.Version [Version.java : 21] HV000001: Hibernate Validator 6.2.3.Final |
| | | 2023-04-12 09:57:46,398 INFO [main] c.a.n.p.a.s.c.ClientAuthPluginManager [ClientAuthPluginManager.java : 56] [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success. |
| | | 2023-04-12 09:57:46,400 INFO [main] c.a.n.p.a.s.c.ClientAuthPluginManager [ClientAuthPluginManager.java : 56] [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success. |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 2023-04-12 09:57:50,683 INFO [background-preinit] o.h.validator.internal.util.Version [Version.java : 21] HV000001: Hibernate Validator 6.2.3.Final |
| | | 2023-04-12 09:57:51,691 INFO [main] c.a.n.p.a.s.c.ClientAuthPluginManager [ClientAuthPluginManager.java : 56] [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success. |
| | | 2023-04-12 09:57:51,693 INFO [main] c.a.n.p.a.s.c.ClientAuthPluginManager [ClientAuthPluginManager.java : 56] [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success. |
| | | 2023-04-12 09:57:58,635 WARN [main] c.a.c.n.c.NacosPropertySourceBuilder [NacosPropertySourceBuilder.java : 87] Ignore the empty nacos configuration and get it based on dataId[ubcs-xxljob] & group[DEFAULT_GROUP] |
| | | 2023-04-12 09:57:58,646 WARN [main] c.a.c.n.c.NacosPropertySourceBuilder [NacosPropertySourceBuilder.java : 87] Ignore the empty nacos configuration and get it based on dataId[ubcs-xxljob.yaml] & group[DEFAULT_GROUP] |
| | | 2023-04-12 09:57:58,659 WARN [main] c.a.c.n.c.NacosPropertySourceBuilder [NacosPropertySourceBuilder.java : 87] Ignore the empty nacos configuration and get it based on dataId[ubcs-xxljob-dev.yaml] & group[DEFAULT_GROUP] |
| | | 2023-04-12 09:57:58,661 INFO [main] o.s.c.b.c.PropertySourceBootstrapConfiguration [PropertySourceBootstrapConfiguration.java : 109] Located property source: [BootstrapPropertySource {name='bootstrapProperties-ubcs-xxljob-dev.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-ubcs-xxljob.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-ubcs-xxljob,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-ubcs-dev.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-ubcs.yaml,DEFAULT_GROUP'}] |