已修改95个文件
已删除255个文件
已添加46个文件
| | |
| | | Integer NOT_SEALED_ID = 0; |
| | | |
| | | /** |
| | | * æ¯é»è®¤å¯ç çç¥å¼ |
| | | */ |
| | | Integer IS_DEFAULT = 1; |
| | | |
| | | /** |
| | | * 䏿¯é»è®¤å¯ç çç¥å¼ |
| | | */ |
| | | Integer NOT_DEFAULT = 0; |
| | | |
| | | /** |
| | | * é»è®¤å¯ç |
| | | */ |
| | | String DEFAULT_PASSWORD = "123456"; |
| | |
| | | * nacos dev å°å |
| | | */ |
| | | //String NACOS_DEV_ADDR = "dev.vci-tech.com:38848"; |
| | | String NACOS_DEV_ADDR = "192.168.93.133:38848"; |
| | | String NACOS_DEV_ADDR = "192.168.93.140:38848"; |
| | | |
| | | /** |
| | | * nacos prod å°å |
| | |
| | | <version>${bladex.project.version}</version> |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.thoughtworks.xstream</groupId> |
| | | <artifactId>xstream</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci</groupId> |
| | | <artifactId>vci-starter-poi</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.thoughtworks.xstream</groupId>--> |
| | | <!-- <artifactId>xstream</artifactId>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.vci</groupId>--> |
| | | <!-- <artifactId>vci-starter-poi</artifactId>--> |
| | | <!-- <version>1.0-SNAPSHOT</version>--> |
| | | <!-- <scope>compile</scope>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <!--<dependency> |
| | | <groupId>com.vci</groupId> |
| | | <artifactId>vci-platform-web</artifactId> |
| | | <version>2022.1-SNAPSHOT</version> |
| | | <scope>compile</scope> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>vci-starter-web</artifactId> |
| | | <groupId>com.vci</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>com.vci</groupId> |
| | | <artifactId>vci-starter-corba</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | <groupId>de.odysseus.staxon</groupId> |
| | | <artifactId>staxon</artifactId> |
| | | <version>1.3</version> |
| | | </dependency>--> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | <packaging>jar</packaging> |
| | |
| | | package com.vci.ubcs.code.bo; |
| | | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | /** |
| | | * å页对象 |
| | | */ |
| | | private PageHelper pageHelper; |
| | | //private PageHelper pageHelper; |
| | | |
| | | /** |
| | | * å
å«å页çsqlè¯å¥ |
| | |
| | | this.joinTable = joinTable; |
| | | } |
| | | |
| | | public PageHelper getPageHelper() { |
| | | return pageHelper; |
| | | } |
| | | |
| | | public void setPageHelper(PageHelper pageHelper) { |
| | | this.pageHelper = pageHelper; |
| | | } |
| | | // public PageHelper getPageHelper() { |
| | | // return pageHelper; |
| | | // } |
| | | // |
| | | // public void setPageHelper(PageHelper pageHelper) { |
| | | // this.pageHelper = pageHelper; |
| | | // } |
| | | |
| | | public String getSqlHasPage() { |
| | | return sqlHasPage; |
| | |
| | | "tableName='" + tableName + '\'' + |
| | | ", nickName='" + nickName + '\'' + |
| | | ", joinTable=" + joinTable + |
| | | ", pageHelper=" + pageHelper + |
| | | //", pageHelper=" + pageHelper + |
| | | ", sqlHasPage='" + sqlHasPage + '\'' + |
| | | ", sqlUnPage='" + sqlUnPage + '\'' + |
| | | ", sqlCount='" + sqlCount + '\'' + |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ä¸çæé®æ©å±æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * å类使ç¨çæµç¨æ¨¡æ¿æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * æ å°è§åçæç»æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.annotation.Column; |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»çæ¨¡æ¿å±æ§æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | /** |
| | | * 说æ |
| | | */ |
| | | @Column(columnDefinition = "说æ") |
| | | private String explain; |
| | | |
| | | /** |
| | | * éæ©åºæ è¯ |
| | | */ |
| | | @Column(columnDefinition = "éæ©åºæ è¯") |
| | | private String libraryIdentification; |
| | | |
| | | /** |
| | | * 级è屿§ç¼å· |
| | | */ |
| | | @Column(columnDefinition = "级è屿§ç¼å·") |
| | | private String parentCode; |
| | | |
| | | /** |
| | | * 级è屿§åç§° |
| | | */ |
| | | @Column(columnDefinition = "级è屿§åç§°") |
| | | private String parentName; |
| | | |
| | | /** |
| | | * çº§èæ¥è¯¢å±æ§ |
| | | */ |
| | | @Column(columnDefinition = "çº§èæ¥è¯¢å±æ§") |
| | | private String parentQueryAttr; |
| | | |
| | | public String getExplain() { |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºé模æ¿å
å«çæé®æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * å类模æ¿å¯¹è±¡æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºæ¨¡æ¿æ å°è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * åç±»ç æ®µçç 弿°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * åºå®ç 段çç 弿°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * å
³é®æ°æ®æ¥éè§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * é¶æ®µç屿§æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç¸ä¼¼æ¥è¯¢è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * åä¹è¯é
ç½®æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | import com.vci.starter.web.model.BaseModel; |
| | | import com.vci.ubcs.code.entity.BaseModel; |
| | | |
| | | /** |
| | | * è¦æ¨é徿°æ® |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * èµæºå¯¹æ¥éç¥ãæ¥è¯¢æ¥å£æ¥å¿æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * è®°å½å·¥èºæ¨éè¿æ¥çæ°æ®ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * è®°å½å·¥èºæ¨éè¿æ¥çæ°æ®ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | public class DockingPreAttrRangeDTO extends BaseModelVO { |
| | | /** |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * èµæºå¯¹æ¥éç¥ãæ¥è¯¢æ¥å£å¾
æ¨é任塿°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éææ¥å£çè®¤è¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éæçç³»ç»ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éææ¥å£çè®¤è¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.dto; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éææ¥å£çè®¤è¯æ°æ®ä¼ è¾å¯¹è±¡ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.dto; |
| | | |
| | | |
| | | import com.vci.ubcs.code.entity.BaseModel; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç¼è¾çæ°æ®,å¨åæ¡æ°æ®å¢å åä¿®æ¹çæ¶åä½¿ç¨ |
| | | * @author weidy |
| | | * @date 2021-2-12 |
| | | */ |
| | | public class BaseModelDTO extends BaseModel { |
| | | |
| | | /** |
| | | * æ°æ® |
| | | */ |
| | | private Map<String,String> data = new HashMap<>(); |
| | | /** |
| | | * å表çä¸å¡ç±»å |
| | | */ |
| | | private String subBtmType; |
| | | |
| | | /** |
| | | * åè¡¨çæ°æ® |
| | | */ |
| | | private List<Map<String,String>> subTableData = new ArrayList<Map<String,String>>(); |
| | | |
| | | /** |
| | | * åç½®äºä»¶ |
| | | */ |
| | | private String preEvent; |
| | | |
| | | /** |
| | | * åç½®äºä»¶ |
| | | */ |
| | | private String postEvent; |
| | | |
| | | /** |
| | | * è¦åå¸çæä»¶çä¸»é® |
| | | */ |
| | | private List<String> releaseFileOids = new ArrayList<>(); |
| | | |
| | | /** |
| | | * åçæ¬¡ |
| | | */ |
| | | private boolean upVersion = false; |
| | | |
| | | /** |
| | | * æ¥æºæ°æ® |
| | | */ |
| | | private List<Map<String,String>> sourceData = new ArrayList<>(); |
| | | |
| | | /** |
| | | * éæ©æ°æ® |
| | | */ |
| | | private List<Map<String,String>> selectData = new ArrayList<>(); |
| | | |
| | | public List<Map<String, String>> getSourceData() { |
| | | return sourceData; |
| | | } |
| | | |
| | | public void setSourceData(List<Map<String, String>> sourceData) { |
| | | this.sourceData = sourceData; |
| | | } |
| | | |
| | | public List<Map<String, String>> getSelectData() { |
| | | return selectData; |
| | | } |
| | | |
| | | public void setSelectData(List<Map<String, String>> selectData) { |
| | | this.selectData = selectData; |
| | | } |
| | | |
| | | public boolean isUpVersion() { |
| | | return upVersion; |
| | | } |
| | | |
| | | public void setUpVersion(boolean upVersion) { |
| | | this.upVersion = upVersion; |
| | | } |
| | | |
| | | public String getPreEvent() { |
| | | return preEvent; |
| | | } |
| | | |
| | | public void setPreEvent(String preEvent) { |
| | | this.preEvent = preEvent; |
| | | } |
| | | |
| | | public String getPostEvent() { |
| | | return postEvent; |
| | | } |
| | | |
| | | public void setPostEvent(String postEvent) { |
| | | this.postEvent = postEvent; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, String> getData() { |
| | | return data; |
| | | } |
| | | |
| | | @Override |
| | | public void setData(Map<String, String> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public String getSubBtmType() { |
| | | return subBtmType; |
| | | } |
| | | |
| | | public void setSubBtmType(String subBtmType) { |
| | | this.subBtmType = subBtmType; |
| | | } |
| | | |
| | | public List<Map<String, String>> getSubTableData() { |
| | | return subTableData; |
| | | } |
| | | |
| | | public void setSubTableData(List<Map<String, String>> subTableData) { |
| | | this.subTableData = subTableData; |
| | | } |
| | | |
| | | public List<String> getReleaseFileOids() { |
| | | return releaseFileOids; |
| | | } |
| | | |
| | | public void setReleaseFileOids(List<String> releaseFileOids) { |
| | | this.releaseFileOids = releaseFileOids; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BaseModelDTO{" + |
| | | "data=" + data + |
| | | ", subBtmType='" + subBtmType + '\'' + |
| | | ", subTableData=" + subTableData + |
| | | ", preEvent='" + preEvent + '\'' + |
| | | ", postEvent='" + postEvent + '\'' + |
| | | ", releaseFileOids=" + releaseFileOids + |
| | | ", upVersion=" + upVersion + |
| | | ", sourceData=" + sourceData + |
| | | ", selectData=" + selectData + |
| | | "} " + super.toString(); |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.code.dto.datapush.classify; |
| | | |
| | | import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | import com.thoughtworks.xstream.annotations.XStreamAsAttribute; |
| | | //import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | //import com.thoughtworks.xstream.annotations.XStreamAsAttribute; |
| | | |
| | | @XStreamAlias("classify") |
| | | //@XStreamAlias("classify") |
| | | public class NodeClassifyDTO { |
| | | /** |
| | | * åç±»id |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String id; |
| | | /*** |
| | | * åç±»åç§° |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String name; |
| | | /*** |
| | | * ç¶èç¹id |
| | | */ |
| | | @XStreamAsAttribute |
| | | // @XStreamAsAttribute |
| | | private String pid; |
| | | /*** |
| | | * åç±»ä»£å· |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String classCode; |
| | | /*** |
| | | * æè¿° |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String description; |
| | | /*** |
| | | * åç±»é¾æ¥è·¯å¾ |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String fullPathName; |
| | | /*** |
| | | * åç±»ç¶æ |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String lcStatus; |
| | | |
| | | public String getId() { |
| | |
| | | package com.vci.ubcs.code.dto.datapush.classify; |
| | | |
| | | import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | //import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | |
| | | @XStreamAlias("data") |
| | | //@XStreamAlias("data") |
| | | public class NodeDataDTO { |
| | | |
| | | private NodeLibraryDTO library; |
| | |
| | | package com.vci.ubcs.code.dto.datapush.classify; |
| | | |
| | | import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | import com.thoughtworks.xstream.annotations.XStreamAsAttribute; |
| | | import com.thoughtworks.xstream.annotations.XStreamImplicit; |
| | | |
| | | import java.util.List; |
| | | |
| | | @XStreamAlias("library") |
| | | //@XStreamAlias("library") |
| | | public class NodeLibraryDTO { |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String id; |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String name; |
| | | @XStreamImplicit |
| | | //@XStreamImplicit |
| | | private List<NodeClassifyDTO> classify; |
| | | |
| | | public String getId() { |
| | |
| | | package com.vci.ubcs.code.dto.datapush.result; |
| | | |
| | | import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | import com.thoughtworks.xstream.annotations.XStreamImplicit; |
| | | //import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | //import com.thoughtworks.xstream.annotations.XStreamImplicit; |
| | | |
| | | import java.util.List; |
| | | |
| | | @XStreamAlias("data") |
| | | //@XStreamAlias("data") |
| | | public class ResultNodeDataDTO { |
| | | |
| | | @XStreamImplicit |
| | | //@XStreamImplicit |
| | | private List<ResultNodeObjectDTO> object; |
| | | |
| | | public List<ResultNodeObjectDTO> getObject() { |
| | |
| | | package com.vci.ubcs.code.dto.datapush.result; |
| | | |
| | | import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | import com.thoughtworks.xstream.annotations.XStreamAsAttribute; |
| | | //import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | //import com.thoughtworks.xstream.annotations.XStreamAsAttribute; |
| | | |
| | | @XStreamAlias("object") |
| | | //@XStreamAlias("object") |
| | | public class ResultNodeObjectDTO { |
| | | /*** |
| | | * æ°æ®ç¼ç |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String code; |
| | | /*** |
| | | * æ°æ®oid |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String oid; |
| | | /*** |
| | | * é误æ è¯ |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String erroid; |
| | | /*** |
| | | * éè¯¯ä¿¡æ¯ |
| | | */ |
| | | @XStreamAsAttribute |
| | | //@XStreamAsAttribute |
| | | private String msg; |
| | | |
| | | public String getCode() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.data.annotation.Transient; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | public class BaseModel implements Serializable { |
| | | @JsonSerialize( |
| | | using = ToStringSerializer.class |
| | | ) |
| | | @ApiModelProperty("主é®id") |
| | | @TableId(value = "OID") |
| | | private String oid; |
| | | |
| | | private String id; |
| | | |
| | | private String name; |
| | | |
| | | private String description; |
| | | |
| | | private String revisionOid; |
| | | |
| | | private String nameOid; |
| | | |
| | | private String btmname; |
| | | |
| | | private String lastR; |
| | | |
| | | private String firstR; |
| | | |
| | | private String lastV; |
| | | |
| | | private String firstV; |
| | | |
| | | private String creator; |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private Date createTime; |
| | | |
| | | private String lastModifier; |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private Date lastModifyTime; |
| | | |
| | | private String revisionRule; |
| | | |
| | | private Integer revisionSeq; |
| | | |
| | | private String revisionValue; |
| | | |
| | | private String versionRule; |
| | | |
| | | private Integer versionSeq; |
| | | |
| | | private String versionValue; |
| | | |
| | | @Transient |
| | | private String lctid; |
| | | |
| | | private String lcStatus; |
| | | |
| | | @TableField(exist = false) |
| | | private String lcStatusText; |
| | | |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss.SSS" |
| | | ) |
| | | private Date ts; |
| | | |
| | | private String owner; |
| | | |
| | | private String copyFromVersion; |
| | | |
| | | // @VciUseEnum( |
| | | // value = "Enumsecretgrade", |
| | | // showTextField = "secretGradeText" |
| | | // ) |
| | | @TableField(exist = false) |
| | | private Integer secretGrade; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String secretGradeText; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private Map<String, String> data; |
| | | |
| | | public BaseModel() { |
| | | } |
| | | |
| | | public String getOid() { |
| | | return this.oid; |
| | | } |
| | | |
| | | public void setOid(String oid) { |
| | | this.oid = oid; |
| | | } |
| | | |
| | | public String getId() { |
| | | return this.id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return this.description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getRevisionOid() { |
| | | return this.revisionOid; |
| | | } |
| | | |
| | | public void setRevisionOid(String revisionOid) { |
| | | this.revisionOid = revisionOid; |
| | | } |
| | | |
| | | public String getNameOid() { |
| | | return this.nameOid; |
| | | } |
| | | |
| | | public void setNameOid(String nameOid) { |
| | | this.nameOid = nameOid; |
| | | } |
| | | |
| | | public String getBtmname() { |
| | | return this.btmname; |
| | | } |
| | | |
| | | public void setBtmname(String btmname) { |
| | | this.btmname = btmname; |
| | | } |
| | | |
| | | public String getLastR() { |
| | | return this.lastR; |
| | | } |
| | | |
| | | public void setLastR(String lastR) { |
| | | this.lastR = lastR; |
| | | } |
| | | |
| | | public String getFirstR() { |
| | | return this.firstR; |
| | | } |
| | | |
| | | public void setFirstR(String firstR) { |
| | | this.firstR = firstR; |
| | | } |
| | | |
| | | public String getLastV() { |
| | | return this.lastV; |
| | | } |
| | | |
| | | public void setLastV(String lastV) { |
| | | this.lastV = lastV; |
| | | } |
| | | |
| | | public String getFirstV() { |
| | | return this.firstV; |
| | | } |
| | | |
| | | public void setFirstV(String firstV) { |
| | | this.firstV = firstV; |
| | | } |
| | | |
| | | public String getCreator() { |
| | | return this.creator; |
| | | } |
| | | |
| | | public void setCreator(String creator) { |
| | | this.creator = creator; |
| | | } |
| | | |
| | | public String getLastModifier() { |
| | | return this.lastModifier; |
| | | } |
| | | |
| | | public void setLastModifier(String lastModifier) { |
| | | this.lastModifier = lastModifier; |
| | | } |
| | | |
| | | public Date getLastModifyTime() { |
| | | return this.lastModifyTime; |
| | | } |
| | | |
| | | public void setLastModifyTime(Date lastModifyTime) { |
| | | this.lastModifyTime = lastModifyTime; |
| | | } |
| | | |
| | | public String getRevisionRule() { |
| | | return this.revisionRule; |
| | | } |
| | | |
| | | public void setRevisionRule(String revisionRule) { |
| | | this.revisionRule = revisionRule; |
| | | } |
| | | |
| | | public String getVersionRule() { |
| | | return this.versionRule; |
| | | } |
| | | |
| | | public void setVersionRule(String versionRule) { |
| | | this.versionRule = versionRule; |
| | | } |
| | | |
| | | public Integer getRevisionSeq() { |
| | | return this.revisionSeq; |
| | | } |
| | | |
| | | public void setRevisionSeq(Integer revisionSeq) { |
| | | this.revisionSeq = revisionSeq; |
| | | } |
| | | |
| | | public String getRevisionValue() { |
| | | return this.revisionValue; |
| | | } |
| | | |
| | | public void setRevisionValue(String revisionValue) { |
| | | this.revisionValue = revisionValue; |
| | | } |
| | | |
| | | public Integer getVersionSeq() { |
| | | return this.versionSeq; |
| | | } |
| | | |
| | | public void setVersionSeq(Integer versionSeq) { |
| | | this.versionSeq = versionSeq; |
| | | } |
| | | |
| | | public String getVersionValue() { |
| | | return this.versionValue; |
| | | } |
| | | |
| | | public void setVersionValue(String versionValue) { |
| | | this.versionValue = versionValue; |
| | | } |
| | | |
| | | public String getLcStatus() { |
| | | return this.lcStatus; |
| | | } |
| | | |
| | | public void setLcStatus(String lcStatus) { |
| | | this.lcStatus = lcStatus; |
| | | } |
| | | |
| | | public Date getTs() { |
| | | return this.ts; |
| | | } |
| | | |
| | | public void setTs(Date ts) { |
| | | this.ts = ts; |
| | | } |
| | | |
| | | public String getOwner() { |
| | | return this.owner; |
| | | } |
| | | |
| | | public void setOwner(String owner) { |
| | | this.owner = owner; |
| | | } |
| | | |
| | | public String getCopyFromVersion() { |
| | | return this.copyFromVersion; |
| | | } |
| | | |
| | | public void setCopyFromVersion(String copyFromVersion) { |
| | | this.copyFromVersion = copyFromVersion; |
| | | } |
| | | |
| | | public String getLcStatusText() { |
| | | return this.lcStatusText; |
| | | } |
| | | |
| | | public void setLcStatusText(String lcStatusText) { |
| | | this.lcStatusText = lcStatusText; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return this.createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Integer getSecretGrade() { |
| | | return this.secretGrade; |
| | | } |
| | | |
| | | public void setSecretGrade(Integer secretGrade) { |
| | | this.secretGrade = secretGrade; |
| | | } |
| | | |
| | | public String getSecretGradeText() { |
| | | return this.secretGradeText; |
| | | } |
| | | |
| | | public void setSecretGradeText(String secretGradeText) { |
| | | this.secretGradeText = secretGradeText; |
| | | } |
| | | |
| | | public String getLctid() { |
| | | return this.lctid; |
| | | } |
| | | |
| | | public void setLctid(String lctid) { |
| | | this.lctid = lctid; |
| | | } |
| | | |
| | | public Map<String, String> getData() { |
| | | return this.data; |
| | | } |
| | | |
| | | public void setData(Map<String, String> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BaseModel{oid='" + this.oid + '\'' + ", id='" + this.id + '\'' + ", name='" + this.name + '\'' + ", description='" + this.description + '\'' + ", revisionOid='" + this.revisionOid + '\'' + ", nameOid='" + this.nameOid + '\'' + ", btmname='" + this.btmname + '\'' + ", lastR='" + this.lastR + '\'' + ", firstR='" + this.firstR + '\'' + ", lastV='" + this.lastV + '\'' + ", firstV='" + this.firstV + '\'' + ", creator='" + this.creator + '\'' + ", createTime=" + this.createTime + ", lastModifier='" + this.lastModifier + '\'' + ", lastModifyTime=" + this.lastModifyTime + ", revisionRule='" + this.revisionRule + '\'' + ", revisionSeq=" + this.revisionSeq + ", revisionValue='" + this.revisionValue + '\'' + ", versionRule='" + this.versionRule + '\'' + ", versionSeq=" + this.versionSeq + ", versionValue='" + this.versionValue + '\'' + ", lctid='" + this.lctid + '\'' + ", lcStatus='" + this.lcStatus + '\'' + ", lcStatusText='" + this.lcStatusText + '\'' + ", ts=" + this.ts + ", owner='" + this.owner + '\'' + ", copyFromVersion='" + this.copyFromVersion + '\'' + ", secretGrade=" + this.secretGrade + ", secretGradeText='" + this.secretGradeText + '\'' + ", data=" + this.data + '}'; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.data.annotation.Transient; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ å®ä½ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Data |
| | | @TableName("PL_CODE_ALLCODE") |
| | | @ApiModel(value = "CodeAllcode对象", description = "å
¨é¨ç å¼") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeAllcode extends BaseModel { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 5020487634341415429L; |
| | | /** |
| | | * åç±»çä¸»é® |
| | | */ |
| | | private String codeClassifyOid; |
| | | |
| | | /** |
| | | * è§åçä¸»é® |
| | | */ |
| | | private String codeRuleOid; |
| | | |
| | | /** |
| | | * è§åçåç§° |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String codeRuleOidName; |
| | | |
| | | /** |
| | | * å卿°æ®çæ¨¡æ¿ |
| | | */ |
| | | private String codeClassifyTemplateOid; |
| | | |
| | | /** |
| | | * ç å¼çå¼ |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * å建ç¼ç çä¸å¡ç±»å |
| | | */ |
| | | private String createCodeBtm; |
| | | |
| | | /** |
| | | * å建ç¼ç çä¸å¡æ°æ®ä¸»é® |
| | | */ |
| | | private String createCodeOid; |
| | | |
| | | /*** |
| | | * æµæ°´ä¾èµ |
| | | */ |
| | | private String serialUnit; |
| | | |
| | | /** |
| | | * 没æå¡«å
åçæµæ°´å· |
| | | */ |
| | | private String unFillSerial; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.com.vci.starter.annotation.Transient; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * åºç¡ç 段çä¿¡æ¯ |
| | | * æ¹ä¾¿å¨åä¸ä¸ªé¡µé¢éæ¾ç¤ºææçç æ®µ |
| | | * @author weidy |
| | | * @date 2022-1-18 |
| | | */ |
| | | @Data |
| | | @TableName("PL_CODE_BASICSEC") |
| | | @ApiModel(value = "CodeBasicSec对象", description = "ç æ®µåºç¡ä¿¡æ¯") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeBasicSec extends BaseModel{ |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 1803476098497357359L; |
| | | |
| | | /** |
| | | * ç æ®µä¿¡æ¯ |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * ç æ®µåç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ç æ®µç±»å |
| | | */ |
| | | private String secType; |
| | | |
| | | /** |
| | | * ç æ®µé¿åº¦ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String secTypeText; |
| | | |
| | | /** |
| | | * æå±ç¼ç è§å |
| | | */ |
| | | private String pkCodeRule; |
| | | |
| | | /** |
| | | * ç æ®µæåºå· |
| | | */ |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | | * å¼ç¨ç屿§çææ¬ |
| | | */ |
| | | private String referAttributeName; |
| | | |
| | | /** |
| | | * å¼ç¨ç屿§è±æåç§° |
| | | */ |
| | | private String referAttributeId; |
| | | |
| | | /** |
| | | * åå¼è§å |
| | | */ |
| | | private String getValueClass ; |
| | | |
| | | //å端è¾å
¥åèªå¨å å
¥å°æä¸¾ä¸ |
| | | /** |
| | | * æ¥ææ ¼å¼ |
| | | */ |
| | | private String codeDateFormatStr; |
| | | |
| | | /** |
| | | * ç æ®µé¿åº¦ç±»å |
| | | */ |
| | | private String codeSecLengthType; |
| | | |
| | | /** |
| | | * ç æ®µé¿åº¦ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | @TableField(exist = false) |
| | | private String codeSecLengthTypeText; |
| | | |
| | | /** |
| | | * ç æ®µçé¿åº¦ |
| | | */ |
| | | private String codeSecLength; |
| | | |
| | | /** |
| | | * å±çº§ç±»å |
| | | */ |
| | | private String codeLevelType; |
| | | |
| | | /** |
| | | * å±çº§ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | @TableField(exist = false) |
| | | private String codeLevelTypeText; |
| | | |
| | | /** |
| | | * å±çº§çå¼ |
| | | */ |
| | | private Integer codeLevelValue; |
| | | |
| | | /** |
| | | * 弿ªåé¿åº¦ |
| | | */ |
| | | private Integer valueCutLength; |
| | | |
| | | /** |
| | | * å符æªåç±»å |
| | | */ |
| | | private String valueCutType; |
| | | |
| | | /** |
| | | * å符串æªåç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String valueCutTypeText; |
| | | |
| | | /** |
| | | * åå¼ç±»å |
| | | */ |
| | | private String codeGetValueType; |
| | | |
| | | /** |
| | | * åå¼ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String codeGetValueTypeText; |
| | | |
| | | /** |
| | | * å¼ç¨ç屿§æå±çåºåç±» |
| | | */ |
| | | private String referCodeClassifyOid; |
| | | |
| | | /** |
| | | * å¼ç¨ç屿§æå±åºåç±»çåç§° |
| | | */ |
| | | @Transient(referColumn = "referCodeClassifyOid.name") |
| | | @TableField(exist = false) |
| | | private String referCodeClassifyOidName; |
| | | |
| | | /** |
| | | * å¼ç¨çä¸å¡ç±»å |
| | | */ |
| | | private String referBtmId; |
| | | |
| | | /** |
| | | * å¼ç¨çä¸å¡ç±»ååç§° |
| | | */ |
| | | private String referBtmName; |
| | | |
| | | /** |
| | | * åç
§ççªå£é
ç½® |
| | | */ |
| | | private String referConfig; |
| | | |
| | | /** |
| | | * æ¾ç¤ºä¿¡æ¯ |
| | | */ |
| | | private String referValueInfo; |
| | | |
| | | /** |
| | | * è¿æ»¤çsqlå
容 |
| | | */ |
| | | private String filterSql ; |
| | | |
| | | |
| | | /** |
| | | * æµæ°´å·èµ·å§å¼ |
| | | */ |
| | | private String serialStart; |
| | | |
| | | /** |
| | | * æµæ°´çæ¥é¿ |
| | | */ |
| | | private Integer serialStep; |
| | | |
| | | |
| | | /** |
| | | * ç¼ç è¡¥ä½æ¹å¼ |
| | | */ |
| | | //@VciUseEnum(value = EnumIdConstant.CODE_FILL_TYPE,showTextField = "codeFillTypeText") |
| | | private String codeFillType; |
| | | |
| | | /** |
| | | * ç¼ç è¡¥ä½æ¹å¼æ¾ç¤ºææ¬ |
| | | */ |
| | | private String codeFillTypeText; |
| | | |
| | | /** |
| | | * è¡¥ä½æ¶çå符 |
| | | */ |
| | | private String codeFillSeparator; |
| | | |
| | | /** |
| | | * å¡«å
é¿åº¦ |
| | | */ |
| | | private String codeFillLength; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | private Integer codeFillLimit; |
| | | |
| | | /** |
| | | * æµæ°´æ¯å¦è¡¥ç |
| | | */ |
| | | //@VciFieldType(VciFieldTypeEnum.VTBoolean) |
| | | private String codeFillFlag; |
| | | |
| | | /** |
| | | * èªå®ä¹çæµæ°´ç®æ³ç±» |
| | | */ |
| | | private String customCodeSerialClass; |
| | | |
| | | /** |
| | | * æ¯å¦èªå¨å¹é
åç±»å¼ |
| | | */ |
| | | //@VciFieldType(VciFieldTypeEnum.VTBoolean) |
| | | private String matchClassifyValueFlag; |
| | | |
| | | /** |
| | | * ç¶åç±»ç æ®µä¸»é® |
| | | */ |
| | | private String parentClassifySecOid; |
| | | |
| | | /** |
| | | * ç¶åç±»ç æ®µåç§° |
| | | */ |
| | | //@Transient(referColumn = "parentClassifySecOid.name") |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String parentClassifySecText; |
| | | |
| | | /** |
| | | * æ¯å¦å¯ä»¥ä¸ºç©º |
| | | */ |
| | | //@VciFieldType(VciFieldTypeEnum.VTBoolean) |
| | | private String nullableFlag; |
| | | |
| | | /** |
| | | * æ¯å¦åä¸ç¼ç |
| | | */ |
| | | //@VciFieldType(VciFieldTypeEnum.VTBoolean) |
| | | private String componentCodeFlag; |
| | | |
| | | /** |
| | | * æ¯å¦æµæ°´ä¾èµ |
| | | */ |
| | | //@VciFieldType(VciFieldTypeEnum.VTBoolean) |
| | | private String serialDependFlag; |
| | | |
| | | /** |
| | | * æ¯å¦æ¾ç¤º |
| | | */ |
| | | //@VciFieldType(VciFieldTypeEnum.VTBoolean) |
| | | private String displayFlag; |
| | | |
| | | /** |
| | | * æµæ°´ä¾èµé¡ºåº |
| | | */ |
| | | private Integer serialDependOrder; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.com.vci.starter.annotation.Transient; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 主é¢åºçåç±» |
| | | * @author weidy |
| | | * @date 2022-1-14 |
| | | */ |
| | | //@VciBtmType(name = MdmBtmTypeConstant.CODE_CLASSIFY,text = "主é¢åºåç±»",lifeCycle = FrameWorkLcStatusConstant.FRAME_WORK_LIFE_CYCLE_NAME) |
| | | @Data |
| | | @TableName("PL_CODE_CLASSIFY") |
| | | @ApiModel(value = "CodeClassify对象", description = "主é¢åºçåç±»") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeClassify extends BaseModel { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 2217599544701726951L; |
| | | |
| | | /** |
| | | * åç±»çç¼å· |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * åç±»çåç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ä¸çº§çä¸»é® |
| | | */ |
| | | private String parentCodeClassifyOid; |
| | | |
| | | /** |
| | | * æåºå· |
| | | */ |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | | * åå¨çä¸å¡ç±»å |
| | | */ |
| | | private String btmTypeId; |
| | | |
| | | /** |
| | | * åå¨çä¸å¡ç±»åç䏿åç§° |
| | | */ |
| | | private String btmTypeName; |
| | | |
| | | /** |
| | | * ç¼ç è§åçä¸»é® |
| | | */ |
| | | //@VciUseRefer(MdmBtmTypeConstant.CODE_RULE) |
| | | private String codeRuleOid; |
| | | |
| | | /** |
| | | * ç¼ç è§åçåç§° |
| | | */ |
| | | @Transient(referColumn = "codeRuleOid.name") |
| | | @TableField(exist = false) |
| | | private String codeRuleOidName; |
| | | |
| | | /** |
| | | * å
³é®å±æ§æ¥è¯¢çè§å |
| | | */ |
| | | //@VciUseRefer(MdmBtmTypeConstant.CODE_KEY_ATTR_REPEAT_RULE) |
| | | private String codeKeyAttrRepeatOid; |
| | | |
| | | /** |
| | | * å
³é®å±æ§æ¥è¯¢çè§ååç§° |
| | | */ |
| | | @Transient(referColumn = "codeKeyAttrRepeatOid.name") |
| | | @TableField(exist = false) |
| | | private String codeKeyAttrRepeatOidName; |
| | | |
| | | /** |
| | | * ç¸ä¼¼é¡¹æ¥è¯¢çè§åä¸»é® |
| | | */ |
| | | //@VciUseRefer(MdmBtmTypeConstant.CODE_RESEMBLE_RULE) |
| | | private String codeResembleRuleOid; |
| | | |
| | | /** |
| | | * ç¸ä¼¼é¡¹æ¥è¯¢è§ååç§° |
| | | */ |
| | | @Transient(referColumn = "codeResembleRuleOid.name") |
| | | @TableField(exist = false) |
| | | private String codeResembleRuleOidName; |
| | | |
| | | /** |
| | | * æ°æ®æå¨çå±çº§ |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private Integer dataLevel; |
| | | |
| | | /** |
| | | * è·¯å¾ |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String path; |
| | | |
| | | /*** |
| | | * åç§°è·¯å¾ |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String namePath; |
| | | |
| | | /*** |
| | | * 代ç è·¯å¾ |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String idPath; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * åç±»ç æ®µçç å¼ |
| | | * ç¸å½äºçº§èçä¸ææ¡ |
| | | * @author weidy |
| | | * @date 2022-1-18 |
| | | */ |
| | | @Data |
| | | @TableName("PL_CODE_CLASSIFYVALUE") |
| | | @ApiModel(value = "CodeClassify对象", description = "åç±»ç æ®µçç å¼") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeClassifyValue extends BaseModel { |
| | | |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 5238387322464830032L; |
| | | /** |
| | | * åç±»ç æ®µä¸»é® |
| | | */ |
| | | //@VciUseRefer(MdmBtmTypeConstant.CODE_BASIC_SEC) |
| | | private String codeClassifySecOid; |
| | | |
| | | /** |
| | | * åç±»ç å¼ |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * åç±»åç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ç å¼åºå· |
| | | */ |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | | * ä¸çº§åç±»ç å¼ä¸»é® |
| | | */ |
| | | private String parentClassifyValueOid; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * åºå®ç 段çç å¼ |
| | | * ç¸å½äºå¨æä¸¾çä½ç¨ï¼ä¼æå¤ä¸ª |
| | | * @author weidy |
| | | * @date 2022-1-18 |
| | | */ |
| | | @Data |
| | | @TableName("PL_CODE_FIXEDVALUE") |
| | | @ApiModel(value = "CodeFixedValue对象", description = "åºå®ç 段çç å¼") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeFixedValue extends BaseModel { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 3392365440606832597L; |
| | | /** |
| | | * åºå®ç æ®µä¸»é® |
| | | */ |
| | | //@VciUseRefer(MdmBtmTypeConstant.CODE_BASIC_SEC) |
| | | private String codeFixedSecOid; |
| | | |
| | | /** |
| | | * åºå®ç 段çç å¼ |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * åºå®ç 段ç å¼çæè¿° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 屿§æåºå· |
| | | */ |
| | | private Integer orderNum; |
| | | |
| | | @Override |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | @Override |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | @Override |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | @Override |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getCodeFixedSecOid() { |
| | | return codeFixedSecOid; |
| | | } |
| | | |
| | | public void setCodeFixedSecOid(String codeFixedSecOid) { |
| | | this.codeFixedSecOid = codeFixedSecOid; |
| | | } |
| | | |
| | | public Integer getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeFixedValueDO{" + |
| | | "codeFixedSecOid='" + codeFixedSecOid + '\'' + |
| | | ", id='" + id + '\'' + |
| | | ", name='" + name + '\'' + |
| | | ", orderNum=" + orderNum + |
| | | "} " + 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.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * ç¼ç è§å å®ä½ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Data |
| | | @TableName("PL_CODE_RULE") |
| | | @ApiModel(value = "CodeRule对象", description = "ç¼ç è§å") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeRule extends BaseModel { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = -7142347409110551299L; |
| | | |
| | | /** |
| | | * è§åç¼å· |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * è§åçåç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * è§åçæè¿° |
| | | */ |
| | | private String description; |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.po; |
| | | |
| | | import com.vci.starter.poi.annotation.ExcelColumn; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»ç导å
¥å¯¼åºå¯¹è±¡ |
| | | * @author weidy |
| | |
| | | /** |
| | | * æå¨æ°æ®è¡ |
| | | */ |
| | | @ExcelColumn(rowIndexColumn = true,value = "") |
| | | private String rowIndex; |
| | | |
| | | |
| | | /** |
| | | * åç±»ç¼å· |
| | | */ |
| | | @ExcelColumn(value="åç±»ç¼å·",nullable = false) |
| | | private String id; |
| | | /** |
| | | * åç±»åç§° |
| | | */ |
| | | @ExcelColumn(value="åç±»åç§°",nullable = false) |
| | | private String name; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | @ExcelColumn(value = "æè¿°") |
| | | private String description; |
| | | |
| | | /** |
| | | * ç¼ç è§åç¼å· |
| | | */ |
| | | @ExcelColumn(value = "ç¼ç è§åç¼å·") |
| | | private String codeRuleId; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åç¼å· |
| | | */ |
| | | @ExcelColumn(value = "ä¸å¡ç±»åç¼å·") |
| | | private String btmTypeId; |
| | | |
| | | /** |
| | | * æ¥éè§åç¼å· |
| | | */ |
| | | @ExcelColumn(value = "æ¥éè§åç¼å·") |
| | | private String keyRepeatRuleId; |
| | | |
| | | /** |
| | | * åç±»è·¯å¾ |
| | | */ |
| | | @ExcelColumn(value = "å类路å¾",nullable = false) |
| | | private String path; |
| | | |
| | | /** |
| | | * ç¶æææ¬ |
| | | */ |
| | | @ExcelColumn(value = "ç¶æ") |
| | | private String lcStatusText; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import org.springframework.data.annotation.Transient; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | public class BaseModelVO implements Serializable { |
| | | private String oid; |
| | | private String id; |
| | | private String name; |
| | | private String description; |
| | | private String revisionOid; |
| | | private String nameOid; |
| | | private String btmname; |
| | | private String lastR; |
| | | private String firstR; |
| | | private String lastV; |
| | | private String firstV; |
| | | private String creator; |
| | | private Date createTime; |
| | | private String lastModifier; |
| | | private Date lastModifyTime; |
| | | private String revisionRule; |
| | | private int revisionSeq; |
| | | private String revisionValue; |
| | | private String versionRule; |
| | | private int versionSeq; |
| | | private String versionValue; |
| | | private String lcStatus; |
| | | private String lcStatusText; |
| | | private Date ts; |
| | | private String owner; |
| | | private String checkInBy; |
| | | private Date checkInTime; |
| | | private String checkOutBy; |
| | | private Date checkOutTime; |
| | | private String copyFromVersion; |
| | | private Integer secretGrade; |
| | | private String secretGradeText; |
| | | private String lctid; |
| | | @Transient |
| | | private Map<String, String> data; |
| | | |
| | | public BaseModelVO() { |
| | | } |
| | | |
| | | public String getOid() { |
| | | return this.oid; |
| | | } |
| | | |
| | | public void setOid(String oid) { |
| | | this.oid = oid; |
| | | } |
| | | |
| | | public String getId() { |
| | | return this.id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return this.description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getRevisionOid() { |
| | | return this.revisionOid; |
| | | } |
| | | |
| | | public void setRevisionOid(String revisionOid) { |
| | | this.revisionOid = revisionOid; |
| | | } |
| | | |
| | | public String getNameOid() { |
| | | return this.nameOid; |
| | | } |
| | | |
| | | public void setNameOid(String nameOid) { |
| | | this.nameOid = nameOid; |
| | | } |
| | | |
| | | public String getBtmname() { |
| | | return this.btmname; |
| | | } |
| | | |
| | | public void setBtmname(String btmname) { |
| | | this.btmname = btmname; |
| | | } |
| | | |
| | | public String getLastR() { |
| | | return this.lastR; |
| | | } |
| | | |
| | | public void setLastR(String lastR) { |
| | | this.lastR = lastR; |
| | | } |
| | | |
| | | public String getFirstR() { |
| | | return this.firstR; |
| | | } |
| | | |
| | | public void setFirstR(String firstR) { |
| | | this.firstR = firstR; |
| | | } |
| | | |
| | | public String getLastV() { |
| | | return this.lastV; |
| | | } |
| | | |
| | | public void setLastV(String lastV) { |
| | | this.lastV = lastV; |
| | | } |
| | | |
| | | public String getFirstV() { |
| | | return this.firstV; |
| | | } |
| | | |
| | | public void setFirstV(String firstV) { |
| | | this.firstV = firstV; |
| | | } |
| | | |
| | | public String getCreator() { |
| | | return this.creator; |
| | | } |
| | | |
| | | public void setCreator(String creator) { |
| | | this.creator = creator; |
| | | } |
| | | |
| | | public String getLastModifier() { |
| | | return this.lastModifier; |
| | | } |
| | | |
| | | public void setLastModifier(String lastModifier) { |
| | | this.lastModifier = lastModifier; |
| | | } |
| | | |
| | | public Date getLastModifyTime() { |
| | | return this.lastModifyTime; |
| | | } |
| | | |
| | | public void setLastModifyTime(Date lastModifyTime) { |
| | | this.lastModifyTime = lastModifyTime; |
| | | } |
| | | |
| | | public String getRevisionRule() { |
| | | return this.revisionRule; |
| | | } |
| | | |
| | | public void setRevisionRule(String revisionRule) { |
| | | this.revisionRule = revisionRule; |
| | | } |
| | | |
| | | public String getVersionRule() { |
| | | return this.versionRule; |
| | | } |
| | | |
| | | public void setVersionRule(String versionRule) { |
| | | this.versionRule = versionRule; |
| | | } |
| | | |
| | | public int getRevisionSeq() { |
| | | return this.revisionSeq; |
| | | } |
| | | |
| | | public void setRevisionSeq(int revisionSeq) { |
| | | this.revisionSeq = revisionSeq; |
| | | } |
| | | |
| | | public String getRevisionValue() { |
| | | return this.revisionValue; |
| | | } |
| | | |
| | | public void setRevisionValue(String revisionValue) { |
| | | this.revisionValue = revisionValue; |
| | | } |
| | | |
| | | public int getVersionSeq() { |
| | | return this.versionSeq; |
| | | } |
| | | |
| | | public void setVersionSeq(int versionSeq) { |
| | | this.versionSeq = versionSeq; |
| | | } |
| | | |
| | | public String getVersionValue() { |
| | | return this.versionValue; |
| | | } |
| | | |
| | | public void setVersionValue(String versionValue) { |
| | | this.versionValue = versionValue; |
| | | } |
| | | |
| | | public String getLcStatus() { |
| | | return this.lcStatus; |
| | | } |
| | | |
| | | public void setLcStatus(String lcStatus) { |
| | | this.lcStatus = lcStatus; |
| | | } |
| | | |
| | | public Date getTs() { |
| | | return this.ts; |
| | | } |
| | | |
| | | public void setTs(Date ts) { |
| | | this.ts = ts; |
| | | } |
| | | |
| | | public String getOwner() { |
| | | return this.owner; |
| | | } |
| | | |
| | | public void setOwner(String owner) { |
| | | this.owner = owner; |
| | | } |
| | | |
| | | public String getCheckInBy() { |
| | | return this.checkInBy; |
| | | } |
| | | |
| | | public void setCheckInBy(String checkInBy) { |
| | | this.checkInBy = checkInBy; |
| | | } |
| | | |
| | | public Date getCheckInTime() { |
| | | return this.checkInTime; |
| | | } |
| | | |
| | | public void setCheckInTime(Date checkInTime) { |
| | | this.checkInTime = checkInTime; |
| | | } |
| | | |
| | | public String getCheckOutBy() { |
| | | return this.checkOutBy; |
| | | } |
| | | |
| | | public void setCheckOutBy(String checkOutBy) { |
| | | this.checkOutBy = checkOutBy; |
| | | } |
| | | |
| | | public Date getCheckOutTime() { |
| | | return this.checkOutTime; |
| | | } |
| | | |
| | | public void setCheckOutTime(Date checkOutTime) { |
| | | this.checkOutTime = checkOutTime; |
| | | } |
| | | |
| | | public String getCopyFromVersion() { |
| | | return this.copyFromVersion; |
| | | } |
| | | |
| | | public void setCopyFromVersion(String copyFromVersion) { |
| | | this.copyFromVersion = copyFromVersion; |
| | | } |
| | | |
| | | public String getLcStatusText() { |
| | | return this.lcStatusText; |
| | | } |
| | | |
| | | public void setLcStatusText(String lcStatusText) { |
| | | this.lcStatusText = lcStatusText; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return this.createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Integer getSecretGrade() { |
| | | return this.secretGrade; |
| | | } |
| | | |
| | | public void setSecretGrade(Integer secretGrade) { |
| | | this.secretGrade = secretGrade; |
| | | } |
| | | |
| | | public String getSecretGradeText() { |
| | | return this.secretGradeText; |
| | | } |
| | | |
| | | public void setSecretGradeText(String secretGradeText) { |
| | | this.secretGradeText = secretGradeText; |
| | | } |
| | | |
| | | public String getLctid() { |
| | | return this.lctid; |
| | | } |
| | | |
| | | public void setLctid(String lctid) { |
| | | this.lctid = lctid; |
| | | } |
| | | |
| | | public Map<String, String> getData() { |
| | | return this.data; |
| | | } |
| | | |
| | | public void setData(Map<String, String> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BaseModelVO{oid='" + this.oid + '\'' + ", id='" + this.id + '\'' + ", name='" + this.name + '\'' + ", description='" + this.description + '\'' + ", revisionOid='" + this.revisionOid + '\'' + ", nameOid='" + this.nameOid + '\'' + ", btmname='" + this.btmname + '\'' + ", lastR='" + this.lastR + '\'' + ", firstR='" + this.firstR + '\'' + ", lastV='" + this.lastV + '\'' + ", firstV='" + this.firstV + '\'' + ", creator='" + this.creator + '\'' + ", createTime=" + this.createTime + ", lastModifier='" + this.lastModifier + '\'' + ", lastModifyTime=" + this.lastModifyTime + ", revisionRule='" + this.revisionRule + '\'' + ", revisionSeq=" + this.revisionSeq + ", revisionValue='" + this.revisionValue + '\'' + ", versionRule='" + this.versionRule + '\'' + ", versionSeq=" + this.versionSeq + ", versionValue='" + this.versionValue + '\'' + ", lcStatus='" + this.lcStatus + '\'' + ", lcStatusText='" + this.lcStatusText + '\'' + ", ts=" + this.ts + ", owner='" + this.owner + '\'' + ", checkInBy='" + this.checkInBy + '\'' + ", checkInTime=" + this.checkInTime + ", checkOutBy='" + this.checkOutBy + '\'' + ", checkOutTime=" + this.checkOutTime + ", copyFromVersion='" + this.copyFromVersion + '\'' + ", secretGrade=" + this.secretGrade + ", secretGradeText='" + this.secretGradeText + '\'' + ", lctid='" + this.lctid + '\'' + ", data=" + this.data + '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.vo.pagemodel; |
| | | |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ è§å¾å®ä½ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeAllcodeVO extends BaseModelVO { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ä¸çæé®æ©å±æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»æé屿§éæ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * æ å°è§åçæç»æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.annotation.Column; |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»çæ¨¡æ¿å±æ§æ¾ç¤ºå¯¹è±¡ |
| | | * |
| | |
| | | /** |
| | | * 说æ |
| | | */ |
| | | @Column(columnDefinition = "说æ") |
| | | private String explain; |
| | | |
| | | /** |
| | | * éæ©åºæ è¯ |
| | | */ |
| | | @Column(columnDefinition = "éæ©åºæ è¯") |
| | | private String libraryIdentification; |
| | | |
| | | /** |
| | | * 级è屿§ç¼å· |
| | | */ |
| | | @Column(columnDefinition = "级è屿§ç¼å·") |
| | | private String parentCode; |
| | | |
| | | /** |
| | | * 级è屿§åç§° |
| | | */ |
| | | @Column(columnDefinition = "级è屿§åç§°") |
| | | private String parentName; |
| | | |
| | | /** |
| | | * çº§èæ¥è¯¢å±æ§ |
| | | */ |
| | | @Column(columnDefinition = "çº§èæ¥è¯¢å±æ§") |
| | | private String parentQueryAttr; |
| | | |
| | | public String getExplain() { |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºé模æ¿å
å«çæé®æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºæ¨¡æ¿æ å°è§åæ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»æ¾ç¤ºå¯¹è±¡ |
| | | * |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * åç±»ç æ®µçç 弿¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * åºå®ç 段çç 弿¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | |
| | | import java.util.*; |
| | | |
| | |
| | | /*** |
| | | * æ ¹æ®å
³é®çææ¥è¯¢çéå¤çæ°æ®å¯¹è±¡ |
| | | */ |
| | | private Map<String, List<ClientBusinessObject>> indexTODataMap=new HashMap<>(); |
| | | //private Map<String, List<ClientBusinessObject>> indexTODataMap=new HashMap<>(); |
| | | |
| | | /** |
| | | * excelèªèº«éå¤çè¡å· |
| | |
| | | this.selfRepeatRowIndexList = selfRepeatRowIndexList; |
| | | } |
| | | |
| | | public Map<String,List<ClientBusinessObject>> getIndexTODataMap() { |
| | | /*public Map<String,List<ClientBusinessObject>> getIndexTODataMap() { |
| | | return indexTODataMap; |
| | | } |
| | | |
| | |
| | | ", nullRowIndexList=" + nullRowIndexList + |
| | | ", unPassVerifyRowIndexSet=" + unPassVerifyRowIndexSet + |
| | | '}'; |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * å
³é®æ°æ®æ¥éè§åæ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * é¶æ®µç屿§æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç¸ä¼¼æ¥è¯¢è§åæ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * åä¹è¯é
ç½®æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * 模æ¿é¶æ®µæ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.model.BaseModel; |
| | | import com.vci.ubcs.code.entity.BaseModel; |
| | | |
| | | /** |
| | | * è¦æ¨é徿°æ® |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * èµæºå¯¹æ¥éç¥ãæ¥è¯¢æ¥å£æ¥å¿æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * è®°å½å·¥èºæ¨éè¿æ¥çæ°æ®ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | public class DockingPreAttrRangeVO extends BaseModelVO { |
| | | /** |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * èµæºå¯¹æ¥éç¥ãæ¥è¯¢æ¥å£å¾
æ¨é任塿¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éææ¥å£çè®¤è¯æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éæçç³»ç»ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éææ¥å£çè®¤è¯æ¾ç¤ºå¯¹è±¡ |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.starter.web.pagemodel.BaseModelVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.BaseModelVO; |
| | | |
| | | /** |
| | | * ç³»ç»éææ¥å£çè®¤è¯æ¾ç¤ºå¯¹è±¡ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface Transient { |
| | | boolean value() default true; |
| | | |
| | | String referColumn() default ""; |
| | | |
| | | String valueField() default "oid"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.annotation; |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target({ElementType.TYPE}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface VciEnum { |
| | | String name() default ""; |
| | | |
| | | Class valueType() default String.class; |
| | | |
| | | String text() default ""; |
| | | |
| | | String description() default ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.exception; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.com.vci.starter.web.util.MessageUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.text.MessageFormat; |
| | | |
| | | public class VciBaseException extends RuntimeException { |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | public static final String paramNull = "com.vci.base.paramNull"; |
| | | public static final String fieldValueRepeat = "com.vci.base.fieldValueRepeat"; |
| | | public static final String objectNotFoundInDb = "com.vci.base.objectNotFoundInDb"; |
| | | public static final String tsNotEqual = "com.vci.base.tsNotEqual"; |
| | | public static final String dateValueFormatError = "com.vci.base.dateValueForamtError"; |
| | | public static final String notLogin = "com.vci.base.notLogin"; |
| | | public static final String notRight = "com.vci.base.notRight"; |
| | | public static final String notDataRight = "com.vci.base.notDataRight"; |
| | | public static final String notUIRight = "com.vci.base.notUIRight"; |
| | | public static final String connectCorbaFail = "com.vci.base.connectCorbaFail"; |
| | | public static final String corbaNotConfig = "com.vci.base.corbaNotConfig "; |
| | | private String code; |
| | | private Object[] objs = new Object[0]; |
| | | |
| | | public VciBaseException(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public VciBaseException(String code, Object[] objs) { |
| | | this.code = code; |
| | | this.objs = objs; |
| | | } |
| | | |
| | | public VciBaseException(String code, Object[] objs, Throwable e) { |
| | | super(e); |
| | | this.code = code; |
| | | this.objs = objs; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return this.code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public Object[] getObjs() { |
| | | return this.objs; |
| | | } |
| | | |
| | | public void setObjs(Object[] objs) { |
| | | this.objs = objs; |
| | | } |
| | | |
| | | public String getErrorMsg() { |
| | | if (!(this instanceof VciBaseException) && !this.getClass().getSuperclass().equals(VciBaseException.class)) { |
| | | return this instanceof Exception ? this.getMessage() : this.code; |
| | | } else { |
| | | if (StringUtils.isNotBlank(this.code)) { |
| | | this.code = MessageUtils.get(this.code, this.objs); |
| | | } |
| | | |
| | | this.code = MessageFormat.format(this.code, this.objs); |
| | | return this.code; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return this.getCode() + "," + this.getErrorMsg(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.revision.model; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.revision.model; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class ReleasedObjDO implements Serializable { |
| | | private static final long serialVersionUID = -7258896338253286905L; |
| | | private String oid; |
| | | private String revisionOid; |
| | | private String nameOid; |
| | | private String btmName; |
| | | |
| | | public ReleasedObjDO() { |
| | | } |
| | | |
| | | public String getOid() { |
| | | return this.oid; |
| | | } |
| | | |
| | | public void setOid(String oid) { |
| | | this.oid = oid; |
| | | } |
| | | |
| | | public String getRevisionOid() { |
| | | return this.revisionOid; |
| | | } |
| | | |
| | | public void setRevisionOid(String revisionOid) { |
| | | this.revisionOid = revisionOid; |
| | | } |
| | | |
| | | public String getNameOid() { |
| | | return this.nameOid; |
| | | } |
| | | |
| | | public void setNameOid(String nameOid) { |
| | | this.nameOid = nameOid; |
| | | } |
| | | |
| | | public String getBtmName() { |
| | | return this.btmName; |
| | | } |
| | | |
| | | public void setBtmName(String btmName) { |
| | | this.btmName = btmName; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ReleasedObjDO{oid='" + this.oid + '\'' + ", revisionOid='" + this.revisionOid + '\'' + ", nameOid='" + this.nameOid + '\'' + ", btmName='" + this.btmName + '\'' + '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.revision.model; |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.revision.model; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class RevisionInfo implements Serializable { |
| | | private static final long serialVersionUID = 7167255550437885283L; |
| | | private String oid; |
| | | private String nameOid; |
| | | private String revisionOid; |
| | | private String lastR; |
| | | private String firstR; |
| | | private String lastV; |
| | | private String firstV; |
| | | private String revisionRule; |
| | | private Integer revisionSeq; |
| | | private String revisionValue; |
| | | private String versionRule; |
| | | private Integer versionSeq; |
| | | private String versionValue; |
| | | private String btmname; |
| | | |
| | | public RevisionInfo() { |
| | | } |
| | | |
| | | public String getBtmname() { |
| | | return this.btmname; |
| | | } |
| | | |
| | | public void setBtmname(String btmname) { |
| | | this.btmname = btmname; |
| | | } |
| | | |
| | | public String getOid() { |
| | | return this.oid; |
| | | } |
| | | |
| | | public void setOid(String oid) { |
| | | this.oid = oid; |
| | | } |
| | | |
| | | public String getNameOid() { |
| | | return this.nameOid; |
| | | } |
| | | |
| | | public void setNameOid(String nameOid) { |
| | | this.nameOid = nameOid; |
| | | } |
| | | |
| | | public String getRevisionOid() { |
| | | return this.revisionOid; |
| | | } |
| | | |
| | | public void setRevisionOid(String revisionOid) { |
| | | this.revisionOid = revisionOid; |
| | | } |
| | | |
| | | public String getLastR() { |
| | | return this.lastR; |
| | | } |
| | | |
| | | public void setLastR(String lastR) { |
| | | this.lastR = lastR; |
| | | } |
| | | |
| | | public String getFirstR() { |
| | | return this.firstR; |
| | | } |
| | | |
| | | public void setFirstR(String firstR) { |
| | | this.firstR = firstR; |
| | | } |
| | | |
| | | public String getLastV() { |
| | | return this.lastV; |
| | | } |
| | | |
| | | public void setLastV(String lastV) { |
| | | this.lastV = lastV; |
| | | } |
| | | |
| | | public String getFirstV() { |
| | | return this.firstV; |
| | | } |
| | | |
| | | public void setFirstV(String firstV) { |
| | | this.firstV = firstV; |
| | | } |
| | | |
| | | public String getRevisionRule() { |
| | | return this.revisionRule; |
| | | } |
| | | |
| | | public void setRevisionRule(String revisionRule) { |
| | | this.revisionRule = revisionRule; |
| | | } |
| | | |
| | | public int getRevisionSeq() { |
| | | return this.revisionSeq; |
| | | } |
| | | |
| | | public void setRevisionSeq(Integer revisionSeq) { |
| | | this.revisionSeq = revisionSeq; |
| | | } |
| | | |
| | | public String getRevisionValue() { |
| | | return this.revisionValue; |
| | | } |
| | | |
| | | public void setRevisionValue(String revisionValue) { |
| | | this.revisionValue = revisionValue; |
| | | } |
| | | |
| | | public String getVersionRule() { |
| | | return this.versionRule; |
| | | } |
| | | |
| | | public void setVersionRule(String versionRule) { |
| | | this.versionRule = versionRule; |
| | | } |
| | | |
| | | public int getVersionSeq() { |
| | | return this.versionSeq; |
| | | } |
| | | |
| | | public void setVersionSeq(Integer versionSeq) { |
| | | this.versionSeq = versionSeq; |
| | | } |
| | | |
| | | public String getVersionValue() { |
| | | return this.versionValue; |
| | | } |
| | | |
| | | public void setVersionValue(String versionValue) { |
| | | this.versionValue = versionValue; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "RevisionInfo{oid='" + this.oid + '\'' + ", nameOid='" + this.nameOid + '\'' + ", revisionOid='" + this.revisionOid + '\'' + ", lastR='" + this.lastR + '\'' + ", firstR='" + this.firstR + '\'' + ", lastV='" + this.lastV + '\'' + ", firstV='" + this.firstV + '\'' + ", revisionRule='" + this.revisionRule + '\'' + ", revisionSeq=" + this.revisionSeq + ", revisionValue='" + this.revisionValue + '\'' + ", versionRule='" + this.versionRule + '\'' + ", versionSeq=" + this.versionSeq + ", versionValue='" + this.versionValue + '\'' + ", btmname='" + this.btmname + '\'' + '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.revision.service; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.revision.service; |
| | | |
| | | import com.vci.ubcs.code.entity.BaseModel; |
| | | import com.vci.ubcs.com.vci.starter.util.VciBaseUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.service.VciSecretServiceI; |
| | | import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class RevisionModelUtil implements VciSecretServiceI { |
| | | |
| | | public void copyFromDTOIgnore(Object dto, BaseModel baseModel) { |
| | | VciBaseUtil.alertNotNull(new Object[]{dto, "æ°æ®ä¼ è¾å¯¹è±¡", baseModel, "æ°æ®åºä¸çæ°æ®å¯¹è±¡"}); |
| | | BaseModel tempModel = new BaseModel(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(baseModel, tempModel); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(dto, baseModel); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(tempModel, baseModel); |
| | | baseModel.setId(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField("id", dto))); |
| | | baseModel.setName(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField("name", dto))); |
| | | baseModel.setDescription(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField("description", dto))); |
| | | tempModel = null; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.revision.service; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.revision.service; |
| | | |
| | | |
| | | import com.vci.ubcs.com.vci.starter.revision.model.ReleasedObjDO; |
| | | import com.vci.ubcs.com.vci.starter.revision.model.RevisionInfo; |
| | | |
| | | public interface VciRevisionServiceI { |
| | | RevisionInfo selectLastRevision(String var1, String var2); |
| | | |
| | | RevisionInfo selectLastVersion(String var1, String var2, String var3); |
| | | |
| | | RevisionInfo selectRelease(String var1, String var2, String var3); |
| | | |
| | | int saveReleased(ReleasedObjDO var1); |
| | | |
| | | int resetLastRevision(String var1, String var2); |
| | | |
| | | int resetOldRevision(String var1, String var2); |
| | | |
| | | RevisionInfo selectByOid(String var1, String var2); |
| | | |
| | | int resetLastVersion(String var1, String var2, String var3); |
| | | |
| | | int resetOldVersion(String var1, String var2); |
| | | |
| | | int countByProperties(String var1, Object var2, String var3); |
| | | |
| | | int countByPropertiesNotIncludeSelf(String var1, Object var2, String var3, String var4); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.util; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | |
| | | 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 com.vci.ubcs.com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.util.WebThreadLocalUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.ResourceUtils; |
| | | |
| | | import java.beans.IntrospectionException; |
| | | import java.beans.PropertyDescriptor; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.lang.Character.UnicodeBlock; |
| | | import java.lang.annotation.Annotation; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.net.InetAddress; |
| | | import java.net.NetworkInterface; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | 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 VciBaseUtil() { |
| | | } |
| | | |
| | | public static String getPk() { |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | public static int getIntForBoolean(boolean b) { |
| | | return b ? 1 : 0; |
| | | } |
| | | |
| | | public static int getIntFromHibernateResult(Object obj) { |
| | | if (obj == null) { |
| | | return 0; |
| | | } else if (obj instanceof BigDecimal) { |
| | | return ((BigDecimal)obj).intValue(); |
| | | } else if (obj instanceof BigInteger) { |
| | | return ((BigInteger)obj).intValue(); |
| | | } else if (obj instanceof Double) { |
| | | return ((Double)obj).intValue(); |
| | | } else if (obj instanceof Long) { |
| | | return ((Long)obj).intValue(); |
| | | } else if (obj instanceof Short) { |
| | | return ((Short)obj).intValue(); |
| | | } else if (obj instanceof Float) { |
| | | return ((Float)obj).intValue(); |
| | | } else if (obj instanceof String) { |
| | | try { |
| | | return Integer.valueOf(obj.toString()); |
| | | } catch (Exception var2) { |
| | | return 0; |
| | | } |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public static long getLong(String s) { |
| | | long l = 0L; |
| | | if (s == null) { |
| | | return 0L; |
| | | } else { |
| | | try { |
| | | l = Long.parseLong(s); |
| | | return l; |
| | | } catch (Exception var4) { |
| | | return 0L; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static float getFloat(String s) { |
| | | float f = 0.0F; |
| | | if (s == null) { |
| | | return 0.0F; |
| | | } else { |
| | | try { |
| | | f = Float.parseFloat(s); |
| | | return f; |
| | | } catch (Exception var3) { |
| | | return 0.0F; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static int getInt(String string) { |
| | | //int i = false; |
| | | if (string != null && !"".equals(string.trim())) { |
| | | if (string.contains(".")) { |
| | | string = string.substring(0, string.indexOf(".")); |
| | | } |
| | | |
| | | try { |
| | | int i = Integer.parseInt(string); |
| | | return i; |
| | | } catch (Exception var3) { |
| | | return 0; |
| | | } |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public static double getDouble(String s) { |
| | | double d = 0.0D; |
| | | if (isNull(s)) { |
| | | return 0.0D; |
| | | } else { |
| | | try { |
| | | d = Double.parseDouble(s); |
| | | return d; |
| | | } catch (Exception var4) { |
| | | return 0.0D; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static String removeComma(String s) { |
| | | if (s != null && s.trim().length() != 0) { |
| | | if (s.startsWith(",")) { |
| | | s = s.substring(1, s.length()); |
| | | } |
| | | |
| | | if (s.endsWith(",")) { |
| | | s = s.substring(0, s.length() - 1); |
| | | } |
| | | |
| | | return s; |
| | | } else { |
| | | return s; |
| | | } |
| | | } |
| | | |
| | | public static String toInSql(String s) { |
| | | s = removeComma(s); |
| | | if (s != null && s.trim().length() != 0) { |
| | | String[] temp = s.split(","); |
| | | return toInSql(temp); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String toInSql(String[] s) { |
| | | if (s != null && s.length > 0) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (s != null && s.length > 0) { |
| | | for(int i = 0; i < s.length; ++i) { |
| | | if (s[i] != null && s[i].trim().length() > 0 && !s[i].startsWith("'")) { |
| | | sb.append("'").append(s[i]).append("',"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return removeComma(sb.toString()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String toInSql(String field, String s) { |
| | | return !StringUtils.isBlank(field) && !StringUtils.isBlank(s) ? toInSql(field, removeComma(s).split(","), "") : ""; |
| | | } |
| | | |
| | | public static String toInSql(String field, String[] s) { |
| | | return toInSql(field, s, "in"); |
| | | } |
| | | |
| | | public static String toInSql(String field, String[] s, String operation) { |
| | | if (!StringUtils.isBlank(field) && s != null && s.length != 0) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (s != null && s.length > 0) { |
| | | String andOr = "or"; |
| | | if (operation.trim().toLowerCase().equals("not in")) { |
| | | andOr = "and"; |
| | | } |
| | | |
| | | for(int i = 0; i < s.length; ++i) { |
| | | if (s[i] != null && s[i].trim().length() > 0 && !s[i].startsWith("'")) { |
| | | if (i == 0) { |
| | | sb.append(field).append(" ").append(operation).append(" ("); |
| | | } |
| | | |
| | | if (i % 500 == 0 && i != 0) { |
| | | sb.append(" ").append(andOr).append(" ").append(field).append(" ").append(operation).append(" ("); |
| | | } |
| | | |
| | | sb.append("'").append(s[i]).append("'"); |
| | | if (i % 500 != 499 && i != s.length - 1) { |
| | | sb.append(","); |
| | | } |
| | | |
| | | if (i % 500 == 499 || i == s.length - 1) { |
| | | sb.append(") "); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public static String arrayToString(String[] array) { |
| | | if (array != null && array.length > 0) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | for(int i = 0; i < array.length; ++i) { |
| | | String record = array[i]; |
| | | if (StringUtils.isNotBlank(record)) { |
| | | sb.append(record).append(","); |
| | | } |
| | | } |
| | | |
| | | return removeComma(sb.toString()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String collectionToString(Collection collection) { |
| | | if (CollectionUtils.isEmpty(collection)) { |
| | | return ""; |
| | | } else { |
| | | StringBuilder sb = new StringBuilder(); |
| | | Iterator it = collection.iterator(); |
| | | |
| | | while(true) { |
| | | Object record; |
| | | do { |
| | | do { |
| | | if (!it.hasNext()) { |
| | | return removeComma(sb.toString()); |
| | | } |
| | | |
| | | record = it.next(); |
| | | } while(record == null); |
| | | } while(record instanceof String && !StringUtils.isNotBlank((String)record)); |
| | | |
| | | sb.append(record.toString()).append(","); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static String toUpForFirst(String s) { |
| | | if (s != null && s.trim().length() != 0) { |
| | | String temp = s.substring(0, 1); |
| | | temp = temp.toUpperCase(); |
| | | return temp + s.substring(1, s.length()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String toLowForFirst(String s) { |
| | | if (s != null && s.trim().length() != 0) { |
| | | String temp = s.substring(0, 1); |
| | | temp = temp.toLowerCase(); |
| | | return temp + s.substring(1, s.length()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static int countOfString(String s, char findC) { |
| | | Map<String, Integer> charMap = new HashMap(); |
| | | char[] cs = s.toCharArray(); |
| | | char[] var4 = cs; |
| | | int var5 = cs.length; |
| | | |
| | | for(int var6 = 0; var6 < var5; ++var6) { |
| | | char c = var4[var6]; |
| | | charMap.put(String.valueOf(c), !charMap.containsKey(String.valueOf(c)) ? 1 : (Integer)charMap.get(String.valueOf(c)) + 1); |
| | | } |
| | | |
| | | return (Integer)charMap.get(String.valueOf(findC)); |
| | | } |
| | | |
| | | public static List<String> str2List(String s) { |
| | | if (isNull(s)) { |
| | | return null; |
| | | } else { |
| | | List<String> l = new ArrayList(); |
| | | Collections.addAll(l, removeComma(s).split(",")); |
| | | return l; |
| | | } |
| | | } |
| | | |
| | | public static String list2String(List<String> ls) { |
| | | return ls != null && ls.size() != 0 ? (String)ls.stream().collect(Collectors.joining(",")) : ""; |
| | | } |
| | | |
| | | public static boolean isNull(String o) { |
| | | return StringUtils.isEmpty(o); |
| | | } |
| | | |
| | | public static boolean isNotNull(String o) { |
| | | return !isNull(o); |
| | | } |
| | | |
| | | public static boolean isNullOrNullString(String o) { |
| | | return StringUtils.isBlank(o); |
| | | } |
| | | |
| | | public static boolean inArray(String[] arr, String s) { |
| | | if (arr != null && s != null) { |
| | | String[] var2 = arr; |
| | | int var3 = arr.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | String a = var2[var4]; |
| | | if (s.trim().equalsIgnoreCase(a)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public static boolean inArray(Object[] arr, Object o) { |
| | | if (arr != null && o != null) { |
| | | Object[] var2 = arr; |
| | | int var3 = arr.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | Object a = var2[var4]; |
| | | if (a.equals(o)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public static double round(double value, int scale, int roundingMode) { |
| | | BigDecimal bd = new BigDecimal(value); |
| | | bd = bd.setScale(scale, roundingMode); |
| | | double d = bd.doubleValue(); |
| | | bd = null; |
| | | return d; |
| | | } |
| | | |
| | | public static double round(double value, int scale) { |
| | | return round(value, scale, 4); |
| | | } |
| | | |
| | | public static boolean isEmail(String string) { |
| | | if (StringUtils.isBlank(string)) { |
| | | return false; |
| | | } else { |
| | | String regEx1 = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; |
| | | Pattern p = Pattern.compile(regEx1); |
| | | Matcher m = p.matcher(string); |
| | | return m.matches(); |
| | | } |
| | | } |
| | | |
| | | public static boolean isNumber(String s) { |
| | | return StringUtils.isNotBlank(s) && s.matches("\\d+\\.?\\d*"); |
| | | } |
| | | |
| | | public static Field getFieldForObject(String fieldName, List<Field> fieldsList) { |
| | | if (StringUtils.isBlank(fieldName)) { |
| | | return null; |
| | | } else { |
| | | if (fieldsList != null && fieldsList.size() > 0) { |
| | | Iterator var2 = fieldsList.iterator(); |
| | | |
| | | while(var2.hasNext()) { |
| | | Field field = (Field)var2.next(); |
| | | if (field.getName().toLowerCase().equals(fieldName.toLowerCase())) { |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static Method getSetmethod(Class c, String fieldName) { |
| | | if (c != null && StringUtils.isNotBlank(fieldName)) { |
| | | try { |
| | | PropertyDescriptor pd = new PropertyDescriptor(fieldName, c); |
| | | return pd.getWriteMethod(); |
| | | } catch (SecurityException var3) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var3); |
| | | } |
| | | } catch (IntrospectionException var4) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var4); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Method getGetmethod(Class c, String fieldName) { |
| | | if (c != null && StringUtils.isNotBlank(fieldName)) { |
| | | try { |
| | | PropertyDescriptor pd = new PropertyDescriptor(fieldName, c); |
| | | return pd.getReadMethod(); |
| | | } catch (SecurityException var3) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var3); |
| | | } |
| | | } catch (IntrospectionException var4) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var4); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static String getColumnAnnotaionNameValue(Annotation[] fieldAnnotaions) { |
| | | return getAnnotationValue("com.vci.starter.web.annotation.Column,javax.persistence.Column", "name", fieldAnnotaions); |
| | | } |
| | | |
| | | public static String getAnnotationValue(String annotationName, String methodName, Annotation[] fieldAnnotaions) { |
| | | String[] annotaionNameArray = annotationName.split(","); |
| | | Annotation[] var4 = fieldAnnotaions; |
| | | int var5 = fieldAnnotaions.length; |
| | | |
| | | for(int var6 = 0; var6 < var5; ++var6) { |
| | | Annotation annotation = var4[var6]; |
| | | String anname = annotation.annotationType().getName(); |
| | | if (inArray(annotaionNameArray, anname)) { |
| | | String name = null; |
| | | |
| | | try { |
| | | name = (String)annotation.getClass().getMethod(methodName).invoke(annotation); |
| | | } catch (IllegalAccessException var11) { |
| | | var11.printStackTrace(); |
| | | } catch (InvocationTargetException var12) { |
| | | var12.printStackTrace(); |
| | | } catch (NoSuchMethodException var13) { |
| | | var13.printStackTrace(); |
| | | } |
| | | |
| | | return name; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Object getValueFromField(String fieldName, Object sourceObject) { |
| | | if (StringUtils.isNotBlank(fieldName)) { |
| | | try { |
| | | Method getMethod = getGetmethod(sourceObject.getClass(), fieldName); |
| | | if (getMethod != null) { |
| | | return getMethod.invoke(sourceObject); |
| | | } |
| | | |
| | | Field field = getFieldForObject(fieldName, sourceObject); |
| | | if (field != null) { |
| | | field.setAccessible(true); |
| | | return field.get(sourceObject); |
| | | } |
| | | } catch (SecurityException var4) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var4); |
| | | } |
| | | } catch (IllegalAccessException var5) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var5); |
| | | } |
| | | } catch (IllegalArgumentException var6) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var6); |
| | | } |
| | | } catch (InvocationTargetException var7) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var7); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static void setValueForMethod(Field field, Object obj, Object value) { |
| | | try { |
| | | if (field != null) { |
| | | field.setAccessible(true); |
| | | Method setMethod = getSetmethod(field.getDeclaringClass(), field.getName()); |
| | | setMethod.invoke(obj, value); |
| | | } |
| | | } catch (Exception var4) { |
| | | log.error("åå°è°ç¨æ¹æ³åºç°äºé误,", var4); |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void alertNotNull(Object... s) throws VciBaseException { |
| | | if (s != null && s.length > 0) { |
| | | for(int i = 0; i < s.length; ++i) { |
| | | Object obj = s[i]; |
| | | String param = ""; |
| | | |
| | | try { |
| | | ++i; |
| | | param = s[i].toString(); |
| | | } catch (Exception var5) { |
| | | } |
| | | |
| | | if (obj == null) { |
| | | throw new VciBaseException("åæ°[{0}]ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | |
| | | if (obj instanceof Collection) { |
| | | if (CollectionUtils.isEmpty((Collection)obj)) { |
| | | throw new VciBaseException("åæ°[{0}]ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | } else if (StringUtils.isBlank(obj.toString())) { |
| | | throw new VciBaseException("åæ°[{0}]ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public static void alertCollectionNotNull(String param, Collection collections) throws VciBaseException { |
| | | if (CollectionUtils.isEmpty(collections)) { |
| | | throw new VciBaseException("åæ°{0}ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | } |
| | | |
| | | public static <T> Set<Set<T>> switchSetForOracleIn(Set<T> set) { |
| | | Set<Set<T>> listHasList = new HashSet(); |
| | | if (set == null) { |
| | | return listHasList; |
| | | } else { |
| | | int muti = 1; |
| | | if (set.size() > 500) { |
| | | int balance = set.size() % 500; |
| | | muti = (set.size() - balance) / 500 + (balance == 0 ? 0 : 1); |
| | | } |
| | | |
| | | List list = new ArrayList(); |
| | | Iterator it = set.iterator(); |
| | | |
| | | while(it.hasNext()) { |
| | | list.add(it.next()); |
| | | } |
| | | |
| | | for(int i = 0; i < muti; ++i) { |
| | | int start = i * 500; |
| | | int end = start + 500; |
| | | if (i == muti - 1 || end > set.size()) { |
| | | end = set.size(); |
| | | } |
| | | |
| | | List subList = list.subList(start, end); |
| | | Set subSet = new HashSet(); |
| | | Iterator var10 = subList.iterator(); |
| | | |
| | | while(var10.hasNext()) { |
| | | Object obj = var10.next(); |
| | | subSet.add(obj); |
| | | } |
| | | |
| | | listHasList.add(subSet); |
| | | } |
| | | |
| | | return listHasList; |
| | | } |
| | | } |
| | | |
| | | public static <T> Vector<Vector<T>> switchVectorForOracleIn(Vector<T> vector) { |
| | | Vector<Vector<T>> listHasList = new Vector(); |
| | | if (vector == null) { |
| | | return listHasList; |
| | | } else { |
| | | int muti = 1; |
| | | if (vector.size() > 500) { |
| | | int balance = vector.size() % 500; |
| | | muti = (vector.size() - balance) / 500 + (balance == 0 ? 0 : 1); |
| | | } |
| | | |
| | | List list = new ArrayList(); |
| | | Iterator it = vector.iterator(); |
| | | |
| | | while(it.hasNext()) { |
| | | list.add(it.next()); |
| | | } |
| | | |
| | | for(int i = 0; i < muti; ++i) { |
| | | int start = i * 500; |
| | | int end = start + 500; |
| | | if (i == muti - 1 || end > vector.size()) { |
| | | end = vector.size(); |
| | | } |
| | | |
| | | List subList = list.subList(start, end); |
| | | Vector subSet = new Vector(); |
| | | Iterator var10 = subList.iterator(); |
| | | |
| | | while(var10.hasNext()) { |
| | | Object obj = var10.next(); |
| | | subSet.add(obj); |
| | | } |
| | | |
| | | listHasList.add(subSet); |
| | | } |
| | | |
| | | return listHasList; |
| | | } |
| | | } |
| | | |
| | | public static <T> T jsonString2JavaBean(String jsonString, Class<T> beanClass) { |
| | | return JSONObject.parseObject(jsonString, beanClass); |
| | | } |
| | | |
| | | public static void ifNullSetDefautl(String str, String defaultValue) { |
| | | if (isNull(str)) { |
| | | ; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static <T> T getFristObjectFromJson(String jsonString, Class<T> beanClass) { |
| | | return !isNull(jsonString) ? JSONObject.parseArray(jsonString, beanClass).get(0) : null; |
| | | } |
| | | |
| | | public static String getJSONStringWithDateFormat(Object obj) { |
| | | return JSONObject.toJSONStringWithDateFormat(obj, "yyyy-MM-dd HH:mm:ss.SSS", new SerializerFeature[]{SerializerFeature.WriteDateUseDateFormat}); |
| | | } |
| | | |
| | | public static Map<String, Object> objectToMap(Object o) { |
| | | Map<String, Object> map = new HashMap(); |
| | | if (o != null) { |
| | | String jsonString = JSONObject.toJSONStringWithDateFormat(o, "yyyy-MM-dd HH:mm:ss.SSS", new SerializerFeature[]{SerializerFeature.WriteDateUseDateFormat}); |
| | | if (StringUtils.isNotBlank(jsonString)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if (jsonObject != null) { |
| | | Iterator var4 = jsonObject.keySet().iterator(); |
| | | |
| | | while(var4.hasNext()) { |
| | | String key = (String)var4.next(); |
| | | map.put(key, jsonObject.get(key)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public static Map<String, String> objectToMapString(Object o) { |
| | | Map<String, String> map = new HashMap(); |
| | | if (o != null) { |
| | | String jsonString = JSONObject.toJSONStringWithDateFormat(o, "yyyy-MM-dd HH:mm:ss.SSS", new SerializerFeature[]{SerializerFeature.WriteDateUseDateFormat}); |
| | | if (StringUtils.isNotBlank(jsonString)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if (jsonObject != null) { |
| | | Iterator var4 = jsonObject.keySet().iterator(); |
| | | |
| | | while(var4.hasNext()) { |
| | | String key = (String)var4.next(); |
| | | map.put(key, jsonObject.getString(key)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public static boolean isNotNullForField(Object obj, Field f) { |
| | | return !"serialVersionUID".equalsIgnoreCase(f.getName()) && !"DEFAULT_INITIAL_CAPACITY".equalsIgnoreCase(f.getName()) && null != obj && !isNullOrNullString(obj.toString()); |
| | | } |
| | | |
| | | public static String array2String(String[] array) { |
| | | if (null != array && array.length != 0) { |
| | | String ss = ""; |
| | | String[] var2 = array; |
| | | int var3 = array.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | String s = var2[var4]; |
| | | ss = ss + s + ","; |
| | | } |
| | | |
| | | return removeComma(ss); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static void copyValueForMap(Map source, Map target, String[] copyField) { |
| | | Map<String, String> copyFieldMap = new HashMap(); |
| | | String[] var4 = copyField; |
| | | int var5 = copyField.length; |
| | | |
| | | for(int var6 = 0; var6 < var5; ++var6) { |
| | | String field = var4[var6]; |
| | | copyFieldMap.put(field, field); |
| | | } |
| | | |
| | | copyValueForMap(source, target, (Map)copyFieldMap); |
| | | } |
| | | |
| | | public static void copyValueForMap(Map source, Map target, Map<String, String> copyField) { |
| | | try { |
| | | Iterator it = copyField.keySet().iterator(); |
| | | |
| | | while(it.hasNext()) { |
| | | String field = (String)it.next(); |
| | | target.put(field, source.get(copyField.get(field))); |
| | | } |
| | | } catch (Exception var5) { |
| | | } |
| | | |
| | | } |
| | | |
| | | public static Double getDoubleFromMap(String field, Map<String, Object> record) { |
| | | if (!isNullOrNullString(field) && record != null && record.containsKey(field)) { |
| | | Object v = record.get(field); |
| | | if (v instanceof BigDecimal) { |
| | | return ((BigDecimal)v).doubleValue(); |
| | | } else { |
| | | return v instanceof Double ? (Double)v : getDouble((String)v); |
| | | } |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String getDataByKey(String key, Map<String, Object> data) { |
| | | String value = ""; |
| | | if (data.containsKey(key)) { |
| | | value = (String)data.get(key); |
| | | } |
| | | |
| | | if (value == null) { |
| | | value = ""; |
| | | } |
| | | |
| | | return value; |
| | | } |
| | | |
| | | public static Map getNotNullMap(Map map) { |
| | | if (map == null) { |
| | | return new HashMap(); |
| | | } else { |
| | | Iterator it = map.keySet().iterator(); |
| | | HashMap unNullMap = new HashMap(); |
| | | |
| | | while(true) { |
| | | while(true) { |
| | | String newKey; |
| | | Object value; |
| | | do { |
| | | if (!it.hasNext()) { |
| | | return unNullMap; |
| | | } |
| | | |
| | | Object key = it.next(); |
| | | newKey = key.toString().toLowerCase(); |
| | | value = map.get(key); |
| | | } while(value == null); |
| | | |
| | | if (value instanceof String && isNotNull(value.toString())) { |
| | | unNullMap.put(newKey, value); |
| | | } else if (!(value instanceof String)) { |
| | | unNullMap.put(newKey, value); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static List<Field> getAllFieldForObj(Class c) { |
| | | List<Field> allField = new ArrayList(); |
| | | Set<String> fieldNameSet = new HashSet(); |
| | | |
| | | for(Class classz = c; classz != Object.class; classz = classz.getSuperclass()) { |
| | | Field[] thisClassField = classz.getDeclaredFields(); |
| | | Field[] var5 = thisClassField; |
| | | int var6 = thisClassField.length; |
| | | |
| | | for(int var7 = 0; var7 < var6; ++var7) { |
| | | Field field = var5[var7]; |
| | | if (!field.getName().equals("serialVersionUID")) { |
| | | String fieldLowerName = field.getName().toLowerCase(); |
| | | if (!fieldNameSet.contains(fieldLowerName)) { |
| | | fieldNameSet.add(fieldLowerName); |
| | | allField.add(field); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return allField; |
| | | } |
| | | |
| | | public static Field getTsField(Class c) { |
| | | List<Field> allField = getAllFieldForObj(c); |
| | | if (allField != null && allField.size() > 0) { |
| | | Iterator var2 = allField.iterator(); |
| | | |
| | | while(var2.hasNext()) { |
| | | Field field = (Field)var2.next(); |
| | | if (field.getName().equals("ts")) { |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Field getFieldForObject(String fieldName, Object obj) { |
| | | return obj == null ? null : getFieldForObject(fieldName, obj.getClass()); |
| | | } |
| | | |
| | | public static Field getFieldForObject(String fieldName, Class c) { |
| | | List<Field> allField = getAllFieldForObj(c); |
| | | if (allField != null && allField.size() > 0) { |
| | | Iterator var3 = allField.iterator(); |
| | | |
| | | while(var3.hasNext()) { |
| | | Field field = (Field)var3.next(); |
| | | if (field.getName().toLowerCase().equalsIgnoreCase(fieldName.toLowerCase())) { |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Method getSetmethod(Class c, Field field) { |
| | | return getSetmethod(c, field.getName()); |
| | | } |
| | | |
| | | public static Method getGetmethod(Class c, Field field) { |
| | | return getGetmethod(c, field.getName()); |
| | | } |
| | | |
| | | public static Method getMethodByName(Class<?> classObj, String methodName) { |
| | | alertNotNull(classObj, "è·åæ¹æ³ç对象æå±çç±»", methodName, "æ¹æ³çåå"); |
| | | Method[] methods = classObj.getMethods(); |
| | | List<Method> sameMethods = (List)Arrays.stream(methods).filter((method) -> { |
| | | return method.getName().equalsIgnoreCase(methodName); |
| | | }).collect(Collectors.toList()); |
| | | return !CollectionUtils.isEmpty(sameMethods) ? (Method)sameMethods.get(0) : null; |
| | | } |
| | | |
| | | public static Map<String, String> whereSql2Map(String whereSql) { |
| | | Map<String, String> map = new HashMap(); |
| | | if (isNotNull(whereSql)) { |
| | | String[] selects = whereSql.split("and"); |
| | | if (selects != null && selects.length > 0) { |
| | | String[] var3 = selects; |
| | | int var4 = selects.length; |
| | | |
| | | for(int var5 = 0; var5 < var4; ++var5) { |
| | | String s = var3[var5]; |
| | | s = s.trim(); |
| | | map.put(s.substring(0, s.indexOf(" ")).trim(), s.substring(s.indexOf(" ") + 1).trim()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public static synchronized String getRoundFilename(String prefix) { |
| | | if (prefix == null) { |
| | | prefix = ""; |
| | | } |
| | | |
| | | return prefix + System.currentTimeMillis(); |
| | | } |
| | | |
| | | 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 var1) { |
| | | localIp = "127.0.0.1"; |
| | | } |
| | | } |
| | | |
| | | return localIp; |
| | | } |
| | | |
| | | private static InetAddress getLocalHostLANAddress() throws Exception { |
| | | try { |
| | | InetAddress candidateAddress = null; |
| | | Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); |
| | | |
| | | while(ifaces.hasMoreElements()) { |
| | | NetworkInterface iface = (NetworkInterface)ifaces.nextElement(); |
| | | Enumeration inetAddrs = iface.getInetAddresses(); |
| | | |
| | | while(inetAddrs.hasMoreElements()) { |
| | | InetAddress inetAddr = (InetAddress)inetAddrs.nextElement(); |
| | | if (!inetAddr.isLoopbackAddress()) { |
| | | if (inetAddr.isSiteLocalAddress()) { |
| | | return inetAddr; |
| | | } |
| | | |
| | | if (candidateAddress == null) { |
| | | candidateAddress = inetAddr; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (candidateAddress != null) { |
| | | return candidateAddress; |
| | | } else { |
| | | InetAddress jdkSuppliedAddress = InetAddress.getLocalHost(); |
| | | return jdkSuppliedAddress; |
| | | } |
| | | } catch (Exception var5) { |
| | | var5.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String getProjectPath() { |
| | | String path = ""; |
| | | |
| | | try { |
| | | String jarFilePath = ResourceUtils.getURL("classpath:").getPath(); |
| | | if (jarFilePath.contains("!")) { |
| | | path = (new File(jarFilePath)).getParentFile().getParentFile().getParent(); |
| | | } else { |
| | | path = (new File(jarFilePath)).getParent(); |
| | | } |
| | | } catch (IOException var2) { |
| | | throw new VciBaseException("è·åå½åæå¡æå¨çæä»¶å¤¹åºç°äºé误"); |
| | | } |
| | | |
| | | if (path.startsWith("file:\\")) { |
| | | path = path.substring(6); |
| | | } |
| | | |
| | | return path; |
| | | } |
| | | |
| | | public static Map<String, String> getParamsByUrl(String url) { |
| | | if (StringUtils.isBlank(url)) { |
| | | return new HashMap(); |
| | | } else { |
| | | String[] array = url.split("&"); |
| | | Map<String, String> params = new HashMap(); |
| | | String[] var3 = array; |
| | | int var4 = array.length; |
| | | |
| | | for(int var5 = 0; var5 < var4; ++var5) { |
| | | String temp = var3[var5]; |
| | | if (temp.contains("=")) { |
| | | String[] keyValues = temp.split("="); |
| | | params.put(keyValues[0], keyValues[1]); |
| | | } else { |
| | | params.put(temp, ""); |
| | | } |
| | | } |
| | | |
| | | return params; |
| | | } |
| | | } |
| | | |
| | | public static boolean isChinese(char c) { |
| | | UnicodeBlock ub = UnicodeBlock.of(c); |
| | | return ub == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || ub == UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS || ub == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == UnicodeBlock.GENERAL_PUNCTUATION || ub == UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION || ub == UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS; |
| | | } |
| | | |
| | | public static boolean containsKeyUnCaseForMap(Map map, String key) { |
| | | if (!CollectionUtils.isEmpty(map)) { |
| | | boolean[] finded = new boolean[]{false}; |
| | | map.forEach((k, value) -> { |
| | | if (k instanceof String && k.toString().toLowerCase(Locale.ROOT).equalsIgnoreCase(key)) { |
| | | finded[0] = true; |
| | | } |
| | | }); |
| | | return finded[0]; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public static boolean isChinese(String str) { |
| | | char[] ch = str.toCharArray(); |
| | | char[] var2 = ch; |
| | | int var3 = ch.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | char c = var2[var4]; |
| | | if (isChinese(c)) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public static String toDBC(String input) { |
| | | if (StringUtils.isBlank(input)) { |
| | | return input; |
| | | } else { |
| | | char[] c = input.toCharArray(); |
| | | |
| | | for(int i = 0; i < c.length; ++i) { |
| | | if (c[i] == 12288) { |
| | | c[i] = ' '; |
| | | } else if (c[i] > '\uff00' && c[i] < 'ï½') { |
| | | c[i] -= 'ï» '; |
| | | } |
| | | } |
| | | |
| | | return new String(c); |
| | | } |
| | | } |
| | | |
| | | public static String toSBC(String input) { |
| | | if (StringUtils.isBlank(input)) { |
| | | return input; |
| | | } else { |
| | | char[] c = input.toCharArray(); |
| | | |
| | | for(int i = 0; i < c.length; ++i) { |
| | | if (c[i] == 12288) { |
| | | c[i] = ' '; |
| | | } else if (c[i] > '\uff00' && c[i] < 'ï½') { |
| | | c[i] += 'ï» '; |
| | | } |
| | | } |
| | | |
| | | return new String(c); |
| | | } |
| | | } |
| | | |
| | | public static SessionInfo getCurrentUserSessionInfoNotException() { |
| | | return (SessionInfo) WebThreadLocalUtil.getCurrentUserSessionInfoInThread().get(); |
| | | } |
| | | |
| | | 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 obj instanceof Date ? VciDateUtil.date2Str((Date)obj, "yyyy-MM-dd HH:mm:ss.SSS") : obj.toString(); |
| | | } else { |
| | | if (obj instanceof Double) { |
| | | Double aDouble = (Double)obj; |
| | | if (aDouble != null && aDouble % 1.0D == 0.0D) { |
| | | return String.valueOf(aDouble.intValue()); |
| | | } |
| | | } |
| | | |
| | | return String.valueOf(obj); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.enumpck; |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.enumpck; |
| | | |
| | | public interface BaseEnumInt { |
| | | |
| | | int getValue(); |
| | | |
| | | String getText(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.enumpck; |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.enumpck; |
| | | |
| | | //import com.vci.starter.web.annotation.VciEnum; |
| | | |
| | | import com.vci.ubcs.com.vci.starter.annotation.VciEnum; |
| | | |
| | | @VciEnum( |
| | | name = "usersecurityenum", |
| | | text = "人åå¯çº§", |
| | | description = "ç¨æ·ï¼äººåçå¯çº§" |
| | | ) |
| | | public enum UserSecretEnum implements BaseEnumInt { |
| | | NONE(10, "å
é¨"), |
| | | SECRET(20, "ä¸è¬"), |
| | | PRIVACY(30, "éè¦"); |
| | | |
| | | private int value; |
| | | private String text; |
| | | |
| | | @Override |
| | | public int getValue() { |
| | | return this.value; |
| | | } |
| | | |
| | | public void setValue(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | @Override |
| | | public String getText() { |
| | | return this.text; |
| | | } |
| | | |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | |
| | | private UserSecretEnum(int secret, String secretText) { |
| | | this.value = secret; |
| | | this.text = secretText; |
| | | } |
| | | |
| | | public static String getSecretText(int secret) { |
| | | UserSecretEnum[] var1 = values(); |
| | | int var2 = var1.length; |
| | | |
| | | for(int var3 = 0; var3 < var2; ++var3) { |
| | | UserSecretEnum eu = var1[var3]; |
| | | if (eu.value == secret) { |
| | | return eu.text; |
| | | } |
| | | } |
| | | |
| | | return NONE.text; |
| | | } |
| | | |
| | | public static boolean isValid(int secret) { |
| | | UserSecretEnum[] var1 = values(); |
| | | int var2 = var1.length; |
| | | |
| | | for(int var3 = 0; var3 < var2; ++var3) { |
| | | UserSecretEnum eu = var1[var3]; |
| | | if (eu.value == secret) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public static int getSecretValueByText(String text) { |
| | | UserSecretEnum[] var1 = values(); |
| | | int var2 = var1.length; |
| | | |
| | | for(int var3 = 0; var3 < var2; ++var3) { |
| | | UserSecretEnum eu = var1[var3]; |
| | | if (eu.text.equalsIgnoreCase(text)) { |
| | | return eu.value; |
| | | } |
| | | } |
| | | |
| | | return NONE.value; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class SessionInfo implements Serializable { |
| | | private static final long serialVersionUID = 7950268190988911233L; |
| | | private String orgsOid; |
| | | private String orgsName; |
| | | private String deptOid; |
| | | private String deptName; |
| | | private String userOid; |
| | | private String userId; |
| | | private String userName; |
| | | private String personOid; |
| | | private String personId; |
| | | private String personName; |
| | | private String dutyOid; |
| | | private String dutyName; |
| | | private String workgroupOid; |
| | | private String workgroupName; |
| | | private String workTypeOid; |
| | | private String workTypeName; |
| | | private String usertype; |
| | | private String usertypeText; |
| | | private String sex; |
| | | private String sexText; |
| | | private Map<String, String> rolesName; |
| | | private List<String> functionOids; |
| | | private String photoUrl; |
| | | private String ip; |
| | | private String language; |
| | | private String userSecret; |
| | | private String userSecretText; |
| | | private String ipSecret; |
| | | private String ipSecretText; |
| | | private String machine; |
| | | private String os; |
| | | private String browser; |
| | | private String osUser; |
| | | private List<String> deviceInfo = new ArrayList(); |
| | | private String email; |
| | | private String phoneNo; |
| | | private String rtxNo; |
| | | private String portalId; |
| | | private String IMId; |
| | | private boolean sso; |
| | | private String ssoServiceName; |
| | | private String token; |
| | | private Map<String, String> globalAttributeMap = new HashMap(); |
| | | private String workNo; |
| | | |
| | | public SessionInfo() { |
| | | } |
| | | |
| | | public String getDutyOid() { |
| | | return this.dutyOid; |
| | | } |
| | | |
| | | public void setDutyOid(String dutyOid) { |
| | | this.dutyOid = dutyOid; |
| | | } |
| | | |
| | | public String getDutyName() { |
| | | return this.dutyName; |
| | | } |
| | | |
| | | public void setDutyName(String dutyName) { |
| | | this.dutyName = dutyName; |
| | | } |
| | | |
| | | public String getOrgsOid() { |
| | | return this.orgsOid; |
| | | } |
| | | |
| | | public void setOrgsOid(String orgsOid) { |
| | | this.orgsOid = orgsOid; |
| | | } |
| | | |
| | | public String getOrgsName() { |
| | | return this.orgsName; |
| | | } |
| | | |
| | | public void setOrgsName(String orgsName) { |
| | | this.orgsName = orgsName; |
| | | } |
| | | |
| | | public String getDeptOid() { |
| | | return this.deptOid; |
| | | } |
| | | |
| | | public void setDeptOid(String deptOid) { |
| | | this.deptOid = deptOid; |
| | | } |
| | | |
| | | public String getDeptName() { |
| | | return this.deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | public String getUserOid() { |
| | | return this.userOid; |
| | | } |
| | | |
| | | public void setUserOid(String userOid) { |
| | | this.userOid = userOid; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return this.userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return this.userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getPersonOid() { |
| | | return this.personOid; |
| | | } |
| | | |
| | | public void setPersonOid(String personOid) { |
| | | this.personOid = personOid; |
| | | } |
| | | |
| | | public String getPersonName() { |
| | | return this.personName; |
| | | } |
| | | |
| | | public void setPersonName(String personName) { |
| | | this.personName = personName; |
| | | } |
| | | |
| | | public String getWorkgroupOid() { |
| | | return this.workgroupOid; |
| | | } |
| | | |
| | | public void setWorkgroupOid(String workgroupOid) { |
| | | this.workgroupOid = workgroupOid; |
| | | } |
| | | |
| | | public String getWorkgroupName() { |
| | | return this.workgroupName; |
| | | } |
| | | |
| | | public void setWorkgroupName(String workgroupName) { |
| | | this.workgroupName = workgroupName; |
| | | } |
| | | |
| | | public String getUsertype() { |
| | | return this.usertype; |
| | | } |
| | | |
| | | public void setUsertype(String usertype) { |
| | | this.usertype = usertype; |
| | | } |
| | | |
| | | public String getUsertypeText() { |
| | | return this.usertypeText; |
| | | } |
| | | |
| | | public void setUsertypeText(String usertypeText) { |
| | | this.usertypeText = usertypeText; |
| | | } |
| | | |
| | | public String getSex() { |
| | | return this.sex; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public List<String> getFunctionOids() { |
| | | return this.functionOids; |
| | | } |
| | | |
| | | public void setFunctionOids(List<String> functionOids) { |
| | | this.functionOids = functionOids; |
| | | } |
| | | |
| | | public String getPhotoUrl() { |
| | | return this.photoUrl; |
| | | } |
| | | |
| | | public void setPhotoUrl(String photoUrl) { |
| | | this.photoUrl = photoUrl; |
| | | } |
| | | |
| | | public String getIp() { |
| | | return this.ip; |
| | | } |
| | | |
| | | public void setIp(String ip) { |
| | | this.ip = ip; |
| | | } |
| | | |
| | | public String getLanguage() { |
| | | return this.language; |
| | | } |
| | | |
| | | public void setLanguage(String language) { |
| | | this.language = language; |
| | | } |
| | | |
| | | public String getUserSecret() { |
| | | return this.userSecret; |
| | | } |
| | | |
| | | public void setUserSecret(String userSecret) { |
| | | this.userSecret = userSecret; |
| | | } |
| | | |
| | | public String getUserSecretText() { |
| | | return this.userSecretText; |
| | | } |
| | | |
| | | public void setUserSecretText(String userSecretText) { |
| | | this.userSecretText = userSecretText; |
| | | } |
| | | |
| | | public String getIpSecret() { |
| | | return this.ipSecret; |
| | | } |
| | | |
| | | public void setIpSecret(String ipSecret) { |
| | | this.ipSecret = ipSecret; |
| | | } |
| | | |
| | | public String getIpSecretText() { |
| | | return this.ipSecretText; |
| | | } |
| | | |
| | | public void setIpSecretText(String ipSecretText) { |
| | | this.ipSecretText = ipSecretText; |
| | | } |
| | | |
| | | public String getMachine() { |
| | | return this.machine; |
| | | } |
| | | |
| | | public void setMachine(String machine) { |
| | | this.machine = machine; |
| | | } |
| | | |
| | | public String getOs() { |
| | | return this.os; |
| | | } |
| | | |
| | | public void setOs(String os) { |
| | | this.os = os; |
| | | } |
| | | |
| | | public String getBrowser() { |
| | | return this.browser; |
| | | } |
| | | |
| | | public void setBrowser(String browser) { |
| | | this.browser = browser; |
| | | } |
| | | |
| | | public String getOsUser() { |
| | | return this.osUser; |
| | | } |
| | | |
| | | public void setOsUser(String osUser) { |
| | | this.osUser = osUser; |
| | | } |
| | | |
| | | public List<String> getDeviceInfo() { |
| | | return this.deviceInfo; |
| | | } |
| | | |
| | | public void setDeviceInfo(List<String> deviceInfo) { |
| | | this.deviceInfo = deviceInfo; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return this.email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getPhoneNo() { |
| | | return this.phoneNo; |
| | | } |
| | | |
| | | public void setPhoneNo(String phoneNo) { |
| | | this.phoneNo = phoneNo; |
| | | } |
| | | |
| | | public String getRtxNo() { |
| | | return this.rtxNo; |
| | | } |
| | | |
| | | public void setRtxNo(String rtxNo) { |
| | | this.rtxNo = rtxNo; |
| | | } |
| | | |
| | | public String getPortalId() { |
| | | return this.portalId; |
| | | } |
| | | |
| | | public void setPortalId(String portalId) { |
| | | this.portalId = portalId; |
| | | } |
| | | |
| | | public String getIMId() { |
| | | return this.IMId; |
| | | } |
| | | |
| | | public void setIMId(String IMId) { |
| | | this.IMId = IMId; |
| | | } |
| | | |
| | | public boolean isSso() { |
| | | return this.sso; |
| | | } |
| | | |
| | | public void setSso(boolean sso) { |
| | | this.sso = sso; |
| | | } |
| | | |
| | | public String getSsoServiceName() { |
| | | return this.ssoServiceName; |
| | | } |
| | | |
| | | public void setSsoServiceName(String ssoServiceName) { |
| | | this.ssoServiceName = ssoServiceName; |
| | | } |
| | | |
| | | public String getToken() { |
| | | return this.token; |
| | | } |
| | | |
| | | public void setToken(String token) { |
| | | this.token = token; |
| | | } |
| | | |
| | | public Map<String, String> getGlobalAttributeMap() { |
| | | return this.globalAttributeMap; |
| | | } |
| | | |
| | | public void setGlobalAttributeMap(Map<String, String> globalAttributeMap) { |
| | | this.globalAttributeMap = globalAttributeMap; |
| | | } |
| | | |
| | | public String getPersonId() { |
| | | return this.personId; |
| | | } |
| | | |
| | | public void setPersonId(String personId) { |
| | | this.personId = personId; |
| | | } |
| | | |
| | | public String getSexText() { |
| | | return this.sexText; |
| | | } |
| | | |
| | | public void setSexText(String sexText) { |
| | | this.sexText = sexText; |
| | | } |
| | | |
| | | public Map<String, String> getRolesName() { |
| | | return this.rolesName; |
| | | } |
| | | |
| | | public void setRolesName(Map<String, String> rolesName) { |
| | | this.rolesName = rolesName; |
| | | } |
| | | |
| | | public String getWorkNo() { |
| | | return this.workNo; |
| | | } |
| | | |
| | | public void setWorkNo(String workNo) { |
| | | this.workNo = workNo; |
| | | } |
| | | |
| | | public String getWorkTypeOid() { |
| | | return this.workTypeOid; |
| | | } |
| | | |
| | | public void setWorkTypeOid(String workTypeOid) { |
| | | this.workTypeOid = workTypeOid; |
| | | } |
| | | |
| | | public String getWorkTypeName() { |
| | | return this.workTypeName; |
| | | } |
| | | |
| | | public void setWorkTypeName(String workTypeName) { |
| | | this.workTypeName = workTypeName; |
| | | } |
| | | |
| | | public String toString() { |
| | | return "SessionInfo{orgsOid='" + this.orgsOid + '\'' + ", orgsName='" + this.orgsName + '\'' + ", deptOid='" + this.deptOid + '\'' + ", deptName='" + this.deptName + '\'' + ", userOid='" + this.userOid + '\'' + ", userId='" + this.userId + '\'' + ", userName='" + this.userName + '\'' + ", personOid='" + this.personOid + '\'' + ", personId='" + this.personId + '\'' + ", personName='" + this.personName + '\'' + ", dutyOid='" + this.dutyOid + '\'' + ", dutyName='" + this.dutyName + '\'' + ", workgroupOid='" + this.workgroupOid + '\'' + ", workgroupName='" + this.workgroupName + '\'' + ", workTypeOid='" + this.workTypeOid + '\'' + ", workTypeName='" + this.workTypeName + '\'' + ", usertype='" + this.usertype + '\'' + ", usertypeText='" + this.usertypeText + '\'' + ", sex='" + this.sex + '\'' + ", sexText='" + this.sexText + '\'' + ", rolesName=" + this.rolesName + ", functionOids=" + this.functionOids + ", photoUrl='" + this.photoUrl + '\'' + ", ip='" + this.ip + '\'' + ", language='" + this.language + '\'' + ", userSecret='" + this.userSecret + '\'' + ", userSecretText='" + this.userSecretText + '\'' + ", ipSecret='" + this.ipSecret + '\'' + ", ipSecretText='" + this.ipSecretText + '\'' + ", machine='" + this.machine + '\'' + ", os='" + this.os + '\'' + ", browser='" + this.browser + '\'' + ", osUser='" + this.osUser + '\'' + ", deviceInfo=" + this.deviceInfo + ", email='" + this.email + '\'' + ", phoneNo='" + this.phoneNo + '\'' + ", rtxNo='" + this.rtxNo + '\'' + ", portalId='" + this.portalId + '\'' + ", IMId='" + this.IMId + '\'' + ", sso=" + this.sso + ", ssoServiceName='" + this.ssoServiceName + '\'' + ", token='" + this.token + '\'' + ", globalAttributeMap=" + this.globalAttributeMap + ", workNo='" + this.workNo + '\'' + '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | public interface VciSecretServiceI { |
| | | |
| | | default String getLessThanUserSecretSql() { |
| | | SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfoNotException(); |
| | | return sessionInfo != null ? sessionInfo.getUserSecret() : ""; |
| | | } |
| | | |
| | | default boolean checkUserSecret(int dataSecret) { |
| | | SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfoNotException(); |
| | | if (sessionInfo != null) { |
| | | if (StringUtils.isBlank(sessionInfo.getUserSecret())) { |
| | | sessionInfo.setUserSecret(UserSecretEnum.NONE.getValue() + ""); |
| | | } |
| | | |
| | | return VciBaseUtil.getInt(sessionInfo.getUserSecret()) >= dataSecret; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.util; |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | 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.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | public class BeanUtilForVCI { |
| | | private static Logger logger = LoggerFactory.getLogger(BeanUtilForVCI.class); |
| | | |
| | | public BeanUtilForVCI() { |
| | | } |
| | | |
| | | public static void copyPropertiesIgnoreCase(Object source, Object target) { |
| | | copyPropertiesIgnoreCase(source, target, false); |
| | | } |
| | | |
| | | public static void copyPropertiesIgnoreCase(Object source, Object target, Map<String, String> fieldMap) { |
| | | copyPropertiesIgnoreCase(source, target, false, fieldMap); |
| | | } |
| | | |
| | | public static void copyPropertiesIgnoreCase(Object source, Object target, boolean ignoreNull) { |
| | | copyPropertiesIgnoreCase(source, target, ignoreNull, (Map)null); |
| | | } |
| | | |
| | | public static void copyDeclaredIgnoreCase(Object source, Object target) { |
| | | copyDeclaredIgnoreCase(source, target, false); |
| | | } |
| | | |
| | | public static void copyDeclaredIgnoreCase(Object source, Object target, boolean ignoreNull) { |
| | | copyDeclaredIgnoreCase(source, target, ignoreNull, (Map)null); |
| | | } |
| | | |
| | | public static void copyDeclaredIgnoreCase(Object source, Object target, boolean ignoreNull, Map<String, String> fieldMap) { |
| | | copyDeclaredIgnoreCase(source, target, ignoreNull, fieldMap, (Collection)null); |
| | | } |
| | | |
| | | public static void copyDeclaredIgnoreCase(Object source, Object target, boolean ignoreNull, Map<String, String> fieldMap, Collection<String> ignoreField) { |
| | | Map<String, Field> sourceMap = BeanUtilForVCI.CacheFieldMap.getDeclaredFieldMap(source.getClass()); |
| | | Map<String, Field> targetMap = BeanUtilForVCI.CacheFieldMap.getDeclaredFieldMap(target.getClass()); |
| | | copyPropertiesIgnoreCase(source, target, ignoreNull, fieldMap, ignoreField, sourceMap, targetMap); |
| | | } |
| | | |
| | | public static void copyPropertiesIgnoreCase(Object source, Object target, boolean ignoreNull, Map<String, String> fieldMap, Collection<String> ignoreField) { |
| | | Map<String, Field> sourceMap = BeanUtilForVCI.CacheFieldMap.getFieldMap(source.getClass()); |
| | | Map<String, Field> targetMap = BeanUtilForVCI.CacheFieldMap.getFieldMap(target.getClass()); |
| | | copyPropertiesIgnoreCase(source, target, ignoreNull, fieldMap, ignoreField, sourceMap, targetMap); |
| | | } |
| | | |
| | | public static void copyPropertiesIgnoreCase(Object source, Object target, boolean ignoreNull, Map<String, String> fieldMap, Collection<String> ignoreField, Map<String, Field> sourceMap, Map<String, Field> targetMap) { |
| | | if (fieldMap == null) { |
| | | fieldMap = new HashMap(); |
| | | } |
| | | |
| | | Map<String, String> finalFieldMap = fieldMap; |
| | | targetMap.values().forEach((it) -> { |
| | | boolean not = false; |
| | | if (ignoreField != null && ignoreField.contains(it.getName())) { |
| | | not = true; |
| | | } |
| | | |
| | | if (!not) { |
| | | String itFieldName = it.getName().toLowerCase().replace("_", ""); |
| | | itFieldName = (String) finalFieldMap.getOrDefault(itFieldName, itFieldName); |
| | | Field field = (Field)sourceMap.getOrDefault(itFieldName, (Field) null); |
| | | if (field != null) { |
| | | it.setAccessible(true); |
| | | field.setAccessible(true); |
| | | |
| | | try { |
| | | String sourceClassName = field.getClass().getName(); |
| | | String targetClassName = it.getClass().getName(); |
| | | if ((sourceClassName.equalsIgnoreCase(Boolean.class.getName()) || sourceClassName.equalsIgnoreCase(Boolean.TYPE.getName())) && targetClassName.equalsIgnoreCase(String.class.getName()) || (targetClassName.equalsIgnoreCase(Boolean.class.getName()) || targetClassName.equalsIgnoreCase(Boolean.TYPE.getName())) && sourceClassName.equalsIgnoreCase(String.class.getName())) { |
| | | if (targetClassName.equalsIgnoreCase(String.class.getName())) { |
| | | it.set(target, String.valueOf((Boolean)field.get(source))); |
| | | } else { |
| | | it.set(target, Boolean.valueOf((String)field.get(source))); |
| | | } |
| | | } else if (!ignoreNull) { |
| | | it.set(target, field.get(source)); |
| | | } else { |
| | | Object sourceValue = field.get(source); |
| | | if (sourceValue != null && StringUtils.isNotBlank(sourceValue.toString())) { |
| | | it.set(target, sourceValue); |
| | | } |
| | | } |
| | | } catch (IllegalAccessException var13) { |
| | | if (logger.isErrorEnabled()) { |
| | | logger.error("æ·è´å±æ§åºé" + var13); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | public static void copyPropertiesIgnoreCase(Object source, Object target, boolean ignoreNull, Map<String, String> fieldMap) { |
| | | copyPropertiesIgnoreCase(source, target, ignoreNull, fieldMap, (Collection)null); |
| | | } |
| | | |
| | | private static class CacheFieldMap { |
| | | private static Map<String, Map<String, Field>> cacheMap = new HashMap(); |
| | | private static Map<String, Map<String, Field>> declaredCacheMap = new HashMap(); |
| | | |
| | | private CacheFieldMap() { |
| | | } |
| | | |
| | | private static Map<String, Field> getFieldMap(Class clazz) { |
| | | Map<String, Field> result = (Map)cacheMap.get(clazz.getName()); |
| | | if (result == null) { |
| | | Class var2 = BeanUtilForVCI.CacheFieldMap.class; |
| | | synchronized(BeanUtilForVCI.CacheFieldMap.class) { |
| | | if (result == null) { |
| | | Map<String, Field> fieldMap = new HashMap(); |
| | | List<Field> allFields = VciBaseUtil.getAllFieldForObj(clazz); |
| | | if (!CollectionUtils.isEmpty(allFields)) { |
| | | allFields.stream().forEach((field) -> { |
| | | fieldMap.put(field.getName().toLowerCase().replace("_", ""), field); |
| | | }); |
| | | } |
| | | |
| | | cacheMap.put(clazz.getName(), fieldMap); |
| | | result = (Map)cacheMap.get(clazz.getName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private static Map<String, Field> getDeclaredFieldMap(Class clazz) { |
| | | Map<String, Field> result = (Map)declaredCacheMap.get(clazz.getName()); |
| | | if (result == null) { |
| | | Class var2 = BeanUtilForVCI.CacheFieldMap.class; |
| | | synchronized(BeanUtilForVCI.CacheFieldMap.class) { |
| | | if (result == null) { |
| | | Map<String, Field> fieldMap = new HashMap(); |
| | | Field[] allFields = clazz.getDeclaredFields(); |
| | | if (allFields != null && allFields.length > 0) { |
| | | Arrays.stream(allFields).forEach((field) -> { |
| | | fieldMap.put(field.getName().toLowerCase().replace("_", ""), field); |
| | | }); |
| | | } |
| | | |
| | | declaredCacheMap.put(clazz.getName(), fieldMap); |
| | | result = (Map)declaredCacheMap.get(clazz.getName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.util; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.util; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | public class Lunar { |
| | | private int year; |
| | | private int month; |
| | | private int day; |
| | | private boolean leap; |
| | | static final String[] chineseNumber = new String[]{"ä¸", "äº", "ä¸", "å", "äº", "å
", "ä¸", "å
«", "ä¹", "å", "åä¸", "åäº"}; |
| | | static SimpleDateFormat chineseDateFormat = new SimpleDateFormat("yyyyå¹´MMæddæ¥"); |
| | | static final long[] lunarInfo = new long[]{19416L, 19168L, 42352L, 21717L, 53856L, 55632L, 91476L, 22176L, 39632L, 21970L, 19168L, 42422L, 42192L, 53840L, 119381L, 46400L, 54944L, 44450L, 38320L, 84343L, 18800L, 42160L, 46261L, 27216L, 27968L, 109396L, 11104L, 38256L, 21234L, 18800L, 25958L, 54432L, 59984L, 28309L, 23248L, 11104L, 100067L, 37600L, 116951L, 51536L, 54432L, 120998L, 46416L, 22176L, 107956L, 9680L, 37584L, 53938L, 43344L, 46423L, 27808L, 46416L, 86869L, 19872L, 42448L, 83315L, 21200L, 43432L, 59728L, 27296L, 44710L, 43856L, 19296L, 43748L, 42352L, 21088L, 62051L, 55632L, 23383L, 22176L, 38608L, 19925L, 19152L, 42192L, 54484L, 53840L, 54616L, 46400L, 46496L, 103846L, 38320L, 18864L, 43380L, 42160L, 45690L, 27216L, 27968L, 44870L, 43872L, 38256L, 19189L, 18800L, 25776L, 29859L, 59984L, 27480L, 21952L, 43872L, 38613L, 37600L, 51552L, 55636L, 54432L, 55888L, 30034L, 22176L, 43959L, 9680L, 37584L, 51893L, 43344L, 46240L, 47780L, 44368L, 21977L, 19360L, 42416L, 86390L, 21168L, 43312L, 31060L, 27296L, 44368L, 23378L, 19296L, 42726L, 42208L, 53856L, 60005L, 54576L, 23200L, 30371L, 38608L, 19415L, 19152L, 42192L, 118966L, 53840L, 54560L, 56645L, 46496L, 22224L, 21938L, 18864L, 42359L, 42160L, 43600L, 111189L, 27936L, 44448L}; |
| | | |
| | | private static final int yearDays(int y) { |
| | | int sum = 348; |
| | | |
| | | for(int i = 32768; i > 8; i >>= 1) { |
| | | if ((lunarInfo[y - 1900] & (long)i) != 0L) { |
| | | ++sum; |
| | | } |
| | | } |
| | | |
| | | return sum + leapDays(y); |
| | | } |
| | | |
| | | private static final int leapDays(int y) { |
| | | if (leapMonth(y) != 0) { |
| | | return (lunarInfo[y - 1900] & 65536L) != 0L ? 30 : 29; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | private static final int leapMonth(int y) { |
| | | return (int)(lunarInfo[y - 1900] & 15L); |
| | | } |
| | | |
| | | private static final int monthDays(int y, int m) { |
| | | return (lunarInfo[y - 1900] & (long)(65536 >> m)) == 0L ? 29 : 30; |
| | | } |
| | | |
| | | public final String animalsYear() { |
| | | String[] Animals = new String[]{"é¼ ", "ç", "è", "å
", "é¾", "è", "马", "ç¾", "ç´", "鸡", "ç", "çª"}; |
| | | return Animals[(this.year - 4) % 12]; |
| | | } |
| | | |
| | | private static final String cyclicalm(int num) { |
| | | String[] Gan = new String[]{"ç²", "ä¹", "ä¸", "ä¸", "æ", "å·±", "åº", "è¾", "壬", "ç¸"}; |
| | | String[] Zhi = new String[]{"å", "ä¸", "å¯
", "å¯", "è¾°", "å·³", "å", "æª", "ç³", "é
", "æ", "亥"}; |
| | | return Gan[num % 10] + Zhi[num % 12]; |
| | | } |
| | | |
| | | public final String cyclical() { |
| | | int num = this.year - 1900 + 36; |
| | | return cyclicalm(num); |
| | | } |
| | | |
| | | public Lunar(Calendar cal) { |
| | | //int leapMonth = false; |
| | | Date baseDate = null; |
| | | |
| | | try { |
| | | baseDate = chineseDateFormat.parse("1900å¹´1æ31æ¥"); |
| | | } catch (ParseException var12) { |
| | | var12.printStackTrace(); |
| | | } |
| | | |
| | | int offset = (int)((cal.getTime().getTime() - baseDate.getTime()) / 86400000L); |
| | | int dayCyl = offset + 40; |
| | | int monCyl = 14; |
| | | int daysOfYear = 0; |
| | | |
| | | int iYear; |
| | | for(iYear = 1900; iYear < 2050 && offset > 0; ++iYear) { |
| | | daysOfYear = yearDays(iYear); |
| | | offset -= daysOfYear; |
| | | monCyl += 12; |
| | | } |
| | | |
| | | if (offset < 0) { |
| | | offset += daysOfYear; |
| | | --iYear; |
| | | monCyl -= 12; |
| | | } |
| | | |
| | | this.year = iYear; |
| | | int yearCyl = iYear - 1864; |
| | | int leapMonth = leapMonth(iYear); |
| | | this.leap = false; |
| | | int daysOfMonth = 0; |
| | | |
| | | int iMonth; |
| | | for(iMonth = 1; iMonth < 13 && offset > 0; ++iMonth) { |
| | | if (leapMonth > 0 && iMonth == leapMonth + 1 && !this.leap) { |
| | | --iMonth; |
| | | this.leap = true; |
| | | daysOfMonth = leapDays(this.year); |
| | | } else { |
| | | daysOfMonth = monthDays(this.year, iMonth); |
| | | } |
| | | |
| | | offset -= daysOfMonth; |
| | | if (this.leap && iMonth == leapMonth + 1) { |
| | | this.leap = false; |
| | | } |
| | | |
| | | if (!this.leap) { |
| | | ++monCyl; |
| | | } |
| | | } |
| | | |
| | | if (offset == 0 && leapMonth > 0 && iMonth == leapMonth + 1) { |
| | | if (this.leap) { |
| | | this.leap = false; |
| | | } else { |
| | | this.leap = true; |
| | | --iMonth; |
| | | --monCyl; |
| | | } |
| | | } |
| | | |
| | | if (offset < 0) { |
| | | offset += daysOfMonth; |
| | | --iMonth; |
| | | --monCyl; |
| | | } |
| | | |
| | | this.month = iMonth; |
| | | this.day = offset + 1; |
| | | } |
| | | |
| | | public static String getChinaDayString(int day) { |
| | | String[] chineseTen = new String[]{"å", "å", "廿", "å
"}; |
| | | int n = day % 10 == 0 ? 9 : day % 10 - 1; |
| | | if (day > 30) { |
| | | return ""; |
| | | } else { |
| | | return day == 10 ? "åå" : chineseTen[day / 10] + chineseNumber[n]; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | String m = chineseNumber[this.month - 1]; |
| | | if (m != null && m.trim().equals("ä¸")) { |
| | | m = "æ£"; |
| | | } |
| | | |
| | | if (m != null && m.trim().equals("åä¸")) { |
| | | m = "å¬"; |
| | | } |
| | | |
| | | if (m != null && m.trim().equals("åäº")) { |
| | | m = "è
"; |
| | | } |
| | | |
| | | return this.year + this.cyclical() + this.animalsYear() + "å¹´" + (this.leap ? "é°" : "") + m + "æ" + getChinaDayString(this.day); |
| | | } |
| | | |
| | | public String getDate() { |
| | | String m = chineseNumber[this.month - 1]; |
| | | if (m != null && m.trim().equals("ä¸")) { |
| | | m = "æ£"; |
| | | } |
| | | |
| | | if (m != null && m.trim().equals("åä¸")) { |
| | | m = "å¬"; |
| | | } |
| | | |
| | | if (m != null && m.trim().equals("åäº")) { |
| | | m = "è
"; |
| | | } |
| | | |
| | | return this.animalsYear() + "å¹´" + (this.leap ? "é°" : "") + m + "æ" + getChinaDayString(this.day); |
| | | } |
| | | |
| | | public static void main(String[] args) throws ParseException { |
| | | Calendar today = Calendar.getInstance(); |
| | | today.setTime(chineseDateFormat.parse("2013å¹´2æ1æ¥")); |
| | | Lunar lunar = new Lunar(today); |
| | | System.out.println(lunar.toString()); |
| | | System.out.println("å京æ¶é´ï¼" + chineseDateFormat.format(today.getTime()) + "ãåå" + lunar); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.util; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.util; |
| | | |
| | | import org.springframework.context.MessageSource; |
| | | import org.springframework.context.i18n.LocaleContextHolder; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class MessageUtils { |
| | | private static MessageSource messageSource; |
| | | |
| | | public MessageUtils(MessageSource messageSource) { |
| | | MessageUtils.messageSource = messageSource; |
| | | } |
| | | |
| | | public static String get(String msgKey) { |
| | | try { |
| | | return messageSource.getMessage(msgKey, (Object[])null, LocaleContextHolder.getLocale()); |
| | | } catch (Throwable var2) { |
| | | return msgKey; |
| | | } |
| | | } |
| | | |
| | | public static String get(String msgKey, Object[] objects) { |
| | | try { |
| | | return messageSource.getMessage(msgKey, objects, LocaleContextHolder.getLocale()); |
| | | } catch (Throwable var3) { |
| | | return msgKey; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.util; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | 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.util.CollectionUtils; |
| | | import org.springframework.util.ResourceUtils; |
| | | |
| | | import java.beans.IntrospectionException; |
| | | import java.beans.PropertyDescriptor; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.lang.Character.UnicodeBlock; |
| | | import java.lang.annotation.Annotation; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.net.InetAddress; |
| | | import java.net.NetworkInterface; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | 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 VciBaseUtil() { |
| | | } |
| | | |
| | | public static String getPk() { |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | public static int getIntForBoolean(boolean b) { |
| | | return b ? 1 : 0; |
| | | } |
| | | |
| | | public static int getIntFromHibernateResult(Object obj) { |
| | | if (obj == null) { |
| | | return 0; |
| | | } else if (obj instanceof BigDecimal) { |
| | | return ((BigDecimal)obj).intValue(); |
| | | } else if (obj instanceof BigInteger) { |
| | | return ((BigInteger)obj).intValue(); |
| | | } else if (obj instanceof Double) { |
| | | return ((Double)obj).intValue(); |
| | | } else if (obj instanceof Long) { |
| | | return ((Long)obj).intValue(); |
| | | } else if (obj instanceof Short) { |
| | | return ((Short)obj).intValue(); |
| | | } else if (obj instanceof Float) { |
| | | return ((Float)obj).intValue(); |
| | | } else if (obj instanceof String) { |
| | | try { |
| | | return Integer.valueOf(obj.toString()); |
| | | } catch (Exception var2) { |
| | | return 0; |
| | | } |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public static long getLong(String s) { |
| | | long l = 0L; |
| | | if (s == null) { |
| | | return 0L; |
| | | } else { |
| | | try { |
| | | l = Long.parseLong(s); |
| | | return l; |
| | | } catch (Exception var4) { |
| | | return 0L; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static float getFloat(String s) { |
| | | float f = 0.0F; |
| | | if (s == null) { |
| | | return 0.0F; |
| | | } else { |
| | | try { |
| | | f = Float.parseFloat(s); |
| | | return f; |
| | | } catch (Exception var3) { |
| | | return 0.0F; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static int getInt(String string) { |
| | | //int i = false; |
| | | if (string != null && !"".equals(string.trim())) { |
| | | if (string.contains(".")) { |
| | | string = string.substring(0, string.indexOf(".")); |
| | | } |
| | | |
| | | try { |
| | | int i = Integer.parseInt(string); |
| | | return i; |
| | | } catch (Exception var3) { |
| | | return 0; |
| | | } |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public static double getDouble(String s) { |
| | | double d = 0.0D; |
| | | if (isNull(s)) { |
| | | return 0.0D; |
| | | } else { |
| | | try { |
| | | d = Double.parseDouble(s); |
| | | return d; |
| | | } catch (Exception var4) { |
| | | return 0.0D; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static String removeComma(String s) { |
| | | if (s != null && s.trim().length() != 0) { |
| | | if (s.startsWith(",")) { |
| | | s = s.substring(1, s.length()); |
| | | } |
| | | |
| | | if (s.endsWith(",")) { |
| | | s = s.substring(0, s.length() - 1); |
| | | } |
| | | |
| | | return s; |
| | | } else { |
| | | return s; |
| | | } |
| | | } |
| | | |
| | | public static String toInSql(String s) { |
| | | s = removeComma(s); |
| | | if (s != null && s.trim().length() != 0) { |
| | | String[] temp = s.split(","); |
| | | return toInSql(temp); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String toInSql(String[] s) { |
| | | if (s != null && s.length > 0) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (s != null && s.length > 0) { |
| | | for(int i = 0; i < s.length; ++i) { |
| | | if (s[i] != null && s[i].trim().length() > 0 && !s[i].startsWith("'")) { |
| | | sb.append("'").append(s[i]).append("',"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return removeComma(sb.toString()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String toInSql(String field, String s) { |
| | | return !StringUtils.isBlank(field) && !StringUtils.isBlank(s) ? toInSql(field, removeComma(s).split(","), "") : ""; |
| | | } |
| | | |
| | | public static String toInSql(String field, String[] s) { |
| | | return toInSql(field, s, "in"); |
| | | } |
| | | |
| | | public static String toInSql(String field, String[] s, String operation) { |
| | | if (!StringUtils.isBlank(field) && s != null && s.length != 0) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (s != null && s.length > 0) { |
| | | String andOr = "or"; |
| | | if (operation.trim().toLowerCase().equals("not in")) { |
| | | andOr = "and"; |
| | | } |
| | | |
| | | for(int i = 0; i < s.length; ++i) { |
| | | if (s[i] != null && s[i].trim().length() > 0 && !s[i].startsWith("'")) { |
| | | if (i == 0) { |
| | | sb.append(field).append(" ").append(operation).append(" ("); |
| | | } |
| | | |
| | | if (i % 500 == 0 && i != 0) { |
| | | sb.append(" ").append(andOr).append(" ").append(field).append(" ").append(operation).append(" ("); |
| | | } |
| | | |
| | | sb.append("'").append(s[i]).append("'"); |
| | | if (i % 500 != 499 && i != s.length - 1) { |
| | | sb.append(","); |
| | | } |
| | | |
| | | if (i % 500 == 499 || i == s.length - 1) { |
| | | sb.append(") "); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public static String arrayToString(String[] array) { |
| | | if (array != null && array.length > 0) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | for(int i = 0; i < array.length; ++i) { |
| | | String record = array[i]; |
| | | if (StringUtils.isNotBlank(record)) { |
| | | sb.append(record).append(","); |
| | | } |
| | | } |
| | | |
| | | return removeComma(sb.toString()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String collectionToString(Collection collection) { |
| | | if (CollectionUtils.isEmpty(collection)) { |
| | | return ""; |
| | | } else { |
| | | StringBuilder sb = new StringBuilder(); |
| | | Iterator it = collection.iterator(); |
| | | |
| | | while(true) { |
| | | Object record; |
| | | do { |
| | | do { |
| | | if (!it.hasNext()) { |
| | | return removeComma(sb.toString()); |
| | | } |
| | | |
| | | record = it.next(); |
| | | } while(record == null); |
| | | } while(record instanceof String && !StringUtils.isNotBlank((String)record)); |
| | | |
| | | sb.append(record.toString()).append(","); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static String toUpForFirst(String s) { |
| | | if (s != null && s.trim().length() != 0) { |
| | | String temp = s.substring(0, 1); |
| | | temp = temp.toUpperCase(); |
| | | return temp + s.substring(1, s.length()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String toLowForFirst(String s) { |
| | | if (s != null && s.trim().length() != 0) { |
| | | String temp = s.substring(0, 1); |
| | | temp = temp.toLowerCase(); |
| | | return temp + s.substring(1, s.length()); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static int countOfString(String s, char findC) { |
| | | Map<String, Integer> charMap = new HashMap(); |
| | | char[] cs = s.toCharArray(); |
| | | char[] var4 = cs; |
| | | int var5 = cs.length; |
| | | |
| | | for(int var6 = 0; var6 < var5; ++var6) { |
| | | char c = var4[var6]; |
| | | charMap.put(String.valueOf(c), !charMap.containsKey(String.valueOf(c)) ? 1 : (Integer)charMap.get(String.valueOf(c)) + 1); |
| | | } |
| | | |
| | | return (Integer)charMap.get(String.valueOf(findC)); |
| | | } |
| | | |
| | | public static List<String> str2List(String s) { |
| | | if (isNull(s)) { |
| | | return null; |
| | | } else { |
| | | List<String> l = new ArrayList(); |
| | | Collections.addAll(l, removeComma(s).split(",")); |
| | | return l; |
| | | } |
| | | } |
| | | |
| | | public static String list2String(List<String> ls) { |
| | | return ls != null && ls.size() != 0 ? (String)ls.stream().collect(Collectors.joining(",")) : ""; |
| | | } |
| | | |
| | | public static boolean isNull(String o) { |
| | | return StringUtils.isEmpty(o); |
| | | } |
| | | |
| | | public static boolean isNotNull(String o) { |
| | | return !isNull(o); |
| | | } |
| | | |
| | | public static boolean isNullOrNullString(String o) { |
| | | return StringUtils.isBlank(o); |
| | | } |
| | | |
| | | public static boolean inArray(String[] arr, String s) { |
| | | if (arr != null && s != null) { |
| | | String[] var2 = arr; |
| | | int var3 = arr.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | String a = var2[var4]; |
| | | if (s.trim().equalsIgnoreCase(a)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public static boolean inArray(Object[] arr, Object o) { |
| | | if (arr != null && o != null) { |
| | | Object[] var2 = arr; |
| | | int var3 = arr.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | Object a = var2[var4]; |
| | | if (a.equals(o)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public static double round(double value, int scale, int roundingMode) { |
| | | BigDecimal bd = new BigDecimal(value); |
| | | bd = bd.setScale(scale, roundingMode); |
| | | double d = bd.doubleValue(); |
| | | bd = null; |
| | | return d; |
| | | } |
| | | |
| | | public static double round(double value, int scale) { |
| | | return round(value, scale, 4); |
| | | } |
| | | |
| | | public static boolean isEmail(String string) { |
| | | if (StringUtils.isBlank(string)) { |
| | | return false; |
| | | } else { |
| | | String regEx1 = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; |
| | | Pattern p = Pattern.compile(regEx1); |
| | | Matcher m = p.matcher(string); |
| | | return m.matches(); |
| | | } |
| | | } |
| | | |
| | | public static boolean isNumber(String s) { |
| | | return StringUtils.isNotBlank(s) && s.matches("\\d+\\.?\\d*"); |
| | | } |
| | | |
| | | public static Field getFieldForObject(String fieldName, List<Field> fieldsList) { |
| | | if (StringUtils.isBlank(fieldName)) { |
| | | return null; |
| | | } else { |
| | | if (fieldsList != null && fieldsList.size() > 0) { |
| | | Iterator var2 = fieldsList.iterator(); |
| | | |
| | | while(var2.hasNext()) { |
| | | Field field = (Field)var2.next(); |
| | | if (field.getName().toLowerCase().equals(fieldName.toLowerCase())) { |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static Method getSetmethod(Class c, String fieldName) { |
| | | if (c != null && StringUtils.isNotBlank(fieldName)) { |
| | | try { |
| | | PropertyDescriptor pd = new PropertyDescriptor(fieldName, c); |
| | | return pd.getWriteMethod(); |
| | | } catch (SecurityException var3) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var3); |
| | | } |
| | | } catch (IntrospectionException var4) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var4); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Method getGetmethod(Class c, String fieldName) { |
| | | if (c != null && StringUtils.isNotBlank(fieldName)) { |
| | | try { |
| | | PropertyDescriptor pd = new PropertyDescriptor(fieldName, c); |
| | | return pd.getReadMethod(); |
| | | } catch (SecurityException var3) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var3); |
| | | } |
| | | } catch (IntrospectionException var4) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("è·ågetteråºé", var4); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static String getColumnAnnotaionNameValue(Annotation[] fieldAnnotaions) { |
| | | return getAnnotationValue("com.vci.starter.web.annotation.Column,javax.persistence.Column", "name", fieldAnnotaions); |
| | | } |
| | | |
| | | public static String getAnnotationValue(String annotationName, String methodName, Annotation[] fieldAnnotaions) { |
| | | String[] annotaionNameArray = annotationName.split(","); |
| | | Annotation[] var4 = fieldAnnotaions; |
| | | int var5 = fieldAnnotaions.length; |
| | | |
| | | for(int var6 = 0; var6 < var5; ++var6) { |
| | | Annotation annotation = var4[var6]; |
| | | String anname = annotation.annotationType().getName(); |
| | | if (inArray(annotaionNameArray, anname)) { |
| | | String name = null; |
| | | |
| | | try { |
| | | name = (String)annotation.getClass().getMethod(methodName).invoke(annotation); |
| | | } catch (IllegalAccessException var11) { |
| | | var11.printStackTrace(); |
| | | } catch (InvocationTargetException var12) { |
| | | var12.printStackTrace(); |
| | | } catch (NoSuchMethodException var13) { |
| | | var13.printStackTrace(); |
| | | } |
| | | |
| | | return name; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Object getValueFromField(String fieldName, Object sourceObject) { |
| | | if (StringUtils.isNotBlank(fieldName)) { |
| | | try { |
| | | Method getMethod = getGetmethod(sourceObject.getClass(), fieldName); |
| | | if (getMethod != null) { |
| | | return getMethod.invoke(sourceObject); |
| | | } |
| | | |
| | | Field field = getFieldForObject(fieldName, sourceObject); |
| | | if (field != null) { |
| | | field.setAccessible(true); |
| | | return field.get(sourceObject); |
| | | } |
| | | } catch (SecurityException var4) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var4); |
| | | } |
| | | } catch (IllegalAccessException var5) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var5); |
| | | } |
| | | } catch (IllegalArgumentException var6) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var6); |
| | | } |
| | | } catch (InvocationTargetException var7) { |
| | | if (log.isErrorEnabled()) { |
| | | log.error("ä»å±æ§ä¸è·åå¼", var7); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static void setValueForMethod(Field field, Object obj, Object value) { |
| | | try { |
| | | if (field != null) { |
| | | field.setAccessible(true); |
| | | Method setMethod = getSetmethod(field.getDeclaringClass(), field.getName()); |
| | | setMethod.invoke(obj, value); |
| | | } |
| | | } catch (Exception var4) { |
| | | log.error("åå°è°ç¨æ¹æ³åºç°äºé误,", var4); |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void alertNotNull(Object... s) throws VciBaseException { |
| | | if (s != null && s.length > 0) { |
| | | for(int i = 0; i < s.length; ++i) { |
| | | Object obj = s[i]; |
| | | String param = ""; |
| | | |
| | | try { |
| | | ++i; |
| | | param = s[i].toString(); |
| | | } catch (Exception var5) { |
| | | } |
| | | |
| | | if (obj == null) { |
| | | throw new VciBaseException("åæ°[{0}]ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | |
| | | if (obj instanceof Collection) { |
| | | if (CollectionUtils.isEmpty((Collection)obj)) { |
| | | throw new VciBaseException("åæ°[{0}]ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | } else if (StringUtils.isBlank(obj.toString())) { |
| | | throw new VciBaseException("åæ°[{0}]ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public static void alertCollectionNotNull(String param, Collection collections) throws VciBaseException { |
| | | if (CollectionUtils.isEmpty(collections)) { |
| | | throw new VciBaseException("åæ°{0}ä¸è½ä¸ºç©º", new String[]{param}); |
| | | } |
| | | } |
| | | |
| | | public static <T> Set<Set<T>> switchSetForOracleIn(Set<T> set) { |
| | | Set<Set<T>> listHasList = new HashSet(); |
| | | if (set == null) { |
| | | return listHasList; |
| | | } else { |
| | | int muti = 1; |
| | | if (set.size() > 500) { |
| | | int balance = set.size() % 500; |
| | | muti = (set.size() - balance) / 500 + (balance == 0 ? 0 : 1); |
| | | } |
| | | |
| | | List list = new ArrayList(); |
| | | Iterator it = set.iterator(); |
| | | |
| | | while(it.hasNext()) { |
| | | list.add(it.next()); |
| | | } |
| | | |
| | | for(int i = 0; i < muti; ++i) { |
| | | int start = i * 500; |
| | | int end = start + 500; |
| | | if (i == muti - 1 || end > set.size()) { |
| | | end = set.size(); |
| | | } |
| | | |
| | | List subList = list.subList(start, end); |
| | | Set subSet = new HashSet(); |
| | | Iterator var10 = subList.iterator(); |
| | | |
| | | while(var10.hasNext()) { |
| | | Object obj = var10.next(); |
| | | subSet.add(obj); |
| | | } |
| | | |
| | | listHasList.add(subSet); |
| | | } |
| | | |
| | | return listHasList; |
| | | } |
| | | } |
| | | |
| | | public static <T> Vector<Vector<T>> switchVectorForOracleIn(Vector<T> vector) { |
| | | Vector<Vector<T>> listHasList = new Vector(); |
| | | if (vector == null) { |
| | | return listHasList; |
| | | } else { |
| | | int muti = 1; |
| | | if (vector.size() > 500) { |
| | | int balance = vector.size() % 500; |
| | | muti = (vector.size() - balance) / 500 + (balance == 0 ? 0 : 1); |
| | | } |
| | | |
| | | List list = new ArrayList(); |
| | | Iterator it = vector.iterator(); |
| | | |
| | | while(it.hasNext()) { |
| | | list.add(it.next()); |
| | | } |
| | | |
| | | for(int i = 0; i < muti; ++i) { |
| | | int start = i * 500; |
| | | int end = start + 500; |
| | | if (i == muti - 1 || end > vector.size()) { |
| | | end = vector.size(); |
| | | } |
| | | |
| | | List subList = list.subList(start, end); |
| | | Vector subSet = new Vector(); |
| | | Iterator var10 = subList.iterator(); |
| | | |
| | | while(var10.hasNext()) { |
| | | Object obj = var10.next(); |
| | | subSet.add(obj); |
| | | } |
| | | |
| | | listHasList.add(subSet); |
| | | } |
| | | |
| | | return listHasList; |
| | | } |
| | | } |
| | | |
| | | public static <T> T jsonString2JavaBean(String jsonString, Class<T> beanClass) { |
| | | return JSONObject.parseObject(jsonString, beanClass); |
| | | } |
| | | |
| | | public static void ifNullSetDefautl(String str, String defaultValue) { |
| | | if (isNull(str)) { |
| | | ; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static <T> T getFristObjectFromJson(String jsonString, Class<T> beanClass) { |
| | | return !isNull(jsonString) ? JSONObject.parseArray(jsonString, beanClass).get(0) : null; |
| | | } |
| | | |
| | | public static String getJSONStringWithDateFormat(Object obj) { |
| | | return JSONObject.toJSONStringWithDateFormat(obj, "yyyy-MM-dd HH:mm:ss.SSS", new SerializerFeature[]{SerializerFeature.WriteDateUseDateFormat}); |
| | | } |
| | | |
| | | public static Map<String, Object> objectToMap(Object o) { |
| | | Map<String, Object> map = new HashMap(); |
| | | if (o != null) { |
| | | String jsonString = JSONObject.toJSONStringWithDateFormat(o, "yyyy-MM-dd HH:mm:ss.SSS", new SerializerFeature[]{SerializerFeature.WriteDateUseDateFormat}); |
| | | if (StringUtils.isNotBlank(jsonString)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if (jsonObject != null) { |
| | | Iterator var4 = jsonObject.keySet().iterator(); |
| | | |
| | | while(var4.hasNext()) { |
| | | String key = (String)var4.next(); |
| | | map.put(key, jsonObject.get(key)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public static Map<String, String> objectToMapString(Object o) { |
| | | Map<String, String> map = new HashMap(); |
| | | if (o != null) { |
| | | String jsonString = JSONObject.toJSONStringWithDateFormat(o, "yyyy-MM-dd HH:mm:ss.SSS", new SerializerFeature[]{SerializerFeature.WriteDateUseDateFormat}); |
| | | if (StringUtils.isNotBlank(jsonString)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if (jsonObject != null) { |
| | | Iterator var4 = jsonObject.keySet().iterator(); |
| | | |
| | | while(var4.hasNext()) { |
| | | String key = (String)var4.next(); |
| | | map.put(key, jsonObject.getString(key)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public static boolean isNotNullForField(Object obj, Field f) { |
| | | return !"serialVersionUID".equalsIgnoreCase(f.getName()) && !"DEFAULT_INITIAL_CAPACITY".equalsIgnoreCase(f.getName()) && null != obj && !isNullOrNullString(obj.toString()); |
| | | } |
| | | |
| | | public static String array2String(String[] array) { |
| | | if (null != array && array.length != 0) { |
| | | String ss = ""; |
| | | String[] var2 = array; |
| | | int var3 = array.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | String s = var2[var4]; |
| | | ss = ss + s + ","; |
| | | } |
| | | |
| | | return removeComma(ss); |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static void copyValueForMap(Map source, Map target, String[] copyField) { |
| | | Map<String, String> copyFieldMap = new HashMap(); |
| | | String[] var4 = copyField; |
| | | int var5 = copyField.length; |
| | | |
| | | for(int var6 = 0; var6 < var5; ++var6) { |
| | | String field = var4[var6]; |
| | | copyFieldMap.put(field, field); |
| | | } |
| | | |
| | | copyValueForMap(source, target, (Map)copyFieldMap); |
| | | } |
| | | |
| | | public static void copyValueForMap(Map source, Map target, Map<String, String> copyField) { |
| | | try { |
| | | Iterator it = copyField.keySet().iterator(); |
| | | |
| | | while(it.hasNext()) { |
| | | String field = (String)it.next(); |
| | | target.put(field, source.get(copyField.get(field))); |
| | | } |
| | | } catch (Exception var5) { |
| | | } |
| | | |
| | | } |
| | | |
| | | public static Double getDoubleFromMap(String field, Map<String, Object> record) { |
| | | if (!isNullOrNullString(field) && record != null && record.containsKey(field)) { |
| | | Object v = record.get(field); |
| | | if (v instanceof BigDecimal) { |
| | | return ((BigDecimal)v).doubleValue(); |
| | | } else { |
| | | return v instanceof Double ? (Double)v : getDouble((String)v); |
| | | } |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String getDataByKey(String key, Map<String, Object> data) { |
| | | String value = ""; |
| | | if (data.containsKey(key)) { |
| | | value = (String)data.get(key); |
| | | } |
| | | |
| | | if (value == null) { |
| | | value = ""; |
| | | } |
| | | |
| | | return value; |
| | | } |
| | | |
| | | public static Map getNotNullMap(Map map) { |
| | | if (map == null) { |
| | | return new HashMap(); |
| | | } else { |
| | | Iterator it = map.keySet().iterator(); |
| | | HashMap unNullMap = new HashMap(); |
| | | |
| | | while(true) { |
| | | while(true) { |
| | | String newKey; |
| | | Object value; |
| | | do { |
| | | if (!it.hasNext()) { |
| | | return unNullMap; |
| | | } |
| | | |
| | | Object key = it.next(); |
| | | newKey = key.toString().toLowerCase(); |
| | | value = map.get(key); |
| | | } while(value == null); |
| | | |
| | | if (value instanceof String && isNotNull(value.toString())) { |
| | | unNullMap.put(newKey, value); |
| | | } else if (!(value instanceof String)) { |
| | | unNullMap.put(newKey, value); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static List<Field> getAllFieldForObj(Class c) { |
| | | List<Field> allField = new ArrayList(); |
| | | Set<String> fieldNameSet = new HashSet(); |
| | | |
| | | for(Class classz = c; classz != Object.class; classz = classz.getSuperclass()) { |
| | | Field[] thisClassField = classz.getDeclaredFields(); |
| | | Field[] var5 = thisClassField; |
| | | int var6 = thisClassField.length; |
| | | |
| | | for(int var7 = 0; var7 < var6; ++var7) { |
| | | Field field = var5[var7]; |
| | | if (!field.getName().equals("serialVersionUID")) { |
| | | String fieldLowerName = field.getName().toLowerCase(); |
| | | if (!fieldNameSet.contains(fieldLowerName)) { |
| | | fieldNameSet.add(fieldLowerName); |
| | | allField.add(field); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return allField; |
| | | } |
| | | |
| | | public static Field getTsField(Class c) { |
| | | List<Field> allField = getAllFieldForObj(c); |
| | | if (allField != null && allField.size() > 0) { |
| | | Iterator var2 = allField.iterator(); |
| | | |
| | | while(var2.hasNext()) { |
| | | Field field = (Field)var2.next(); |
| | | if (field.getName().equals("ts")) { |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Field getFieldForObject(String fieldName, Object obj) { |
| | | return obj == null ? null : getFieldForObject(fieldName, obj.getClass()); |
| | | } |
| | | |
| | | public static Field getFieldForObject(String fieldName, Class c) { |
| | | List<Field> allField = getAllFieldForObj(c); |
| | | if (allField != null && allField.size() > 0) { |
| | | Iterator var3 = allField.iterator(); |
| | | |
| | | while(var3.hasNext()) { |
| | | Field field = (Field)var3.next(); |
| | | if (field.getName().toLowerCase().equalsIgnoreCase(fieldName.toLowerCase())) { |
| | | return field; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static Method getSetmethod(Class c, Field field) { |
| | | return getSetmethod(c, field.getName()); |
| | | } |
| | | |
| | | public static Method getGetmethod(Class c, Field field) { |
| | | return getGetmethod(c, field.getName()); |
| | | } |
| | | |
| | | public static Method getMethodByName(Class<?> classObj, String methodName) { |
| | | alertNotNull(classObj, "è·åæ¹æ³ç对象æå±çç±»", methodName, "æ¹æ³çåå"); |
| | | Method[] methods = classObj.getMethods(); |
| | | List<Method> sameMethods = (List)Arrays.stream(methods).filter((method) -> { |
| | | return method.getName().equalsIgnoreCase(methodName); |
| | | }).collect(Collectors.toList()); |
| | | return !CollectionUtils.isEmpty(sameMethods) ? (Method)sameMethods.get(0) : null; |
| | | } |
| | | |
| | | public static Map<String, String> whereSql2Map(String whereSql) { |
| | | Map<String, String> map = new HashMap(); |
| | | if (isNotNull(whereSql)) { |
| | | String[] selects = whereSql.split("and"); |
| | | if (selects != null && selects.length > 0) { |
| | | String[] var3 = selects; |
| | | int var4 = selects.length; |
| | | |
| | | for(int var5 = 0; var5 < var4; ++var5) { |
| | | String s = var3[var5]; |
| | | s = s.trim(); |
| | | map.put(s.substring(0, s.indexOf(" ")).trim(), s.substring(s.indexOf(" ") + 1).trim()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public static synchronized String getRoundFilename(String prefix) { |
| | | if (prefix == null) { |
| | | prefix = ""; |
| | | } |
| | | |
| | | return prefix + System.currentTimeMillis(); |
| | | } |
| | | |
| | | 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 var1) { |
| | | localIp = "127.0.0.1"; |
| | | } |
| | | } |
| | | |
| | | return localIp; |
| | | } |
| | | |
| | | private static InetAddress getLocalHostLANAddress() throws Exception { |
| | | try { |
| | | InetAddress candidateAddress = null; |
| | | Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); |
| | | |
| | | while(ifaces.hasMoreElements()) { |
| | | NetworkInterface iface = (NetworkInterface)ifaces.nextElement(); |
| | | Enumeration inetAddrs = iface.getInetAddresses(); |
| | | |
| | | while(inetAddrs.hasMoreElements()) { |
| | | InetAddress inetAddr = (InetAddress)inetAddrs.nextElement(); |
| | | if (!inetAddr.isLoopbackAddress()) { |
| | | if (inetAddr.isSiteLocalAddress()) { |
| | | return inetAddr; |
| | | } |
| | | |
| | | if (candidateAddress == null) { |
| | | candidateAddress = inetAddr; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (candidateAddress != null) { |
| | | return candidateAddress; |
| | | } else { |
| | | InetAddress jdkSuppliedAddress = InetAddress.getLocalHost(); |
| | | return jdkSuppliedAddress; |
| | | } |
| | | } catch (Exception var5) { |
| | | var5.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String getProjectPath() { |
| | | String path = ""; |
| | | |
| | | try { |
| | | String jarFilePath = ResourceUtils.getURL("classpath:").getPath(); |
| | | if (jarFilePath.contains("!")) { |
| | | path = (new File(jarFilePath)).getParentFile().getParentFile().getParent(); |
| | | } else { |
| | | path = (new File(jarFilePath)).getParent(); |
| | | } |
| | | } catch (IOException var2) { |
| | | throw new VciBaseException("è·åå½åæå¡æå¨çæä»¶å¤¹åºç°äºé误"); |
| | | } |
| | | |
| | | if (path.startsWith("file:\\")) { |
| | | path = path.substring(6); |
| | | } |
| | | |
| | | return path; |
| | | } |
| | | |
| | | public static Map<String, String> getParamsByUrl(String url) { |
| | | if (StringUtils.isBlank(url)) { |
| | | return new HashMap(); |
| | | } else { |
| | | String[] array = url.split("&"); |
| | | Map<String, String> params = new HashMap(); |
| | | String[] var3 = array; |
| | | int var4 = array.length; |
| | | |
| | | for(int var5 = 0; var5 < var4; ++var5) { |
| | | String temp = var3[var5]; |
| | | if (temp.contains("=")) { |
| | | String[] keyValues = temp.split("="); |
| | | params.put(keyValues[0], keyValues[1]); |
| | | } else { |
| | | params.put(temp, ""); |
| | | } |
| | | } |
| | | |
| | | return params; |
| | | } |
| | | } |
| | | |
| | | public static boolean isChinese(char c) { |
| | | UnicodeBlock ub = UnicodeBlock.of(c); |
| | | return ub == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || ub == UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS || ub == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == UnicodeBlock.GENERAL_PUNCTUATION || ub == UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION || ub == UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS; |
| | | } |
| | | |
| | | public static boolean containsKeyUnCaseForMap(Map map, String key) { |
| | | if (!CollectionUtils.isEmpty(map)) { |
| | | boolean[] finded = new boolean[]{false}; |
| | | map.forEach((k, value) -> { |
| | | if (k instanceof String && k.toString().toLowerCase(Locale.ROOT).equalsIgnoreCase(key)) { |
| | | finded[0] = true; |
| | | } |
| | | }); |
| | | return finded[0]; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public static boolean isChinese(String str) { |
| | | char[] ch = str.toCharArray(); |
| | | char[] var2 = ch; |
| | | int var3 = ch.length; |
| | | |
| | | for(int var4 = 0; var4 < var3; ++var4) { |
| | | char c = var2[var4]; |
| | | if (isChinese(c)) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public static String toDBC(String input) { |
| | | if (StringUtils.isBlank(input)) { |
| | | return input; |
| | | } else { |
| | | char[] c = input.toCharArray(); |
| | | |
| | | for(int i = 0; i < c.length; ++i) { |
| | | if (c[i] == 12288) { |
| | | c[i] = ' '; |
| | | } else if (c[i] > '\uff00' && c[i] < 'ï½') { |
| | | c[i] -= 'ï» '; |
| | | } |
| | | } |
| | | |
| | | return new String(c); |
| | | } |
| | | } |
| | | |
| | | public static String toSBC(String input) { |
| | | if (StringUtils.isBlank(input)) { |
| | | return input; |
| | | } else { |
| | | char[] c = input.toCharArray(); |
| | | |
| | | for(int i = 0; i < c.length; ++i) { |
| | | if (c[i] == 12288) { |
| | | c[i] = ' '; |
| | | } else if (c[i] > '\uff00' && c[i] < 'ï½') { |
| | | c[i] += 'ï» '; |
| | | } |
| | | } |
| | | |
| | | return new String(c); |
| | | } |
| | | } |
| | | |
| | | public static SessionInfo getCurrentUserSessionInfoNotException() { |
| | | return (SessionInfo) WebThreadLocalUtil.getCurrentUserSessionInfoInThread().get(); |
| | | } |
| | | |
| | | 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 obj instanceof Date ? VciDateUtil.date2Str((Date)obj, "yyyy-MM-dd HH:mm:ss.SSS") : obj.toString(); |
| | | } else { |
| | | if (obj instanceof Double) { |
| | | Double aDouble = (Double)obj; |
| | | if (aDouble != null && aDouble % 1.0D == 0.0D) { |
| | | return String.valueOf(aDouble.intValue()); |
| | | } |
| | | } |
| | | |
| | | return String.valueOf(obj); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.util; |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.com.vci.starter.util.VciBaseUtil; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | public class VciDateUtil { |
| | | private static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; |
| | | public static final String DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; |
| | | public static final String DateTimeFormatStr = "yyyyMMddHHmmss"; |
| | | public static final String DateTimeMillFormatStr = "yyyyMMddHHmmssSSS"; |
| | | public static final String DateTimeMillFormat = "yyyy-MM-dd HH:mm:ss.SSS"; |
| | | public static final String DateFormat = "yyyy-MM-dd"; |
| | | public static final String TimeFormat = "HH:mm:ss"; |
| | | |
| | | private VciDateUtil() { |
| | | } |
| | | |
| | | public static Date str2Date(String str, String format) throws Exception { |
| | | if (null != str && !"".equals(str) && !str.equals("null")) { |
| | | if (null == format || "".equals(format) || format.equals("null")) { |
| | | format = "yyyy-MM-dd HH:mm:ss.SSS"; |
| | | } |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format); |
| | | Date date = null; |
| | | |
| | | try { |
| | | date = sdf.parse(str); |
| | | return date; |
| | | } catch (ParseException var5) { |
| | | throw new Exception(var5); |
| | | } |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static Date getCurrentMonday() { |
| | | return getCurrentWeekDay(2); |
| | | } |
| | | |
| | | public static Date getCurrentWeekDay(int dayOfWeek) { |
| | | if (dayOfWeek > 7) { |
| | | dayOfWeek = 7; |
| | | } |
| | | |
| | | if (dayOfWeek < 1) { |
| | | dayOfWeek = 1; |
| | | } |
| | | |
| | | Date date = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.set(7, dayOfWeek); |
| | | calendar.set(11, 0); |
| | | calendar.set(12, 0); |
| | | calendar.set(13, 0); |
| | | calendar.set(14, 0); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | public static Date getCurrentFriday() { |
| | | return getCurrentWeekDay(6); |
| | | } |
| | | |
| | | public static String date2Str(Date date, String format) { |
| | | if (null == date) { |
| | | return null; |
| | | } else { |
| | | if (format == null || format.trim().length() == 0) { |
| | | format = "yyyy-MM-dd HH:mm:ss.SSS"; |
| | | } |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format); |
| | | return sdf.format(date); |
| | | } |
| | | } |
| | | |
| | | public static String timestamp2Str(Timestamp time) { |
| | | Date date = null; |
| | | if (null == time) { |
| | | return null; |
| | | } else { |
| | | if (null != time) { |
| | | date = new Date(time.getTime()); |
| | | } |
| | | |
| | | return date2Str(date, "yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } |
| | | } |
| | | |
| | | public static Timestamp str2Timestamp(String str) throws Exception { |
| | | if (str != null && str.trim().length() != 0) { |
| | | Date date = str2Date(str, "yyyy-MM-dd HH:mm:ss.SSS"); |
| | | return new Timestamp(date.getTime()); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String compareDate(String date, String date1) throws Exception { |
| | | if (date != null && date.trim().length() != 0 && date1 != null && date1.trim().length() != 0) { |
| | | try { |
| | | long time = str2Date(date, "yyyy-MM-dd").getTime(); |
| | | long time1 = str2Date(date1, "yyyy-MM-dd").getTime(); |
| | | if (time == time1) { |
| | | return "="; |
| | | } else if (time < time1) { |
| | | return "<"; |
| | | } else { |
| | | return time > time1 ? ">" : ""; |
| | | } |
| | | } catch (Exception var6) { |
| | | throw var6; |
| | | } |
| | | } else { |
| | | throw new Exception("ä¼ å
¥compareDateçåæ°ä¸ºç©º"); |
| | | } |
| | | } |
| | | |
| | | public static String compareDate(Date date, Date date1) { |
| | | if (date != null && date1 != null) { |
| | | long time = date.getTime(); |
| | | long time1 = date1.getTime(); |
| | | if (time == time1) { |
| | | return "="; |
| | | } else if (time < time1) { |
| | | return "<"; |
| | | } else { |
| | | return time > time1 ? ">" : ""; |
| | | } |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String dateTimeAddMinutes(String date, int minute) throws Exception { |
| | | String ret = ""; |
| | | if (date == null || date.equals("")) { |
| | | date = date2Str(getNow(), "yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } |
| | | |
| | | if (minute == 0) { |
| | | return date; |
| | | } else { |
| | | Date d = str2Date(date, "yyyy-MM-dd HH:mm:ss"); |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(d); |
| | | cal.add(12, minute); |
| | | return date2Str(cal.getTime(), "yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | } |
| | | |
| | | public static Date getDateAddDay(String date, int dayCount) throws Exception { |
| | | if (date != null && !date.equals("") && !date.equals("null")) { |
| | | if (dayCount == 0) { |
| | | return str2Date(date, "yyyy-MM-dd"); |
| | | } else { |
| | | Date d = str2Date(date, "yyyy-MM-dd"); |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(d); |
| | | cal.add(5, dayCount); |
| | | return cal.getTime(); |
| | | } |
| | | } else { |
| | | return getNow(); |
| | | } |
| | | } |
| | | |
| | | public static Date getDateAddDay(Date date, int dayCount) { |
| | | if (dayCount == 0) { |
| | | return date; |
| | | } else { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(date); |
| | | cal.add(5, dayCount); |
| | | return cal.getTime(); |
| | | } |
| | | } |
| | | |
| | | public static long getDaySub(String beginDateStr, String endDateStr) { |
| | | if (beginDateStr != null && !beginDateStr.trim().equals("") && endDateStr != null && !endDateStr.trim().equals("")) { |
| | | long day = 0L; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | try { |
| | | Date beginDate = format.parse(beginDateStr); |
| | | Date endDate = format.parse(endDateStr); |
| | | day = (endDate.getTime() - beginDate.getTime()) / 86400000L; |
| | | } catch (ParseException var8) { |
| | | var8.printStackTrace(); |
| | | } |
| | | |
| | | return day; |
| | | } else { |
| | | return 0L; |
| | | } |
| | | } |
| | | |
| | | public static long getDaySub(Date date, Date date1) { |
| | | return (date.getTime() - date1.getTime()) / 86400000L; |
| | | } |
| | | |
| | | public static Date addOrSubDate(Date d, int addDayType, int addCount) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(d); |
| | | cal.add(addDayType, addCount); |
| | | return cal.getTime(); |
| | | } |
| | | |
| | | public static Date getNow() { |
| | | return new Date(); |
| | | } |
| | | |
| | | public static String getNowString() { |
| | | return getNowString("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } |
| | | |
| | | public static String getNowString(String simpleDateFormat) { |
| | | Date currentTime = new Date(); |
| | | SimpleDateFormat formatter = new SimpleDateFormat(simpleDateFormat); |
| | | return formatter.format(currentTime); |
| | | } |
| | | |
| | | public static Date getNow(String simpleDateFormat) throws Exception { |
| | | return str2Date(getNowString(simpleDateFormat), simpleDateFormat); |
| | | } |
| | | |
| | | public static String getCountdown(String oldtime, String newTime) { |
| | | if (oldtime != null && !oldtime.trim().equals("") && newTime != null && !newTime.equals("")) { |
| | | try { |
| | | Date date1 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(oldtime); |
| | | Date date2 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(newTime); |
| | | long l = date1.getTime() - date2.getTime() > 0L ? date1.getTime() - date2.getTime() : date2.getTime() - date1.getTime(); |
| | | long d = 0L; |
| | | long yushu = l; |
| | | long h = 0L; |
| | | long m = 0L; |
| | | if (l > 86400000L) { |
| | | yushu = l % 86400000L; |
| | | d = (l - yushu) / 86400000L; |
| | | } |
| | | |
| | | if (yushu > 3600000L) { |
| | | h = (yushu - yushu % 3600000L) / 3600000L; |
| | | yushu %= 3600000L; |
| | | } |
| | | |
| | | if (yushu > 60000L) { |
| | | m = (yushu - yushu % 60000L) / 60000L; |
| | | } |
| | | |
| | | return date1.getTime() - date2.getTime() < 0L ? "å·²ç»è¶
æ" + d + "天" + h + "å°æ¶" + m + "å" : "è¿å©ä¸" + d + "天" + h + "å°æ¶" + m + "å"; |
| | | } catch (Exception var14) { |
| | | return ""; |
| | | } |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static long getDateDiffer(String oldTime, String newTime) { |
| | | if (oldTime != null && !oldTime.trim().equals("") && newTime != null && !newTime.equals("")) { |
| | | try { |
| | | Date date1 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(oldTime); |
| | | Date date2 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(newTime); |
| | | return date1.getTime() - date2.getTime(); |
| | | } catch (Exception var4) { |
| | | return 0L; |
| | | } |
| | | } else { |
| | | return 0L; |
| | | } |
| | | } |
| | | |
| | | public static int getWeeks(int year) { |
| | | if (year == 0) { |
| | | return year; |
| | | } else { |
| | | //int week = false; |
| | | int days = 365; |
| | | if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) { |
| | | days = 366; |
| | | } |
| | | |
| | | int week = days / 7; |
| | | return week; |
| | | } |
| | | } |
| | | |
| | | public static int getWeekOnDate(Date date) { |
| | | GregorianCalendar g = new GregorianCalendar(); |
| | | g.setTime(date); |
| | | return isSunday(date) ? g.get(3) - 1 : g.get(3); |
| | | } |
| | | |
| | | public static Calendar getCalendarFromWeek(String year, int week) throws Exception { |
| | | Date newDate = str2Date(year + "-01-01", "yyyy-MM-dd"); |
| | | Calendar caleNew = Calendar.getInstance(); |
| | | caleNew.setTime(newDate); |
| | | caleNew.add(3, week - 1); |
| | | return caleNew; |
| | | } |
| | | |
| | | public static String[] getDaysInWeek(int year, int week) { |
| | | String[] thisWeek = new String[7]; |
| | | |
| | | try { |
| | | GregorianCalendar gc = (GregorianCalendar)getCalendarFromWeek(year + "-01-01", week); |
| | | |
| | | for(int i = 0; i < 7; ++i) { |
| | | Calendar myCale = Calendar.getInstance(); |
| | | myCale.setTime(gc.getTime()); |
| | | myCale.set(5, gc.get(5) - gc.get(7) + i + 2); |
| | | thisWeek[i] = date2Str(myCale.getTime(), "yyyy-MM-dd"); |
| | | } |
| | | } catch (Exception var6) { |
| | | System.out.println(var6.getMessage()); |
| | | } |
| | | |
| | | return thisWeek; |
| | | } |
| | | |
| | | public static boolean isSunday() { |
| | | return isSunday(new Date()); |
| | | } |
| | | |
| | | public static boolean isSunday(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int week = calendar.get(7) - 1; |
| | | return week == 0; |
| | | } |
| | | |
| | | public static boolean isWeekend(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int week = calendar.get(7) - 1; |
| | | return week == 0 || week == 1; |
| | | } |
| | | |
| | | public static boolean isFriday(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int week = calendar.get(7) - 1; |
| | | return week == 5; |
| | | } |
| | | |
| | | public static boolean isMouthEnd(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int dayOfMonth = calendar.get(5); |
| | | int endMonth = calendar.getActualMaximum(5); |
| | | return endMonth == dayOfMonth; |
| | | } |
| | | |
| | | public static boolean isSeasonEnd(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int y = calendar.get(2) + 1; |
| | | int d = calendar.get(5); |
| | | if (y == 3 && d == 31) { |
| | | return true; |
| | | } else if (y == 6 && d == 30) { |
| | | return true; |
| | | } else if (y == 9 && d == 30) { |
| | | return true; |
| | | } else { |
| | | return y == 12 && d == 31; |
| | | } |
| | | } |
| | | |
| | | public static boolean isYearEnd(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int y = calendar.get(2) + 1; |
| | | int d = calendar.get(5); |
| | | return y == 12 && d == 31; |
| | | } |
| | | |
| | | public static Long getProcessedTime(Date newDate, Date startDate) { |
| | | try { |
| | | Long p = newDate.getTime() - startDate.getTime(); |
| | | return p; |
| | | } catch (Exception var3) { |
| | | return 0L; |
| | | } |
| | | } |
| | | |
| | | public static String getProcessedTime(Date startDate) { |
| | | return getProcessedTime(new Date(), startDate) + "ms"; |
| | | } |
| | | |
| | | public static String getCurrentYear() { |
| | | Calendar c = Calendar.getInstance(); |
| | | return String.valueOf(c.get(1) + 1900); |
| | | } |
| | | |
| | | public static String getCurrentYearStart() { |
| | | return getCurrentYear() + "-01-01 00:00:00"; |
| | | } |
| | | |
| | | public static String getCurrentYearEnd() { |
| | | return getCurrentYear() + "-12-31 23:59:59"; |
| | | } |
| | | |
| | | public static String getCurrentQuarter() { |
| | | String currentMouth = getCurrentMouth(); |
| | | int currentMouthInt = getInt(currentMouth); |
| | | if (currentMouthInt > 0 && currentMouthInt <= 3) { |
| | | return "1"; |
| | | } else if (currentMouthInt > 3 && currentMouthInt <= 6) { |
| | | return "2"; |
| | | } else { |
| | | return currentMouthInt > 6 && currentMouthInt <= 9 ? "3" : "4"; |
| | | } |
| | | } |
| | | |
| | | private static int getInt(String s) { |
| | | try { |
| | | return Integer.valueOf(s); |
| | | } catch (Exception var2) { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public static String getCurrentQuarterStart() { |
| | | String currentQuarter = getCurrentQuarter(); |
| | | if ("1".equalsIgnoreCase(currentQuarter)) { |
| | | return getCurrentYearStart(); |
| | | } else if ("2".equalsIgnoreCase(currentQuarter)) { |
| | | return getCurrentYear() + "-04-01 00:00:00"; |
| | | } else { |
| | | return "3".equalsIgnoreCase(currentQuarter) ? getCurrentYear() + "-07-01 00:00:00" : getCurrentYear() + "-10-01 00:00:00"; |
| | | } |
| | | } |
| | | |
| | | public static String getCurrentQuarterEnd() { |
| | | String currentQuarter = getCurrentQuarter(); |
| | | if ("1".equalsIgnoreCase(currentQuarter)) { |
| | | return getCurrentYear() + "-03-31 23:59:59"; |
| | | } else if ("2".equalsIgnoreCase(currentQuarter)) { |
| | | return getCurrentYear() + "-06-30 23:59:59"; |
| | | } else { |
| | | return "3".equalsIgnoreCase(currentQuarter) ? getCurrentYear() + "-09-30 23:59:59" : getCurrentYear() + "-12-31 23:59:59"; |
| | | } |
| | | } |
| | | |
| | | public static String getCurrentMouth() { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(getNow()); |
| | | int m = cal.get(2); |
| | | return m < 10 ? "0" + String.valueOf(m) : String.valueOf(m); |
| | | } |
| | | |
| | | public static String getCurrentMouthStart() { |
| | | String currentMouth = getCurrentMouth(); |
| | | return getCurrentYear() + "-" + currentMouth + "-01 00:00:00"; |
| | | } |
| | | |
| | | public static String getCurrentMouthEnd() { |
| | | String currentMouth = getCurrentMouth(); |
| | | int currentMouthInt = getInt(currentMouth); |
| | | if (currentMouthInt != 1 && currentMouthInt != 3 && currentMouthInt != 5 && currentMouthInt != 7 && currentMouthInt != 8 && currentMouthInt != 10 && currentMouthInt != 12) { |
| | | if (currentMouthInt == 2) { |
| | | return isLeapYear(getInt(getCurrentYear())) ? getCurrentYear() + "-" + currentMouth + "-29 23:59:59" : getCurrentYear() + "-" + currentMouth + "-28 23:59:59"; |
| | | } else { |
| | | return getCurrentYear() + "-" + currentMouth + "-30 23:59:59"; |
| | | } |
| | | } else { |
| | | return getCurrentYear() + "-" + currentMouth + "-31 23:59:59"; |
| | | } |
| | | } |
| | | |
| | | public static boolean isLeapYear(int year) { |
| | | return year % 4 == 0 && year % 100 != 0 || year % 400 == 0; |
| | | } |
| | | |
| | | public static String getCurrentDay() { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(getNow()); |
| | | int day = cal.get(5); |
| | | return day < 10 ? "0" + String.valueOf(day) : String.valueOf(day); |
| | | } |
| | | |
| | | public static String getCurrentDayStart() { |
| | | return LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MIN).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | } |
| | | |
| | | public static String getCurrentDayEnd() { |
| | | return LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MAX).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | } |
| | | |
| | | public static List<Date> getDateInRange(Date dBegin, Date dEnd) { |
| | | List lDate = new ArrayList(); |
| | | lDate.add(dBegin); |
| | | Calendar calBegin = Calendar.getInstance(); |
| | | calBegin.setTime(dBegin); |
| | | Calendar calEnd = Calendar.getInstance(); |
| | | calEnd.setTime(dEnd); |
| | | |
| | | while(dEnd.after(calBegin.getTime())) { |
| | | calBegin.add(5, 1); |
| | | lDate.add(calBegin.getTime()); |
| | | } |
| | | |
| | | return lDate; |
| | | } |
| | | |
| | | public static Date getDateFromStringForVci(String value) { |
| | | Date d = null; |
| | | if (StringUtils.isNotBlank(value)) { |
| | | try { |
| | | if (value.indexOf("-") > -1 && value.indexOf(".") > -1 && value.indexOf(" ") > -1 && value.substring(value.lastIndexOf(".") + 1).length() >= 9) { |
| | | String ymd = value.substring(0, value.indexOf(".")); |
| | | value = value.substring(value.indexOf(".") + 1); |
| | | if (value.indexOf(".") > -1) { |
| | | String hms = value.substring(0, value.lastIndexOf(".")); |
| | | String nano = value.substring(value.lastIndexOf(".") + 1).trim(); |
| | | if (nano.length() > 3) { |
| | | nano = nano.substring(0, 3); |
| | | } |
| | | |
| | | hms = hms.replace(".", ":").replace(" ", ""); |
| | | Date tempDate = str2Date(ymd + " " + hms, "yyyy-M-d h:m:s"); |
| | | if (tempDate != null) { |
| | | d = str2Date(date2Str(tempDate, "yyyy-MM-dd HH:mm:ss") + "." + nano, "yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } |
| | | } |
| | | } else if (VciBaseUtil.isNumber(value)) { |
| | | d = new Date(); |
| | | |
| | | try { |
| | | d = str2Date(value, "yyyyMMddHHmmssSSS"); |
| | | } catch (Exception var8) { |
| | | if (value.length() != 14) { |
| | | d.setTime(VciBaseUtil.getLong(value)); |
| | | } else { |
| | | try { |
| | | d = str2Date(value, "yyyyMMddHHmmss"); |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(d); |
| | | if (cal.get(1) < 1900) { |
| | | d.setTime(VciBaseUtil.getLong(value)); |
| | | } |
| | | } catch (Exception var7) { |
| | | d.setTime(VciBaseUtil.getLong(value)); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | d = str2Date(value, "yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } |
| | | } catch (Exception var9) { |
| | | try { |
| | | d = str2Date(value, "yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } catch (Exception var6) { |
| | | } |
| | | } |
| | | } |
| | | |
| | | return d; |
| | | } |
| | | |
| | | public static Date readText2Date(String text) { |
| | | if (VciBaseUtil.isNullOrNullString(text)) { |
| | | return null; |
| | | } else { |
| | | SimpleDateFormat dateFormat = null; |
| | | int exactDateLength = 0; |
| | | if (text.trim().indexOf("/") > -1 && text.trim().length() == 19) { |
| | | exactDateLength = 19; |
| | | dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); |
| | | } else if (text.trim().indexOf("/") > -1 && text.trim().length() == 17) { |
| | | exactDateLength = 17; |
| | | dateFormat = new SimpleDateFormat("yy/MM/dd HH:mm:ss"); |
| | | } else if (text.trim().indexOf("/") > -1 && text.trim().length() == 8) { |
| | | exactDateLength = 8; |
| | | dateFormat = new SimpleDateFormat("yy/MM/dd"); |
| | | } else if (text.trim().indexOf("-") > -1 && text.trim().length() >= 19) { |
| | | if (text.trim().length() == 19) { |
| | | exactDateLength = 19; |
| | | dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | } else if (text.trim().length() == 23) { |
| | | exactDateLength = 23; |
| | | dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } |
| | | } else if (text.trim().indexOf("-") > -1 && text.trim().length() == 17) { |
| | | exactDateLength = 17; |
| | | dateFormat = new SimpleDateFormat("yy-MM-dd HH:mm:ss"); |
| | | } else if (text.trim().indexOf("-") > -1 && text.trim().length() == 8) { |
| | | exactDateLength = 8; |
| | | dateFormat = new SimpleDateFormat("yy-MM-dd"); |
| | | } else { |
| | | exactDateLength = 19; |
| | | dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | |
| | | if (text != null && exactDateLength >= 0 && text.length() != exactDateLength) { |
| | | throw new IllegalArgumentException("ä¸è½åå§åæ¶é´ï¼å 为å
容ä¸å°" + exactDateLength + "é¿åº¦"); |
| | | } else { |
| | | try { |
| | | return str2Date(date2Str(dateFormat.parse(text), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss.SSS"); |
| | | } catch (ParseException var4) { |
| | | throw new IllegalArgumentException("ä¸è½æ ¼å¼åæ¥æ: " + var4.getMessage(), var4); |
| | | } catch (Exception var5) { |
| | | throw new IllegalArgumentException("ä¸è½æ ¼å¼åæ¥æ: " + var5.getMessage(), var5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static String getChinaDate(String d) throws Exception { |
| | | Date s = str2Date(d, "yyyy-MM-dd"); |
| | | SimpleDateFormat chineseDateFormat = new SimpleDateFormat("yyyyå¹´MMæddæ¥"); |
| | | Calendar today = Calendar.getInstance(); |
| | | |
| | | try { |
| | | today.setTime(chineseDateFormat.parse(date2Str(s, "yyyyå¹´MMæddæ¥"))); |
| | | } catch (ParseException var5) { |
| | | throw new Exception(var5); |
| | | } |
| | | |
| | | Lunar lunar = new Lunar(today); |
| | | return lunar.getDate(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.com.vci.starter.web.util; |
| | | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | //package com.vci.starter.web.util; |
| | | |
| | | |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.SessionInfo; |
| | | |
| | | public class WebThreadLocalUtil { |
| | | private static ThreadLocal<SessionInfo> currentUserSessionInfoInThread = new ThreadLocal(); |
| | | private static ThreadLocal<String> needQueryTotalInThread = new ThreadLocal(); |
| | | |
| | | public WebThreadLocalUtil() { |
| | | } |
| | | |
| | | public static ThreadLocal<SessionInfo> getCurrentUserSessionInfoInThread() { |
| | | return currentUserSessionInfoInThread; |
| | | } |
| | | |
| | | public static void setCurrentUserSessionInfoInThread(ThreadLocal<SessionInfo> currentUserSessionInfoInThread) { |
| | | WebThreadLocalUtil.currentUserSessionInfoInThread = currentUserSessionInfoInThread; |
| | | } |
| | | |
| | | public static ThreadLocal<String> getNeedQueryTotalInThread() { |
| | | return needQueryTotalInThread; |
| | | } |
| | | |
| | | public static void setNeedQueryTotalInThread(ThreadLocal<String> needQueryTotalInThread) { |
| | | WebThreadLocalUtil.needQueryTotalInThread = needQueryTotalInThread; |
| | | } |
| | | } |
| | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.vci</groupId> |
| | | <artifactId>vci-platform-web</artifactId> |
| | | <version>2022.1-SNAPSHOT</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </exclusion> |
| | | <!-- <exclusion>--> |
| | | <!-- <groupId>com.vci</groupId>--> |
| | | <!-- <artifactId>vci-starter-corba</artifactId>--> |
| | | <!-- </exclusion>--> |
| | | <exclusion> |
| | | <groupId>org.apache.logging.log4j</groupId> |
| | | <artifactId>log4j-slf4j-impl</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci</groupId> |
| | | <artifactId>vci-platform-webservice</artifactId> |
| | | <version>2022.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.vci.mdm</groupId> |
| | | <artifactId>vci-mdm-wrj-webducking</artifactId> |
| | | <version>2022.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>de.odysseus.staxon</groupId> |
| | | <artifactId>staxon</artifactId> |
| | | <version>1.3</version> |
| | | </dependency> |
| | | |
| | | <!--axis2 begin --> |
| | | <dependency> |
| | | <groupId>org.apache.axis2</groupId> |
| | | <artifactId>axis2-adb</artifactId> |
| | | <version>${axis2.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.axis2</groupId> |
| | | <artifactId>axis2-kernel</artifactId> |
| | | <version>${axis2.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.axis2</groupId> |
| | | <artifactId>axis2-transport-http</artifactId> |
| | | <version>${axis2.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>javax-servlet</groupId> |
| | | <artifactId>servlet-api</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.axis2</groupId> |
| | | <artifactId>axis2-transport-local</artifactId> |
| | | <version>${axis2.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.axis2</groupId> |
| | | <artifactId>axis2-jaxws</artifactId> |
| | | <version>${axis2.version}</version> |
| | | </dependency> |
| | | <!--axis2 end --> |
| | | |
| | | <!--webserviceçå
容--> |
| | | <dependency> |
| | | <groupId>com.vci</groupId> |
| | | <artifactId>vci-platform-webservice</artifactId> |
| | | <version>2022.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-code-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-swagger</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | |
| | | */ |
| | | package com.vci.ubcs.code; |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | /** |
| | | * Codeå¯å¨å¨ |
| | |
| | | * @author |
| | | * ludc |
| | | */ |
| | | @SpringBootApplication |
| | | @EnableFeignClients(basePackages = {"com.vci.*"}) |
| | | @ComponentScan({"com.vci.*"}) |
| | | @EnableScheduling |
| | | @EnableCaching |
| | | @UbcsCloudApplication |
| | | public class CodeApplication { |
| | | |
| | | public static void main(String[] args) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.annotation; |
| | | |
| | | public interface BaseEnum { |
| | | String getValue(); |
| | | |
| | | String getText(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.constant; |
| | | |
| | | /** |
| | | * 平尿¡æ¶çä¸äºé»è®¤å¼ï¼å¨ä¸äºå®¢æ·ä¸éè¦ç®¡çæäºæ¡£æ¡æ¶ï¼é»è®¤ä¸ä¸ªå¼ |
| | | * @author weidy |
| | | * @date 2019/12/30 |
| | | */ |
| | | public class FrameWorkDefaultValueConstant { |
| | | |
| | | /** |
| | | * é»è®¤çç»ç»ä¸»é® |
| | | */ |
| | | public static final String DEFAULT_ORGANIZATION_OID = "defaultOrg"; |
| | | |
| | | /** |
| | | * é»è®¤çç»ç»åç§° |
| | | */ |
| | | public static final String DEFAULT_ORGANIZATION_NAME = "é»è®¤ç»ç»"; |
| | | |
| | | /** |
| | | * é»è®¤çåºæ¿ä¸»é® |
| | | */ |
| | | public static final String DEFAULT_WAREHOUSE_OID = "defaultWarehouse"; |
| | | |
| | | /** |
| | | * é»è®¤çåºæ¿åç§° |
| | | */ |
| | | public static final String DEFAULT_WAREHOUSE_NAME ="é»è®¤åºæ¿"; |
| | | |
| | | /** |
| | | * é»è®¤çè´§ä½ä¸»é® |
| | | */ |
| | | public static final String DEFAULT_GOODS_LOCATION_OID = "defaultGoodsLocation"; |
| | | |
| | | /** |
| | | * é»è®¤çè´§ä½åç§° |
| | | */ |
| | | public static final String DEFAULT_GOODS_LOCATION_NAME = "é»è®¤è´§ä½"; |
| | | |
| | | /** |
| | | * é»è®¤çåºæ¿ç®¡çå |
| | | */ |
| | | public static final String DEFAULT_WAREHOUSE_ADMIN_OID = "defaultWarehouseAdmin"; |
| | | |
| | | /** |
| | | * é»è®¤çåºæ¿ç®¡çååç§° |
| | | */ |
| | | public static final String DEFAULT_WAREHOUSE_ADMIN_NAME = "é»è®¤åºæ¿ç®¡çå"; |
| | | |
| | | /** |
| | | * é»è®¤ç¨æ· |
| | | */ |
| | | public static final String DEFAULT_USER_OID = "defaultUser"; |
| | | |
| | | /** |
| | | * é»è®¤ç¨æ·åç§° |
| | | */ |
| | | public static final String DEFAULT_USER_NAME = "é»è®¤ç¨æ·"; |
| | | |
| | | /** |
| | | * é»è®¤é¨é¨ |
| | | */ |
| | | public static final String DEFAULT_DEPARTMENT_OID = "defaultDepartment"; |
| | | |
| | | /** |
| | | * é»è®¤é¨é¨åç§° |
| | | */ |
| | | public static final String DEFAULT_DEPARTMENT_NAME = "é»è®¤é¨é¨"; |
| | | |
| | | /** |
| | | * é»è®¤token |
| | | */ |
| | | public static final String DEFAULT_TOKEN = "51b3df0f-e769-40a5-bf3a-a8143ef0262f"; |
| | | |
| | | /** |
| | | * å¯ç¨çæ°æ® |
| | | */ |
| | | public static final String FRAMEWORK_DATA_ENABLED = "Enabled"; |
| | | |
| | | /** |
| | | * åç¨çæ°æ® |
| | | */ |
| | | public static final String FRAMEWORK_DATA_DISABLED = "Disabled"; |
| | | |
| | | /** |
| | | * ç¼è¾çæ°æ® |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_EDITING = "Editing"; |
| | | |
| | | /** |
| | | * å®¡æ ¸ä¸çæ°æ® |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_AUDITING = "Auditing"; |
| | | |
| | | /** |
| | | * å·²æäº¤ |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_SUBMIT = "Submit"; |
| | | |
| | | /** |
| | | * åå¸çæ°æ® |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_RELEASED = "Released"; |
| | | |
| | | /** |
| | | * 卿 䏿¾ç¤ºâææXXXâè¿ä¸ªèç¹çä¸»é® |
| | | */ |
| | | public static final String ALL_DATA_TREE_NODE_OID = "${all}"; |
| | | |
| | | /** |
| | | * æ¥è¯¢ææççæ¬ |
| | | */ |
| | | public static final String QUERY_ALL_REVISION = "${queryAllRevision}"; |
| | | |
| | | /** |
| | | * åç
§çæ¶åï¼æ¾ç¤ºå·²åç¨çæ°æ®çæ¥è¯¢åæ° |
| | | */ |
| | | public static final String REFER_SHOW_DISABLED_QUERY_KEY ="referAllLcStatus"; |
| | | |
| | | /** |
| | | * 宿 |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_FINISH = "Finish"; |
| | | |
| | | /** |
| | | * å·²æèµ· |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_SUSPENDED = "Suspended"; |
| | | |
| | | /** |
| | | * å·²ä½åº |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_OBSOLETED = "Obsoleted"; |
| | | |
| | | /** |
| | | * æ§è¡ä¸ |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_EXECUTING = "Executing"; |
| | | |
| | | /** |
| | | * å·²éå |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_SENDBACK = "SendBack"; |
| | | |
| | | /** |
| | | * å·²æ¶å |
| | | */ |
| | | public static final String FRAMEWORK_RELEASE_TAKEBACK = "TakeBack"; |
| | | |
| | | /** |
| | | * é»è®¤çå¯ç çç¥ä¸»é® |
| | | */ |
| | | public static final String DEFAULT_PASSWORD_STRATEGY = "defaultPasswordStrategy"; |
| | | |
| | | /** |
| | | * ç¶æåæ®µ |
| | | */ |
| | | public static final String LC_STATUS = "lcStatus"; |
| | | |
| | | /** |
| | | * 忝åçççæ¬è§å |
| | | */ |
| | | public static final String CHAR_REVISION = "characterversionrule"; |
| | | |
| | | /** |
| | | * æ°ååçççæ¬è§å |
| | | */ |
| | | public static final String NUMBER_REVISION = "numberversionrule"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.constant; |
| | | |
| | | //package com.vci.frameworkcore.constant; |
| | | |
| | | /** |
| | | * åºç¡æ¡æ¶çéç¨çå¤è¯è¨ç¼ç |
| | | * @author weidy |
| | | * @date 2020/4/25 |
| | | */ |
| | | public class FrameWorkLangCodeConstant { |
| | | |
| | | /** |
| | | * æ·»å æå |
| | | */ |
| | | public static final String ADD_SUCCESS ="addSuccess"; |
| | | |
| | | /** |
| | | * æ·»å 失败 |
| | | */ |
| | | public static final String ADD_FAIL = "addFailInDB"; |
| | | |
| | | /** |
| | | * ä¿®æ¹æå |
| | | */ |
| | | public static final String EDIT_SUCCESS = "editSuccess"; |
| | | |
| | | /** |
| | | * ä¿®æ¹å¤±è´¥ |
| | | */ |
| | | public static final String EDIT_FAIL = "editFail"; |
| | | |
| | | /** |
| | | * å 餿å |
| | | */ |
| | | public static final String DELETE_SUCCESS = "deleteSuccess"; |
| | | |
| | | /** |
| | | * 级èå 餿å |
| | | */ |
| | | public static final String DELETE_SUCCESS_CASCADE = "deleteSuccessCascade"; |
| | | |
| | | /** |
| | | * å é¤å¤±è´¥ |
| | | */ |
| | | public static final String DELETE_FAIL = "deleteFail"; |
| | | |
| | | /** |
| | | * å¯ç¨æå |
| | | */ |
| | | public static final String ENABLE_SUCCESS ="enableSuccess"; |
| | | |
| | | /** |
| | | * é宿å |
| | | */ |
| | | public static final String LOCK_SUCCESS = "lockSuccess"; |
| | | |
| | | /** |
| | | * éå®å¤±è´¥ |
| | | */ |
| | | public static final String LOCK_FAIL = "lockFail"; |
| | | |
| | | /** |
| | | * è§£éæå |
| | | */ |
| | | public static final String UNLOCK_SUCCESS = "unlockSuccess"; |
| | | |
| | | /** |
| | | * è§£é失败 |
| | | */ |
| | | public static final String UNLOCK_FAIL = "unlockFail"; |
| | | |
| | | /** |
| | | * 级èå¯ç¨æå |
| | | */ |
| | | public static final String ENABLE_SUCCESS_CASCADE = "enableSuccessCascade"; |
| | | |
| | | /** |
| | | * å¯ç¨å¤±è´¥ |
| | | */ |
| | | public static final String ENABLE_FAIL = "enableFail"; |
| | | |
| | | /** |
| | | * åç¨æå |
| | | */ |
| | | public static final String DISABLE_SUCCESS = "disableSuccess"; |
| | | |
| | | /** |
| | | * 级èåç¨æå |
| | | */ |
| | | public static final String DISABLE_SUCCESS_CASCADE = "disableSuccessCascade"; |
| | | |
| | | /** |
| | | * åç¨å¤±è´¥ |
| | | */ |
| | | public static final String DISABLE_FAIL = "disableFail"; |
| | | |
| | | /** |
| | | * åçæ¬å·æå |
| | | */ |
| | | public static final String UP_REVISION_SUCCESS = "dataUpRevisionSuccess"; |
| | | |
| | | /** |
| | | * åçæ¬å·å¤±è´¥ |
| | | */ |
| | | public static final String UP_REVISION_FAIL = "dataUpRevisionFail"; |
| | | |
| | | /** |
| | | * åçæ¬¡æå |
| | | */ |
| | | public static final String UP_VERSION_SUCCESS = "dataUpVersionSuccess"; |
| | | |
| | | /** |
| | | * åçæ¬¡å¤±è´¥ |
| | | */ |
| | | public static final String UP_VERSION_FAIL = "dataUpVersionFail"; |
| | | |
| | | /** |
| | | * æäº¤æå |
| | | */ |
| | | public static final String SUBMIT_SUCCESS= "submitSuccess"; |
| | | |
| | | /** |
| | | * æäº¤å¤±è´¥ |
| | | */ |
| | | public static final String SUBMIR_FAIL = "submitFail"; |
| | | |
| | | /** |
| | | * å叿å |
| | | */ |
| | | public static final String RELEASE_SUCCESS = "releaseSuccess"; |
| | | |
| | | /** |
| | | * åå¸å¤±è´¥ |
| | | */ |
| | | public static final String RELEASE_FAIL = "releaseFail"; |
| | | |
| | | /** |
| | | * çæ¬å·éå¤ |
| | | */ |
| | | public static final String REVISION_REPEAT = "revisionRepeat"; |
| | | |
| | | /** |
| | | * çæ¬¡å·éå¤ |
| | | */ |
| | | public static final String VERSION_REPEAT= "versionRepeat"; |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¥è¯¢æ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_OID_NOT_EXIST = "dataOidNotExist"; |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¥è¯¢çæ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_ID_NOT_EXIST = "dataIdNotExist"; |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°æ¥è¯¢çæ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_NAME_NOT_EXIST = "dataNameNotExist"; |
| | | |
| | | /** |
| | | * 屿§å¼éå¤ |
| | | */ |
| | | public static final String DATA_ATTR_REPEAT = "dataRepeat"; |
| | | |
| | | /** |
| | | * èçæ¬çæ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String OLD_REVISION_DATA_NOT_EXIST = "oldRevsionDataNotExist"; |
| | | |
| | | /** |
| | | * ä¸çº§ä¸»é®å®é
æ¯å½åèç¹çä¸çº§èç¹ï¼ä¼å¼èµ·æ»å¾ªç¯ |
| | | */ |
| | | public static final String PARENT_OID_IS_CHILD ="parentIsChild"; |
| | | |
| | | /** |
| | | * æ°æ®è¢«å¼ç¨ï¼ä¸å
许å é¤ |
| | | */ |
| | | public static final String DATA_LINKED_NOT_DELETE = "dataLinkedNotDelete"; |
| | | |
| | | /** |
| | | * æ°æ®çåèç¹ä¹è¢«å¼ç¨ï¼ä¸å
许å é¤ |
| | | */ |
| | | public static final String DATA_CASCADE_LINKED_NOT_DELETE = "dataCascadeLinkedNotDelete"; |
| | | |
| | | /** |
| | | * æ°æ®è¢«å¼ç¨ï¼ä¸å
è®¸ä¿®æ¹ |
| | | */ |
| | | public static final String DATA_LINKED_NOT_EDIT ="dataLinkedNotEdit"; |
| | | |
| | | /** |
| | | * æ°æ®ä¸å¼ç¨ï¼ä¸å
è®¸ä¿®æ¹æä¸ªå±æ§ |
| | | */ |
| | | public static final String DATA_LINKED_NOT_EDIT_ATTR="dataLinkedNotEditAttr"; |
| | | |
| | | /** |
| | | * ä¸çº§æ¡£æ¡ä¸åå¨ |
| | | */ |
| | | public static final String DATA_PARENT_NOT_EXIST = "parentNotExist"; |
| | | |
| | | /** |
| | | * åç±»æ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_CLASSIFY_NOT_EXIST = "classifyNotExist"; |
| | | |
| | | /** |
| | | * å½åç¶æä¸ä¸å
è®¸ä¿®æ¹æ°æ® |
| | | */ |
| | | public static final String LCSTATUS_CAN_NOT_EDIT = "lcStatusCannotEditData"; |
| | | |
| | | /** |
| | | * å½åç¶æä¸ä¸å
许å 餿°æ® |
| | | */ |
| | | public static final String LCSTATUS_CAN_NOT_DELETE = "lcStatusCannotDeleteData"; |
| | | |
| | | /** |
| | | * 导å
¥æå |
| | | */ |
| | | public static final String IMPORT_SUCCESS = "importSuccess"; |
| | | |
| | | /** |
| | | * 导å
¥å¤±è´¥ |
| | | */ |
| | | public static final String IMPORT_FAIL = "importFail"; |
| | | |
| | | /** |
| | | * 导å
¥çæ¨¡æ¿æä»¶ä¸åå¨ |
| | | */ |
| | | public static final String IMPORT_TEMPLATE_FILE_NOT_FOUND = "importTemplateFileNotFound"; |
| | | |
| | | /** |
| | | * å¯¼åºæå |
| | | */ |
| | | public static final String EXPORT_SUCCESS = "exportSuccess"; |
| | | |
| | | /** |
| | | * 导åºå¤±è´¥ |
| | | */ |
| | | public static final String EXPORT_FAIL = "exportFail"; |
| | | |
| | | /** |
| | | * ä¸ä¼ æå |
| | | */ |
| | | public static final String UPLOAD_SUCCESS = "uploadSuccess"; |
| | | |
| | | /** |
| | | * ä¸ä¼ 失败 |
| | | */ |
| | | public static final String UPLOAD_FAIL = "uploadFail"; |
| | | |
| | | /** |
| | | * ä¸è½½æå |
| | | */ |
| | | public static final String DOWNLOAD_SUCCESS = "downloadSuccess"; |
| | | |
| | | /** |
| | | * ä¸è½½å¤±è´¥ |
| | | */ |
| | | public static final String DOWNLOAD_FAIL = "downloadFail"; |
| | | |
| | | /** |
| | | * æä»¶ä¸åå¨ |
| | | */ |
| | | public static final String FILE_NOT_EXIST = "fileNotExist"; |
| | | |
| | | /** |
| | | * å®¡æ¹æå |
| | | */ |
| | | public static final String AUDIT_SUCCESS = "auditSuccess"; |
| | | |
| | | /** |
| | | * 审æ¹å¤±è´¥ |
| | | */ |
| | | public static final String AUDIT_FAIL = "auditFail"; |
| | | |
| | | /** |
| | | * ä¸åæå |
| | | */ |
| | | public static final String ISSUED_SUCCESS = "issuedSuccess"; |
| | | |
| | | /** |
| | | * ä¸å失败 |
| | | */ |
| | | public static final String ISSUED_FAIL = "issuedFail"; |
| | | |
| | | /** |
| | | * æ¥æ¶æå |
| | | */ |
| | | public static final String RECEIVE_SUCCESS = "receiveSuccess"; |
| | | |
| | | /** |
| | | * æ¥æ¶å¤±è´¥ |
| | | */ |
| | | public static final String RECEIVE_FAIL = "receiveFail"; |
| | | |
| | | /** |
| | | * 计åçå¶é 便®ä¸åå¨ |
| | | */ |
| | | public static final String PLAN_SOURCE_NOT_EXIST = "planSourceNotExist"; |
| | | |
| | | /** |
| | | * 计åçå¶é ç®æ ä¸åå¨ |
| | | */ |
| | | public static final String PLAN_TARGET_NOT_EXIST = "planTargetNotExist"; |
| | | |
| | | /** |
| | | * æ´¾åæå |
| | | */ |
| | | public static final String DISPATCH_SUCCESS = "dispatchSuccess"; |
| | | |
| | | /** |
| | | * æ´¾å失败 |
| | | */ |
| | | public static final String DISPATCH_FAIL = "dispatchFail"; |
| | | |
| | | /** |
| | | * 该计åä¸ä¸å卿´¾åè¿çä»»å¡ |
| | | */ |
| | | public static final String DISPATCH_TASK_NOT_EXIST_BY_PLAN = "dispatchTaskNotExistByPlan"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.controller; |
| | | |
| | | 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.vo.pagemodel.CodeAllcodeVO; |
| | | import com.vci.ubcs.code.wrapper.CodeAllcodeWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ æ§å¶å¨ |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-code/CodeAllcode") |
| | | @Api(value = "å
¨é¨ç å¼", tags = "å
¨é¨ç 弿¥å£") |
| | | public class CodeAllcodeController extends BladeController { |
| | | |
| | | private final ICodeAllcodeService CodeAllcodeService; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ è¯¦æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥CodeAllcode") |
| | | public R<CodeAllcodeVO> detail(CodeAllcode CodeAllcode) { |
| | | CodeAllcode detail = CodeAllcodeService.getOne(Condition.getQueryWrapper(CodeAllcode)); |
| | | return R.data(CodeAllcodeWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * å
¨é¨ç å¼ å页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥CodeAllcode") |
| | | public R<IPage<CodeAllcodeVO>> list(CodeAllcode CodeAllcode, Query query) { |
| | | IPage<CodeAllcode> pages = CodeAllcodeService.page(Condition.getPage(query), Condition.getQueryWrapper(CodeAllcode)); |
| | | return R.data(CodeAllcodeWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ èªå®ä¹å页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥CodeAllcode") |
| | | public R<IPage<CodeAllcodeVO>> page(CodeAllcodeVO CodeAllcode, Query query) { |
| | | IPage<CodeAllcodeVO> pages = CodeAllcodeService.selectCodeAllcodePage(Condition.getPage(query), CodeAllcode); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ æ°å¢ |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥CodeAllcode") |
| | | public R save(@Valid @RequestBody CodeAllcode codeAllcode) { |
| | | return R.status(CodeAllcodeService.save(codeAllcode)); |
| | | } |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥CodeAllcode") |
| | | public R update(@Valid @RequestBody CodeAllcode codeAllcode) { |
| | | return R.status(CodeAllcodeService.updateById(codeAllcode)); |
| | | } |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ æ°å¢æä¿®æ¹ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥CodeAllcode") |
| | | public R submit(@Valid @RequestBody CodeAllcode codeAllcode) { |
| | | return R.status(CodeAllcodeService.saveOrUpdate(codeAllcode)); |
| | | } |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ å é¤ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(CodeAllcodeService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /* |
| | | * 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.controller; |
| | | |
| | | |
| | | import com.vci.ubcs.code.service.CodeRuleServiceI; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.dto.CodeRuleDTO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.entity.CodeRule; |
| | | import com.vci.ubcs.code.service.ICodeRuleService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import com.vci.ubcs.code.wrapper.CodeRuleWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Map; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ç¼ç è§åæ§å¶å¨ |
| | | * ç¼ç è§å æ§å¶å¨ |
| | | * |
| | | * @author weidy |
| | | * @date 2022-01-24 |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mdmRuleController") |
| | | public class CodeRuleController { |
| | | /** |
| | | * ä¸»æ°æ®ç¼ç è§å æå¡ |
| | | */ |
| | | @Autowired |
| | | private CodeRuleServiceI codeRuleService; |
| | | @AllArgsConstructor |
| | | @RequestMapping("/mdmRule") |
| | | @Api(value = "ç¼ç è§å", tags = "ç¼ç è§åæ¥å£") |
| | | public class CodeRuleController extends BladeController { |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ç¼ç è§åå表 |
| | | * @param baseQueryObject åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºç |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡å表 |
| | | */ |
| | | @GetMapping("/gridCodeRule") |
| | | public DataGrid<CodeRuleVO> gridCodeRule(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | DataGrid<CodeRuleVO> result = codeRuleService.gridCodeRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | return result; |
| | | } |
| | | /** |
| | | * å¢å ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | public BaseResult<CodeRuleVO> addSave(@RequestBody CodeRuleDTO codeRuleDTO){ |
| | | CodeRuleVO codeRuleVO = codeRuleService.addSave(codeRuleDTO); |
| | | return BaseResult.success(codeRuleVO); |
| | | } |
| | | private final ICodeRuleService codeRuleService; |
| | | |
| | | /** |
| | | * ä¿®æ¹ ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public BaseResult<CodeRuleVO> editSave(@RequestBody CodeRuleDTO codeRuleDTO){ |
| | | CodeRuleVO codeRuleVO = codeRuleService.editSave(codeRuleDTO); |
| | | return BaseResult.success(codeRuleVO); |
| | | } |
| | | /** |
| | | * ç¼ç è§å 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥codeRule") |
| | | public R<CodeRuleVO> detail(CodeRule codeRule) { |
| | | CodeRule detail = codeRuleService.getOne(Condition.getQueryWrapper(codeRule)); |
| | | return R.data(CodeRuleWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * ç¼ç è§å å页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥codeRuleVO") |
| | | public R<IPage<CodeRuleVO>> list(CodeRule codeRule, Query query) { |
| | | IPage<CodeRule> pages = codeRuleService.page(Condition.getPage(query), Condition.getQueryWrapper(codeRule)); |
| | | return R.data(CodeRuleWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç è§å èªå®ä¹å页 |
| | | */ |
| | | @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); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public BaseResult delCodeRule( CodeRuleDTO codeRuleDTO) { |
| | | return codeRuleService.deleteCodeRule(codeRuleDTO); |
| | | } |
| | | /** |
| | | * å¢å ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping("/addCode") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥CodeRule") |
| | | public R save(@Valid @RequestBody CodeRuleDTO codeRuleDTO) { |
| | | return R.status(codeRuleService.addSave(codeRuleDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 主é®è·åä¸»æ°æ®ç¼ç è§å |
| | | * @param oid ä¸»é® |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public BaseResult<CodeRuleVO> getObjectByOid(String oid){ |
| | | CodeRuleVO codeRuleVO = codeRuleService.getObjectByOid(oid); |
| | | return BaseResult.success(codeRuleVO); |
| | | } |
| | | /** |
| | | * ä¿®æ¹ ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥CodeRule") |
| | | public R update(@Valid @RequestBody CodeRuleDTO codeRuleDTO) { |
| | | return R.status(codeRuleService.editSave(codeRuleDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·åä¸»æ°æ®ç¼ç è§å |
| | | * @param oids 主é®ï¼å¤ä¸ªä»¥éå·åéï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public BaseResult<CodeRuleVO> listCodeRuleByOids(String oids){ |
| | | Collection<CodeRuleVO> voCollection = codeRuleService.listCodeRuleByOids(VciBaseUtil.str2List(oids)); |
| | | BaseResult baseResult = BaseResult.success(); |
| | | baseResult.setData(voCollection); |
| | | return baseResult; |
| | | } |
| | | /** |
| | | * ç¼ç è§å æ°å¢æä¿®æ¹ |
| | | */ |
| | | @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") |
| | | public R delCodeRule(@Valid @RequestBody CodeRuleDTO codeRuleDTO) { |
| | | return codeRuleService.deleteCodeRule(codeRuleDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åç
§ä¸»æ°æ®ç¼ç è§åå表 |
| | | * @param baseQueryObject åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºç |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | public DataGrid<CodeRuleVO> refDataGridCodeRule(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeRuleService.refDataGridCodeRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥çä¸»æ°æ®ç¼ç è§åç使ç¨èå´ |
| | | * @param oid ä¸»é® |
| | | * @return 使ç¨èå´ |
| | | */ |
| | | @GetMapping("/listUseRange") |
| | | public BaseResult<CodeClassifyVO> listUseRange(String oid){ |
| | | Collection<CodeClassifyVO> voList = codeRuleService.listUseRangeInCodeClassify(oid); |
| | | BaseResult baseResult = BaseResult.success(); |
| | | baseResult.setData(voList); |
| | | return baseResult; |
| | | } |
| | | |
| | | /** |
| | | * åç¨ä¸å¯ç¨ç¼ç è§å |
| | | * @param map å°è£
åæ°ï¼å
æ¬oid ç¼ç è§åä¸»é® update æ´æ°ç¶æçæä½ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PostMapping ("/updateStatus") |
| | | public BaseResult updateStatus(@RequestBody Map<String,String> map){ |
| | | if (CollectionUtils.isEmpty(map)){ |
| | | return BaseResult.fail("åæ°é误"); |
| | | } |
| | | String oid = map.get("oid"); |
| | | String update = map.get("update"); |
| | | return codeRuleService.updateStatus(oid,update); |
| | | } |
| | | |
| | | /** |
| | | * å
éç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping("/clone") |
| | | public BaseResult cloneCodeRule(@RequestBody CodeRuleDTO codeRuleDTO){ |
| | | return codeRuleService.cloneCodeRule(codeRuleDTO); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç è§åæ¸
空ææå·²çæçç¼ç |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @DeleteMapping("/clearAllCode") |
| | | public BaseResult clearAllCode(String oid){ |
| | | return codeRuleService.clearAllCode(oid); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.entity.CodeRule; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¼ç è§å æ°æ®ä¼ è¾å¯¹è±¡å®ä½ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeRuleDTO extends CodeRule { |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 4615707117067738769L; |
| | | |
| | | /** |
| | | * ç æ®µéå |
| | | */ |
| | | private List<CodeBasicSecDTO> elements; |
| | | |
| | | public List<CodeBasicSecDTO> getElements() { |
| | | return elements; |
| | | } |
| | | |
| | | public void setElements(List<CodeBasicSecDTO> elements) { |
| | | this.elements = elements; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeRuleDTO{" + |
| | | "elements=" + elements + |
| | | '}'+ super.toString(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.enumpack; |
| | | |
| | | |
| | | import com.vci.ubcs.code.annotation.BaseEnum; |
| | | import com.vci.ubcs.code.constant.MdmEnumIdConstant; |
| | | import com.vci.starter.web.annotation.VciEnum; |
| | | import com.vci.starter.web.enumpck.BaseEnum; |
| | | import com.vci.ubcs.com.vci.starter.annotation.VciEnum; |
| | | |
| | | /** |
| | | * ç æ®µçç±»å |
| | |
| | | @VciEnum(name = MdmEnumIdConstant.CODE_SEC_TYPE,text = "ç æ®µçç±»å",description = "") |
| | | public enum CodeSecTypeEnum implements BaseEnum { |
| | | |
| | | /** |
| | | * åºå®ç 段 |
| | | */ |
| | | CODE_FIXED_SEC("codefixedsec","åºå®ç 段"), |
| | | /** |
| | | * åºå®ç 段 |
| | | */ |
| | | CODE_FIXED_SEC("codefixedsec","åºå®ç 段"), |
| | | |
| | | /** |
| | | * å¯åç æ®µ |
| | | */ |
| | | CODE_VARIABLE_SEC("codevariablesec","å¯åç æ®µ"), |
| | | /** |
| | | * æ¥æç æ®µ |
| | | */ |
| | | CODE_DATE_SEC("codedatasec","æ¥æç æ®µ"), |
| | | /** |
| | | * åç±»ç æ®µ |
| | | */ |
| | | CODE_CLASSIFY_SEC("codeclassifysec","åç±»ç æ®µ"), |
| | | /** |
| | | * 屿§ç 段 |
| | | */ |
| | | CODE_ATTR_SEC("codeattrsec","屿§ç 段"), |
| | | /** |
| | | * æµæ°´ç 段 |
| | | */ |
| | | CODE_SERIAL_SEC("codeserialsec","æµæ°´ç 段"), |
| | | /** |
| | | * å¯åç æ®µ |
| | | */ |
| | | CODE_VARIABLE_SEC("codevariablesec","å¯åç æ®µ"), |
| | | /** |
| | | * æ¥æç æ®µ |
| | | */ |
| | | CODE_DATE_SEC("codedatasec","æ¥æç æ®µ"), |
| | | /** |
| | | * åç±»ç æ®µ |
| | | */ |
| | | CODE_CLASSIFY_SEC("codeclassifysec","åç±»ç æ®µ"), |
| | | /** |
| | | * 屿§ç 段 |
| | | */ |
| | | CODE_ATTR_SEC("codeattrsec","屿§ç 段"), |
| | | /** |
| | | * æµæ°´ç 段 |
| | | */ |
| | | CODE_SERIAL_SEC("codeserialsec","æµæ°´ç 段"), |
| | | |
| | | /** |
| | | * å±çº§ç 段 |
| | | */ |
| | | CODE_LEVEL_SEC("codelevelsec","å±çº§ç 段"), |
| | | /** |
| | | * å±çº§ç 段 |
| | | */ |
| | | CODE_LEVEL_SEC("codelevelsec","å±çº§ç 段"), |
| | | |
| | | /** |
| | | * å¼ç¨ç 段 |
| | | */ |
| | | CODE_REFER_SEC("coderefersec","å¼ç¨ç 段") |
| | | ; |
| | | /** |
| | | * å¼ç¨ç 段 |
| | | */ |
| | | CODE_REFER_SEC("coderefersec","å¼ç¨ç 段") |
| | | ; |
| | | |
| | | /** |
| | | * æä¸¾çå¼ |
| | | */ |
| | | private String value; |
| | | /** |
| | | * æä¸¾çå¼ |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * æä¸¾æ¾ç¤ºææ¬ |
| | | */ |
| | | private String text; |
| | | /** |
| | | * æä¸¾æ¾ç¤ºææ¬ |
| | | */ |
| | | private String text; |
| | | |
| | | /** |
| | | * è·åæä¸¾å¼ |
| | | * |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | @Override |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | /** |
| | | * è·åæä¸¾å¼ |
| | | * |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | @Override |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 设置æä¸¾å¼ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | */ |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | /** |
| | | * 设置æä¸¾å¼ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | */ |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾æ¾ç¤ºææ¬ |
| | | * |
| | | * @return æ¾ç¤ºææ¬ |
| | | */ |
| | | @Override |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | /** |
| | | * è·åæä¸¾æ¾ç¤ºææ¬ |
| | | * |
| | | * @return æ¾ç¤ºææ¬ |
| | | */ |
| | | @Override |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¾ç¤ºææ¬ |
| | | * |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | /** |
| | | * 设置æ¾ç¤ºææ¬ |
| | | * |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æé 彿° |
| | | * |
| | | * @param value å¼ |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | private CodeSecTypeEnum(String value, String text) { |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | /** |
| | | * æé 彿° |
| | | * |
| | | * @param value å¼ |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | private CodeSecTypeEnum(String value, String text) { |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·å对åºçæä¸¾å¼ |
| | | * |
| | | * @param text åç§° |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | public static String getValueByText(String text) { |
| | | for (CodeSecTypeEnum wenum : CodeSecTypeEnum.values()) { |
| | | if (wenum.getText().equalsIgnoreCase(text)) { |
| | | return wenum.getValue(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | /** |
| | | * æ ¹æ®åç§°è·å对åºçæä¸¾å¼ |
| | | * |
| | | * @param text åç§° |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | public static String getValueByText(String text) { |
| | | for (CodeSecTypeEnum wenum : CodeSecTypeEnum.values()) { |
| | | if (wenum.getText().equalsIgnoreCase(text)) { |
| | | return wenum.getValue(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return åç§° |
| | | */ |
| | | public static String getTextByValue(String value) { |
| | | for (CodeSecTypeEnum wenum : CodeSecTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum.getText(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return åç§° |
| | | */ |
| | | public static String getTextByValue(String value) { |
| | | for (CodeSecTypeEnum wenum : CodeSecTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum.getText(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·åæä¸¾å¯¹è±¡ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return æä¸¾å¯¹è±¡ï¼ä¸å卿¶åè¿ånull |
| | | */ |
| | | public static CodeSecTypeEnum forValue(String value) { |
| | | for (CodeSecTypeEnum wenum : CodeSecTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·åæä¸¾å¯¹è±¡ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return æä¸¾å¯¹è±¡ï¼ä¸å卿¶åè¿ånull |
| | | */ |
| | | public static CodeSecTypeEnum forValue(String value) { |
| | | for (CodeSecTypeEnum wenum : CodeSecTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.vci.ubcs.code.lifecycle; |
| | | |
| | | |
| | | import com.vci.ubcs.code.constant.MdmLifeCycleConstant; |
| | | import com.vci.frameworkcore.constant.FrameWorkDefaultValueConstant; |
| | | import com.vci.starter.web.annotation.VciLifeCycle; |
| | | import com.vci.starter.web.annotation.VciLifeCycleTrans; |
| | | import com.vci.starter.web.enumpck.BaseEnum; |
| | | import com.vci.ubcs.code.annotation.BaseEnum; |
| | | import com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant; |
| | | |
| | | /** |
| | | * ç¼ç è§åççå½å¨æ |
| | | * @author weidy |
| | | * @date 2022-2-23 |
| | | */ |
| | | @VciLifeCycle(name = MdmLifeCycleConstant.CODE_RULE_LC,text = "ç¼ç è§åæ¿çå½å¨æ",description = "",startStatus = FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING, |
| | | /*@VciLifeCycle(name = MdmLifeCycleConstant.CODE_RULE_LC,text = "ç¼ç è§åæ¿çå½å¨æ",description = "",startStatus = FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING, |
| | | translations={ |
| | | @VciLifeCycleTrans(source = FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING,target =FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_RELEASED,name = "åå¸"), |
| | | @VciLifeCycleTrans(source = FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_RELEASED,target = FrameWorkDefaultValueConstant.FRAMEWORK_DATA_DISABLED,name = "ä½åº"), |
| | | @VciLifeCycleTrans(source = FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING,target = FrameWorkDefaultValueConstant.FRAMEWORK_DATA_DISABLED,name = "æªåå¸ç´æ¥åç¨"), |
| | | @VciLifeCycleTrans(source = FrameWorkDefaultValueConstant.FRAMEWORK_DATA_DISABLED,target = FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_RELEASED,name = "åç¨å忬¡çæ") |
| | | } |
| | | ) |
| | | )*/ |
| | | public enum CodeRuleLC implements BaseEnum { |
| | | |
| | | /** |
| | |
| | | /* |
| | | * 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.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeAllcode; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeAllcodeVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ææçç 弿°æ®æä½å± |
| | | * å
¨é¨ç å¼ Mapper æ¥å£ |
| | | * |
| | | * @author weidy |
| | | * @date 2022-03-01 |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | public interface CodeAllCodeMapper { |
| | | public interface CodeAllcodeMapper extends BaseMapper<CodeAllcode> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param CodeAllcode |
| | | * @return |
| | | */ |
| | | List<CodeAllcodeVO> selectCodeAllcodePage(IPage page, CodeAllcodeVO CodeAllcode); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeBasicSecDO; |
| | | import org.springframework.data.domain.Page; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯æ°æ®æä½å± |
| | | * |
| | | * @author weidy |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface CodeBasicSecMapper extends BaseMapper<CodeBasicSecDO> { |
| | | public interface CodeBasicSecMapper extends BaseMapper<CodeBasicSec> { |
| | | |
| | | IPage<CodeBasicSecDO> selectByCondition(Page<CodeBasicSecDO> codeBasicSecDO, Map<String,Object> condtions); |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param plCodeRule |
| | | * @return |
| | | */ |
| | | List<CodeRuleVO> selectPlCodeRulePage(IPage page, CodeRuleVO plCodeRule); |
| | | |
| | | List<CodeBasicSec> countByCondition(Map<String,String> condtions); |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyDO; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | /** |
| | | * 主é¢åºåç±»æ°æ®æä½å± |
| | | * |
| | | * @author weidy |
| | | * @author ludc |
| | | * @date 2022-01-20 |
| | | */ |
| | | public interface CodeClassifyMapper { |
| | | public interface CodeClassifyMapper extends BaseMapper<CodeClassify> { |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®å é¤ |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO deleteByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param record 主é¢åºåç±»æ°æ®å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO insert(CodeClassifyDO record); |
| | | |
| | | /** |
| | | * æ¹éæ·»å æ°æ® |
| | | * @param records 主é¢åºåç±»æ°æ®å¯¹è±¡éå |
| | | * @return æ§è¡ç»ææ° |
| | | */ |
| | | BatchCBO batchInsert(List<CodeClassifyDO> records); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¥è¯¢ |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | CodeClassifyDO selectByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¹éè·å对象 |
| | | * @param oids 主é®ï¼å
å«åå¼å·,使¯ä¸è½è¶
è¿1000 |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeClassifyDO> selectByPrimaryKeys(String oids); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¹éæ¥è¯¢å¯¹è±¡ |
| | | * @param oids 对象主é®,使ç¨éå·åéï¼ä½æ¯ä¸è½è¶
è¿1000 |
| | | * @return ä¸å¡å¯¹è±¡ |
| | | */ |
| | | List<CodeClassifyDO> selectByPrimaryKeyCollection(Collection<String> oids); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææåç±» |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | List<CodeClassifyDO> selectAll(); |
| | | |
| | | /** |
| | | * æ´æ°å¯¹è±¡ |
| | | * @param record 主é¢åºåç±»æ°æ®å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO updateByPrimaryKey(CodeClassifyDO record); |
| | | |
| | | /** |
| | | * æ¹éæ´æ° |
| | | * @param records 主é¢åºåç±»æ°æ®å¯¹è±¡éå |
| | | * @return æ§è¡ç»æè¡æ° |
| | | */ |
| | | BatchCBO batchUpdate(List<CodeClassifyDO> records); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢æ¡ä»¶æ¥è¯¢æ°æ® |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ï¼ |
| | | * @param pageHelper å
æ¬åé¡µï¼æåº |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeClassifyDO> selectByCondition(Map<String,String> conditionMap, PageHelper pageHelper); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢æ¡ä»¶æ¥æ¥è¯¢æ»æ° |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @return æ»æ° |
| | | */ |
| | | Long countByCondition(Map<String,String> conditionMap); |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param queryWrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | List<CodeClassifyDO> selectByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥è¯¢æ»æ° |
| | | * @param queryWrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ»æ° |
| | | */ |
| | | Long countByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®è·ååç§° |
| | | * @param oid ä¸»é® |
| | | * @return 䏿åç§° |
| | | */ |
| | | String selectNameByOid(String oid); |
| | | |
| | | /** |
| | | * è·åææå±çº§ä¸çº§çä¸»é® |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ¥è¯¢ç»æ keyæ¯ä¸»é®ï¼valueæ¯æ¬æ¬¡æ¥è¯¢çå±çº§ |
| | | */ |
| | | Map<String,String> selectAllLevelChildOid(String oid); |
| | | |
| | | /** |
| | | * è·åææå±çº§ä¸çº§å
³èä¸å¡ç±»åæ°æ® |
| | | * @param oid å½ååç±»çoid |
| | | * @return oid,id,name,btmtypeid,btmtypename |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelParents(String oid); |
| | | |
| | | /** |
| | | * è·åå½ååç±»çææä¸çº§åç±»ï¼å«æ¬æ¬¡æ¥è¯¢å±çº§å·ï¼ |
| | | * @param oid ä¸»é® |
| | | * @return ææçä¸çº§ |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelParentByOid(String oid); |
| | | |
| | | /** |
| | | * è·åè¿ä¸ªåç±»ä¸çä¸å¡ç±»åï¼å½å没æå°±è·åä¸çº§ç第ä¸ä¸ªä¸å¡ç±»å |
| | | * @param oid å½ååç±»çoid |
| | | * @return oid,id,name,btmtypeid,btmtypename |
| | | */ |
| | | CodeClassifyDO selectBtmOrParentBtm(String oid); |
| | | |
| | | /** |
| | | * è·åææä¸çº§æ°æ® |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelChild(String oid); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææçä¸çº§ï¼å¹¶å
å«å±çº§çè·¯å¾ |
| | | * @param oid ä¸çº§çä¸»é® |
| | | * @param fieldInPath åæ®µå¨è·¯å¾ä¸çå
容 |
| | | * @param enable æ¯å¦åªæ¥è¯¢å¯ç¨ |
| | | * @return åç±»çæ°æ®å
容 |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelChildHasPath(String oid, String fieldInPath,boolean enable); |
| | | |
| | | /** |
| | | * æ¥è¯¢æä¸ªèç¹çææå±çº§ä¸çº§çä¸ªæ° |
| | | * @param oid ä¸»é® |
| | | * @return æ»æ° |
| | | */ |
| | | long countAllLevelChildOid(String oid); |
| | | |
| | | /** |
| | | * ååä»å级è·åç¶çº§ç主é¢åºåç±» |
| | | * |
| | | * @param codeClassifyOid åç±»çä¸»é® |
| | | * @return åç±»çæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | List<CodeClassifyDO> listParentClassify(String codeClassifyOid); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¿ä¸ªåç±»çrootèç¹oid |
| | | */ |
| | | CodeClassifyDO getRootClassify(String codeClassifyOid); |
| | | |
| | | /** |
| | | * 夿è¿ä¸ªåç±»æ¯å¦å±äºwupinåç±»æ |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | boolean isWupin(String oid); |
| | | /** |
| | | * æ¹éä¿®æ¹çå½å¨æçç¶æ |
| | | * @param oids 主é®éåï¼ä¸è½å¤§äº1000 |
| | | * @param lcStatus çå½å¨æçå¼ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | long batchUpdateLcStatus(Collection<String> oids, String lcStatus); |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ´æ°ç¶æ |
| | | * @param oid ä¸»é® |
| | | * @param lcStatus çå½å¨æç¶æ |
| | | * @return åå½±åçè¡æ° |
| | | */ |
| | | int updateLcStatus( String oid, String lcStatus); |
| | | |
| | | /** |
| | | * æ¹éå é¤å¯¹è±¡ |
| | | * @param oids 对象ç主é®éå |
| | | * @return åå½±åçè¡æ° |
| | | */ |
| | | BatchCBO batchDeleteByOids(Collection<String> oids); |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦å
å«åèç¹ |
| | | * @param oid åç±»çä¸»é® |
| | | * @return true 表示å
å« |
| | | */ |
| | | boolean checkHasChild(String oid); |
| | | |
| | | /** |
| | | * 使ç¨å段çè·¯å¾ï¼æ¥è¯¢å¯¹è±¡ |
| | | * @param fieldPath åæ®µçè·¯å¾ï¼å¿
é¡»ä»é¡¶å±èç¹å¼å§ xxx/yyy/zzçæ ¼å¼ |
| | | * @param field åæ®µçè±æåç§° |
| | | * @return åç±»ç对象 |
| | | */ |
| | | CodeClassifyDO selectByFieldPath(String fieldPath, String field); |
| | | |
| | | /*** |
| | | * æ ¹æ®ä¸çº§èç¹è·åä¸çº§èç¹ä»£å·è·¯å¾ååç§°è·¯å¾ |
| | | * @param classifyId |
| | | * @param enable |
| | | * @return |
| | | */ |
| | | public List<CodeClassifyDO>getIdPathToNamePathByParentId(String classifyId,boolean enable); |
| | | } |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValue; |
| | | |
| | | /** |
| | | * åç±»ç æ®µçç 弿°æ®æä½å± |
| | | * |
| | | * @author weidy |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface CodeClassifyValueMapper extends BaseMapper<CodeClassifyValueMapper> { |
| | | public interface CodeClassifyValueMapper extends BaseMapper<CodeClassifyValue> { |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.ubcs.code.entity.CodeFixedValueDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.code.entity.CodeFixedValue; |
| | | |
| | | /** |
| | | * åºå®ç 段çç 弿°æ®æä½å± |
| | | * |
| | | * @author weidy |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface CodeFixedValueMapper { |
| | | public interface CodeFixedValueMapper extends BaseMapper<CodeFixedValue> { |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®å é¤ |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO deleteByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param record åºå®ç 段çç 弿°æ®å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO insert(CodeFixedValueDO record); |
| | | |
| | | /** |
| | | * æ¹éæ·»å æ°æ® |
| | | * @param records åºå®ç 段çç 弿°æ®å¯¹è±¡éå |
| | | * @return æ§è¡ç»ææ° |
| | | */ |
| | | BatchCBO batchInsert(List<CodeFixedValueDO> records); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¥è¯¢ |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | CodeFixedValueDO selectByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¹éè·å对象 |
| | | * @param oids 主é®ï¼å
å«åå¼å·,使¯ä¸è½è¶
è¿1000 |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeFixedValueDO> selectByPrimaryKeys(String oids); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¹éæ¥è¯¢å¯¹è±¡ |
| | | * @param oids 对象主é®,使ç¨éå·åéï¼ä½æ¯ä¸è½è¶
è¿1000 |
| | | * @return ä¸å¡å¯¹è±¡ |
| | | */ |
| | | List<CodeFixedValueDO> selectByPrimaryKeyCollection(Collection<String> oids); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææåç±» |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | List<CodeFixedValueDO> selectAll(); |
| | | |
| | | /** |
| | | * æ´æ°å¯¹è±¡ |
| | | * @param record åºå®ç 段çç 弿°æ®å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO updateByPrimaryKey(CodeFixedValueDO record); |
| | | |
| | | /** |
| | | * æ¹éæ´æ° |
| | | * @param records åºå®ç 段çç 弿°æ®å¯¹è±¡éå |
| | | * @return æ§è¡ç»æè¡æ° |
| | | */ |
| | | BatchCBO batchUpdate(List<CodeFixedValueDO> records); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢æ¡ä»¶æ¥è¯¢æ°æ® |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ï¼ |
| | | * @param pageHelper å
æ¬åé¡µï¼æåº |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeFixedValueDO> selectByCondition(Map<String,String> conditionMap, PageHelper pageHelper); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢æ¡ä»¶æ¥æ¥è¯¢æ»æ° |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @return æ»æ° |
| | | */ |
| | | Long countByCondition(Map<String,String> conditionMap); |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param queryWrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeFixedValueDO> selectByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢å°è£
卿¥æ¥è¯¢æ»æ° |
| | | * @param queryWrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ»æ° |
| | | */ |
| | | Long countByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®è·ååç§° |
| | | * @param oid ä¸»é® |
| | | * @return 䏿åç§° |
| | | */ |
| | | String selectNameByOid(String oid); |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ¹éå é¤å¯¹è±¡ |
| | | * @param oids 对象ç主é®éå |
| | | * @return åå½±åçè¡æ° |
| | | */ |
| | | BatchCBO batchDeleteByOids(Collection<String> oids); |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.ubcs.code.entity.CodeRuleDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeRule; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ç¼ç è§åæ°æ®æä½å± |
| | | * |
| | | * @author weidy |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface CodeRuleMapper { |
| | | public interface CodeRuleMapper extends BaseMapper<CodeRule> { |
| | | |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®å é¤ |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO deleteByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param record ä¸»æ°æ®ç¼ç è§åæ°æ®å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO insert(CodeRuleDO record); |
| | | |
| | | /** |
| | | * æ¹éæ·»å æ°æ® |
| | | * @param records ä¸»æ°æ®ç¼ç è§åæ°æ®å¯¹è±¡éå |
| | | * @return æ§è¡ç»ææ° |
| | | */ |
| | | BatchCBO batchInsert(List<CodeRuleDO> records); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¥è¯¢ |
| | | * @param oid æ°æ®ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | CodeRuleDO selectByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¹éè·å对象 |
| | | * @param oids 主é®ï¼å
å«åå¼å·,使¯ä¸è½è¶
è¿1000 |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeRuleDO> selectByPrimaryKeys(String oids); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¹éæ¥è¯¢å¯¹è±¡ |
| | | * @param oids 对象主é®,使ç¨éå·åéï¼ä½æ¯ä¸è½è¶
è¿1000 |
| | | * @return ä¸å¡å¯¹è±¡ |
| | | */ |
| | | List<CodeRuleDO> selectByPrimaryKeyCollection(Collection<String> oids); |
| | | |
| | | /** |
| | | * 使ç¨ç¼å·éåæ¹éæ¥è¯¢å¯¹è±¡ |
| | | * @param ids ç¼å·çéå |
| | | * @return ä¸å¡å¯¹è±¡ |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param codeRule |
| | | * @return |
| | | */ |
| | | List<CodeRuleDO> selectByIdCollection(Collection<String> ids); |
| | | List<CodeRule> selectCodeRulePage(IPage page,@Param("codeRule") CodeRuleVO codeRule); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææåç±» |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | List<CodeRuleDO> selectAll(); |
| | | |
| | | /** |
| | | * æ´æ°å¯¹è±¡ |
| | | * @param record ä¸»æ°æ®ç¼ç è§åæ°æ®å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | BatchCBO updateByPrimaryKey(CodeRuleDO record); |
| | | |
| | | /** |
| | | * æ¹éæ´æ° |
| | | * @param records ä¸»æ°æ®ç¼ç è§åæ°æ®å¯¹è±¡éå |
| | | * @return æ§è¡ç»æè¡æ° |
| | | */ |
| | | BatchCBO batchUpdate(List<CodeRuleDO> records); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢æ¡ä»¶æ¥è¯¢æ°æ® |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ï¼ |
| | | * @param pageHelper å
æ¬åé¡µï¼æåº |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeRuleDO> selectByCondition(Map<String,String> conditionMap, PageHelper pageHelper); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢æ¡ä»¶æ¥æ¥è¯¢æ»æ° |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @return æ»æ° |
| | | */ |
| | | Long countByCondition(Map<String,String> conditionMap); |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param queryWrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<CodeRuleDO> selectByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢å°è£
卿¥æ¥è¯¢æ»æ° |
| | | * @param queryWrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ»æ° |
| | | */ |
| | | Long countByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®è·ååç§° |
| | | * @param oid ä¸»é® |
| | | * @return 䏿åç§° |
| | | */ |
| | | String selectNameByOid(String oid); |
| | | |
| | | |
| | | /** |
| | | * æ¹éä¿®æ¹çå½å¨æçç¶æ |
| | | * @param oids 主é®éåï¼ä¸è½å¤§äº1000 |
| | | * @param lcStatus çå½å¨æçå¼ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | long batchUpdateLcStatus(Collection<String> oids, String lcStatus); |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ´æ°ç¶æ |
| | | * @param oid ä¸»é® |
| | | * @param lcStatus çå½å¨æç¶æ |
| | | * @return åå½±åçè¡æ° |
| | | */ |
| | | int updateLcStatus( String oid, String lcStatus); |
| | | |
| | | /** |
| | | * æ¹éå é¤å¯¹è±¡ |
| | | * @param oids 对象ç主é®éå |
| | | * @return åå½±åçè¡æ° |
| | | */ |
| | | BatchCBO batchDeleteByOids(Collection<String> oids); |
| | | |
| | | /** |
| | | * å 餿°æ®ä¸è¿è¡æä¹
åï¼è½¬å为batchCBO |
| | | * @param codeRule ç¼ç è§å对象 |
| | | * @return åå½±åçè¡æ° |
| | | */ |
| | | BatchCBO delete4BatchCBO (CodeRuleDO codeRule); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.code.entity.CodeAllcode; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeAllcodeVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ æå¡ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | public interface ICodeAllcodeService extends IService<CodeAllcode> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param CodeAllcode |
| | | * @return |
| | | */ |
| | | IPage<CodeAllcodeVO> selectCodeAllcodePage(IPage<CodeAllcodeVO> page, CodeAllcodeVO CodeAllcode); |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param wrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | List<CodeAllcode> selectByWrapper(Wrapper wrapper); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | |
| | | /** |
| | | * åºå®ç 段çç 弿塿¥å£ |
| | | * |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface ICodeBasicSecService extends IService<CodeBasicSec> { |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼ç è§åæ¹éå é¤ç æ®µåºæ¬ä¿¡æ¯ |
| | | * @param codeRuleOid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | boolean batchDeleteSecByCodeRuleOid(String codeRuleOid); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»æå¡æ¥å£ |
| | | * |
| | | * @author ludc |
| | | * @date 2022-01-20 |
| | | */ |
| | | public interface ICodeClassifyService extends IService<CodeClassify> { |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param wrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | List<CodeClassify> selectByWrapper(Wrapper wrapper); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValue; |
| | | |
| | | /** |
| | | * åç±»ç æ®µçç 弿塿¥å£ |
| | | * |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface ICodeClassifyValueService extends IService<CodeClassifyValue> { |
| | | |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.code.entity.CodeFixedValue; |
| | | |
| | | /** |
| | | * åºå®ç 段çç 弿塿¥å£ |
| | | * |
| | | * @author ludc |
| | | * @date 2022-01-24 |
| | | */ |
| | | public interface ICodeFixedValueService extends IService<CodeFixedValue> { |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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 org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * ç¼ç è§å æå¡ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | public interface ICodeRuleService extends IService<CodeRule> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param plCodeRule |
| | | * @return |
| | | */ |
| | | IPage<CodeRuleVO> selectPlCodeRulePage(IPage<CodeRuleVO> page, CodeRuleVO plCodeRule); |
| | | |
| | | /** |
| | | * æ ¡éªç¼ç è§åçç¶ææ¯å¦å¯ä»¥ç¼è¾æå é¤ |
| | | * @param lcStatus ç¼ç è§å |
| | | * @return true表示å¯ä»¥ç¼è¾æå é¤ï¼false表示ä¸å¯ä»¥ |
| | | */ |
| | | boolean checkEditDelStatus(String lcStatus); |
| | | |
| | | /** |
| | | * å¢å ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | Boolean addSave(CodeRuleDTO codeRuleDTO) throws VciBaseException; |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | Boolean editSave(CodeRuleDTO codeRuleDTO) throws VciBaseException; |
| | | |
| | | /** |
| | | * å é¤ä¸»æ°æ®ç¼ç è§å |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | R deleteCodeRule(CodeRuleDTO codeRuleDTO) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ£éªç¼ç è§åæ¯å¦å·²ç»è¢«ä½¿ç¨ |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return true表示已ç»ä½¿ç¨ï¼false表示æªè¢«ä½¿ç¨ |
| | | */ |
| | | boolean isAlreadyInUse(String oid); |
| | | |
| | | /** |
| | | * æ¥çä¸»æ°æ®ç¼ç è§åç使ç¨èå´ |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return 主é¢åºå类使ç¨å°è¯¥ç¼ç è§åçææéå |
| | | */ |
| | | Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.vo.pagemodel.CodeAllcodeVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ æå¡å®ç°ç±» |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Service |
| | | public class CodeAllcodeServiceImpl extends ServiceImpl<CodeAllcodeMapper, CodeAllcode> implements ICodeAllcodeService { |
| | | |
| | | /** |
| | | * æ°æ®æä½å¯¹è±¡ |
| | | */ |
| | | @Resource |
| | | private CodeAllcodeMapper codeAllcodeMapper; |
| | | |
| | | @Override |
| | | public IPage<CodeAllcodeVO> selectCodeAllcodePage(IPage<CodeAllcodeVO> page, CodeAllcodeVO CodeAllcode) { |
| | | return page.setRecords(baseMapper.selectCodeAllcodePage(page, CodeAllcode)); |
| | | } |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param wrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public List<CodeAllcode> selectByWrapper(Wrapper wrapper) { |
| | | return this.codeAllcodeMapper.selectList(wrapper); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; |
| | | import com.vci.starter.revision.bo.TreeWrapperOptions; |
| | | import com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.*; |
| | | import com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.wrapper.VciParentQueryOption; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.ubcs.code.constant.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.code.dto.CodeBasicSecDTO; |
| | | import com.vci.ubcs.code.entity.CodeBasicSecDO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValueDO; |
| | | import com.vci.ubcs.code.entity.CodeFixedValueDO; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.CodeBasicSecServiceI; |
| | | import com.vci.ubcs.code.service.CodeClassifyValueServiceI; |
| | | import com.vci.ubcs.code.service.CodeFixedValueServiceI; |
| | | import com.vci.ubcs.code.service.CodeRuleServiceI; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyValueVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeFixedValueVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.web.enumpck.OsCodeFillTypeEnum; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import com.vci.web.pageModel.UIFormReferVO; |
| | | import com.vci.web.service.BdSelectInputCharServiceI; |
| | | import com.vci.web.service.WebBoServiceI; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import com.vci.ubcs.code.service.ICodeBasicSecService; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.frameworkcore.constant.FrameWorkLangCodeConstant.*; |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯æå¡ |
| | | * ç æ®µåºç¡ä¿¡æ¯æå¡æ¥å£ |
| | | * |
| | | * @author weidy |
| | | * @date 2022-01-24 |
| | | */ |
| | | @Service |
| | | public class CodeBasicSecServiceImpl implements CodeBasicSecServiceI { |
| | | public class CodeBasicSecServiceImpl extends ServiceImpl<CodeBasicSecMapper, CodeBasicSec> implements ICodeBasicSecService { |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | @Resource |
| | | private CodeBasicSecMapper codeBasicSecMapper; |
| | | |
| | | /** |
| | | * æ°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeBasicSecMapper codeBasicSecMapper; |
| | | /** |
| | | * åºå®ç 段çç 弿°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeFixedValueMapper fixedValueMapper; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæä½çæå¡ |
| | | */ |
| | | @Autowired |
| | | @Lazy |
| | | private WebBoServiceI boService; |
| | | /** |
| | | * åç±»ç æ®µçç 弿°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeClassifyValueMapper codeClassifyValueMapper; |
| | | |
| | | /** |
| | | * 对象çæä½ |
| | | */ |
| | | @Autowired |
| | | private RevisionModelUtil revisionModelUtil; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ç¼ç è§åæå¡ |
| | | */ |
| | | @Autowired |
| | | @Lazy |
| | | private CodeRuleServiceI codeRuleService; |
| | | |
| | | /** |
| | | * åç±»ç æ®µçç å¼æå¡ |
| | | */ |
| | | @Autowired |
| | | private CodeClassifyValueServiceI codeClassifyValueService; |
| | | |
| | | /** |
| | | * åç±»ç æ®µçç 弿°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeClassifyValueMapper codeClassifyValueMapper; |
| | | |
| | | /** |
| | | * åºå®ç 段çç å¼çæå¡ |
| | | */ |
| | | @Autowired |
| | | private CodeFixedValueServiceI fixedValueService; |
| | | |
| | | /** |
| | | * åºå®ç 段çç 弿°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeFixedValueMapper fixedValueMapper; |
| | | |
| | | /** |
| | | * ä¸å±åç±»ç æ®µç屿§åç§° |
| | | */ |
| | | private static final String PARENT_FIELD_NAME = "parentclassifysecoid"; |
| | | |
| | | /** |
| | | * ä¸çº§åç±»ç å¼ç屿§åç§° |
| | | */ |
| | | private static final String PARENT_CLASSIFY_VALUE_FIELD_NAME = "parentClassifyValueOid"; |
| | | |
| | | /** |
| | | * å¯éå¯è¾æå¡ |
| | | */ |
| | | @Autowired |
| | | private BdSelectInputCharServiceI charService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ææçç æ®µåºç¡ä¿¡æ¯ |
| | | * |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页åæåº |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public DataGrid<CodeBasicSecVO> gridCodeBasicSec(Map<String, String> conditionMap, PageHelper pageHelper) throws VciBaseException { |
| | | if (pageHelper == null) { |
| | | pageHelper = new PageHelper(-1); |
| | | } |
| | | pageHelper.addDefaultAsc("ordernum"); |
| | | if(!conditionMap.containsKey("pkCodeRule") || StringUtils.isBlank(conditionMap.get("pkCodeRule"))){ |
| | | return new DataGrid<>(); |
| | | } |
| | | List<CodeBasicSecDO> doList = codeBasicSecMapper.(conditionMap, pageHelper); |
| | | DataGrid<CodeBasicSecVO> dataGrid = new DataGrid<CodeBasicSecVO>(); |
| | | if (!CollectionUtils.isEmpty(doList)) { |
| | | dataGrid.setData(codeBasicSecDO2VOs(doList)); |
| | | dataGrid.setTotal(VciBaseUtil.getInt(String.valueOf(codeBasicSecMapper.countByCondition(conditionMap)))); |
| | | } |
| | | return dataGrid; |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param codeBasicSecDOs æ°æ®å¯¹è±¡å表 |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<CodeBasicSecVO> codeBasicSecDO2VOs(Collection<CodeBasicSecDO> codeBasicSecDOs) throws VciBaseException { |
| | | List<CodeBasicSecVO> voList = new ArrayList<CodeBasicSecVO>(); |
| | | if (!CollectionUtils.isEmpty(codeBasicSecDOs)) { |
| | | for (CodeBasicSecDO s : codeBasicSecDOs) { |
| | | CodeBasicSecVO vo = codeBasicSecDO2VO(s); |
| | | if (vo != null) { |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param codeBasicSecDOs æ°æ®å¯¹è±¡å表 |
| | | * @param hasFixedValue æ¯å¦æåºå®å¼ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<CodeBasicSecVO> codeBasicSecDO2VOs(Collection<CodeBasicSecDO> codeBasicSecDOs, boolean hasFixedValue) throws VciBaseException { |
| | | List<CodeBasicSecVO> voList = new ArrayList<CodeBasicSecVO>(); |
| | | if (!CollectionUtils.isEmpty(codeBasicSecDOs)) { |
| | | for (CodeBasicSecDO s : codeBasicSecDOs) { |
| | | CodeBasicSecVO vo = codeBasicSecDO2VO(s); |
| | | if (vo != null) { |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | } |
| | | if(hasFixedValue && !CollectionUtils.isEmpty(voList)){ |
| | | List<CodeBasicSecVO> fixedSecVOList = voList.stream().filter(s -> CodeSecTypeEnum.CODE_FIXED_SEC.getValue().equalsIgnoreCase(s.getSectype())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(fixedSecVOList)){ |
| | | //æ¥è¯¢åºå®ç çç å¼ |
| | | Map<String, List<CodeFixedValueVO>> secValueMap = fixedValueService.listCodeFixedValueBySecOids(fixedSecVOList.stream().map(CodeBasicSecVO::getOid).collect(Collectors.toList())); |
| | | voList.stream().forEach(vo->{ |
| | | vo.setFixedValueVOList(secValueMap.getOrDefault(vo.getOid(),null)); |
| | | }); |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param codeBasicSecDO æ°æ®å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ·è´å±æ§åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeBasicSecVO codeBasicSecDO2VO(CodeBasicSecDO codeBasicSecDO) throws VciBaseException { |
| | | CodeBasicSecVO vo = new CodeBasicSecVO(); |
| | | if (codeBasicSecDO != null) { |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDO, vo); |
| | | //妿ælcstatusçç±»çè¯ |
| | | if (true) { |
| | | //vo.setLcStatusText({lcStatusFullClassName}.getTextByValue(vo.getLcStatus())); |
| | | } |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * å¢å ç æ®µåºç¡ä¿¡æ¯ |
| | | * |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeBasicSecVO 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() + "ä¸è½ä¸ºç©º"); |
| | | } |
| | | /** |
| | | * æ ¹æ®ç¼ç è§åæ¹éå é¤ç æ®µåºæ¬ä¿¡æ¯ |
| | | * @param codeRuleOid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean batchDeleteSecByCodeRuleOid(String codeRuleOid) { |
| | | VciBaseUtil.alertNotNull(codeRuleOid,"ç¼ç è§å主é®"); |
| | | // 1ãéè¿pkcoderuleä½ä¸ºæ¡ä»¶ï¼å
æ¥è¯¢è¦å é¤åºç¡ç 段 |
| | | List<CodeBasicSec> deleteList = this.codeBasicSecMapper.selectList(Wrappers.<CodeBasicSec>query().eq("pkcoderule", codeRuleOid)); |
| | | if (CollectionUtils.isEmpty(deleteList)){ |
| | | return true; |
| | | } |
| | | // 2ãåå é¤åºç¡ç 段 |
| | | boolean deletFlag = codeBasicSecMapper.deleteBatchIds(deleteList.stream().map(CodeBasicSec::getOid).collect(Collectors.toSet())) > 0; |
| | | // 3ãåæ ¹æ®å é¤åºå®ç 段ï¼ä¸æ¥è¯¢åºæ¥çåºç¡ç 段ä¸è¿æ»¤åºå
å«åºå®ç 段çè®°å½ |
| | | List<CodeBasicSec> fixedSecList = deleteList.stream().filter(sec -> { |
| | | return CodeSecTypeEnum.CODE_FIXED_SEC.getValue().equals(sec.getSecType()); |
| | | }).collect(Collectors.toList()); |
| | | if (!CollectionUtils.isEmpty(fixedSecList)){ |
| | | // å°è¦ä½ä¸ºå 餿¡ä»¶ç弿¾å¨ä¸ä¸ªéåéé¢ |
| | | Set<String> fixedSecOidSet = fixedSecList.stream().map(CodeBasicSec::getOid).collect(Collectors.toSet()); |
| | | // éè¿å¤é®è¿è¡æ¥è¯¢ |
| | | List<CodeFixedValue> fixedValueS = fixedValueMapper.selectList(Wrappers.<CodeFixedValue>query().lambda().in(CodeFixedValue::getCodeFixedSecOid,fixedSecOidSet)); |
| | | // æ ¹æ®æ¥è¯¢åºæ¥çidæ§è¡åºå®ç 段æ§è¡å é¤ |
| | | deletFlag = fixedValueMapper.deleteBatchIds(fixedValueS.stream().map(CodeFixedValue::getOid).collect(Collectors.toSet()))>0; |
| | | } |
| | | // 4ãåå é¤åç±»ç æ®µ |
| | | List<CodeBasicSec> classifySecList = deleteList.stream().filter(sec -> { |
| | | return CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue().equals(sec.getSecType()); |
| | | }).collect(Collectors.toList()); |
| | | if (!CollectionUtils.isEmpty(classifySecList)){ |
| | | // å°è¦ä½ä¸ºå 餿¡ä»¶ç弿¾å¨ä¸ä¸ªéåéé¢ |
| | | Set<String> classifySecOidSet = classifySecList.stream().map(CodeBasicSec::getOid).collect(Collectors.toSet()); |
| | | // éè¿å¤é®è¿è¡æ¥è¯¢ |
| | | List<CodeClassifyValue> fixedValueS = codeClassifyValueMapper.selectList(Wrappers.<CodeClassifyValue>query().lambda().in(CodeClassifyValue::getCodeClassifySecOid,classifySecOidSet)); |
| | | // æ ¹æ®æ¥è¯¢åºæ¥ç主é®idæ§è¡åºå®ç 段æ§è¡å é¤ |
| | | deletFlag = fixedValueMapper.deleteBatchIds(fixedValueS.stream().map(CodeClassifyValue::getOid).collect(Collectors.toSet()))>0; |
| | | } |
| | | return deletFlag; |
| | | } |
| | | |
| | | |
| | | |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeBasicSecDO codeBasicSecDO = new CodeBasicSecDO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDTO, codeBasicSecDO); |
| | | //æåºå·ï¼é»è®¤çäºå½åå·²æçæ°éå 1 |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pkCodeRule",ruleVO.getOid()); |
| | | Long total = codeBasicSecMapper.countByCondition(conditionMap); |
| | | 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); |
| | | } |
| | | } |
| | | codeBasicSecMapper.insert(codeBasicSecDO); |
| | | SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | if(StringUtils.isNotBlank(codeBasicSecDO.getCodeFillSeparator())){ |
| | | charService.save(MdmBtmTypeConstant.CODE_BASIC_SEC,"codefileseparator",codeBasicSecDO.getCodeFillSeparator(),sessionInfo); |
| | | } |
| | | return codeBasicSecDO2VO(codeBasicSecDO); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç 段åºç¡ä¿¡æ¯ |
| | | * |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeBasicSecVO editSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | KeyValue attrKv = checkAttrNullableBySecType(codeBasicSecDTO); |
| | | if (! "success".equals(attrKv.getKey())){ |
| | | throw new VciBaseException(attrKv.getValue() + "ä¸è½ä¸ºç©º"); |
| | | } |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeBasicSecDO codeBasicSecDO = selectByOid(codeBasicSecDTO.getOid()); |
| | | boolean status = codeRuleService.checkEditDelStatus(codeRuleService.getObjectByOid(codeBasicSecDO.getPkCodeRule()).getLcStatus()); |
| | | if (!status){ |
| | | //è¿åéè¯¯ä¿¡æ¯ |
| | | throw new VciBaseException("ç¼ç è§åä¸å
许ç¼è¾æå é¤ï¼"); |
| | | } else { |
| | | //è¡¥ä½çæ¶åï¼è¦æ§å¶è¡¥ä½å符 |
| | | 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); |
| | | } |
| | | } |
| | | revisionModelUtil.copyFromDTOIgnore(codeBasicSecDTO, codeBasicSecDO); |
| | | codeBasicSecMapper.updateByPrimaryKey(codeBasicSecDO); |
| | | SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | if(StringUtils.isNotBlank(codeBasicSecDO.getCodeFillSeparator())){ |
| | | charService.save(MdmBtmTypeConstant.CODE_BASIC_SEC,"codefileseparator",codeBasicSecDO.getCodeFillSeparator(),sessionInfo); |
| | | } |
| | | } |
| | | return codeBasicSecDO2VO(codeBasicSecDO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦å¯ä»¥å é¤ï¼å¦æåå¨ä¸çº§ï¼å¹¶ä¸ä¸çº§ææ°æ®å¼ç¨åä¸è½å é¤ |
| | | * |
| | | * @param codeBasicSecDTO æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @param codeBasicSecDO æ°æ®åºä¸çæ°æ®å¯¹è±¡ |
| | | * @return success为true为å¯ä»¥å é¤ï¼falseè¡¨ç¤ºææ°æ®å¼ç¨ï¼obj为true表示æä¸çº§ |
| | | */ |
| | | private BaseResult checkIsCanDeleteForDO(CodeBasicSecDTO codeBasicSecDTO, CodeBasicSecDO codeBasicSecDO) { |
| | | boService.checkTs(codeBasicSecDTO); |
| | | if (!checkIsLinked(null, codeBasicSecDO.getOid())) { |
| | | return BaseResult.success(); |
| | | } else { |
| | | return BaseResult.fail(DATA_LINKED_NOT_DELETE, new String[]{""}); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦è¢«å¼ç¨ |
| | | * |
| | | * @param codeRuleOid ç¼ç è§åä¸»é® |
| | | * @param codeBasicSecOid ç¼ç åºç¡ä¿¡æ¯ä¸»é® |
| | | * @return true表示已被å¼ç¨ï¼false表示æªè¢«å¼ç¨ |
| | | * @throws VciBaseException 被å¼ç¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private boolean checkIsLinked(String codeRuleOid, String codeBasicSecOid) throws VciBaseException { |
| | | boolean flag = true; |
| | | if (StringUtils.isNotBlank(codeRuleOid)) { |
| | | boolean status = codeRuleService.checkEditDelStatus(codeRuleService.getObjectByOid(codeRuleOid).getLcStatus()); |
| | | if (!status){ |
| | | return true; |
| | | } |
| | | boolean alreadyInUse = codeRuleService.isAlreadyInUse(codeRuleOid); |
| | | if (!alreadyInUse){ |
| | | flag = false; |
| | | } |
| | | } else { |
| | | boolean status = codeRuleService.checkEditDelStatus(codeRuleService.getObjectByOid(codeBasicSecMapper.selectByPrimaryKey(codeBasicSecOid).getPkCodeRule()).getLcStatus()); |
| | | if (!status){ |
| | | return true; |
| | | } |
| | | boolean alreadyInUse = codeRuleService.isAlreadyInUse(codeBasicSecMapper.selectByPrimaryKey(codeBasicSecOid).getPkCodeRule()); |
| | | if (!alreadyInUse){ |
| | | flag = false; |
| | | } |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç 段åºç¡ä¿¡æ¯ |
| | | * |
| | | * @param codeBasicSecDTO ç æ®µåºç¡ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteCodeBasicSec(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO, "ç æ®µåºç¡ä¿¡æ¯æ°æ®å¯¹è±¡", codeBasicSecDTO.getOid(), "ç æ®µåºç¡ä¿¡æ¯ç主é®"); |
| | | return deleteCodeBasicSecByPrimaryKey(codeBasicSecDTO.getOid()); |
| | | } |
| | | |
| | | /** |
| | | * 主é®å é¤ç 段åºç¡ä¿¡æ¯ |
| | | * |
| | | * @param oid ç æ®µåºç¡ä¿¡æ¯ä¸»é® |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteCodeBasicSecByPrimaryKey(String oid) throws VciBaseException { |
| | | CodeBasicSecDO codeBasicSecDO = selectByOid(oid); |
| | | boolean isLinked = checkIsLinked(codeBasicSecDO.getPkCodeRule(), oid); |
| | | if (isLinked) { |
| | | return BaseResult.fail("ç¼ç è§å已被å¼ç¨ï¼ä¸å
许ç¼è¾æå é¤"); |
| | | } |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | //æ§è¡å é¤æä½ |
| | | WebUtil.setPersistence(false); |
| | | BatchCBO batchCBO = codeBasicSecMapper.deleteByPrimaryKey(oid); |
| | | Set<ClientBusinessObject> deleteSet = new HashSet<>(); |
| | | deleteSet.addAll(batchCBO.getDeleteCbos()); |
| | | if (CodeSecTypeEnum.CODE_FIXED_SEC.getValue().equals(codeBasicSecDO.getSecType())){ |
| | | conditionMap.put("codefixedsecoid",codeBasicSecDO.getOid()); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap, CodeFixedValueDO.class); |
| | | List<CodeFixedValueDO> fixedValueDOS = fixedValueMapper.selectByWrapper(wrapper); |
| | | BatchCBO valueCBO = fixedValueMapper.batchDeleteByOids(fixedValueDOS.stream().map(CodeFixedValueDO::getOid).collect(Collectors.toSet())); |
| | | deleteSet.addAll(valueCBO.getDeleteCbos()); |
| | | } |
| | | if (CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue().equals(codeBasicSecDO.getSecType())){ |
| | | conditionMap.put("codeclassifysecoid",codeBasicSecDO.getOid()); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap, CodeClassifyValueDO.class); |
| | | List<CodeClassifyValueDO> classifyValueDOS = codeClassifyValueMapper.selectByWrapper(wrapper); |
| | | if(!CollectionUtils.isEmpty(classifyValueDOS)) { |
| | | BatchCBO valueCBO = codeClassifyValueMapper.batchDeleteByOids(classifyValueDOS.stream().map(CodeClassifyValueDO::getOid).collect(Collectors.toSet())); |
| | | deleteSet.addAll(valueCBO.getDeleteCbos()); |
| | | } |
| | | } |
| | | batchCBO.setDeleteCbos(deleteSet); |
| | | WebUtil.setPersistence(true); |
| | | boService.persistenceBatch(batchCBO); |
| | | return (batchCBO != null && batchCBO.getDeleteCbos() != null && batchCBO.getDeleteCbos().size() > 0) ? BaseResult.successMsg(DELETE_SUCCESS) : BaseResult.fail(DELETE_FAIL); |
| | | } |
| | | |
| | | /** |
| | | * 主é®è·åç æ®µåºç¡ä¿¡æ¯ |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return ç æ®µåºç¡ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ°æ®ä¸å卿¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeBasicSecVO getObjectByOid(String oid) throws VciBaseException { |
| | | return codeBasicSecDO2VO(selectByOid(oid)); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¹¶ä¸æ°æ®ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private CodeBasicSecDO selectByOid(String oid) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oid, "主é®"); |
| | | CodeBasicSecDO codeBasicSecDO = codeBasicSecMapper.selectByPrimaryKey(oid.trim()); |
| | | if (codeBasicSecDO == null || StringUtils.isBlank(codeBasicSecDO.getOid())) { |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | return codeBasicSecDO; |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·åç æ®µåºç¡ä¿¡æ¯ |
| | | * |
| | | * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return ç æ®µåºç¡ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢åºç°å¼å¸¸æ¶ä¼æåº |
| | | */ |
| | | @Override |
| | | public Collection<CodeBasicSecVO> listCodeBasicSecByOids(Collection<String> oidCollections) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oidCollections, "æ°æ®å¯¹è±¡ä¸»é®éå"); |
| | | List<CodeBasicSecDO> codeBasicSecDOList = listCodeBasicSecDOByOidCollections(oidCollections); |
| | | return codeBasicSecDO2VOs(codeBasicSecDOList); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®éåæ¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param oidCollections 主é®çéå |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | private List<CodeBasicSecDO> listCodeBasicSecDOByOidCollections(Collection<String> oidCollections) { |
| | | List<CodeBasicSecDO> codeBasicSecDOList = new ArrayList<CodeBasicSecDO>(); |
| | | if (!CollectionUtils.isEmpty(oidCollections)) { |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | | for (Collection<String> oids : oidCollectionsList) { |
| | | List<CodeBasicSecDO> tempDOList = codeBasicSecMapper.selectByPrimaryKeyCollection(oids); |
| | | if (!CollectionUtils.isEmpty(tempDOList)) { |
| | | codeBasicSecDOList.addAll(tempDOList); |
| | | } |
| | | } |
| | | } |
| | | return codeBasicSecDOList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åç
§ç 段åºç¡ä¿¡æ¯å表 |
| | | * |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页åæåº |
| | | * @return ç æ®µåºç¡ä¿¡æ¯æ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public DataGrid<CodeBasicSecVO> refDataGridCodeBasicSec(Map<String, String> conditionMap, PageHelper pageHelper) throws VciBaseException { |
| | | if (conditionMap == null) { |
| | | conditionMap = new HashMap<String, String>(); |
| | | } |
| | | return gridCodeBasicSec(conditionMap, pageHelper); |
| | | } |
| | | |
| | | /** |
| | | * å
éç æ®µä¿¡æ¯ |
| | | * |
| | | * @param oidList æºç 段信æ¯ä¸»é®éå |
| | | * @param pkCodeRule ç®æ ç¼ç è§å |
| | | * @return å
éç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | */ |
| | | @Override |
| | | public BaseResult cloneCodeBasicSec(List<String> oidList, String pkCodeRule) { |
| | | boolean isLinked = checkIsLinked(pkCodeRule,null); |
| | | if (isLinked) { |
| | | return BaseResult.fail("ç¼ç è§å已被å¼ç¨ï¼ä¸å
许ç¼è¾æå é¤"); |
| | | } |
| | | List<CodeBasicSecDO> createList = new ArrayList<>(); |
| | | List<CodeBasicSecDO> basicSecDOS = codeBasicSecMapper.selectByPrimaryKeyCollection(oidList); |
| | | basicSecDOS.forEach(sec -> { |
| | | CodeBasicSecDO newSecDO = new CodeBasicSecDO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(sec,newSecDO); |
| | | newSecDO.setOid(""); |
| | | newSecDO.setNameOid(""); |
| | | newSecDO.setRevisionOid(""); |
| | | newSecDO.setId(newSecDO.getId() + "_copy"); |
| | | newSecDO.setName(newSecDO.getName() + "_copy"); |
| | | newSecDO.setPkCodeRule(pkCodeRule); |
| | | createList.add(newSecDO); |
| | | }); |
| | | codeBasicSecMapper.batchInsert(createList); |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段åç±»çç±»å夿屿§æ¯å¦æ¯ç©ºç |
| | | * |
| | | * @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 ruleOid è§åçå
容 |
| | | * @return ç æ®µçå
容 |
| | | */ |
| | | @Override |
| | | public List<CodeBasicSecVO> listCodeBasicSecByRuleOid(String ruleOid) { |
| | | if(StringUtils.isBlank(ruleOid)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pkCodeRule",ruleOid); |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.addDefaultAsc("ordernum"); |
| | | List<CodeBasicSecDO> secDOList = codeBasicSecMapper.selectByCondition(conditionMap, pageHelper); |
| | | return codeBasicSecDO2VOs(secDOList,true); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨è§åç主é®è·å对åºçç æ®µçå
容 |
| | | * |
| | | * @param ruleCollection è§å主é®éå |
| | | * @return ç æ®µçå
容 |
| | | */ |
| | | @Override |
| | | public List<CodeBasicSecVO> listCodeBasicSecByRuleOids(Collection<String> ruleCollection) { |
| | | if(CollectionUtils.isEmpty(ruleCollection)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<CodeBasicSecDO> secDOList = new CopyOnWriteArrayList<>(); |
| | | SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | VciBaseUtil.switchCollectionForOracleIn(ruleCollection).parallelStream().forEach(ruleOids->{ |
| | | WebUtil.setCurrentUserSessionInfo(sessionInfo); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pkcoderule", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(ruleOids.toArray(new String[0])) + ")"); |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.addDefaultAsc("ordernum"); |
| | | List<CodeBasicSecDO> tempSecDOs = codeBasicSecMapper.selectByCondition(conditionMap, pageHelper); |
| | | if(!CollectionUtils.isEmpty(tempSecDOs)){ |
| | | secDOList.addAll(tempSecDOs); |
| | | } |
| | | }); |
| | | return codeBasicSecDO2VOs(secDOList); |
| | | } |
| | | |
| | | /** |
| | | * åç
§åç±»çç æ®µ |
| | | * |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ï¼å¿
é¡»è¦æpkCodeRule |
| | | * @param pageHelper å页ç对象 |
| | | * @return ç æ®µçå
容 |
| | | */ |
| | | @Override |
| | | public DataGrid<CodeBasicSecVO> refDataGridClassifySec(Map<String, String> conditionMap, PageHelper pageHelper) { |
| | | if(CollectionUtils.isEmpty(conditionMap) || !conditionMap.containsKey("pkCodeRule")){ |
| | | return new DataGrid<>(); |
| | | } |
| | | conditionMap.put("secType",CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue()); |
| | | return refDataGridCodeBasicSec(conditionMap,pageHelper); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段类åè·åä¸å¯ä¸ºç©ºçåæ®µ |
| | | * |
| | | * @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; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®æ åç±»ç æ®µæå¨çæ ç»æ |
| | | * |
| | | * @param oid ç®æ åç±»ç æ®µä¸»é® |
| | | * @return åç±»ç æ®µæ ç»æ |
| | | */ |
| | | @Override |
| | | public List<Tree> gridCodeClassifySecTree(String oid) { |
| | | VciParentQueryOption queryOption = new VciParentQueryOption(PARENT_FIELD_NAME); |
| | | queryOption.setfOid(oid); |
| | | queryOption.setLinkTypeFlag(false); |
| | | queryOption.setHasSelf(true); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(CodeBasicSecDO.class); |
| | | wrapper.childQueryParent(queryOption); |
| | | List<CodeBasicSecDO> doList = codeBasicSecMapper.selectByWrapper(wrapper); |
| | | List<String> secOid = new ArrayList<>(); |
| | | doList.forEach(o -> secOid.add(o.getOid())); |
| | | List<CodeClassifyValueVO> valueVOs = (List<CodeClassifyValueVO>) codeClassifyValueService.listCodeClassifyValueByOids(secOid); |
| | | TreeQueryObject treeQueryObject = new TreeQueryObject(); |
| | | treeQueryObject.setMultipleSelect(false); |
| | | treeQueryObject.setShowCheckBox(false); |
| | | treeQueryObject.setQueryAllLevel(false); |
| | | treeQueryObject.setValueField("oid"); |
| | | treeQueryObject.setTextField("name"); |
| | | treeQueryObject.setQueryAllRev(false); |
| | | TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_CLASSIFY_VALUE_FIELD_NAME); |
| | | treeWrapperOptions.copyFromTreeQuery(treeQueryObject); |
| | | return revisionModelUtil.doList2Trees(valueVOs,treeWrapperOptions,(CodeClassifyValueVO s) ->{ |
| | | //å¯ä»¥å¨è¿éå¤çæ èç¹çæ¾ç¤º |
| | | return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s |
| | | .getLcStatus()) ? (" ãåç¨ã ") : ""); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼ç è§åæ¹éå é¤ç æ®µåºæ¬ä¿¡æ¯ |
| | | * @param codeRuleOid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public BatchCBO batchDeleteSecByCodeRuleOid(String codeRuleOid) { |
| | | VciBaseUtil.alertNotNull(codeRuleOid,"ç¼ç è§å主é®"); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pkcoderule",codeRuleOid); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap,CodeBasicSecDO.class); |
| | | List<CodeBasicSecDO> deleteList = codeBasicSecMapper.selectByWrapper(wrapper); |
| | | if (CollectionUtils.isEmpty(deleteList)){ |
| | | return new BatchCBO(); |
| | | } |
| | | BatchCBO batchCBO = codeBasicSecMapper.batchDeleteByOids(deleteList.stream().map(CodeBasicSecDO::getOid).collect(Collectors.toSet())); |
| | | Set<ClientBusinessObject> deleteSet = new HashSet<>(); |
| | | deleteSet.addAll(batchCBO.getDeleteCbos()); |
| | | List<CodeBasicSecDO> fixedSecList = deleteList.stream().filter(sec -> { |
| | | return CodeSecTypeEnum.CODE_FIXED_SEC.getValue().equals(sec.getSecType()); |
| | | }).collect(Collectors.toList()); |
| | | List<CodeBasicSecDO> classifySecList = deleteList.stream().filter(sec -> { |
| | | return CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue().equals(sec.getSecType()); |
| | | }).collect(Collectors.toList()); |
| | | Set<String> fixedSecOidSet = fixedSecList.stream().map(CodeBasicSecDO::getOid).collect(Collectors.toSet()); |
| | | Set<String> classifySecOidSet = classifySecList.stream().map(CodeBasicSecDO::getOid).collect(Collectors.toSet()); |
| | | if (!CollectionUtils.isEmpty(fixedSecOidSet)){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | fixedSecOidSet.stream().forEach(oid -> { |
| | | sb.append("'").append(oid).append("',"); |
| | | }); |
| | | String inSql = sb.toString().substring(0,sb.toString().length()-1); |
| | | VciQueryWrapperForDO wrapperForValue = new VciQueryWrapperForDO(null,CodeFixedValueDO.class); |
| | | PageHelper ph = new PageHelper(); |
| | | ph.setLimit(-1); |
| | | wrapperForValue.in("codefixedsecoid",inSql); |
| | | List<CodeFixedValueDO> fixedValueDOS = fixedValueMapper.selectByWrapper(wrapperForValue); |
| | | BatchCBO fixedCBO = fixedValueMapper.batchDeleteByOids(fixedValueDOS.stream().map(CodeFixedValueDO::getOid).collect(Collectors.toSet())); |
| | | deleteSet.addAll(fixedCBO.getDeleteCbos()); |
| | | } |
| | | if (!CollectionUtils.isEmpty(classifySecOidSet)){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | classifySecOidSet.stream().forEach(oid -> { |
| | | sb.append("'").append(oid).append("',"); |
| | | }); |
| | | String inSql = sb.toString().substring(0,sb.toString().length()-1); |
| | | VciQueryWrapperForDO wrapperForValue = new VciQueryWrapperForDO(null,CodeClassifyValueDO.class); |
| | | PageHelper ph = new PageHelper(); |
| | | ph.setLimit(-1); |
| | | wrapperForValue.in("codeclassifysecoid",inSql); |
| | | List<CodeClassifyValueDO> classifyValueDOS = codeClassifyValueMapper.selectByWrapper(wrapperForValue); |
| | | BatchCBO fixedCBO = codeClassifyValueMapper.batchDeleteByOids(classifyValueDOS.stream().map(CodeClassifyValueDO::getOid).collect(Collectors.toSet())); |
| | | deleteSet.addAll(fixedCBO.getDeleteCbos()); |
| | | } |
| | | batchCBO.setDeleteCbos(deleteSet); |
| | | return batchCBO; |
| | | } |
| | | |
| | | /** |
| | | * ä¸ç§» |
| | | * |
| | | * @param oid ä¸»é® |
| | | */ |
| | | @Override |
| | | public void upOrderNum(String oid) { |
| | | CodeBasicSecDO secDO = selectByOid(oid); |
| | | BatchCBO batchCBO = new BatchCBO(); |
| | | WebUtil.setPersistence(false); |
| | | if(secDO.getOrderNum() >1){ |
| | | //çäº1çæ¶åä¸è½ä¸ç§»äº |
| | | //æ¾æ¯èªå·±å°ç |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pkCodeRule",secDO.getPkCodeRule()); |
| | | conditionMap.put("ordernum",String.valueOf(secDO.getOrderNum()-1)); |
| | | List<CodeBasicSecDO> lastSecDOs = codeBasicSecMapper.selectByCondition(conditionMap,new PageHelper(-1)); |
| | | if(!CollectionUtils.isEmpty(lastSecDOs)){ |
| | | CodeBasicSecDO lastSec = lastSecDOs.get(0); |
| | | lastSec.setOrderNum(lastSec.getOrderNum()+1); |
| | | batchCBO.copyFromOther(codeBasicSecMapper.updateByPrimaryKey(lastSec)); |
| | | } |
| | | secDO.setOrderNum(secDO.getOrderNum()-1); |
| | | batchCBO.copyFromOther(codeBasicSecMapper.updateByPrimaryKey(secDO)); |
| | | } |
| | | WebUtil.setPersistence(true); |
| | | boService.persistenceBatch(batchCBO); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ç§» |
| | | * |
| | | * @param oid ä¸»é® |
| | | */ |
| | | @Override |
| | | public void downOrderNum(String oid) { |
| | | CodeBasicSecDO secDO = selectByOid(oid); |
| | | BatchCBO batchCBO = new BatchCBO(); |
| | | WebUtil.setPersistence(false); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pkCodeRule",secDO.getPkCodeRule()); |
| | | Long total = codeBasicSecMapper.countByCondition(conditionMap); |
| | | if(secDO.getOrderNum() < total){ |
| | | //å°äºæ»æ°çæ¶åæä¸ç§» |
| | | conditionMap.put("ordernum",String.valueOf(secDO.getOrderNum()+1)); |
| | | List<CodeBasicSecDO> lastSecDOs = codeBasicSecMapper.selectByCondition(conditionMap,new PageHelper(-1)); |
| | | if(!CollectionUtils.isEmpty(lastSecDOs)){ |
| | | CodeBasicSecDO lastSec = lastSecDOs.get(0); |
| | | lastSec.setOrderNum(lastSec.getOrderNum()-1); |
| | | batchCBO.copyFromOther(codeBasicSecMapper.updateByPrimaryKey(lastSec)); |
| | | } |
| | | secDO.setOrderNum(secDO.getOrderNum()+1); |
| | | batchCBO.copyFromOther(codeBasicSecMapper.updateByPrimaryKey(secDO)); |
| | | } |
| | | WebUtil.setPersistence(true); |
| | | boService.persistenceBatch(batchCBO); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.vci.ubcs.code.dao.CodeBasicSecDaoI; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValue; |
| | | import com.vci.ubcs.code.mapper.CodeClassifyValueMapper; |
| | | import com.vci.ubcs.code.entity.CodeBasicSecDO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValueDO; |
| | | import com.vci.ubcs.code.service.CodeClassifyValueServiceI; |
| | | import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; |
| | | import com.vci.starter.revision.bo.TreeWrapperOptions; |
| | | import com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.starter.web.pagemodel.TreeQueryObject; |
| | | import com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.wrapper.VciParentQueryOption; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import com.vci.web.service.WebBoServiceI; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.vci.ubcs.code.dto.CodeClassifyValueDTO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyValueVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import com.vci.ubcs.code.service.ICodeClassifyValueService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.frameworkcore.constant.FrameWorkDefaultValueConstant.LC_STATUS; |
| | | import static com.vci.frameworkcore.constant.FrameWorkLangCodeConstant.*; |
| | | /** |
| | | * åç±»ç æ®µçç å¼æå¡ |
| | | * @author weidy |
| | | * @date 2022-01-24 |
| | | */ |
| | | @Service |
| | | public class CodeClassifyValueServiceImpl implements CodeClassifyValueServiceI { |
| | | public class CodeClassifyValueServiceImpl extends ServiceImpl<CodeClassifyValueMapper, CodeClassifyValue> implements ICodeClassifyValueService { |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * æ°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeClassifyValueMapper codeClassifyValueMapper; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæä½çæå¡ |
| | | */ |
| | | @Autowired |
| | | @Lazy |
| | | private WebBoServiceI boService; |
| | | |
| | | /** |
| | | * 对象çæä½ |
| | | */ |
| | | @Autowired |
| | | private RevisionModelUtil revisionModelUtil; |
| | | |
| | | /** |
| | | * ç æ®µçä¿¡æ¯ |
| | | */ |
| | | @Autowired |
| | | private CodeBasicSecDaoI basicSecMapper; |
| | | |
| | | /** |
| | | * ä¸çº§èç¹ç屿§åç§° |
| | | */ |
| | | private static final String PARENT_FIELD_NAME = "parentClassifyValueOid"; |
| | | /** |
| | | * æ¥è¯¢åç±»ç æ®µçç å¼ æ |
| | | * @param treeQueryObject æ æ¥è¯¢å¯¹è±¡ |
| | | * @return åç±»ç æ®µçç å¼ æ¾ç¤ºæ |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶ä¸ç¬¦åè¦æ±çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<Tree> treeCodeClassifyValue(TreeQueryObject treeQueryObject) throws VciBaseException{ |
| | | // List<CodeClassifyValueDO> doList =selectCodeClassifyValueDOByTree(treeQueryObject); |
| | | List<CodeClassifyValueDO> doList =selectCodeClassifyValueDO4Tree(treeQueryObject); |
| | | List<CodeClassifyValueVO> voList = codeClassifyValueDO2VOs(doList); |
| | | TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_FIELD_NAME); |
| | | treeWrapperOptions.copyFromTreeQuery(treeQueryObject); |
| | | return revisionModelUtil.doList2Trees(voList,treeWrapperOptions,(CodeClassifyValueVO s) ->{ |
| | | //å¯ä»¥å¨è¿éå¤çæ èç¹çæ¾ç¤º |
| | | return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s |
| | | .getLcStatus()) ? (" ãåç¨ã ") : ""); |
| | | }); |
| | | } |
| | | /** |
| | | * æ ¹æ®æ å½¢æ¥è¯¢å¯¹è±¡æ¥æ¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ |
| | | * @return æ¥è¯¢ç»æ,æ°æ®å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public List<CodeClassifyValueDO> selectCodeClassifyValueDOByTree(TreeQueryObject treeQueryObject) { |
| | | VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(treeQueryObject.getConditionMap(),CodeClassifyValueDO.class); |
| | | PageHelper ph = new PageHelper(); |
| | | ph.addDefaultAsc("ordernum"); |
| | | queryWrapperForDO.setPageHelper(ph); |
| | | VciParentQueryOption parentQueryOption = new VciParentQueryOption(); |
| | | parentQueryOption.setParentFieldName(PARENT_FIELD_NAME); |
| | | //queryWrapperForDO.parentQueryChild(treeQueryObject,parentQueryOption); |
| | | parentQueryOption.setHasSelf(true); |
| | | queryWrapperForDO.childQueryParent(parentQueryOption); |
| | | return codeClassifyValueMapper.selectByWrapper(queryWrapperForDO); |
| | | } |
| | | |
| | | private List<CodeClassifyValueDO> selectCodeClassifyValueDO4Tree(TreeQueryObject treeQueryObject){ |
| | | Map<String, String> conditionMap = treeQueryObject.getConditionMap(); |
| | | String currentSecOid = conditionMap.get("codeclassifysecoid"); |
| | | String sql = "select oid from PLATFORMBTM_CODEBASICSEC start with oid = '"+currentSecOid+"' connect by prior PARENTCLASSIFYSECOID = OID"; |
| | | List<ClientBusinessObject> targetParentList = boService.queryBySql(sql, new HashMap<>()); |
| | | Set<String> secOidList = targetParentList.stream().map(ClientBusinessObject::getOid).collect(Collectors.toSet()); |
| | | conditionMap.clear(); |
| | | StringBuilder oidStrBuilder = new StringBuilder(); |
| | | secOidList.forEach(oid -> oidStrBuilder.append("'").append(oid).append("',")); |
| | | String oidStr = oidStrBuilder.toString().substring(0,oidStrBuilder.toString().length() -1); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(null,CodeClassifyValueDO.class); |
| | | PageHelper ph = new PageHelper(); |
| | | ph.addDefaultAsc("ordernum"); |
| | | ph.setLimit(-1); |
| | | wrapper.setPageHelper(ph); |
| | | wrapper.in("codeclassifysecoid",oidStr); |
| | | return codeClassifyValueMapper.selectByWrapper(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * @param codeClassifyValueDOs æ°æ®å¯¹è±¡å表 |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<CodeClassifyValueVO> codeClassifyValueDO2VOs(Collection<CodeClassifyValueDO> codeClassifyValueDOs) throws VciBaseException{ |
| | | List<CodeClassifyValueVO> voList = new ArrayList<CodeClassifyValueVO>(); |
| | | if(!CollectionUtils.isEmpty(codeClassifyValueDOs)){ |
| | | for(CodeClassifyValueDO s: codeClassifyValueDOs){ |
| | | CodeClassifyValueVO vo = codeClassifyValueDO2VO(s); |
| | | if(vo != null){ |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * @param codeClassifyValueDO æ°æ®å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ·è´å±æ§åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeClassifyValueVO codeClassifyValueDO2VO(CodeClassifyValueDO codeClassifyValueDO) throws VciBaseException{ |
| | | CodeClassifyValueVO vo = new CodeClassifyValueVO(); |
| | | if(codeClassifyValueDO != null){ |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeClassifyValueDO,vo); |
| | | //妿ælcstatusçç±»çè¯ |
| | | |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * å¢å åç±»ç æ®µçç å¼ |
| | | * @param codeClassifyValueDTO åç±»ç æ®µçç 弿°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeClassifyValueVO addSave(CodeClassifyValueDTO codeClassifyValueDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeClassifyValueDTO,"éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | //æ·»å 对ç å¼åç¶çº§ç夿 |
| | | if(StringUtils.isNotBlank(codeClassifyValueDTO.getParentclassifyvalueoid())){ |
| | | String parentclassifyvalueoid = codeClassifyValueDTO.getParentclassifyvalueoid(); |
| | | String codeclassifysecoid = codeClassifyValueDTO.getCodeclassifysecoid(); |
| | | CodeClassifyValueDO parentDO = codeClassifyValueMapper.selectByPrimaryKey(parentclassifyvalueoid); |
| | | if (parentDO.getCodeClassifySecOid().equalsIgnoreCase(codeclassifysecoid)){ |
| | | throw new VciBaseException("ä¸å
许å¨ç¶ç å¼ä¸ç´æ¥æ·»å åç å¼"); |
| | | } |
| | | } |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeClassifyValueDO codeClassifyValueDO = new CodeClassifyValueDO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeClassifyValueDTO,codeClassifyValueDO); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codeclassifysecoid", codeClassifyValueDO.getCodeClassifySecOid()); |
| | | conditionMap.put("parentclassifyvalueoid",codeClassifyValueDO.getParentClassifyValueOid()); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap,CodeClassifyValueDO.class); |
| | | List<CodeClassifyValueDO> existList = codeClassifyValueMapper.selectByWrapper(wrapper); |
| | | codeClassifyValueDO.setOrderNum(existList.size() + 1); |
| | | codeClassifyValueMapper.insert(codeClassifyValueDO); |
| | | return codeClassifyValueDO2VO(codeClassifyValueDO); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åç±»ç æ®µçç å¼ |
| | | * @param codeClassifyValueDTO åç±»ç æ®µçç 弿°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeClassifyValueVO editSave(CodeClassifyValueDTO codeClassifyValueDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeClassifyValueDTO,"æ°æ®å¯¹è±¡",codeClassifyValueDTO.getOid(),"åç±»ç æ®µçç å¼ä¸»é®"); |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeClassifyValueDO codeClassifyValueDO = selectByOid(codeClassifyValueDTO.getOid()); |
| | | revisionModelUtil.copyFromDTOIgnore(codeClassifyValueDTO,codeClassifyValueDO); |
| | | codeClassifyValueMapper.updateByPrimaryKey(codeClassifyValueDO); |
| | | return codeClassifyValueDO2VO(codeClassifyValueDO); |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥ åç±»ç æ®µçç 弿¯å¦å é¤ |
| | | * @param codeClassifyValueDTO åç±»ç æ®µçç 弿°æ®ä¼ è¾å¯¹è±¡ï¼å¿
é¡»è¦æoidåts屿§ |
| | | * @return æ§è¡ç»æ success为true为å¯ä»¥å é¤ï¼falseè¡¨ç¤ºææ°æ®å¼ç¨ï¼obj为true表示æä¸çº§ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public BaseResult checkIsCanDelete(CodeClassifyValueDTO codeClassifyValueDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeClassifyValueDTO,"æ°æ®ä¼ è¾å¯¹è±¡",codeClassifyValueDTO.getOid(),"主é®"); |
| | | CodeClassifyValueDO codeClassifyValueDO = selectByOid(codeClassifyValueDTO.getOid()); |
| | | return checkIsCanDeleteForDO(codeClassifyValueDTO,codeClassifyValueDO); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦å¯ä»¥å é¤ï¼å¦æåå¨ä¸çº§ï¼å¹¶ä¸ä¸çº§ææ°æ®å¼ç¨åä¸è½å é¤ |
| | | * @param codeClassifyValueDTO æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @param codeClassifyValueDO æ°æ®åºä¸çæ°æ®å¯¹è±¡ |
| | | * @return success为true为å¯ä»¥å é¤ï¼falseè¡¨ç¤ºææ°æ®å¼ç¨ï¼obj为true表示æä¸çº§ |
| | | */ |
| | | private BaseResult checkIsCanDeleteForDO(CodeClassifyValueDTO codeClassifyValueDTO, CodeClassifyValueDO codeClassifyValueDO) { |
| | | //boService.checkTs(codeClassifyValueDTO); |
| | | //æ ¡éªä¸çº§æ¯å¦æå¼ç¨ |
| | | if(checkChildIsLinked(codeClassifyValueDO.getOid())){ |
| | | return BaseResult.fail(DATA_CASCADE_LINKED_NOT_DELETE,new String[]{""}); |
| | | } |
| | | return BaseResult.success(checkHasChild(codeClassifyValueDO.getOid())); |
| | | } |
| | | /** |
| | | * æ£æ¥æ¯å¦æä¸çº§æ¯å¦å
³èäºæ°æ® |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return true 表示æå¼ç¨ï¼false表示没æå¼ç¨ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºåæå¼ç¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public boolean checkChildIsLinked(String oid) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oid,"主é®"); |
| | | List<String> childOids = codeClassifyValueMapper.selectAllLevelChildOid(oid.trim()); |
| | | if(!CollectionUtils.isEmpty(childOids)){ |
| | | for(String childOid: childOids){ |
| | | if(!checkIsLinked(childOid)){ |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦æä¸çº§èç¹ï¼ä¸æ ¡éªæ¯å¦å
³èäºæ°æ® |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return true表示æä¸çº§ï¼false表示没æä¸çº§ |
| | | * @throws VciBaseException åæ°éè¯¯ï¼æè
æ°æ®ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public boolean checkHasChild(String oid) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oid,"主é®"); |
| | | return codeClassifyValueMapper.countAllLevelChildOid(oid.trim()) > 0; |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦è¢«å¼ç¨ |
| | | * @param oid ä¸»é® |
| | | * @throws VciBaseException 被å¼ç¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private boolean checkIsLinked(String oid) throws VciBaseException{ |
| | | //TODO æ·»å éè¦æ ¡éªå¼ç¨çå°æ¹ |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * å é¤åç±»ç æ®µçç å¼ |
| | | * @param codeClassifyValueDTO åç±»ç æ®µçç 弿°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteCodeClassifyValue(CodeClassifyValueDTO codeClassifyValueDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeClassifyValueDTO,"åç±»ç æ®µçç 弿°æ®å¯¹è±¡",codeClassifyValueDTO.getOid(),"åç±»ç æ®µçç å¼ç主é®"); |
| | | CodeClassifyValueDO codeClassifyValueDO = selectByOid(codeClassifyValueDTO.getOid()); |
| | | BaseResult baseResult = checkIsCanDeleteForDO(codeClassifyValueDTO,codeClassifyValueDO); |
| | | if(baseResult.isSuccess()) { |
| | | //æ¾ä¸çº§çï¼è¿ä¸ªæ¯å¯ä»¥å é¤çæ¶å |
| | | List<String> childrenOids = codeClassifyValueMapper.selectAllLevelChildOid(codeClassifyValueDO.getOid().trim()); |
| | | if (!CollectionUtils.isEmpty(childrenOids)) { |
| | | Collection<Collection<String>> childrenCollections = VciBaseUtil.switchCollectionForOracleIn(childrenOids); |
| | | for(Collection<String> s : childrenCollections){ |
| | | codeClassifyValueMapper.batchDeleteByOids(s); |
| | | } |
| | | } |
| | | }else{ |
| | | return baseResult; |
| | | } |
| | | //æ§è¡å é¤æä½ |
| | | BatchCBO batchCBO = codeClassifyValueMapper.deleteByPrimaryKey(codeClassifyValueDO.getOid()); |
| | | return (batchCBO!=null && batchCBO.getDeleteCbos() !=null &&batchCBO.getDeleteCbos().size() > 0)?BaseResult.successMsg(DELETE_SUCCESS):BaseResult.fail(DELETE_FAIL); |
| | | } |
| | | |
| | | /** |
| | | * 主é®è·ååç±»ç æ®µçç å¼ |
| | | * @param oid ä¸»é® |
| | | * @return åç±»ç æ®µçç 弿¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ°æ®ä¸å卿¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeClassifyValueVO getObjectByOid(String oid) throws VciBaseException{ |
| | | return codeClassifyValueDO2VO(selectByOid(oid)); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢æ°æ®å¯¹è±¡ |
| | | * @param oid ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¹¶ä¸æ°æ®ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private CodeClassifyValueDO selectByOid(String oid) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(oid,"主é®"); |
| | | CodeClassifyValueDO codeClassifyValueDO = codeClassifyValueMapper.selectByPrimaryKey(oid.trim()); |
| | | if(codeClassifyValueDO == null || StringUtils.isBlank(codeClassifyValueDO.getOid())){ |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | return codeClassifyValueDO; |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·ååç±»ç æ®µçç å¼ |
| | | * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return åç±»ç æ®µçç 弿¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢åºç°å¼å¸¸æ¶ä¼æåº |
| | | */ |
| | | @Override |
| | | public Collection<CodeClassifyValueVO> listCodeClassifyValueByOids(Collection<String> oidCollections) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(oidCollections,"æ°æ®å¯¹è±¡ä¸»é®éå"); |
| | | List<CodeClassifyValueDO> codeClassifyValueDOList = listCodeClassifyValueDOByOidCollections(oidCollections); |
| | | return codeClassifyValueDO2VOs(codeClassifyValueDOList); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®éåæ¥è¯¢æ°æ®å¯¹è±¡ |
| | | * @param oidCollections 主é®çéå |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | private List<CodeClassifyValueDO> listCodeClassifyValueDOByOidCollections(Collection<String> oidCollections){ |
| | | List<CodeClassifyValueDO> codeClassifyValueDOList = new ArrayList<CodeClassifyValueDO>(); |
| | | if(!CollectionUtils.isEmpty(oidCollections)){ |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | | for(Collection<String> oids: oidCollectionsList){ |
| | | List<CodeClassifyValueDO> tempDOList = codeClassifyValueMapper.selectByPrimaryKeyCollection(oids); |
| | | if(!CollectionUtils.isEmpty(tempDOList)){ |
| | | codeClassifyValueDOList.addAll(tempDOList); |
| | | } |
| | | } |
| | | } |
| | | return codeClassifyValueDOList; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * åç
§æ åç±»ç æ®µçç å¼ |
| | | * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ |
| | | * @return åç±»ç æ®µçç 弿¾ç¤ºæ |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) throws VciBaseException{ |
| | | if(treeQueryObject == null){ |
| | | treeQueryObject = new TreeQueryObject(); |
| | | } |
| | | if(treeQueryObject.getConditionMap() == null){ |
| | | treeQueryObject.setConditionMap(new HashMap<>()); |
| | | } |
| | | if(treeQueryObject.getConditionMap().containsKey(LC_STATUS)) { |
| | | treeQueryObject.getConditionMap().remove(LC_STATUS); |
| | | } |
| | | return treeCodeClassifyValue(treeQueryObject); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ç 段ç主é®è·ååç±»çç å¼å
容 |
| | | * |
| | | * @param classifySecOid ç æ®µçä¸»é® |
| | | * @param parentClassifyValueOid ä¸çº§åç±»çä¸»é® |
| | | * @return åç±»ç å¼çå
容 |
| | | */ |
| | | @Override |
| | | public List<CodeClassifyValueVO> listCodeClassifyValueBySecOid(String classifySecOid, String parentClassifyValueOid) { |
| | | if(StringUtils.isBlank(classifySecOid)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | CodeBasicSecDO secDO = basicSecMapper.selectByPrimaryKey(classifySecOid); |
| | | if(secDO == null || StringUtils.isBlank(secDO.getOid())){ |
| | | throw new VciBaseException("ç æ®µçå
容å¨ç³»ç»ä¸ä¸åå¨"); |
| | | } |
| | | if(StringUtils.isNotBlank(secDO.getParentClassifySecOid()) && StringUtils.isBlank(parentClassifyValueOid)){ |
| | | return new ArrayList<>(); |
| | | //å 为æä¸çº§åç±»çæ¶åï¼å¿
é¡»å
éæ©ä¸çº§åç±»çå
容 |
| | | } |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codeClassifySecOid",classifySecOid); |
| | | if(StringUtils.isNotBlank(parentClassifyValueOid)){ |
| | | conditionMap.put("parentClassifyValueOid",parentClassifyValueOid); |
| | | } |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.addDefaultAsc("ordernum"); |
| | | List<CodeClassifyValueDO> valueDOList = codeClassifyValueMapper.selectByCondition(conditionMap, pageHelper); |
| | | return codeClassifyValueDO2VOs(valueDOList); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段主é®å é¤å
¶åå¨çç å¼å¯¹è±¡ |
| | | * @param codeclassifysecoid åç±»ç æ®µçä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult batchDeleteBySecOid(String codeclassifysecoid) { |
| | | VciBaseUtil.alertNotNull(codeclassifysecoid,"åç±»ç æ®µç主é®"); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codeClassifySecOid",codeclassifysecoid); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap,CodeClassifyValueDO.class); |
| | | List<CodeClassifyValueDO> valueDOList = codeClassifyValueMapper.selectByWrapper(wrapper); |
| | | codeClassifyValueMapper.batchDeleteByOids(valueDOList.stream().map(CodeClassifyValueDO::getOid).collect(Collectors.toList())); |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ·»å åç±»ç æ®µçç å¼ãä¸»è¦æ¯ä¿åç å¼çåºå· |
| | | * @param dtoList åç±»ç æ®µçç å¼å表 |
| | | * @param codeclassifysecoid åç±»ç æ®µçä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult batchSave4Order(List<CodeClassifyValueDTO> dtoList, String codeclassifysecoid) { |
| | | VciBaseUtil.alertNotNull(codeclassifysecoid,"åç±»ç æ®µä¸»é®"); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codeClassifySecOid",codeclassifysecoid); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap,CodeClassifyValueDO.class); |
| | | List<CodeClassifyValueDO> valueDOList = codeClassifyValueMapper.selectByWrapper(wrapper); |
| | | List<CodeClassifyValueDO> updateList = new ArrayList<>(); |
| | | dtoList.forEach(dto -> { |
| | | if( StringUtils.isNotBlank( dto.getOid() )){ |
| | | List<CodeClassifyValueDO> collect = valueDOList.stream().filter(value -> { |
| | | return dto.getOid().equals(value.getOid()); |
| | | }).collect(Collectors.toList()); |
| | | collect.forEach(ccv -> { |
| | | ccv.setOrderNum(dto.getOrdernum()); |
| | | ccv.setId(dto.getId()); |
| | | ccv.setName(dto.getName()); |
| | | updateList.add(ccv); |
| | | }); |
| | | } |
| | | }); |
| | | codeClassifyValueMapper.batchUpdate(updateList); |
| | | return BaseResult.success(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.entity.CodeFixedValue; |
| | | import com.vci.ubcs.code.mapper.CodeFixedValueMapper; |
| | | import com.vci.ubcs.code.entity.CodeFixedValueDO; |
| | | import com.vci.ubcs.code.service.CodeFixedValueServiceI; |
| | | import com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import com.vci.web.service.WebBoServiceI; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.vci.ubcs.code.dto.CodeFixedValueDTO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeFixedValueVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import com.vci.ubcs.code.service.ICodeFixedValueService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.frameworkcore.constant.FrameWorkLangCodeConstant.*; |
| | | |
| | | /** |
| | | * åºå®ç 段çç å¼æå¡ |
| | |
| | | * @date 2022-01-24 |
| | | */ |
| | | @Service |
| | | public class CodeFixedValueServiceImpl implements CodeFixedValueServiceI { |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * æ°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeFixedValueMapper codeFixedValueMapper; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæä½çæå¡ |
| | | */ |
| | | @Autowired |
| | | @Lazy |
| | | private WebBoServiceI boService; |
| | | |
| | | /** |
| | | * 对象çæä½ |
| | | */ |
| | | @Autowired |
| | | private RevisionModelUtil revisionModelUtil; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ææçåºå®ç 段çç å¼ |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页åæåº |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public DataGrid<CodeFixedValueVO> gridCodeFixedValue(Map<String, String> conditionMap, PageHelper pageHelper) throws VciBaseException{ |
| | | if (pageHelper == null) { |
| | | pageHelper = new PageHelper(-1); |
| | | } |
| | | pageHelper.addDefaultAsc("ordernum"); |
| | | if(conditionMap == null){ |
| | | conditionMap = new HashMap<>(); |
| | | } |
| | | String secOid = conditionMap.getOrDefault("codefixedsecoid", ""); |
| | | if(StringUtils.isBlank(secOid)){ |
| | | return new DataGrid<>(); |
| | | } |
| | | List<CodeFixedValueDO> doList = codeFixedValueMapper.selectByCondition(conditionMap,pageHelper); |
| | | DataGrid<CodeFixedValueVO> dataGrid=new DataGrid<CodeFixedValueVO>(); |
| | | if (!CollectionUtils.isEmpty(doList)) { |
| | | dataGrid.setData(codeFixedValueDO2VOs(doList)); |
| | | dataGrid.setTotal(VciBaseUtil.getInt(String.valueOf(codeFixedValueMapper.countByCondition(conditionMap)))); |
| | | } |
| | | return dataGrid; |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * @param codeFixedValueDOs æ°æ®å¯¹è±¡å表 |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<CodeFixedValueVO> codeFixedValueDO2VOs(Collection<CodeFixedValueDO> codeFixedValueDOs) throws VciBaseException{ |
| | | List<CodeFixedValueVO> voList = new ArrayList<CodeFixedValueVO>(); |
| | | if(!CollectionUtils.isEmpty(codeFixedValueDOs)){ |
| | | for(CodeFixedValueDO s: codeFixedValueDOs){ |
| | | CodeFixedValueVO vo = codeFixedValueDO2VO(s); |
| | | if(vo != null){ |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * @param codeFixedValueDO æ°æ®å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ·è´å±æ§åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeFixedValueVO codeFixedValueDO2VO(CodeFixedValueDO codeFixedValueDO) throws VciBaseException{ |
| | | CodeFixedValueVO vo = new CodeFixedValueVO(); |
| | | if(codeFixedValueDO != null){ |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeFixedValueDO,vo); |
| | | //妿ælcstatusçç±»çè¯ |
| | | |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * å¢å åºå®ç 段çç å¼ |
| | | * @param codeFixedValueDTO åºå®ç 段çç 弿°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeFixedValueVO addSave(CodeFixedValueDTO codeFixedValueDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeFixedValueDTO,"éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeFixedValueDO codeFixedValueDO = new CodeFixedValueDO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeFixedValueDTO,codeFixedValueDO); |
| | | codeFixedValueMapper.insert(codeFixedValueDO); |
| | | return codeFixedValueDO2VO(codeFixedValueDO); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åºå®ç 段çç å¼ |
| | | * @param codeFixedValueDTO åºå®ç 段çç 弿°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeFixedValueVO editSave(CodeFixedValueDTO codeFixedValueDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeFixedValueDTO,"æ°æ®å¯¹è±¡",codeFixedValueDTO.getOid(),"åºå®ç 段çç å¼ä¸»é®"); |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeFixedValueDO codeFixedValueDO = selectByOid(codeFixedValueDTO.getOid()); |
| | | revisionModelUtil.copyFromDTOIgnore(codeFixedValueDTO,codeFixedValueDO); |
| | | codeFixedValueMapper.updateByPrimaryKey(codeFixedValueDO); |
| | | return codeFixedValueDO2VO(codeFixedValueDO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦å¯ä»¥å é¤ï¼å¦æåå¨ä¸çº§ï¼å¹¶ä¸ä¸çº§ææ°æ®å¼ç¨åä¸è½å é¤ |
| | | * @param codeFixedValueDTO æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @param codeFixedValueDO æ°æ®åºä¸çæ°æ®å¯¹è±¡ |
| | | * @return success为true为å¯ä»¥å é¤ï¼falseè¡¨ç¤ºææ°æ®å¼ç¨ï¼obj为true表示æä¸çº§ |
| | | */ |
| | | private BaseResult checkIsCanDeleteForDO(CodeFixedValueDTO codeFixedValueDTO, CodeFixedValueDO codeFixedValueDO) { |
| | | //boService.checkTs(codeFixedValueDTO); |
| | | if(!checkIsLinked(codeFixedValueDO.getOid())) { |
| | | return BaseResult.success(); |
| | | }else{ |
| | | return BaseResult.fail(DATA_LINKED_NOT_DELETE,new String[]{""}); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦è¢«å¼ç¨ |
| | | * @param oid ä¸»é® |
| | | * @throws VciBaseException 被å¼ç¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private boolean checkIsLinked(String oid) throws VciBaseException{ |
| | | //TODO æ·»å éè¦æ ¡éªå¼ç¨çå°æ¹ |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * å é¤åºå®ç 段çç å¼ |
| | | * @param codeFixedValueDTO åºå®ç 段çç 弿°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteCodeFixedValue(CodeFixedValueDTO codeFixedValueDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeFixedValueDTO,"åºå®ç 段çç 弿°æ®å¯¹è±¡",codeFixedValueDTO.getOid(),"åºå®ç 段çç å¼ç主é®"); |
| | | CodeFixedValueDO codeFixedValueDO = selectByOid(codeFixedValueDTO.getOid()); |
| | | BaseResult baseResult = checkIsCanDeleteForDO(codeFixedValueDTO,codeFixedValueDO); |
| | | if(baseResult.isSuccess()) { |
| | | }else{ |
| | | return baseResult; |
| | | } |
| | | //æ§è¡å é¤æä½ |
| | | BatchCBO batchCBO = codeFixedValueMapper.deleteByPrimaryKey(codeFixedValueDO.getOid()); |
| | | return (batchCBO!=null && batchCBO.getDeleteCbos() !=null &&batchCBO.getDeleteCbos().size() > 0)?BaseResult.successMsg(DELETE_SUCCESS):BaseResult.fail(DELETE_FAIL); |
| | | } |
| | | |
| | | /** |
| | | * 主é®è·ååºå®ç 段çç å¼ |
| | | * @param oid ä¸»é® |
| | | * @return åºå®ç 段çç 弿¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ°æ®ä¸å卿¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeFixedValueVO getObjectByOid(String oid) throws VciBaseException{ |
| | | return codeFixedValueDO2VO(selectByOid(oid)); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢æ°æ®å¯¹è±¡ |
| | | * @param oid ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¹¶ä¸æ°æ®ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private CodeFixedValueDO selectByOid(String oid) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(oid,"主é®"); |
| | | CodeFixedValueDO codeFixedValueDO = codeFixedValueMapper.selectByPrimaryKey(oid.trim()); |
| | | if(codeFixedValueDO == null || StringUtils.isBlank(codeFixedValueDO.getOid())){ |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | return codeFixedValueDO; |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·ååºå®ç 段çç å¼ |
| | | * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return åºå®ç 段çç 弿¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢åºç°å¼å¸¸æ¶ä¼æåº |
| | | */ |
| | | @Override |
| | | public Collection<CodeFixedValueVO> listCodeFixedValueByOids(Collection<String> oidCollections) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(oidCollections,"æ°æ®å¯¹è±¡ä¸»é®éå"); |
| | | List<CodeFixedValueDO> codeFixedValueDOList = listCodeFixedValueDOByOidCollections(oidCollections); |
| | | return codeFixedValueDO2VOs(codeFixedValueDOList); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®éåæ¥è¯¢æ°æ®å¯¹è±¡ |
| | | * @param oidCollections 主é®çéå |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | private List<CodeFixedValueDO> listCodeFixedValueDOByOidCollections(Collection<String> oidCollections){ |
| | | List<CodeFixedValueDO> codeFixedValueDOList = new ArrayList<CodeFixedValueDO>(); |
| | | if(!CollectionUtils.isEmpty(oidCollections)){ |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | | for(Collection<String> oids: oidCollectionsList){ |
| | | List<CodeFixedValueDO> tempDOList = codeFixedValueMapper.selectByPrimaryKeyCollection(oids); |
| | | if(!CollectionUtils.isEmpty(tempDOList)){ |
| | | codeFixedValueDOList.addAll(tempDOList); |
| | | } |
| | | } |
| | | } |
| | | return codeFixedValueDOList; |
| | | } |
| | | public class CodeFixedValueServiceImpl extends ServiceImpl<CodeFixedValueMapper, CodeFixedValue> implements ICodeFixedValueService { |
| | | |
| | | |
| | | |
| | | /** |
| | | * åç
§åºå®ç 段çç å¼å表 |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页åæåº |
| | | * @return åºå®ç 段çç 弿¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public DataGrid<CodeFixedValueVO> refDataGridCodeFixedValue(Map<String, String> conditionMap, PageHelper pageHelper) throws VciBaseException{ |
| | | if(conditionMap == null){ |
| | | conditionMap = new HashMap<String, String>(); |
| | | } |
| | | return gridCodeFixedValue(conditionMap,pageHelper); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ç 段ç主é®è·ååºå®ç çç å¼ |
| | | * |
| | | * @param secOidCollection ç æ®µçä¸»é® |
| | | * @return ç 弿¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢çæ¶ååºç°äºéè¯¯ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public Map<String, List<CodeFixedValueVO>> listCodeFixedValueBySecOids(Collection<String> secOidCollection) throws VciBaseException { |
| | | if(CollectionUtils.isEmpty(secOidCollection)){ |
| | | return new HashMap<>(); |
| | | } |
| | | List<CodeFixedValueVO> voList = new ArrayList<>(); |
| | | VciBaseUtil.switchCollectionForOracleIn(secOidCollection).forEach(secOids->{ |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codefixedsecoid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(secOids.toArray(new String[0])) + ")"); |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.addDefaultAsc("ordernum"); |
| | | List<CodeFixedValueDO> valueDOS = codeFixedValueMapper.selectByCondition(conditionMap, pageHelper); |
| | | voList.addAll(codeFixedValueDO2VOs(Optional.ofNullable(valueDOS).orElseGet(() -> new ArrayList<>()))); |
| | | }); |
| | | return voList.stream().collect(Collectors.groupingBy(CodeFixedValueVO::getCodefixedsecoid)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ·»å åºå®ç 段çç å¼ï¼å¦æä¿åçéåä¸ä¸åå¨å·²å¨æ°æ®åºä¸çç å¼åå é¤ãä¸»è¦æ¯ä¿åç å¼çåºå· |
| | | * @param dtoList åºå®ç 段çç å¼å表 |
| | | * @param codefixedsecoid åºå®ç 段çä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult<CodeFixedValueVO> batchSave4Order(List<CodeFixedValueDTO> dtoList, String codefixedsecoid) { |
| | | VciBaseUtil.alertNotNull(codefixedsecoid,"åºå®ç 段主é®"); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codefixedsecoid",codefixedsecoid); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap,CodeFixedValueDO.class); |
| | | List<CodeFixedValueDO> doList = codeFixedValueMapper.selectByWrapper(wrapper); |
| | | List<CodeFixedValueDO> updateList = new ArrayList<>(); |
| | | List<String> deleteOidList = new ArrayList<>(); |
| | | dtoList.forEach(dto -> { |
| | | if (StringUtils.isNotBlank(dto.getOid())){ |
| | | List<CodeFixedValueDO> valueDOList = doList.stream().filter(value -> { |
| | | return value.getOid().equals(dto.getOid()); |
| | | }).collect(Collectors.toList()); |
| | | valueDOList.forEach(valueDO -> { |
| | | valueDO.setId(dto.getId()); |
| | | valueDO.setName(dto.getName()); |
| | | valueDO.setOrderNum(dto.getOrdernum()); |
| | | updateList.add(valueDO); |
| | | }); |
| | | }else{ |
| | | throw new VciBaseException("åºå®ç 段主é®ä¸è½ä¸ºç©º"); |
| | | } |
| | | }); |
| | | if (doList.size() != dtoList.size()){ |
| | | List<String> oidList = dtoList.stream().map(CodeFixedValueDTO::getOid).collect(Collectors.toList()); |
| | | List<CodeFixedValueDO> deleteList = new ArrayList<>(); |
| | | for (CodeFixedValueDO value : doList) { |
| | | if (!oidList.contains(value.getOid())){ |
| | | deleteList.add(value); |
| | | } |
| | | } |
| | | deleteOidList = deleteList.stream().map(CodeFixedValueDO::getOid).collect(Collectors.toList()); |
| | | } |
| | | WebUtil.setPersistence(false); |
| | | BatchCBO batchCBO = codeFixedValueMapper.batchUpdate(updateList); |
| | | if (!CollectionUtils.isEmpty(deleteOidList)) { |
| | | BatchCBO batchDeleteByOids = codeFixedValueMapper.batchDeleteByOids(deleteOidList); |
| | | batchCBO.setDeleteCbos(batchDeleteByOids.getDeleteCbos()); |
| | | } |
| | | WebUtil.setPersistence(true); |
| | | boService.persistenceBatch(batchCBO); |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段主é®å é¤å
¶åå¨çç å¼å¯¹è±¡ |
| | | * @param codefixedsecoid åºå®ç 段çä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult<CodeFixedValueVO> batchDeleteBySecOid(String codefixedsecoid) { |
| | | VciBaseUtil.alertNotNull(codefixedsecoid,"åºå®ç 段主é®"); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codefixedvalueoid",codefixedsecoid); |
| | | VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditionMap,CodeFixedValueDO.class); |
| | | List<CodeFixedValueDO> doList = codeFixedValueMapper.selectByWrapper(wrapper); |
| | | codeFixedValueMapper.batchDeleteByOids(doList.stream().map(CodeFixedValueDO::getOid).collect(Collectors.toList())); |
| | | return BaseResult.success(); |
| | | } |
| | | } |
| | | |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.vci.ubcs.code.constant.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.code.mapper.CodeBasicSecMapper; |
| | | import com.vci.ubcs.code.mapper.CodeRuleMapper; |
| | | import com.vci.ubcs.code.lifecycle.CodeRuleLC; |
| | | import com.vci.ubcs.code.entity.CodeAllCodeDO; |
| | | import com.vci.ubcs.code.entity.CodeBasicSecDO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyDO; |
| | | import com.vci.ubcs.code.entity.CodeRuleDO; |
| | | import com.vci.ubcs.code.service.CodeBasicSecServiceI; |
| | | import com.vci.ubcs.code.service.CodeClassifyServiceI; |
| | | import com.vci.ubcs.code.service.CodeRuleServiceI; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.KeyValue; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import com.vci.web.service.WebBoServiceI; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.vci.ubcs.code.dto.CodeBasicSecDTO; |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | 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.CodeRuleDTO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | 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.lifecycle.CodeRuleLC; |
| | | import com.vci.ubcs.code.mapper.CodeRuleMapper; |
| | | 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.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import com.vci.ubcs.code.wrapper.CodeClassifyWrapper; |
| | | 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.util.VciBaseUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | import plm.bs.bom.clientobject.ClientBusinessObjectOperation; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.*; |
| | | import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING; |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_OID_NOT_EXIST; |
| | | import static com.vci.ubcs.code.constant.MdmLifeCycleConstant.CODE_RULE_LC; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®ç¼ç è§åæå¡ |
| | | * ç¼ç è§å æå¡å®ç°ç±» |
| | | * |
| | | * @author weidy |
| | | * @date 2022-01-24 |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | @Service |
| | | public class CodeRuleServiceImpl implements CodeRuleServiceI { |
| | | public class CodeRuleServiceImpl extends ServiceImpl<CodeRuleMapper, CodeRule> implements ICodeRuleService { |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | /** |
| | | * æ°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeRuleMapper codeRuleMapper; |
| | | |
| | | /** |
| | | * æ°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeRuleMapper codeRuleMapper; |
| | | @Resource |
| | | private ICodeClassifyService codeClassifyServcie; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæä½çæå¡ |
| | | */ |
| | | @Autowired |
| | | @Lazy |
| | | private WebBoServiceI boService; |
| | | @Resource |
| | | private ICodeAllcodeService codeAllcodeService; |
| | | |
| | | /** |
| | | * 对象çæä½ |
| | | */ |
| | | @Autowired |
| | | private RevisionModelUtil revisionModelUtil; |
| | | @Resource |
| | | private ICodeBasicSecService codeBasicSecService; |
| | | |
| | | /** |
| | | * 主é¢åºåç±»æ°æ®æä½å± |
| | | */ |
| | | @Autowired |
| | | private CodeClassifyServiceI codeClassifyService; |
| | | /** |
| | | * 对象çæä½ |
| | | */ |
| | | @Resource |
| | | private RevisionModelUtil revisionModelUtil; |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯æå¡ |
| | | */ |
| | | @Autowired |
| | | private CodeBasicSecServiceI codeBasicSecService; |
| | | @Override |
| | | public IPage<CodeRuleVO> selectPlCodeRulePage(IPage<CodeRuleVO> page, CodeRuleVO codeRule) { |
| | | //对çå½å¨æçæä¸¾è¿è¡è½¬æ¢ |
| | | if(!StringUtils.isEmpty(codeRule.getLcStatusText())){ |
| | | codeRule.setLcStatus(CodeRuleLC.getValueByText(codeRule.getLcStatusText())); |
| | | } |
| | | List<CodeRule> codeRulePage = codeRuleMapper.selectCodeRulePage(page, codeRule); |
| | | //do转voåæ¶setLcStatusTextçå½å¨æå¼ï¼å¹¶å
è£
æå页对象è¿å |
| | | return page.setRecords(CodeRuleWrapper.build().listVO(codeRulePage)); |
| | | } |
| | | |
| | | /** |
| | | * ç æ®µåºç¡ä¿¡æ¯æ°æ®æä½å± |
| | | */ |
| | | @Resource |
| | | private CodeBasicSecMapper codeBasicSecMapper; |
| | | /** |
| | | * å¢å ä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public Boolean addSave(CodeRuleDTO codeRuleDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeRule codeRule = Objects.requireNonNull(BeanUtil.copy(codeRuleDTO, CodeRule.class)); |
| | | String userId = AuthUtil.getUserId().toString(); |
| | | codeRule.setOid(VciBaseUtil.getPk()); |
| | | codeRule.setRevisionOid(VciBaseUtil.getPk()); |
| | | codeRule.setNameOid(VciBaseUtil.getPk()); |
| | | codeRule.setBtmname("coderule"); |
| | | codeRule.setLastR("1"); |
| | | codeRule.setLastV("1"); |
| | | codeRule.setFirstR("1"); |
| | | codeRule.setFirstV("1"); |
| | | codeRule.setCreator(userId); |
| | | codeRule.setCreateTime(new Date()); |
| | | codeRule.setLastModifier("1"); |
| | | codeRule.setLastModifyTime(new Date()); |
| | | codeRule.setVersionRule("0"); |
| | | codeRule.setVersionSeq(1); |
| | | codeRule.setLctid(CODE_RULE_LC); |
| | | codeRule.setLcStatus(FRAMEWORK_RELEASE_EDITING); |
| | | codeRule.setOwner("1"); |
| | | codeRule.setCreator(userId); |
| | | codeRule.setLastModifier(userId); |
| | | return codeRuleMapper.insert(codeRule)>0; |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªç¼ç è§åçç¶ææ¯å¦å¯ä»¥ç¼è¾æå é¤ |
| | | * |
| | | * @param lcStatus ç¼ç è§å |
| | | * @return true表示å¯ä»¥ç¼è¾æå é¤ï¼false表示ä¸å¯ä»¥ |
| | | */ |
| | | @Override |
| | | public boolean checkEditDelStatus(String lcStatus) { |
| | | if (CodeRuleLC.RELEASED.getValue().equals(lcStatus) || CodeRuleLC.DISABLED.getValue().equals(lcStatus)) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææçä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页åæåº |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public DataGrid<CodeRuleVO> gridCodeRule(Map<String, String> conditionMap, PageHelper pageHelper) throws VciBaseException { |
| | | if (pageHelper == null) { |
| | | pageHelper = new PageHelper(-1); |
| | | } |
| | | pageHelper.addDefaultDesc("createTime"); |
| | | List<CodeRuleDO> doList = codeRuleMapper.selectByCondition(conditionMap, pageHelper); |
| | | DataGrid<CodeRuleVO> dataGrid = new DataGrid<CodeRuleVO>(); |
| | | if (!CollectionUtils.isEmpty(doList)) { |
| | | dataGrid.setData(codeRuleDO2VOs(doList)); |
| | | dataGrid.setTotal(VciBaseUtil.getInt(String.valueOf(codeRuleMapper.countByCondition(conditionMap)))); |
| | | } |
| | | return dataGrid; |
| | | } |
| | | /** |
| | | * ä¿®æ¹ä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public Boolean editSave(CodeRuleDTO codeRuleDTO) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "æ°æ®å¯¹è±¡", codeRuleDTO.getOid(), "ä¸»æ°æ®ç¼ç è§å主é®"); |
| | | if (!checkEditDelStatus(codeRuleDTO.getLcStatus())) { |
| | | throw new VciBaseException("ç¼ç è§åå·²åå¸ï¼ä¸å
许ç¼è¾æå é¤"); |
| | | } |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeRule codeRule = selectByOid(codeRuleDTO.getOid()); |
| | | revisionModelUtil.copyFromDTOIgnore(codeRuleDTO, codeRule); |
| | | return codeRuleMapper.updateById(codeRule)>0; |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param codeRuleDOs æ°æ®å¯¹è±¡å表 |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<CodeRuleVO> codeRuleDO2VOs(Collection<CodeRuleDO> codeRuleDOs) throws VciBaseException { |
| | | return codeRuleDO2VOs(codeRuleDOs, false); |
| | | } |
| | | /** |
| | | * å é¤ä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deleteCodeRule(CodeRuleDTO codeRuleDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "ä¸»æ°æ®ç¼ç è§åæ°æ®å¯¹è±¡", codeRuleDTO.getOid(), "ä¸»æ°æ®ç¼ç è§åç主é®"); |
| | | CodeRule codeRule = selectByOid(codeRuleDTO.getOid()); |
| | | if (!checkEditDelStatus(codeRule.getLcStatus())) { |
| | | return R.fail("ç¼ç è§åå·²åå¸ï¼ä¸å
许ç¼è¾æå é¤"); |
| | | } else { |
| | | if (isAlreadyInUse(codeRule.getOid())) { |
| | | return R.fail("ç¼ç è§å已被å¼ç¨ï¼ä¸å
许ç¼è¾æå é¤ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param codeRuleDOs æ°æ®å¯¹è±¡å表 |
| | | * @param hasSec æ¯å¦å
å«ç 段 |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public List<CodeRuleVO> codeRuleDO2VOs(Collection<CodeRuleDO> codeRuleDOs, boolean hasSec) throws VciBaseException { |
| | | List<CodeRuleVO> voList = new ArrayList<CodeRuleVO>(); |
| | | if (!CollectionUtils.isEmpty(codeRuleDOs)) { |
| | | for (CodeRuleDO s : codeRuleDOs) { |
| | | CodeRuleVO vo = codeRuleDO2VO(s); |
| | | if (vo != null) { |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | if (hasSec) { |
| | | List<CodeBasicSecVO> secVOList = codeBasicSecService.listCodeBasicSecByRuleOids(voList.stream().map(CodeRuleVO::getOid).collect(Collectors.toList())); |
| | | if (!CollectionUtils.isEmpty(secVOList)) { |
| | | Map<String, List<CodeBasicSecVO>> secVOMap = secVOList.stream().collect(Collectors.groupingBy(CodeBasicSecVO::getPkCodeRule)); |
| | | voList.stream().forEach(vo -> { |
| | | vo.setSecVOList(secVOMap.getOrDefault(vo.getOid(), new ArrayList<>())); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | List<CodeAllcode> codeDOList = codeAllcodeService.selectByWrapper(Wrappers.<CodeAllcode>query().eq("codeRuleOid", codeRuleDTO.getOid())); |
| | | if (!CollectionUtils.isEmpty(codeDOList)) { |
| | | return R.fail("ç¼ç è§åå·²çæç¼ç ï¼ä¸å
许å é¤"); |
| | | } |
| | | //æ§è¡å é¤æä½ |
| | | //WebUtil.setPersistence(false); |
| | | boolean resBoolean = codeBasicSecService.batchDeleteSecByCodeRuleOid(codeRule.getOid()); |
| | | resBoolean = codeRuleMapper.deleteById(codeRule.getOid())>0; |
| | | //WebUtil.setPersistence(true); |
| | | return R.status(resBoolean); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param codeRuleDO æ°æ®å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ·è´å±æ§åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeRuleVO codeRuleDO2VO(CodeRuleDO codeRuleDO) throws VciBaseException { |
| | | CodeRuleVO vo = new CodeRuleVO(); |
| | | if (codeRuleDO != null) { |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeRuleDO, vo); |
| | | //妿ælcstatusçç±»çè¯ |
| | | vo.setLcStatusText(CodeRuleLC.getTextByValue(vo.getLcStatus())); |
| | | /** |
| | | * 䏻鮿¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¹¶ä¸æ°æ®ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private CodeRule selectByOid(String oid) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oid, "主é®"); |
| | | CodeRule codeRuleDO = codeRuleMapper.selectById(oid.trim()); |
| | | if (codeRuleDO == null || StringUtils.isBlank(codeRuleDO.getOid())) { |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | return codeRuleDO; |
| | | } |
| | | |
| | | } |
| | | return vo; |
| | | } |
| | | /** |
| | | * æ£éªç¼ç è§åæ¯å¦å·²ç»è¢«ä½¿ç¨ |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return true表示已ç»ä½¿ç¨ï¼false表示æªè¢«ä½¿ç¨ |
| | | */ |
| | | @Override |
| | | public boolean isAlreadyInUse(String oid) { |
| | | Collection<CodeClassifyVO> codeClassifyVOS = listUseRangeInCodeClassify(oid); |
| | | if (codeClassifyVOS.size() > 0) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param codeRuleDO è§åçæ°æ®å¯¹è±¡ |
| | | * @param hasSec æ¯å¦æ¥è¯¢ç 段 |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ·è´å±æ§åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | public CodeRuleVO codeRuleDO2VO(CodeRuleDO codeRuleDO, boolean hasSec) throws VciBaseException { |
| | | CodeRuleVO vo = new CodeRuleVO(); |
| | | if (codeRuleDO != null) { |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeRuleDO, vo); |
| | | //妿ælcstatusçç±»çè¯ |
| | | vo.setLcStatusText(CodeRuleLC.getTextByValue(vo.getLcStatus())); |
| | | if (hasSec) { |
| | | //æ¥è¯¢ç 段 |
| | | vo.setSecVOList(codeBasicSecService.listCodeBasicSecByRuleOid(vo.getOid())); |
| | | } |
| | | } |
| | | return vo; |
| | | } |
| | | /** |
| | | * æ¥çä¸»æ°æ®ç¼ç è§åç使ç¨èå´ |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return 主é¢åºå类使ç¨å°è¯¥ç¼ç è§åçææéå |
| | | */ |
| | | @Override |
| | | public Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid) { |
| | | List<CodeClassify> codeClassifies = codeClassifyServcie.selectByWrapper(Wrappers.<CodeClassify>query().eq("codeRuleOid", oid)); |
| | | return CodeClassifyWrapper.build().listVO(codeClassifies); |
| | | } |
| | | |
| | | /** |
| | | * å¢å ä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeRuleVO addSave(CodeRuleDTO codeRuleDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeRuleDO codeRuleDO = new CodeRuleDO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeRuleDTO, codeRuleDO); |
| | | codeRuleMapper.insert(codeRuleDO); |
| | | return codeRuleDO2VO(codeRuleDO); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¯ä¸é¡¹ï¼å¿
è¾é¡¹ä¸éè¿æ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeRuleVO editSave(CodeRuleDTO codeRuleDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "æ°æ®å¯¹è±¡", codeRuleDTO.getOid(), "ä¸»æ°æ®ç¼ç è§å主é®"); |
| | | if (!checkEditDelStatus(codeRuleDTO.getLcStatus())) { |
| | | throw new VciBaseException("ç¼ç è§åå·²åå¸ï¼ä¸å
许ç¼è¾æå é¤"); |
| | | } |
| | | //å°DTO转æ¢ä¸ºDO |
| | | CodeRuleDO codeRuleDO = selectByOid(codeRuleDTO.getOid()); |
| | | revisionModelUtil.copyFromDTOIgnore(codeRuleDTO, codeRuleDO); |
| | | codeRuleMapper.updateByPrimaryKey(codeRuleDO); |
| | | return codeRuleDO2VO(codeRuleDO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦å¯ä»¥å é¤ï¼å¦æåå¨ä¸çº§ï¼å¹¶ä¸ä¸çº§ææ°æ®å¼ç¨åä¸è½å é¤ |
| | | * |
| | | * @param codeRuleDTO æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @param codeRuleDO æ°æ®åºä¸çæ°æ®å¯¹è±¡ |
| | | * @return success为true为å¯ä»¥å é¤ï¼falseè¡¨ç¤ºææ°æ®å¼ç¨ï¼obj为true表示æä¸çº§ |
| | | */ |
| | | private BaseResult checkIsCanDeleteForDO(CodeRuleDTO codeRuleDTO, CodeRuleDO codeRuleDO) { |
| | | boService.checkTs(codeRuleDTO); |
| | | if (!checkIsLinked(codeRuleDO.getOid())) { |
| | | return BaseResult.success(); |
| | | } else { |
| | | return BaseResult.fail(DATA_LINKED_NOT_DELETE, new String[]{""}); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦è¢«å¼ç¨ |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @throws VciBaseException 被å¼ç¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private boolean checkIsLinked(String oid) throws VciBaseException { |
| | | //TODO æ·»å éè¦æ ¡éªå¼ç¨çå°æ¹ |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼è¢«å¼ç¨æ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteCodeRule(CodeRuleDTO codeRuleDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "ä¸»æ°æ®ç¼ç è§åæ°æ®å¯¹è±¡", codeRuleDTO.getOid(), "ä¸»æ°æ®ç¼ç è§åç主é®"); |
| | | CodeRuleDO codeRuleDO = selectByOid(codeRuleDTO.getOid()); |
| | | //BaseResult baseResult = checkIsCanDeleteForDO(codeRuleDTO,codeRuleDO); |
| | | // if(baseResult.isSuccess()) { |
| | | // }else{ |
| | | // return baseResult; |
| | | // } |
| | | if (!checkEditDelStatus(codeRuleDO.getLcStatus())) { |
| | | return BaseResult.fail("ç¼ç è§åå·²åå¸ï¼ä¸å
许ç¼è¾æå é¤"); |
| | | } else { |
| | | if (isAlreadyInUse(codeRuleDO.getOid())) { |
| | | return BaseResult.fail("ç¼ç è§å已被å¼ç¨ï¼ä¸å
许ç¼è¾æå é¤ï¼"); |
| | | } |
| | | } |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codeRuleOid", codeRuleDTO.getOid()); |
| | | List<CodeAllCodeDO> codeDOList = boService.queryObject(CodeAllCodeDO.class, conditionMap); |
| | | if (!CollectionUtils.isEmpty(codeDOList)) { |
| | | return BaseResult.fail("ç¼ç è§åå·²çæç¼ç ï¼ä¸å
许å é¤"); |
| | | } |
| | | //æ§è¡å é¤æä½ |
| | | WebUtil.setPersistence(false); |
| | | BatchCBO batchCBO = codeBasicSecService.batchDeleteSecByCodeRuleOid(codeRuleDO.getOid()); |
| | | BatchCBO mainCBO = codeRuleMapper.deleteByPrimaryKey(codeRuleDO.getOid()); |
| | | WebUtil.setPersistence(true); |
| | | Set<ClientBusinessObject> deleteSet = new HashSet<>(); |
| | | deleteSet.addAll(batchCBO.getDeleteCbos()); |
| | | deleteSet.addAll(mainCBO.getDeleteCbos()); |
| | | batchCBO.setDeleteCbos(deleteSet); |
| | | boService.persistenceBatch(batchCBO); |
| | | return (batchCBO != null && batchCBO.getDeleteCbos() != null && batchCBO.getDeleteCbos().size() > 0) ? BaseResult.successMsg(DELETE_SUCCESS) : BaseResult.fail(DELETE_FAIL); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªç¼ç è§åçç¶ææ¯å¦å¯ä»¥ç¼è¾æå é¤ |
| | | * |
| | | * @param lcStatus ç¼ç è§å |
| | | * @return true表示å¯ä»¥ç¼è¾æå é¤ï¼false表示ä¸å¯ä»¥ |
| | | */ |
| | | @Override |
| | | public boolean checkEditDelStatus(String lcStatus) { |
| | | if (CodeRuleLC.RELEASED.getValue().equals(lcStatus) || CodeRuleLC.DISABLED.getValue().equals(lcStatus)) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 主é®è·åä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ°æ®ä¸å卿¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public CodeRuleVO getObjectByOid(String oid) throws VciBaseException { |
| | | return codeRuleDO2VO(selectByOid(oid)); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return æ°æ®å¯¹è±¡ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼å¹¶ä¸æ°æ®ä¸åå¨çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | private CodeRuleDO selectByOid(String oid) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oid, "主é®"); |
| | | CodeRuleDO codeRuleDO = codeRuleMapper.selectByPrimaryKey(oid.trim()); |
| | | if (codeRuleDO == null || StringUtils.isBlank(codeRuleDO.getOid())) { |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | return codeRuleDO; |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·åä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢åºç°å¼å¸¸æ¶ä¼æåº |
| | | */ |
| | | @Override |
| | | public Collection<CodeRuleVO> listCodeRuleByOids(Collection<String> oidCollections) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oidCollections, "æ°æ®å¯¹è±¡ä¸»é®éå"); |
| | | List<CodeRuleDO> codeRuleDOList = listCodeRuleDOByOidCollections(oidCollections); |
| | | return codeRuleDO2VOs(codeRuleDOList); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·åä¸»æ°æ®ç¼ç è§å |
| | | * |
| | | * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @param hasSec æ¯å¦å
å«ç 段 |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | * @throws VciBaseException æ¥è¯¢åºç°å¼å¸¸æ¶ä¼æåº |
| | | */ |
| | | @Override |
| | | public Collection<CodeRuleVO> listCodeRuleByOids(Collection<String> oidCollections, boolean hasSec) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oidCollections, "æ°æ®å¯¹è±¡ä¸»é®éå"); |
| | | List<CodeRuleDO> codeRuleDOList = listCodeRuleDOByOidCollections(oidCollections); |
| | | return codeRuleDO2VOs(codeRuleDOList, true); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ç¼å·çéåè·åè§åçå
容 |
| | | * |
| | | * @param idCollection ç¼å·çéå |
| | | * @return è§åçå
容 |
| | | */ |
| | | @Override |
| | | public List<CodeRuleVO> listCodeRuleByIds(Collection<String> idCollection) { |
| | | return codeRuleDO2VOs(listCodeRuleDOByIdCollections(idCollection)); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®éåæ¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param oidCollections 主é®çéå |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | private List<CodeRuleDO> listCodeRuleDOByOidCollections(Collection<String> oidCollections) { |
| | | List<CodeRuleDO> codeRuleDOList = new ArrayList<CodeRuleDO>(); |
| | | if (!CollectionUtils.isEmpty(oidCollections)) { |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | | for (Collection<String> oids : oidCollectionsList) { |
| | | List<CodeRuleDO> tempDOList = codeRuleMapper.selectByPrimaryKeyCollection(oids); |
| | | if (!CollectionUtils.isEmpty(tempDOList)) { |
| | | codeRuleDOList.addAll(tempDOList); |
| | | } |
| | | } |
| | | } |
| | | return codeRuleDOList; |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ç¼å·éåæ¥è¯¢æ°æ®å¯¹è±¡ |
| | | * |
| | | * @param idCollections ç¼å·çéå |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | private List<CodeRuleDO> listCodeRuleDOByIdCollections(Collection<String> idCollections) { |
| | | List<CodeRuleDO> codeRuleDOList = new ArrayList<CodeRuleDO>(); |
| | | if (!CollectionUtils.isEmpty(idCollections)) { |
| | | Collection<Collection<String>> idCollectionsList = VciBaseUtil.switchCollectionForOracleIn(idCollections); |
| | | for (Collection<String> ids : idCollectionsList) { |
| | | List<CodeRuleDO> tempDOList = codeRuleMapper.selectByIdCollection(ids); |
| | | if (!CollectionUtils.isEmpty(tempDOList)) { |
| | | codeRuleDOList.addAll(tempDOList); |
| | | } |
| | | } |
| | | } |
| | | return codeRuleDOList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åç
§ä¸»æ°æ®ç¼ç è§åå表 |
| | | * |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页åæåº |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | * @throws VciBaseException æ¥è¯¢æ¡ä»¶åå页åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public DataGrid<CodeRuleVO> refDataGridCodeRule(Map<String, String> conditionMap, PageHelper pageHelper) throws VciBaseException { |
| | | if (conditionMap == null) { |
| | | conditionMap = new HashMap<String, String>(); |
| | | } |
| | | return gridCodeRule(conditionMap, pageHelper); |
| | | } |
| | | |
| | | /** |
| | | * æ¥çä¸»æ°æ®ç¼ç è§åç使ç¨èå´ |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return 主é¢åºå类使ç¨å°è¯¥ç¼ç è§åçææéå |
| | | */ |
| | | @Override |
| | | public Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid) { |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codeRuleOid", oid); |
| | | VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap, CodeClassifyDO.class); |
| | | List<CodeClassifyDO> dos = codeClassifyService.selectByWrapper(queryWrapper); |
| | | return codeClassifyService.codeClassifyDO2VOs(dos); |
| | | } |
| | | |
| | | /** |
| | | * æ£éªç¼ç è§åæ¯å¦å·²ç»è¢«ä½¿ç¨ |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return true表示已ç»ä½¿ç¨ï¼false表示æªè¢«ä½¿ç¨ |
| | | */ |
| | | @Override |
| | | public boolean isAlreadyInUse(String oid) { |
| | | Collection<CodeClassifyVO> codeClassifyVOS = listUseRangeInCodeClassify(oid); |
| | | if (codeClassifyVOS.size() > 0) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åç¨ä¸å¯ç¨ç¼ç è§å |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @param update enable:å¯ç¨ disable:åç¨ release:åå¸ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult updateStatus(String oid, String update) { |
| | | int count = 0; |
| | | CodeRuleDO codeRuleDO = selectByOid(oid); |
| | | if ("enable".equalsIgnoreCase(update)) { |
| | | if (!CodeRuleLC.DISABLED.getValue().equals(codeRuleDO.getLcStatus())) { |
| | | return BaseResult.fail("éåç¨ç¶æçç¼ç è§åæ éç¹å»å¯ç¨"); |
| | | } |
| | | count = codeRuleMapper.updateLcStatus(oid, CodeRuleLC.RELEASED.getValue()); |
| | | } else if ("disable".equalsIgnoreCase(update)) { |
| | | if (!CodeRuleLC.RELEASED.getValue().equals(codeRuleDO.getLcStatus())) { |
| | | return BaseResult.fail("éåå¸ç¶æçç¼ç è§åæ æ³åç¨"); |
| | | } |
| | | count = codeRuleMapper.updateLcStatus(oid, CodeRuleLC.DISABLED.getValue()); |
| | | } else if ("release".equalsIgnoreCase(update)) { |
| | | if (!CodeRuleLC.EDITING.getValue().equals(codeRuleDO.getLcStatus())) { |
| | | return BaseResult.fail("éç¼è¾ç¶æçç¼ç è§åæ æ³åå¸"); |
| | | } |
| | | count = codeRuleMapper.updateLcStatus(oid, CodeRuleLC.RELEASED.getValue()); |
| | | } else { |
| | | return BaseResult.fail("æä¸æ¯æçæä½ç±»å"); |
| | | } |
| | | if (count > 0) { |
| | | return BaseResult.success(); |
| | | } else { |
| | | return BaseResult.fail("æ´æ°ç¶æå¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å
éç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | public BaseResult cloneCodeRule_v1(CodeRuleDTO codeRuleDTO) { |
| | | VciBaseUtil.alertNotNull(codeRuleDTO.getOid(), "ç¼ç è§å主é®"); |
| | | ClientBusinessObjectOperation operation = new ClientBusinessObjectOperation(); |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pkCodeRule", codeRuleDTO.getOid()); |
| | | List<CodeBasicSecDO> basicSecDOS = boService.queryObject(CodeBasicSecDO.class, conditionMap); |
| | | List<String> secOidList = new ArrayList<>(); |
| | | for (CodeBasicSecDO secDO : basicSecDOS) { |
| | | secOidList.add(secDO.getOid()); |
| | | } |
| | | List<ClientBusinessObject> cboList = new ArrayList<>(); |
| | | try { |
| | | ClientBusinessObject templateCbo = operation.readBusinessObjectById(codeRuleDTO.getOid(), MdmBtmTypeConstant.CODE_RULE); |
| | | ClientBusinessObject codeRuleCbo = operation.initBusinessObject(templateCbo.getBtmName()); |
| | | String curOid = codeRuleCbo.getOid(); |
| | | String curRevisionId = codeRuleCbo.getRevisionid(); |
| | | String curNameOid = codeRuleCbo.getNameoid(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(templateCbo, codeRuleCbo); |
| | | codeRuleCbo.setOid(curOid); |
| | | codeRuleCbo.setRevisionid(curRevisionId); |
| | | codeRuleCbo.setNameoid(curNameOid); |
| | | codeRuleCbo.setId(templateCbo.getId() + "_copy"); |
| | | codeRuleCbo.setName(templateCbo.getName() + "_copy"); |
| | | if (!CollectionUtils.isEmpty(secOidList)) { |
| | | ClientBusinessObject[] secCboArr = operation.readBusinessObjectById(secOidList.toArray(new String[0]), MdmBtmTypeConstant.CODE_BASIC_SEC); |
| | | for (ClientBusinessObject cbo : secCboArr) { |
| | | ClientBusinessObject newSecCbo = operation.initBusinessObject(cbo.getBtmName()); |
| | | String newSecCboOid = newSecCbo.getOid(); |
| | | String newSecCboRevisionId = newSecCbo.getRevisionid(); |
| | | String newSecCboNameOid = newSecCbo.getNameoid(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(cbo, newSecCbo); |
| | | newSecCbo.setOid(newSecCboOid); |
| | | newSecCbo.setRevisionid(newSecCboRevisionId); |
| | | newSecCbo.setNameoid(newSecCboNameOid); |
| | | newSecCbo.setId(newSecCbo.getId() + "_copy"); |
| | | newSecCbo.setName(newSecCbo.getName() + "_copy"); |
| | | newSecCbo.setAttributeValue("pkCodeRule", codeRuleCbo.getOid()); |
| | | cboList.add(newSecCbo); |
| | | } |
| | | } |
| | | cboList.add(codeRuleCbo); |
| | | ClientBusinessObject[] saveList = operation.batchSaveCreateBuinessObject(cboList.toArray(new ClientBusinessObject[0])); |
| | | if (saveList.length == 0) { |
| | | return BaseResult.fail("å
éåºéäºâ¦â¦"); |
| | | } |
| | | } catch (VCIError vciError) { |
| | | vciError.printStackTrace(); |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å
éç¼ç è§å |
| | | * |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public BaseResult cloneCodeRule(CodeRuleDTO codeRuleDTO) { |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | CodeRuleDO codeRuleDO = new CodeRuleDO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeRuleDTO, codeRuleDO); |
| | | WebUtil.setPersistence(false); |
| | | BatchCBO batchInsertCBO = codeRuleMapper.insert(codeRuleDO); |
| | | List<CodeBasicSecDTO> secList = codeRuleDTO.getElements(); |
| | | secList.forEach(codeBasicSecDTO -> { |
| | | codeBasicSecDTO.setPkCodeRule(codeRuleDO.getOid()); |
| | | KeyValue attrKv = codeBasicSecService.checkAttrNullableBySecType(codeBasicSecDTO); |
| | | if (!"success".equals(attrKv.getKey())) { |
| | | throw new VciBaseException(attrKv.getValue() + "ä¸è½ä¸ºç©º"); |
| | | } |
| | | CodeBasicSecDO codeBasicSecDO = new CodeBasicSecDO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDTO, codeBasicSecDO); |
| | | codeBasicSecDO.setOid(""); |
| | | codeBasicSecDO.setRevisionOid(""); |
| | | codeBasicSecDO.setNameOid(""); |
| | | //codeBasicSecMapperä¸çè¯å¥å
¨é¨è¿ç§»å°è¿é |
| | | VciBaseUtil.alertNotNull(codeBasicSecDO,"è¦æ·»å çæ°æ®"); |
| | | BatchCBO cbo = boService.addSave(codeBasicSecDO); |
| | | batchInsertCBO.addCreateCbo(cbo.getCreateCboArray()[0]); |
| | | }); |
| | | boService.persistenceBatch(batchInsertCBO); |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ä¸»é®è·åç¼ç è§åçå
容 |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return è§åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public CodeRuleVO getObjectHasSecByOid(String oid) { |
| | | CodeRuleDO ruleDO = selectByOid(oid); |
| | | return codeRuleDO2VO(ruleDO, true); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç è§åæ¸
空ææå·²çæçç¼ç |
| | | * |
| | | * @param oid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult clearAllCode(String oid) { |
| | | WebUtil.alertNotNull(oid, "ç¼ç è§å主é®"); |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("codeRuleOid", oid); |
| | | List<CodeAllCodeDO> codeDOList = boService.queryObject(CodeAllCodeDO.class, conditionMap); |
| | | if (CollectionUtils.isEmpty(codeDOList)) { |
| | | return BaseResult.fail("å½åç¼ç è§å没æçæç¼ç ,æ 鿏
空"); |
| | | } |
| | | //æ¯å¦éè¦è¿è¡btmä¸ç»ä¸ç夿? |
| | | String btmType = codeDOList.get(0).getCreateCodeBtm(); |
| | | /*boolean flag = codeDOList.stream().anyMatch(s -> !StringUtils.equalsIgnoreCase(btmType, s.getCreateCodeBtm())); |
| | | if (flag) { |
| | | return BaseResult.fail("å½åç¼ç è§åçæç¼ç å¨ä¸åç±»åä¸ä½¿ç¨è¿"); |
| | | }*/ |
| | | //å¤ç§ç±»åä¸çæ¥è¯¢ |
| | | Set<String> btmTypeSet = codeDOList.stream().filter(s -> { |
| | | return !StringUtils.equalsIgnoreCase(btmType, s.getCreateCodeBtm()); |
| | | }).map(s -> s.getCreateCodeBtm()).collect(Collectors.toSet()); |
| | | List<ClientBusinessObject> businessDataList = new ArrayList<>(); |
| | | if (btmTypeSet.size() > 1) { |
| | | for (String btm : btmTypeSet) { |
| | | String sql = "select COUNT(w.OID) from PLATFORMBTM_" + btm + " w\n" + |
| | | "join PLATFORMBTM_" + MdmBtmTypeConstant.CODE_ALL_CODE + " c on w.OID = c.CREATECODEOID\n" + |
| | | "where c.CREATECODEBTM = '" + btm + "' and c.CODERULEOID = '" + oid + "'" + |
| | | "and w.ISLASTR = '1' and w.ISLASTV = '1'"; |
| | | List<ClientBusinessObject> businessData = boService.queryByOnlySql(sql); |
| | | businessDataList.addAll(businessData); |
| | | } |
| | | }else { |
| | | String sql = "select COUNT(w.OID) from PLATFORMBTM_" + btmType + " w\n" + |
| | | "join PLATFORMBTM_" + MdmBtmTypeConstant.CODE_ALL_CODE + " c on w.OID = c.CREATECODEOID\n" + |
| | | "where c.CREATECODEBTM = '" + btmType + "' and c.CODERULEOID = '" + oid + "'" + |
| | | "and w.ISLASTR = '1' and w.ISLASTV = '1'"; |
| | | List<ClientBusinessObject> businessData = boService.queryByOnlySql(sql); |
| | | businessDataList.addAll(businessData); |
| | | } |
| | | if (CollectionUtils.isEmpty(businessDataList) || StringUtils.isBlank(businessDataList.get(0).getAttributeValue("COUNT(w.OID)"))) { |
| | | //æ ææ¥è¯¢ |
| | | return BaseResult.fail("æ¥è¯¢å¤±è´¥"); |
| | | } else if (!StringUtils.equalsIgnoreCase("0", businessDataList.get(0).getAttributeValue("COUNT(w.OID)"))) { |
| | | return BaseResult.fail("ç¼ç è§åçæçç¼ç å·²å¨ä¸å¡æ°æ®ä¸åºç¨ï¼ä¸å
许æ¸
空"); |
| | | } |
| | | //æ²¡ææ°æ®ï¼å¯ä»¥å®å
¨å é¤ |
| | | WebUtil.setPersistence(false); |
| | | //å é¤ç å¼è¡¨ä¸çæ°æ®ï¼ä½ä¸å¤ï¼å¦æææµæ°´çç æ®µï¼éè¦éæ°è®¡ç®æµæ°´ |
| | | conditionMap.clear(); |
| | | conditionMap.put("codeRuleOid", oid); |
| | | List<ClientBusinessObject> serialValueList = boService.queryCBO("codeserialvalue", conditionMap); |
| | | BatchCBO batchCBO = boService.batchDelete(codeDOList); |
| | | batchCBO.getDeleteCbos().addAll(serialValueList); |
| | | WebUtil.setPersistence(true); |
| | | boService.persistenceBatch(batchCBO); |
| | | return BaseResult.success(); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.mapper.CodeClassifyMapper; |
| | | import com.vci.ubcs.code.service.ICodeClassifyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ICodeClassifyServiceImpl extends ServiceImpl<CodeClassifyMapper, CodeClassify> implements ICodeClassifyService { |
| | | |
| | | @Resource |
| | | private CodeClassifyMapper codeClassifyMapper; |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param wrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public List<CodeClassify> selectByWrapper(Wrapper wrapper) { |
| | | return codeClassifyMapper.selectList(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) |
| | | */ |
| | | package com.vci.ubcs.code.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import com.vci.ubcs.code.entity.CodeAllcode; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeAllcodeVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * å
¨é¨ç å¼ å
è£
ç±»,è¿åè§å¾å±æéçåæ®µ |
| | | * |
| | | * @author ludc |
| | | * @since 2023-04-03 |
| | | */ |
| | | public class CodeAllcodeWrapper extends BaseEntityWrapper<CodeAllcode, CodeAllcodeVO> { |
| | | |
| | | public static CodeAllcodeWrapper build() { |
| | | return new CodeAllcodeWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public CodeAllcodeVO entityVO(CodeAllcode CodeAllcode) { |
| | | CodeAllcodeVO CodeAllcodeVO = Objects.requireNonNull(BeanUtil.copy(CodeAllcode, CodeAllcodeVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(CodeAllcode.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(CodeAllcode.getUpdateUser()); |
| | | //CodeAllcodeVO.setCreateUserName(createUser.getName()); |
| | | //CodeAllcodeVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return CodeAllcodeVO; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.wrapper; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | public class CodeClassifyWrapper extends BaseEntityWrapper<CodeClassify, CodeClassifyVO> { |
| | | |
| | | public static CodeClassifyWrapper build() { |
| | | return new CodeClassifyWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public CodeClassifyVO entityVO(CodeClassify codeClassify) { |
| | | CodeClassifyVO codeClassifyVO = Objects.requireNonNull(BeanUtil.copy(codeClassify, CodeClassifyVO.class)); |
| | | return codeClassifyVO; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.wrapper; |
| | | |
| | | import com.vci.ubcs.code.entity.CodeRule; |
| | | import com.vci.ubcs.code.lifecycle.CodeRuleLC; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | 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 CodeRuleWrapper extends BaseEntityWrapper<CodeRule, CodeRuleVO> { |
| | | |
| | | public static CodeRuleWrapper build() { |
| | | return new CodeRuleWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public CodeRuleVO entityVO(CodeRule codeRule) { |
| | | CodeRuleVO codeRuleVO = Objects.requireNonNull(BeanUtil.copy(codeRule, CodeRuleVO.class)); |
| | | codeRuleVO.setLcStatusText(CodeRuleLC.getTextByValue(codeRuleVO.getLcStatus())); |
| | | return codeRuleVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<CodeRuleVO> listVO(List<CodeRule> list) { |
| | | return (List)list.stream().map(this::entityVO).collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |
| | |
| | | #æå¡å¨ç«¯å£ |
| | | server: |
| | | port: 36013 |
| | | port: 36014 |
| | | |
| | | #æ°æ®æºé
ç½® |
| | | spring: |
| | | datasource: |
| | | url: ${blade.datasource.dev.url} |
| | | username: ${blade.datasource.dev.username} |
| | | password: ${blade.datasource.dev.password} |
| | | messages: |
| | | encoding: UTF-8 |
| | | basename: i18n/messages |
| | | url: ${ubcs.datasource.mdm.dev.url} |
| | | username: ${ubcs.datasource.mdm.dev.username} |
| | | password: ${ubcs.datasource.mdm.dev.password} |
| | | #å
³é驼峰å½åæ å° |
| | | mybatis-plus: |
| | | configuration: |
| | | map-underscore-to-camel-case: false |
| | | |
| | | #####åºç¨åºæ¬é
ç½® |
| | | app: |
| | | name: web |
| | | group: å京å®åè¿è¾¾ç§ææéå
¬å¸ |
| | | description: å¹³å°B/S客æ·ç«¯ |
| | | private-token-key: vciweb20210212 |
| | | ######åºç¨åºæ¬é
ç½® |
| | | #app: |
| | | # name: web |
| | | # group: å京å®åè¿è¾¾ç§ææéå
¬å¸ |
| | | # description: å¹³å°B/S客æ·ç«¯ |
| | | # private-token-key: vciweb20210212 |
| | | |
| | | ###æ¬é¡¹ç®çé
ç½®ï¼æ³¨æspringå®¶æè¯»åé
ç½®æ¶ï¼å¤§å忝éè¦è½¬æ¢ä¸º-çæ¹å¼ï¼èfeignéè¦å¤§å°åå®å
¨ç¸å |
| | | session: |
| | | session-info-storage-type: "database" |
| | | database-platform: oracle |
| | | clear-session-on-start: false |
| | | ###æ¯å¦å¼å¯ç¨æ·å¨çº¿æ£æ¥ |
| | | checkSessionTimeout: false |
| | | ###客æ·ç«¯å¤æè¶
æ¶è½®è¯¢æ¶é´ï¼åä½ä¸ºç§ |
| | | sessionInterval: 10 |
| | | ###客æ·ç«¯æå¤§å卿¶é´ï¼åä½ä¸ºåé |
| | | sessionIdlTime: 30 |
| | | ###è¶
æ¶æéæ¶é´ï¼åä½ä¸ºåé |
| | | sessionRemind: 3 |
| | | user-table-compatibility: "platform1" |
| | | #å2021çæ¬çé¨åæ¥å£çå½±åï¼ä¸é¢çå
容éè¦é
ç½®ï¼ |
| | | vciPlatform: |
| | | objectServiceUrl: "" |
| | | cache: |
| | | type: ehcache |
| | | |
| | | ##webé
ç½® |
| | | vciweb: |
| | | debug: true |
| | | file-preview: |
| | | enabled: true |
| | | preview-service-url: "http://dev.yunkeruida.top:28090/vciFilePreview/ajaxPreview.html" |
| | | preview-system-key: plt2020 |
| | | docking: |
| | | #æ¯å¦å¼å¯ä¸»æ°æ®/åç±»æ°æ®æ¨é忥 |
| | | insertCache2: false |
| | | cron: 0 0/1 * * * ? |
| | | #é¢ç³è¯·æ°æ®ï¼é
ç½®æ¨¡æ¿æä»¶åæ¾çæä»¶å¤¹ |
| | | templateDir: D:\desktop |
| | | tranTemp: D:\mes |
| | | #å¾å·çkey |
| | | tuhao: tuhao |
| | | |
| | | dataSyncPush: |
| | | isStart: false |
| | | cronTime: "0 0/1 * * * ?" |
| | | dataParamName: dataString |
| | | dataTranTemp: D:\desktop |
| | | clsfSyncPush: |
| | | isStart: false |
| | | cronTime: "0 0/1 * * * ?" |
| | | dataParamName: dataString |
| | | dataTranTemp: D:\desktop |
| | | |
| | | attrconfig: |
| | | #ç³»ç»éæ |
| | | system_attrmap: {RLM: D:\RLM.xml,PDM: D:\pdm.xml,DMS: D:\DMS.xml} |
| | | #MPMæä¸¾å¼å±æ§æ å° |
| | | mpmEnumMap: {partType: [{enumValue: 1,enumText: 产å},{enumValue: 2,enumText: 产å},{'enumValue': 3,enumText: æ åä»¶},{'enumValue': 7,enumText: ææ}]} |
| | | #session: |
| | | # session-info-storage-type: "database" |
| | | # database-platform: oracle |
| | | # clear-session-on-start: false |
| | | # ###æ¯å¦å¼å¯ç¨æ·å¨çº¿æ£æ¥ |
| | | # checkSessionTimeout: false |
| | | # ###客æ·ç«¯å¤æè¶
æ¶è½®è¯¢æ¶é´ï¼åä½ä¸ºç§ |
| | | # sessionInterval: 10 |
| | | # ###客æ·ç«¯æå¤§å卿¶é´ï¼åä½ä¸ºåé |
| | | # sessionIdlTime: 30 |
| | | # ###è¶
æ¶æéæ¶é´ï¼åä½ä¸ºåé |
| | | # sessionRemind: 3 |
| | | #user-table-compatibility: "platform1" |
| | | ##å2021çæ¬çé¨åæ¥å£çå½±åï¼ä¸é¢çå
容éè¦é
ç½®ï¼ |
| | | #vciPlatform: |
| | | # objectServiceUrl: "" |
| | | # cache: |
| | | ## type: ehcache |
| | | # |
| | | ###webé
ç½® |
| | | #vciweb: |
| | | # debug: true |
| | | #file-preview: |
| | | # enabled: true |
| | | # preview-service-url: "http://dev.yunkeruida.top:28090/vciFilePreview/ajaxPreview.html" |
| | | # preview-system-key: plt2020 |
| | | #docking: |
| | | # #æ¯å¦å¼å¯ä¸»æ°æ®/åç±»æ°æ®æ¨é忥 |
| | | # insertCache2: false |
| | | # cron: 0 0/1 * * * ? |
| | | # #é¢ç³è¯·æ°æ®ï¼é
ç½®æ¨¡æ¿æä»¶åæ¾çæä»¶å¤¹ |
| | | # templateDir: D:\desktop |
| | | # tranTemp: D:\mes |
| | | # #å¾å·çkey |
| | | # tuhao: tuhao |
| | | # |
| | | #dataSyncPush: |
| | | # isStart: false |
| | | # cronTime: "0 0/1 * * * ?" |
| | | # dataParamName: dataString |
| | | # dataTranTemp: D:\desktop |
| | | #clsfSyncPush: |
| | | # isStart: false |
| | | # cronTime: "0 0/1 * * * ?" |
| | | # dataParamName: dataString |
| | | # dataTranTemp: D:\desktop |
| | | # |
| | | #attrconfig: |
| | | # #ç³»ç»éæ |
| | | # system_attrmap: {RLM: D:\RLM.xml,PDM: D:\pdm.xml,DMS: D:\DMS.xml} |
| | | # #MPMæä¸¾å¼å±æ§æ å° |
| | | # mpmEnumMap: {partType: [{enumValue: 1,enumText: 产å},{enumValue: 2,enumText: 产å},{'enumValue': 3,enumText: æ åä»¶},{'enumValue': 7,enumText: ææ}]} |
| | | |
| | | |
| | |
| | | <?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.CodeAllCodeMapper"> |
| | | <mapper namespace="com.vci.ubcs.code.mapper.CodeAllcodeMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="CodeAllcodeResultMap" type="com.vci.ubcs.code.entity.CodeAllcode"> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectCodeAllcodePage" resultMap="CodeAllcodeResultMap"> |
| | | select * from PL_CODE_ALLCODE |
| | | </select> |
| | | |
| | | |
| | | |
| | |
| | | <!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.CodeBasicSecMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="CodeRuleResultMap" type="com.vci.ubcs.code.entity.CodeRule"> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectPlCodeRulePage" resultMap="CodeRuleResultMap"> |
| | | select * from PL_CODE_RULE where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="countByCondition" resultType="com.vci.ubcs.code.entity.CodeBasicSec"> |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.vci.ubcs.code.mapper.CodeFixedValueMapper"> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <!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.CodeRuleMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="codeRuleResultMap" type="com.vci.ubcs.code.entity.CodeRule"> |
| | | <id property="oid" column="OID"/> |
| | | <result property="btmname" column="BTMNAME"/> |
| | | <result property="revisionOid" column="REVISIONOID"/> |
| | | <result property="nameOid" column="NAMEOID"/> |
| | | <result property="lastR" column="LASTR"/> |
| | | <result property="firstR" column="FIRSTR"/> |
| | | <result property="lastV" column="LASTV"/> |
| | | <result property="firstV" column="FIRSTV"/> |
| | | <result property="creator" column="CREATOR"/> |
| | | <result property="createTime" column="CREATETIME"/> |
| | | <result property="lastModifier" column="LASTMODIFIER"/> |
| | | <result property="lastModifyTime" column="LASTMODIFYTIME"/> |
| | | <result property="revisionRule" column="REVISIONVALUE"/> |
| | | <result property="versionRule" column="VISIONRULE"/> |
| | | <result property="revisionValue" column="REVISIONRULE"/> |
| | | <result property="versionValue" column="VERSIONVALUE"/> |
| | | <result property="revisionSeq" column="REVISIONSEQ"/> |
| | | <result property="versionSeq" column="VERSIONSEQ"/> |
| | | <result property="lctid" column="LCTID"/> |
| | | <result property="lcStatus" column="LCSTATUS"/> |
| | | <result property="ts" column="TS"/> |
| | | <result property="id" column="ID"/> |
| | | <result property="name" column="NAME"/> |
| | | <result property="description" column="DESCRIPTION"/> |
| | | <result property="owner" column="OWNER"/> |
| | | <result property="copyFromVersion" column="COPYFROMVERSION"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectCodeRulePage" resultMap="codeRuleResultMap"> |
| | | SELECT PCR.oid, |
| | | PCR.REVISIONOID, |
| | | PCR.NAMEOID, |
| | | PCR.BTMNAME, |
| | | PCR.LASTR, |
| | | PCR.FIRSTR, |
| | | PCR.LASTV, |
| | | PCR.FIRSTV, |
| | | PCR.CREATOR, |
| | | PCR.CREATETIME, |
| | | PCR.LASTMODIFIER, |
| | | PCR.LASTMODIFYTIME, |
| | | PCR.REVISIONRULE, |
| | | PCR.VERSIONRULE, |
| | | PCR.REVISIONVALUE, |
| | | PCR.VERSIONVALUE, |
| | | PCR.REVISIONSEQ, |
| | | PCR.VERSIONSEQ, |
| | | PCR.LCTID, |
| | | PCR.LCSTATUS, |
| | | PCR.TS, |
| | | PCR.ID, |
| | | PCR.NAME, |
| | | PCR.DESCRIPTION, |
| | | PCR.OWNER, |
| | | PCR.COPYFROMVERSION |
| | | FROM PL_CODE_RULE PCR |
| | | <where> |
| | | <if test="codeRule.id != null and codeRule.id != ''"> |
| | | and ID like concat(concat('%',#{codeRule.id}),'%') |
| | | </if> |
| | | <if test="codeRule.name != null and codeRule.name != ''"> |
| | | and NAME like concat(concat('%',#{codeRule.name}),'%') |
| | | </if> |
| | | <if test="codeRule.description != null and codeRule.description != ''"> |
| | | and DESCRIPTION like concat(concat('%',#{codeRule.description}),'%') |
| | | </if> |
| | | <if test="codeRule.lcStatus != null and codeRule.lcStatus != ''"> |
| | | and lcStatus like concat(concat('%',#{codeRule.lcStatus}),'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | /** |
| | | * ç»è®¡æ»è¡æ° |
| | | * |
| | | * @param plSysStrategy æ¥è¯¢æ¡ä»¶ |
| | | * @param sysStrategy æ¥è¯¢æ¡ä»¶ |
| | | * @return æ»è¡æ° |
| | | */ |
| | | long count(Strategy plSysStrategy); |
| | | long count(Strategy sysStrategy); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·å以åç§æ·IDæ¥è¯¢å¯ç çç¥ |
| | |
| | | * æ¥è¯¢æå®è¡æ°æ® |
| | | * |
| | | * @param valueRannge æ¥è¯¢æ¡ä»¶ |
| | | * @param pageable å页对象 |
| | | * @param pageable å页对象 |
| | | * @return 对象å表 |
| | | */ |
| | | List<ValueRange> queryAllByLimit(ValueRange valueRannge, @Param("pageable") Pageable pageable); |
| | |
| | | |
| | | |
| | | /** |
| | | * æ ¹ç©¶ç»åidæ¥è¯¢åå¼ |
| | | * æ ¹æ®ç»åidæ¥è¯¢åå¼ |
| | | * @return |
| | | */ |
| | | List<String> queryByCombinationIds(@Param("combinationIds") List<String> combinationIds); |
| | |
| | | if(!Func.isEmpty(dbstrategy)){ |
| | | throw new ServiceException("该å¯ç çç¥å·²åå¨!"); |
| | | } |
| | | //æ£éªå¯ç çç¥æ¯å¦ç¬¦åè¦æ± |
| | | checkPwdStrategy(strategy); |
| | | //妿å½åæ°å¢è®¾ç½®ä¸ºé»è®¤å¯ç çç¥ï¼éè¦å°å·²åå¨é»è®¤å¯ç çç¥ä¿®æ¹ä¸ºéé»è®¤ |
| | | if(strategy.getIsDefault().equals("1") || strategy.getIsDefault() == 1){ |
| | | this.update(Wrappers.<Strategy>update().lambda() |
| | | .set(Strategy::getIsDefault, CommonConstant.NOT_SEALED_ID) |
| | | .eq(Strategy::getIsDefault, CommonConstant.DATA_SCOPE_CATEGORY)); |
| | | } |
| | | if(strategy.getRequiredType() > 0){ |
| | | throw new ServiceException("å¿
å¡«ç§ç±»ä¸è½å°äºçäº0!"); |
| | | } |
| | | if(strategy.getRequiredType() > strategy.getCombinationIds().split(",").length){ |
| | | throw new ServiceException("å¿
å¡«ç§ç±»ä¸è½å¤§äºæéæ©çå¯ç ç»åæ¹å¼ç个æ°!"); |
| | | } |
| | | if(strategy.getMaxPwdLen() > strategy.getMinPwdLen()){ |
| | | throw new ServiceException("å¯ç æå¤§é¿åº¦ä¸è½å°äºæå°é¿åº¦!"); |
| | | } |
| | | if(strategy.getMinPwdLen() < strategy.getCombinationIds().split(",").length || strategy.getMaxPwdLen() < strategy.getCombinationIds().split(",").length){ |
| | | throw new ServiceException("å¯ç æå°é¿åº¦ä¸è½å°äºç§å¯çç¥çå¼!"); |
| | | .set(Strategy::getIsDefault, CommonConstant.NOT_DEFAULT) |
| | | .eq(Strategy::getIsDefault, CommonConstant.IS_DEFAULT)); |
| | | } |
| | | if(Func.isEmpty(strategy.getCreateTime())){ |
| | | strategy.setCreateTime(new Date()); |
| | |
| | | boolean temp = super.saveOrUpdate(strategy); |
| | | return temp; |
| | | }else { |
| | | //æ£éªå¯ç çç¥æ¯å¦ç¬¦åè¦æ± |
| | | checkPwdStrategy(strategy); |
| | | //妿å½åä¿®æ¹è®¾ç½®ä¸ºé»è®¤å¯ç çç¥ï¼éè¦å°å·²åå¨é»è®¤å¯ç çç¥ä¿®æ¹ä¸ºéé»è®¤ |
| | | if(strategy.getIsDefault().equals("1") || strategy.getIsDefault() == 1){ |
| | | this.update(Wrappers.<Strategy>update().lambda() |
| | | .set(Strategy::getIsDefault,CommonConstant.NOT_SEALED_ID) |
| | | .eq(Strategy::getIsDefault,CommonConstant.DATA_SCOPE_CATEGORY)); |
| | | .set(Strategy::getIsDefault,CommonConstant.NOT_DEFAULT) |
| | | .eq(Strategy::getIsDefault,CommonConstant.IS_DEFAULT)); |
| | | }else { |
| | | if(Func.isEmpty(queryByIsDefault())){ |
| | | throw new ServiceException("é»è®¤å¯ç çç¥å¿
é¡»æä¸ä»
æä¸æ¡!"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ£éªå¯ç çç¥æ¯å¦ç¬¦åè¦æ± |
| | | * @param strategy |
| | | */ |
| | | public 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()){ |
| | | throw new ServiceException("å¯ç æå°é¿åº¦ä¸è½å°äºå¿
å¡«ç§ç±»çå¼!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä¸»é®å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | |
| | | public boolean deleteByIds(List<String> ids) { |
| | | Strategy strategy = this.getOne(Wrappers.<Strategy>query().lambda() |
| | | .in(Strategy::getId,ids) |
| | | .eq(Strategy::getIsDefault, CommonConstant.DATA_SCOPE_CATEGORY)); |
| | | .eq(Strategy::getIsDefault, CommonConstant.IS_DEFAULT)); |
| | | //妿åå¨é»è®¤çç¥çidï¼å°±ä¸è½ç´æ¥å é¤ç»åºæç¤º |
| | | if(!Func.isEmpty(strategy)){ |
| | | throw new ServiceException("ä¸è½å é¤é»è®¤å¯ç çç¥!"); |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="queryByCombinationIds" resultType="java.util.List"> |
| | | <select id="queryByCombinationIds" resultType="String"> |
| | | SELECT "VALUE" FROM PL_SYS_VALUE_RANGE PSVR |
| | | WHERE PSVR.COMBINATION_ID IN ( |
| | | <foreach collection="combinationIds" item="id" separator=","> |