Merge remote-tracking branch 'origin/master'
| | |
| | | margin-bottom: 0; |
| | | } |
| | | .avue-dialog .el-dialog__body { |
| | | margin-bottom: 10px |
| | | margin-bottom: 40px |
| | | } |
| | | .avue-dialog__footer{ |
| | | z-index: 1000; |
| | | } |
| | | .avue-crud__pagination { |
| | | padding: 10px 0 2px 20px; |
| | |
| | | <template> |
| | | <el-dialog |
| | | :close-on-click-modal="false" |
| | | :visible.sync="cloneOtherCodeRuleSettingBox" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | |
| | | <template> |
| | | <el-dialog |
| | | :close-on-click-modal="false" |
| | | :visible.sync="cloneSettingBox" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | |
| | | <el-dialog |
| | | title="å
¬å¼ç¼è¾æ¡" |
| | | append-to-body |
| | | :close-on-click-modal="false" |
| | | :visible.sync="isShowformulaEdit" |
| | | @close="closeFormulaEdit" |
| | | width="75%" |
| | |
| | | <template> |
| | | <el-dialog |
| | | :close-on-click-modal="false" |
| | | title="为ãåç
§å¼ç¨çä¸å¡ç±»åãéåå¼" |
| | | append-to-body |
| | | :visible.sync="referBtmDialogParams.isShowDialog" |
| | |
| | | <template> |
| | | <el-dialog |
| | | :close-on-click-modal="false" |
| | | title="éæ©åç
§é
ç½®" |
| | | append-to-body |
| | | :visible.sync="isShowReferConfigCrud" |
| | |
| | | <template> |
| | | <!-- 第äºå±å¯¹è¯æ¡,屿§ç 段ï¼å
¬å¼ç¼è¾æ¡å¼¹çª --> |
| | | <el-dialog |
| | | :close-on-click-modal="false" |
| | | title="åç
§é
ç½®" |
| | | append-to-body |
| | | :visible.sync="isShowReferConfigForm" |
| | |
| | | <template> |
| | | <el-dialog |
| | | :close-on-click-modal="false" |
| | | :title="options.title" |
| | | append-to-body |
| | | :visible.sync="crudParams.isShowDialog" |
| | |
| | | :visible.sync="visible" |
| | | top="0" |
| | | class="avue-dialog avue-dialog--top" |
| | | :width="options.width|| '80%'"> |
| | | |
| | | :width="options.width|| '80%'" |
| | | :height="options.height|| 'auto'"> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | this.selectionList.forEach((item,_index) =>{ |
| | | if(isMutiValue){ |
| | | var valueFieldArray = _that.props.value.split(","); |
| | | valueFieldArray.forEach((_itemField,_indexFiel)=>{ |
| | | valueFieldArray.forEach((_itemField,_indexField)=>{ |
| | | value.push( (item[_itemField] || item['data'][_itemField]) + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | }) |
| | | }else { |
| | |
| | | } |
| | | } |
| | | getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url, this.method).then(res => { |
| | | let data=[] |
| | | if(res.data.records){ |
| | | this.data = res.data.records |
| | | data = res.data.records |
| | | this.page.total=res.data.total ; |
| | | }else{ |
| | | this.data = res.data.data.records; |
| | | data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | } |
| | | this.data=this.data.map(item => { |
| | | this.data=data.map(item => { |
| | | item.data=item.data || {} |
| | | return { |
| | | ...item |
| | |
| | | :visible.sync="visible" |
| | | top="0" |
| | | class="avue-dialog avue-dialog--top" |
| | | :width="options.width|| '80%'"> |
| | | :width="options.width|| '80%'" |
| | | :height="options.height|| 'auto'"> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | this.selectionList.forEach((item,_index) =>{ |
| | | if(isMutiValue){ |
| | | var valueFieldArray = _that.props.value.split(","); |
| | | valueFieldArray.forEach((_itemField,_indexFiel)=>{ |
| | | valueFieldArray.forEach((_itemField,_indexField)=>{ |
| | | value.push( (item[_itemField] || item['data'][_itemField]) + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | }) |
| | | }else { |
| | |
| | | } |
| | | } |
| | | getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url).then(res => { |
| | | let data=[] |
| | | if(res.data.records){ |
| | | this.data = res.data.records |
| | | data = res.data.records |
| | | this.page.total=res.data.total ; |
| | | }else{ |
| | | this.data = res.data.data.records; |
| | | data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | } |
| | | this.data=this.data.map(item => { |
| | | this.data=data.map(item => { |
| | | item.data=item.data || {} |
| | | return { |
| | | ...item |
| | |
| | | .antMatchers( |
| | | "/actuator/**", |
| | | "/oauth/captcha", |
| | | "/oauth/passwordFreeLogin", |
| | | "/oauth/logout", |
| | | "/oauth/clear-cache", |
| | | "/oauth/render/**", |
| | |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.security.authentication.InsufficientAuthenticationException; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.security.oauth2.common.OAuth2AccessToken; |
| | | import org.springframework.security.oauth2.common.OAuth2RefreshToken; |
| | | import org.springframework.security.oauth2.common.exceptions.InvalidClientException; |
| | | import org.springframework.security.oauth2.common.exceptions.InvalidGrantException; |
| | | import org.springframework.security.oauth2.common.exceptions.InvalidRequestException; |
| | | import org.springframework.security.oauth2.common.exceptions.UnsupportedGrantTypeException; |
| | | import org.springframework.security.oauth2.common.util.OAuth2Utils; |
| | | import org.springframework.security.oauth2.provider.AuthorizationRequest; |
| | | import org.springframework.security.oauth2.provider.ClientDetails; |
| | | import org.springframework.security.oauth2.provider.ClientDetailsService; |
| | | import org.springframework.security.oauth2.provider.TokenRequest; |
| | | import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint; |
| | | import org.springframework.security.oauth2.provider.token.TokenStore; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.HttpRequestMethodNotSupportedException; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.security.Principal; |
| | | import java.util.Collections; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import java.time.Duration; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.vci.ubcs.auth.endpoint; |
| | | // |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.http.HttpStatus; |
| | | //import org.springframework.http.ResponseEntity; |
| | | //import org.springframework.security.core.Authentication; |
| | | //import org.springframework.security.oauth2.common.OAuth2AccessToken; |
| | | //import org.springframework.security.oauth2.provider.ClientDetailsService; |
| | | //import org.springframework.security.oauth2.provider.OAuth2RequestFactory; |
| | | //import org.springframework.security.oauth2.provider.TokenGranter; |
| | | //import org.springframework.security.oauth2.provider.TokenRequest; |
| | | //import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint; |
| | | //import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices; |
| | | //import org.springframework.stereotype.Component; |
| | | //import org.springframework.util.LinkedMultiValueMap; |
| | | //import org.springframework.util.MultiValueMap; |
| | | //import org.springframework.web.HttpRequestMethodNotSupportedException; |
| | | //import org.springframework.web.bind.annotation.PostMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMethod; |
| | | //import org.springframework.web.bind.annotation.RequestParam; |
| | | // |
| | | //import java.util.Map; |
| | | // |
| | | ///** |
| | | // * å
å¯ç»å½ |
| | | // * @author ludc |
| | | // * @date 2023/9/12 18:03 |
| | | // */ |
| | | //@Component |
| | | //public class PwdFreeLoginEndpoint extends TokenEndpoint { |
| | | // |
| | | // |
| | | // @Autowired |
| | | // private AuthorizationServerTokenServices tokenServices; |
| | | // |
| | | // @Autowired |
| | | // private ClientDetailsService clientDetailsService; |
| | | // |
| | | // /*@Autowired |
| | | // private OAuth2RequestFactory requestFactory; |
| | | // |
| | | // @Autowired |
| | | // private TokenGranter tokenGranter;*/ |
| | | // |
| | | // @RequestMapping(value = "/oauth/password-free-login",method = RequestMethod.GET) |
| | | // public ResponseEntity<OAuth2AccessToken> getPasswordFreeLogin(@RequestParam Map<String, String> parameters) throws HttpRequestMethodNotSupportedException { |
| | | // return postPasswordFreeLogin(parameters); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/oauth/password-free-login",method = RequestMethod.POST) |
| | | // public ResponseEntity<OAuth2AccessToken> postPasswordFreeLogin(@RequestParam Map<String, String> parameters) throws HttpRequestMethodNotSupportedException { |
| | | // // 夿æ¯å¦æ»¡è¶³å
å¯ç»å½çæ¡ä»¶ |
| | | // if (isSkipLogin(parameters)) { |
| | | // // çæè®¿é®ä»¤ç |
| | | // OAuth2AccessToken accessToken = createAccessToken(parameters); |
| | | // // è¿å访é®ä»¤ç |
| | | // return ResponseEntity.ok(accessToken); |
| | | // } |
| | | // |
| | | // // 䏿»¡è¶³å
å¯ç»å½æ¡ä»¶ï¼è¿åéè¯¯ä¿¡æ¯ |
| | | // return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); |
| | | // } |
| | | // |
| | | // private boolean isSkipLogin(Map<String, String> parameters) { |
| | | // // æ ¹æ®å
·ä½éæ±å¤ææ¯å¦æ»¡è¶³å
å¯ç»å½çæ¡ä»¶ |
| | | // // ä¾å¦ï¼å¤æè¯·æ±åæ°ä¸æ¯å¦å
å«æä¸ªç¹å®çæ è¯ç¬¦ |
| | | // return parameters.containsKey("skipLogin"); |
| | | // } |
| | | // |
| | | // private OAuth2AccessToken createAccessToken(Map<String, String> parameters) throws HttpRequestMethodNotSupportedException { |
| | | // // æé 请æ±åæ° |
| | | // MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); |
| | | // for (Map.Entry<String, String> entry : parameters.entrySet()) { |
| | | // params.add(entry.getKey(), entry.getValue()); |
| | | // } |
| | | // |
| | | // // è°ç¨TokenEndpointçpostAccessTokenæ¹æ³çæè®¿é®ä»¤ç |
| | | // //return postAccessToken(PrincipalUtils.getPrincipal(), params).getBody(); |
| | | // return null; |
| | | // } |
| | | // |
| | | // private ResponseEntity<OAuth2AccessToken> postAccessToken(Authentication authentication, MultiValueMap<String, String> parameters) throws HttpRequestMethodNotSupportedException { |
| | | // // æé è¯·æ± |
| | | // // TokenRequest tokenRequest = requestFactory.createTokenRequest(parameters, clientDetailsService.loadClientByClientId("your-client-id")); |
| | | // |
| | | // // çæè®¿é®ä»¤ç |
| | | // // OAuth2AccessToken accessToken = tokenGranter.grant("password", tokenRequest); |
| | | // |
| | | // // è¿å访é®ä»¤ç |
| | | // //return ResponseEntity.ok(accessToken); |
| | | // return null; |
| | | // } |
| | | |
| | | //} |
| | |
| | | <vciplt.version>2022.RELEASE</vciplt.version> |
| | | <old.spring.version>3.2.0.RELEASE</old.spring.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <java.version>1.8</java.version> |
| | | <java.version>1.7</java.version> |
| | | <maven.compiler.source>7</maven.compiler.source> |
| | | <maven.compiler.target>7</maven.compiler.target> |
| | | </properties> |
| | | <artifactId>ubcs-codeApply</artifactId> |
| | | <dependencies> |
| | |
| | | <url>http://nexus.vci-tech.com:9000/repository/maven-snapshots/</url> |
| | | </snapshotRepository> |
| | | </distributionManagement> |
| | | <!-- <build>--> |
| | | <!-- <plugins>--> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.apache.maven.plugins</groupId>--> |
| | | <!-- <artifactId>maven-compiler-plugin</artifactId>--> |
| | | <!-- <version>3.10.1</version>--> |
| | | <!-- <configuration>--> |
| | | <!-- <source>1.7</source>--> |
| | | <!-- <target>1.7</target>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | <!-- </plugins>--> |
| | | <!-- </build>--> |
| | | |
| | | </project> |
| | |
| | | private Map<String, String> attrNameAndValMap = new LinkedHashMap();//åå¨å±æ§åç§°ï¼å
å«å
é¨åç§°åå¤é¨åç§°ï¼å对åºçå¼ |
| | | private String tokenUrl= ConfigUtils.getConfigValue("410.code.token.url","http://127.0.0.1:37000/ubcs-auth/oauth/token"); |
| | | private String[] fields; |
| | | private String[] Values; |
| | | private String[] values; |
| | | /** |
| | | * åå¨åç±»çMap,key:åç±»åç§°ï¼valueï¼åç±»å¼ |
| | | */ |
| | |
| | | public CodeApplyFor410Dialog(JDialog dialog, String clsfName, String deptName) { |
| | | this(dialog, "pdmUser", clsfName, deptName,new String[]{}); |
| | | } |
| | | public CodeApplyFor410Dialog(JDialog dialog, String clsfName, String deptName,String[] fields,String[] values) { |
| | | this(dialog, "pdmUser", clsfName, deptName,new String[]{},fields,values); |
| | | } |
| | | public CodeApplyFor410Dialog(Frame frame, String clsfName, String deptName,String[] fields,String[] values){ |
| | | this.setModal(true); |
| | | parentComponet = frame; |
| | |
| | | this.clsfName = clsfName; |
| | | this.deptName = deptName; |
| | | this.fields=fields; |
| | | this.Values=values; |
| | | this.values=values; |
| | | //this.libName = libName; |
| | | init(); |
| | | |
| | |
| | | this.deptName = deptName; |
| | | // this.libName = libName; |
| | | |
| | | init(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public CodeApplyFor410Dialog(JDialog dialog, String userName, String clsfName, String deptName, String[] libName,String[] fields,String[] values) { |
| | | super(dialog, true); |
| | | VCISwingUtil.setClientMainFrame(new Frame()); |
| | | try { |
| | | this.setModal(true); |
| | | parentComponet = dialog; |
| | | this.userName = userName; |
| | | this.clsfName = clsfName; |
| | | this.deptName = deptName; |
| | | this.fields = fields; |
| | | this.values = values; |
| | | init(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | private void bulidPal() throws Exception { |
| | | this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); |
| | | this.setTitle("代ç ç³è¯·"); |
| | | mainPal = new CodeApplyPanelFor410(this,tokenUserObject, true, clsfName, deptName,libName); |
| | | Map<String , String> displayValues = new HashMap<>(); |
| | | if(fields != null && fields.length > 0 && values !=null && values.length > 0){ |
| | | for (int i = 0; i < fields.length; i++) { |
| | | displayValues.put(fields[i] , values[i]); |
| | | } |
| | | } |
| | | |
| | | mainPal = new CodeApplyPanelFor410(this,tokenUserObject, true, clsfName, deptName,libName,displayValues); |
| | | |
| | | VCIJPanel btnPal = new VCIJPanel(); |
| | | btnPal.add(okBtn); |
| | |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class CodeApplyFor410MainPanel extends VCIJPanel { |
| | | |
| | |
| | | private StringBuffer tempStr= new StringBuffer();//å¯åç æ®µçå¼; |
| | | private String levelRes=""; |
| | | private String[] specialSecVals = new String[0]; |
| | | private RMDataTransmitObject transmitForRMData = null; |
| | | private RMDataTransmitObject transmitForRMData = new RMDataTransmitObject(); |
| | | private CodeRuleVO codeRuleVO=null; |
| | | /** |
| | | * åå¨å±æ§åå¼çMap,key,ç¨äºé»è®¤å¼çæ¾ç¤º |
| | | */ |
| | | private Map<String,String> displayValues = new HashMap<>(); |
| | | /** |
| | | * 屿§IDä¸å±æ§å¯¹åºçæ§ä»¶ä¹é´çæ å°MAP |
| | | */ |
| | |
| | | this.currentCodeClassifyTemplateVO=currentCodeClassifyTemplateVO; |
| | | } |
| | | |
| | | public CodeApplyFor410MainPanel(TransmitTreeObject transTreeObject,TokenUserObject tokenUserObject,String deptName,CodeClassifyTemplateVO currentCodeClassifyTemplateVO) { |
| | | public CodeApplyFor410MainPanel(TransmitTreeObject transTreeObject,TokenUserObject tokenUserObject,String deptName,CodeClassifyTemplateVO currentCodeClassifyTemplateVO,Map displayValues) { |
| | | this.transTreeObject = transTreeObject; |
| | | this.tokenUserObject = tokenUserObject; |
| | | this.deptName = deptName; |
| | | this.currentCodeClassifyTemplateVO=currentCodeClassifyTemplateVO; |
| | | this.displayValues = displayValues; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | VCIOptionPane.showMessage(this,r.getMsg()); |
| | | } |
| | | if(!r.getMsg().equals("å½å主é¢åºåç±»ï¼ä»¥åå®çææçä¸çº§åç±»é½æ²¡æè®¾ç½®ç¼ç è§å")){ |
| | | VCIOptionPane.showMessage(this,r.getMsg()); |
| | | } |
| | | } |
| | | /**å è½½è§å对åºçç æ®µä¿¡æ¯**/ |
| | | if(codeRuleVO!=null){ |
| | | List<CodeBasicSecVO> codeBasicSecVOList=codeRuleVO.getSecVOList(); |
| | |
| | | if(codeClassifyValueList.size()>1) { |
| | | secCombo.addItem(new CodeClassifyValue()); |
| | | } |
| | | codeClassifyValueList.stream().forEach(codeClassifyValue -> { |
| | | for (CodeClassifyValue codeClassifyValue : codeClassifyValueList) { |
| | | secCombo.addItem(codeClassifyValue); |
| | | valueOidList.add(codeClassifyValue.getOid()); |
| | | }); |
| | | } |
| | | } |
| | | secIdTOListValueOidMap.put(secObj.getOid(),valueOidList); |
| | | /**代ç 项䏿äºä»¶**/ |
| | |
| | | if(fixedValueVOList.size() >1) { |
| | | secCombo.addItem(new CodeFixedValue()); |
| | | } |
| | | fixedValueVOList.stream().forEach(codeFixedValueVO -> { |
| | | for (CodeFixedValueVO codeFixedValueVO : fixedValueVOList) { |
| | | CodeFixedValue codeFixedValue=new CodeFixedValue(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeFixedValueVO,codeFixedValue); |
| | | secCombo.addItem(codeFixedValue); |
| | | }); |
| | | } |
| | | /**å½ç³»ç»éæ©çæ¯æå®ç æ®µå¼æ¶ï¼ç»å«ä»£å·çç æ®µç³»ç»ä¸æ¾ç¤º Begin**/ |
| | | /*FixCodeValObject selObj = (FixCodeValObject) secCombo.getSelectedItem(); |
| | | if(isSpecialRuleFlag && (secObj.getName().equals(specialControlSecName) && secValMap.containsKey(selObj.getValue())) || secValMap.containsKey(getControlSecSelectValue())) { |
| | |
| | | transmit.setRmTypeObject(codeClassify); |
| | | if(currentCodeClassifyTemplateVO!=null) { |
| | | transmit.setTemplateId(templateId); |
| | | Map<String, CodeClassifyTemplateAttrVO> tempPropObjMapsByInnerName = currentCodeClassifyTemplateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | Map<String, CodeClassifyTemplateAttrVO> tempPropObjMapsByInnerName = new HashMap<>(); |
| | | for (CodeClassifyTemplateAttrVO attribute : currentCodeClassifyTemplateVO.getAttributes()) { |
| | | tempPropObjMapsByInnerName.put(attribute.getId().toLowerCase(Locale.ROOT),attribute); |
| | | } |
| | | transmit.setClassifyCode(codeClassify.getId()); |
| | | transmit.setTempPropObjMapsByInnerName(tempPropObjMapsByInnerName); |
| | | Map<String, CodeClassifyTemplateAttrVO> tempPropObjsMap = currentCodeClassifyTemplateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getOid().toLowerCase(Locale.ROOT), t -> t)); |
| | | Map<String, CodeClassifyTemplateAttrVO> tempPropObjsMap = new HashMap<>(); |
| | | for (CodeClassifyTemplateAttrVO attribute : currentCodeClassifyTemplateVO.getAttributes()) { |
| | | tempPropObjsMap.put(attribute.getOid().toLowerCase(Locale.ROOT),attribute); |
| | | } |
| | | transmit.setTempPropObjsMap(tempPropObjsMap); |
| | | transmit.setTemplateObject(currentCodeClassifyTemplateVO); |
| | | transmit.setTempPropObjsList(this.currentCodeClassifyTemplateVO.getAttributes()); |
| | |
| | | if (index >= realAttrs.length) { |
| | | break; |
| | | } |
| | | CodeClassifyTemplateAttrVO attrObj = realAttrs[index]; |
| | | final CodeClassifyTemplateAttrVO attrObj = realAttrs[index]; |
| | | |
| | | /***å¦ææ¨¡æ¿é
ç½®äºå¼ç¨æ¨¡æ¿ï¼å±æ§åç§°å表添å 龿¥è¿è¡å¤ç BEGIN**/ |
| | | //ADD BY liujw |
| | |
| | | for (int i = 0; i < objs.length; i++) { |
| | | objs[i] = new AttrRangObjectWarper(keyValues[i]); |
| | | model.addElement(objs[i]); |
| | | |
| | | specMap.put(objs[i].toString(), comboBoxIndex++); |
| | | } |
| | | cbx.setModel(model); |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | // cbx.setSelectedItem(displayValues.get(attrObj.getId())); |
| | | // cbx.setSelectedIndex(3); |
| | | for (int i = 0; i < objs.length; i++) { |
| | | if(objs[i].getKeyValue().getKey().equals(displayValues.get(attrObj.getId()))){ |
| | | cbx.setSelectedIndex(i); |
| | | } |
| | | } |
| | | cbx.setEnabled(false); |
| | | } |
| | | compt = cbx; |
| | | } |
| | | } else if(StringUtils.isNotBlank(attrObj.getReferConfig())){//åç
§çéè¦è®¾ç½®æä¸ææ¡ï¼å¹¶ä¸åªè¯» |
| | |
| | | cbx.setModel(model); |
| | | compt = cbx; |
| | | } else { // ä¸åå¨åå¼èå´åæç±»åçæä¸åçæ§ä»¶ |
| | | if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTBoolean)) { // Booleanç±»å |
| | | if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTBoolean.toString())) { // Booleanç±»å |
| | | VCIJComboBox cbx = new VCIJComboBox(); |
| | | DefaultComboBoxModel model = new DefaultComboBoxModel(); |
| | | model.addElement("0"); |
| | | model.addElement("1"); |
| | | cbx.setModel(model); |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | cbx.setSelectedIndex(Integer.parseInt(displayValues.get(attrObj.getId()))); |
| | | cbx.setEnabled(false); |
| | | return cbx; |
| | | } |
| | | compt = cbx; |
| | | } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDate)) { // æ¥æç±»å |
| | | compt = new VCIJCalendarPanel("yyyy-MM-dd", |
| | | attrObj.getRequireFlag().equals("true"), true, false); |
| | | } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDateTime)) { // æ¥æç±»å |
| | | compt = new VCIJCalendarPanel("yyyy-MM-dd HH:mm:ss", |
| | | } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDate.toString())) { // æ¥æç±»å |
| | | VCIJCalendarPanel aTrue = new VCIJCalendarPanel("yyyy-MM-dd", |
| | | attrObj.getRequireFlag().equals("true"), true, false); |
| | | }else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTTime)) { // æ¥æç±»å |
| | | compt = new VCIJCalendarPanel("HH:mm:ss", |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | aTrue.setDateString(displayValues.get(attrObj.getId())); |
| | | aTrue.setEnabled(false); |
| | | return aTrue; |
| | | } |
| | | compt = aTrue; |
| | | } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDateTime.toString())) { // æ¥æç±»å |
| | | VCIJCalendarPanel aTrue = new VCIJCalendarPanel("yyyy-MM-dd HH:mm:ss", |
| | | attrObj.getRequireFlag().equals("true"), true, false); |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | aTrue.setDateString(displayValues.get(attrObj.getId())); |
| | | aTrue.setEnabled(false); |
| | | return aTrue; |
| | | } |
| | | compt = aTrue; |
| | | }else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTTime.toString())) { // æ¥æç±»å |
| | | VCIJCalendarPanel aTrue = new VCIJCalendarPanel("HH:mm:ss", |
| | | attrObj.getRequireFlag().equals("true"), true, false); |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | aTrue.setDateString(displayValues.get(attrObj.getId())); |
| | | aTrue.setEnabled(false); |
| | | return aTrue; |
| | | } |
| | | compt = aTrue; |
| | | } |
| | | else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDouble)||attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTLong)) { // Realç±»å |
| | | else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDouble.toString())||attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTLong.toString())) { // Realç±»å |
| | | RealTextField txt = new RealTextField(""); |
| | | txt.setRequired(attrObj.getRequireFlag().equals("true")); |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | txt.setText(displayValues.get(attrObj.getId())); |
| | | txt.setEditable(false); |
| | | } |
| | | compt = txt; |
| | | } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTInteger)) { // Integerç±»å |
| | | } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTInteger.toString())) { // Integerç±»å |
| | | IntegerTextField txt = new IntegerTextField(""); |
| | | txt.setRequired(attrObj.getRequireFlag().equals("true")); |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | txt.setText(displayValues.get(attrObj.getId())); |
| | | txt.setEditable(false); |
| | | } |
| | | compt = txt; |
| | | } |
| | | else{ |
| | | VCIJTextField txt = new VCIJTextField(this,attrObj.getRequireFlag().equals("true")); |
| | | if(displayValues.containsKey(attrObj.getId())){ |
| | | txt.setText(displayValues.get(attrObj.getId())); |
| | | txt.setEditable(false); |
| | | } |
| | | compt = txt; |
| | | textCompts.add(txt); |
| | | } |
| | |
| | | private void getComptAttrValue( CodeClassifyTemplateAttrVO tempPropObj, LinkedHashMap<String, JComponent> attrIdToCtrlMaps) { |
| | | Map<String,String> dataMap=new HashMap<>(); |
| | | Map<String,String> condtionMap=new HashMap<>(); |
| | | attrIdToCtrlMaps.forEach((key,compt)->{ |
| | | for(String key: attrIdToCtrlMaps.keySet()){ |
| | | JComponent compt = attrIdToCtrlMaps.get(key); |
| | | String value = ""; |
| | | if (compt instanceof JTextComponent) { |
| | | value = ((JTextComponent) compt).getText(); |
| | |
| | | } |
| | | dataMap.put(key,value); |
| | | condtionMap.put("dataMap["+key+"]",value); |
| | | }); |
| | | } |
| | | condtionMap.put("componentRuleValue",tempPropObj.getComponentRule()); |
| | | Map<String,String> headerMap=new HashMap<>(); |
| | | headerMap.put("Blade-Auth",this.tokenUserObject.getAccess_token()); |
| | |
| | | dialog.setVisible(true); |
| | | } |
| | | |
| | | private void doSearch(VCIJComboxBox comboxBox,CodeBasicSecVO secObj){ |
| | | private void doSearch(final VCIJComboxBox comboxBox, CodeBasicSecVO secObj){ |
| | | if(StringUtils.isBlank(secObj.getReferConfig())){ |
| | | VCIOptionPane.showMessage(this,"åç
§é
置信æ¯ä¸æ£ç¡®,è¯·æ ¸å¯¹ï¼"); |
| | | return; |
| | |
| | | LinkedList<String> listValues = new LinkedList<String>(); |
| | | // å屿§çç±»å |
| | | LinkedList<String> listDataTypes = new LinkedList<String>(); |
| | | Map<String,CodeClassifyTemplateAttrVO> codeClassifyTemplateAttrVOMap=transmitForRMData.getTempPropObjsList().stream().collect(Collectors.toMap(s -> s.getId(), t -> t)); |
| | | Map<String,CodeClassifyTemplateAttrVO> codeClassifyTemplateAttrVOMap = new HashMap<>(); |
| | | for (CodeClassifyTemplateAttrVO codeClassifyTemplateAttrVO : transmitForRMData.getTempPropObjsList()) { |
| | | codeClassifyTemplateAttrVOMap.put(codeClassifyTemplateAttrVO.getId(),codeClassifyTemplateAttrVO); |
| | | } |
| | | Iterator<String> keys = attrIdToCtrlMaps.keySet().iterator(); |
| | | JComponent compt = null; |
| | | JComponent firstCompt = null; |
| | |
| | | import com.vci.rmip.code.client.codeapply.Apply410.object.R; |
| | | import com.vci.rmip.code.client.codeapply.Apply410.utils.HttpUtil; |
| | | import com.vci.rmip.code.client.codeapply.Apply410.utils.ListUtil; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateAttrVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateVO; |
| | | import com.vci.rmip.code.client.codeapply.Apply410.utils.ConfigUtils; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | |
| | | CodeClassifyTemplateVO codeClassifyTemplateVO=this.dialog.getOwnerPanel().getCurrentCodeClassifyTemplateVO(); |
| | | if(codeClassifyTemplateVO!=null){ |
| | | if(!CollectionUtils.isEmpty(codeClassifyTemplateVO.getAttributes())){ |
| | | codeClassifyTemplateVO.getAttributes().stream().forEach(codeClassifyTemplateAttrVO -> { |
| | | for (CodeClassifyTemplateAttrVO codeClassifyTemplateAttrVO : codeClassifyTemplateVO.getAttributes()) { |
| | | fieldList.add(codeClassifyTemplateAttrVO.getId()); |
| | | nameList.add(codeClassifyTemplateAttrVO.getName()); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | fields = fieldList.toArray(new String[]{}); |
| | |
| | | String data=""; |
| | | for (String field:fields){ |
| | | if(defaultDataMap.containsKey(field+"_text")){ |
| | | data=defaultDataMap.getOrDefault(field+"_text",""); |
| | | data=defaultDataMap.get(field+"_text") ; |
| | | }else if(defaultDataMap.containsKey(field+"Text")){ |
| | | data=defaultDataMap.getOrDefault(field+"Text",""); |
| | | data=defaultDataMap.get(field+"Text") ; |
| | | }else{ |
| | | data=defaultDataMap.getOrDefault(field,""); |
| | | data=defaultDataMap.get(field); |
| | | } |
| | | |
| | | res.setPropertyValue(getColumns()[i++], data); |
| | |
| | | List<Map> dataList= dataGrid.getData(); |
| | | List<BaseModel> hostInfos=new ArrayList<>(); |
| | | //List<BaseModel> hostInfos= ListUtil.listMapParseListObj(dataList, BaseModel.class); |
| | | dataList.stream().forEach(map->{ |
| | | for (Map map : dataList) { |
| | | BaseModel baseModel= ListUtil.mapParseJavaBean(map,BaseModel.class); |
| | | baseModel.setData(map); |
| | | hostInfos.add(baseModel); |
| | | }); |
| | | } |
| | | |
| | | //List<BaseModel> hostInfos = (List<BaseModel>) dataList.stream().map(entity -> JSONUtil.toBean(JSONUtil.parseObj(entity), BaseModel.class)).collect(Collectors.toList()); |
| | | |
| | |
| | | * åå¨å±æ§åå¼çMap,key:屿§åç§°ï¼valueï¼å±æ§å¼ |
| | | */ |
| | | private String deptName = null; |
| | | /** |
| | | * åå¨å±æ§åå¼çMap,key,ç¨äºé»è®¤å¼çæ¾ç¤º |
| | | */ |
| | | private Map displayValues = new HashMap<String,String>(); |
| | | |
| | | private String[] libName = new String[]{};//代ç 项åç§° |
| | | private VCIBaseTree leftTree = null; |
| | |
| | | * @param deptName |
| | | * @param libName |
| | | */ |
| | | public CodeApplyPanelFor410(CodeApplyFor410Dialog owner , TokenUserObject tokenUserObject, boolean isIntegrate, String clsfName, String deptName, String[] libName){ |
| | | public CodeApplyPanelFor410(CodeApplyFor410Dialog owner , TokenUserObject tokenUserObject, boolean isIntegrate, String clsfName, String deptName, String[] libName,Map displayValues){ |
| | | this.tokenUserObject = tokenUserObject; |
| | | this.owner =owner; |
| | | rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,getCurrentCodeClassifyTemplateVO()); |
| | |
| | | this.clsfName = clsfName; |
| | | this.deptName = deptName; |
| | | this.libName = libName; |
| | | this.displayValues = displayValues; |
| | | init(); |
| | | initActionListener(); |
| | | } |
| | |
| | | VCIOptionPane.showMessage(this,r.getMsg()); |
| | | } |
| | | if(!CollectionUtils.isEmpty(codeClassifyList)){ |
| | | codeClassifyList.stream().forEach(codeClassify -> { |
| | | for (CodeClassify codeClassify : codeClassifyList) { |
| | | codeItemCombo.addItem(codeClassify); |
| | | }); |
| | | } |
| | | codeItemCombo.setSelectedIndex(0); |
| | | } |
| | | initLeftPanel(); |
| | |
| | | initBtnStatus(res); |
| | | } |
| | | } |
| | | rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO()); |
| | | rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO(),displayValues); |
| | | scrollPane.setViewportView(rightMainPanel); |
| | | rightMainPanel.buildMainPanel(1); |
| | | int location = jspLeftToRight.getDividerLocation(); |
| | |
| | | transmitTreeObject.setCurrentTreeNode(selectedTreeNode); |
| | | if(selectedTreeNode.isRoot() && selectedTreeNode.getObj() instanceof String) return; |
| | | scrollPane = new JScrollPane(); |
| | | rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO()); |
| | | rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO(),displayValues); |
| | | scrollPane.setViewportView(rightMainPanel); |
| | | rightMainPanel.buildMainPanel(1); |
| | | VCIJPanel rightPanel = new VCIJPanel(); |
| | |
| | | private LinkedHashMap<String, Runnable> actionMaps = new LinkedHashMap<String, Runnable>(); |
| | | boolean codeAlreadExist = false; |
| | | private String url= ConfigUtils.getConfigValue("410.code.url","http://127.0.0.1:36014/codeApplySwingController"); |
| | | private String classifyGroupCode= ConfigUtils.getConfigValue("410.code.codeApply.classifyGroupCode"); |
| | | public CodeApplyPanelFor410ActionListener(CodeApplyPanelFor410 owner){ |
| | | this.owner = owner; |
| | | this.initActionMap(); |
| | |
| | | codeOrderDTO.setTemplateOid(codeClassifyTemplateVO.getOid()); |
| | | codeOrderDTO.setCodeRuleOid(codeRuleVO.getOid()); |
| | | List<CodeOrderSecDTO> secDTOList=new ArrayList<>(); |
| | | keyValueList.stream().forEach(keyValue -> { |
| | | for (KeyValue keyValue : keyValueList) { |
| | | CodeOrderSecDTO codeOrderSecDTO=new CodeOrderSecDTO(); |
| | | codeOrderSecDTO.setSecOid(keyValue.getKey()); |
| | | codeOrderSecDTO.setSecValue(keyValue.getValue()); |
| | | secDTOList.add(codeOrderSecDTO); |
| | | }); |
| | | } |
| | | codeOrderDTO.setLcStatus("Released"); |
| | | codeOrderDTO.setSecDTOList(secDTOList); |
| | | codeOrderDTO.setData(dataMap); |
| | |
| | | String code=""; |
| | | //æ ¡éªå
³é®å±æ§åå¨çæ°æ®ç´æ¥è¿åç¼ç |
| | | R checkKeyAttrOnOrderR= HttpUtil.sendPost(url+"/checkKeyAttrOnOrderFordatas",object.toString(),headerMap); |
| | | //æ¥è¯¢å½åç³è¯·ç¼ç çç±»å |
| | | R checkGroupCode= HttpUtil.sendGet(url+"/checkGroupCode?oid="+codeClassify.getOid()+ |
| | | "&classifyGroupCode="+classifyGroupCode,null,headerMap); |
| | | if(checkKeyAttrOnOrderR.isSuccess()){ |
| | | List<Map> list=(List)checkKeyAttrOnOrderR.getData(); |
| | | if(!CollectionUtils.isEmpty(list)) { |
| | |
| | | this.owner.getApplyTxt().requestFocusInWindow(); |
| | | this.owner.getApplyTxt().selectAll(); |
| | | this.owner.setAttrNameAndValMap(attrNameAndValMap); |
| | | if(checkGroupCode.isSuccess()){ |
| | | if(checkGroupCode.getData().equals("true")){ |
| | | VCIOptionPane.showMessage(this.owner, "å½ååç±»çä¼ä¸ç¼ç 为ï¼"+list.get(0).get("GROUPCODE")); |
| | | }else{ |
| | | VCIOptionPane.showMessage(this.owner, "å½åç¼ç åç±»æªæ¾å°ç¸åºçéå¢ï¼è¯·æ£æ¥ï¼ï¼"); |
| | | } |
| | | }else { |
| | | VCIOptionPane.showMessage(this.owner, "è¿ç¨è°ç¨å¤±è´¥ï¼è¯·éè¯ï¼"); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | |
| | | this.owner.setAttrNameAndValMap(attrNameAndValMap); |
| | | }else{ |
| | | VCIOptionPane.showMessage(this.owner,r.getMsg()); |
| | | } |
| | | if(checkGroupCode.isSuccess()){ |
| | | if(checkGroupCode.getData().equals("false")){ |
| | | Map<String,String> applyMap = new HashMap<>(); |
| | | applyMap.put("oids",codeClassify.getOid()); |
| | | applyMap.put("btmName",codeClassify.getBtmname()); |
| | | Object applyGroupCodeData = JSONObject.toJSON(applyMap); |
| | | R applyResult= HttpUtil.sendPost(url+"/DockingPreApplyCode/applyGroupCode",applyGroupCodeData.toString(),headerMap); |
| | | if(!applyResult.isSuccess()){ |
| | | VCIOptionPane.showMessage(this.owner, "éå¢ç ç³è¯·å¤±è´¥ï¼"+r.getMsg()); |
| | | }else{ |
| | | VCIOptionPane.showMessage(this.owner, "ä¿åæ°æ®æåï¼çå¾
éå¢ç ç³è¯·ï¼"); |
| | | } |
| | | } |
| | | }else { |
| | | VCIOptionPane.showMessage(this.owner, "è¿ç¨è°ç¨å¤±è´¥ï¼è¯·æ³¨æï¼"); |
| | | } |
| | | |
| | | } |
| | |
| | | CodeApplyFor410MainPanel rightMainPanel2 = this.owner.getRightMainPanel(); |
| | | LinkedHashMap<String, JComponent> attrInnerNameToCtrlMaps = rightMainPanel2.getAttrInnerNameToCtrlMaps(); |
| | | if(attrInnerNameToCtrlMaps!=null&&attrInnerNameToCtrlMaps.size()>0){ |
| | | attrInnerNameToCtrlMaps.forEach((key,component)->{ |
| | | for(String key : attrInnerNameToCtrlMaps.keySet()){ |
| | | JComponent component = attrInnerNameToCtrlMaps.get(key); |
| | | if(component instanceof JTextComponent){ |
| | | if(((JTextComponent) component).isEnabled()) |
| | | ((JTextComponent) component).setText(""); |
| | |
| | | if(((VCIJComboBox) component).isEnabled()) |
| | | ((VCIJComboBox) component).setSelectedIndex(0); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | String applyCode = this.owner.getApplyCode(); |
| | | if(StringUtils.isBlank(applyCode)) { |
| | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class CodeDataMainPanelDataProvider extends AbstractVCIJTableDataProvider<BaseModel> { |
| | | private CodeDataMainPanel ownerPanel; |
| | |
| | | LinkedList<String> nameList = new LinkedList<>(); |
| | | LinkedList<String> fieldList = new LinkedList<>(); |
| | | List<CodeShowFieldConfigVO> colsList=ownerPanel.getUiFormRefer().getCodeShowFieldConfigVOS(); |
| | | colsList.stream().forEach(columns->{ |
| | | for (CodeShowFieldConfigVO columns : colsList) { |
| | | String title= columns.getTitle(); |
| | | String field=columns.getField(); |
| | | nameList.add(title); |
| | | fieldList.add(field); |
| | | }); |
| | | } |
| | | specialColumns = nameList.toArray(new String[]{}); |
| | | fields = fieldList.toArray(new String[]{}); |
| | | return specialColumns; |
| | |
| | | VCIJTableNode<BaseModel> res = new VCIJTableNode<BaseModel>(model); |
| | | int i=dataColumnStartIndex; |
| | | for (String field:fields){ |
| | | String data=defaultDataMap.getOrDefault(field,""); |
| | | String data=defaultDataMap.containsKey(field) ? defaultDataMap.get(field) : "" ; |
| | | res.setPropertyValue(getColumns()[i++], data); |
| | | } |
| | | return res; |
| | |
| | | List<CodeSrchCondConfigVO> codeSrchCondConfigVOS=uiFormRefer.getCodeSrchCondConfigVOS(); |
| | | JSONObject jsonObject=new JSONObject(); |
| | | if(!CollectionUtils.isEmpty(codeSrchCondConfigVOS)){ |
| | | codeSrchCondConfigVOS.stream().forEach(codeSrchCondConfigVO -> { |
| | | for (CodeSrchCondConfigVO codeSrchCondConfigVO : codeSrchCondConfigVOS) { |
| | | String field=codeSrchCondConfigVO.getFilterField(); |
| | | String value=codeSrchCondConfigVO.getFilterValue(); |
| | | String filterType= codeSrchCondConfigVO.getFilterType(); |
| | | condtionMap.put("conditionMap["+field+"]",value); |
| | | }); |
| | | } |
| | | } |
| | | Map<String, String> customCondtionMap=ownerPanel.getCustomCondtionMap(); |
| | | if(customCondtionMap!=null&&customCondtionMap.size()>0){ |
| | | customCondtionMap.forEach((field, value) -> { |
| | | condtionMap.put("conditionMap["+field+"]",value); |
| | | }); |
| | | |
| | | for(String field : customCondtionMap.keySet()){ |
| | | condtionMap.put("conditionMap["+field+"]",customCondtionMap.get(field)); |
| | | } |
| | | } |
| | | Map<String,String> headerMap=new HashMap<>(); |
| | | headerMap.put("Blade-Auth",this.ownerPanel.getTokenUserObject().getAccess_token()); |
| | |
| | | List dataList= iPage.getRecords(); |
| | | BaseModel [] baseModels=new BaseModel[]{}; |
| | | if(!CollectionUtils.isEmpty(dataList)) { |
| | | List<BaseModel> hostInfos = (List<BaseModel>) dataList.stream().map(entity -> JSONUtil.toBean(JSONUtil.parseObj(entity), BaseModel.class)).collect(Collectors.toList()); |
| | | List<BaseModel> hostInfos = new ArrayList<>(); |
| | | for (Object entity : dataList) { |
| | | hostInfos.add(JSONUtil.toBean(JSONUtil.parseObj(entity),BaseModel.class)); |
| | | } |
| | | baseModels = hostInfos.toArray(new BaseModel[]{}); |
| | | } |
| | | return baseModels; |
| | |
| | | if(treeNode.getObj() instanceof Tree) { |
| | | Tree tree =(Tree)treeNode.getObj(); |
| | | Map<String,String> attibuteMap= tree.getAttributes(); |
| | | String fieldValue=attibuteMap.getOrDefault(valueField,""); |
| | | String textValue=attibuteMap.getOrDefault(textField,""); |
| | | String fieldValue=attibuteMap.containsKey(valueField) ? attibuteMap.get(valueField) : ""; |
| | | String textValue=attibuteMap.containsKey(textField) ? attibuteMap.get(textField) : ""; |
| | | KeyValue keyValue=new KeyValue(); |
| | | keyValue.setKey(fieldValue); |
| | | keyValue.setValue(textValue); |
| | |
| | | BaseModel baseModel=list.get(0); |
| | | Map<String, String> defaultDataMap= VciBaseUtil.objectToMapString(list.get(0)); |
| | | defaultDataMap.putAll(baseModel.getData()); |
| | | String fieldValue=defaultDataMap.getOrDefault(valueField,""); |
| | | String textValue=defaultDataMap.getOrDefault(textField,""); |
| | | String fieldValue=defaultDataMap.containsKey(valueField) ? defaultDataMap.get(valueField) : ""; |
| | | String textValue=defaultDataMap.containsKey(textField) ? defaultDataMap.get(textField) : ""; |
| | | KeyValue keyValue=new KeyValue(); |
| | | keyValue.setKey(fieldValue); |
| | | keyValue.setValue(textValue); |
| | |
| | | package com.vci.rmip.code.client.codeapply.Apply410.object; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public interface IPage<T> extends Serializable { |
| | | List<OrderItem> orders(); |
| | | |
| | | default boolean optimizeCountSql() { |
| | | return true; |
| | | } |
| | | // default boolean optimizeCountSql() { |
| | | // return true; |
| | | // } |
| | | |
| | | default boolean optimizeJoinOfCountSql() { |
| | | return true; |
| | | } |
| | | // default boolean optimizeJoinOfCountSql() { |
| | | // return true; |
| | | // } |
| | | // |
| | | // default boolean searchCount() { |
| | | // return true; |
| | | // } |
| | | // |
| | | // default long offset() { |
| | | // long current = this.getCurrent(); |
| | | // return current <= 1L ? 0L : Math.max((current - 1L) * this.getSize(), 0L); |
| | | // } |
| | | |
| | | default boolean searchCount() { |
| | | return true; |
| | | } |
| | | // default Long maxLimit() { |
| | | // return null; |
| | | // } |
| | | // |
| | | // default long getPages() { |
| | | // if (this.getSize() == 0L) { |
| | | // return 0L; |
| | | // } else { |
| | | // long pages = this.getTotal() / this.getSize(); |
| | | // if (this.getTotal() % this.getSize() != 0L) { |
| | | // ++pages; |
| | | // } |
| | | // |
| | | // return pages; |
| | | // } |
| | | // } |
| | | |
| | | default long offset() { |
| | | long current = this.getCurrent(); |
| | | return current <= 1L ? 0L : Math.max((current - 1L) * this.getSize(), 0L); |
| | | } |
| | | |
| | | default Long maxLimit() { |
| | | return null; |
| | | } |
| | | |
| | | default long getPages() { |
| | | if (this.getSize() == 0L) { |
| | | return 0L; |
| | | } else { |
| | | long pages = this.getTotal() / this.getSize(); |
| | | if (this.getTotal() % this.getSize() != 0L) { |
| | | ++pages; |
| | | } |
| | | |
| | | return pages; |
| | | } |
| | | } |
| | | |
| | | default IPage<T> setPages(long pages) { |
| | | return this; |
| | | } |
| | | // default IPage<T> setPages(long pages) { |
| | | // return this; |
| | | // } |
| | | |
| | | List<T> getRecords(); |
| | | |
| | |
| | | |
| | | IPage<T> setCurrent(long current); |
| | | |
| | | default <R> IPage<T> convert(Function<? super T, ? extends R> mapper) { |
| | | List<T> collect = (List)this.getRecords().stream().map(mapper).collect(Collectors.toList()); |
| | | return this.setRecords(collect); |
| | | } |
| | | default String countId() { |
| | | return null; |
| | | } |
| | | // default <R> IPage<T> convert(Function<? super T, ? extends R> mapper) { |
| | | // List<T> collect = (List)this.getRecords().stream().map(mapper).collect(Collectors.toList()); |
| | | // return this.setRecords(collect); |
| | | // } |
| | | // default String countId() { |
| | | // return null; |
| | | // } |
| | | } |
| | |
| | | package com.vci.rmip.code.client.codeapply.Apply410.object; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class OrderItem { |
| | | |
| | |
| | | } |
| | | |
| | | public static List<OrderItem> ascs(String... columns) { |
| | | return (List) Arrays.stream(columns).map(OrderItem::asc).collect(Collectors.toList()); |
| | | List<OrderItem> orderItems = new ArrayList<>(); |
| | | for (String column : columns) { |
| | | orderItems.add(asc(column)); |
| | | } |
| | | return orderItems; |
| | | // (List) Arrays.stream(columns).map(OrderItem::asc).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public static List<OrderItem> descs(String... columns) { |
| | | return (List)Arrays.stream(columns).map(OrderItem::desc).collect(Collectors.toList()); |
| | | List<OrderItem> orderItems = new ArrayList<>(); |
| | | for (String column : columns) { |
| | | orderItems.add(desc(column)); |
| | | } |
| | | return orderItems; |
| | | // (List)Arrays.stream(columns).map(OrderItem::desc).collect(Collectors.toList()); |
| | | } |
| | | |
| | | private static OrderItem build(String column, boolean asc) { |
| | |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.function.Predicate; |
| | | |
| | | public class Page<T> { |
| | | private static final long serialVersionUID = 8545996863226528798L; |
| | |
| | | return this.maxLimit; |
| | | } |
| | | |
| | | private String[] mapOrderToArray(Predicate<OrderItem> filter) { |
| | | List<String> columns = new ArrayList(this.orders.size()); |
| | | this.orders.forEach((i) -> { |
| | | if (filter.test(i)) { |
| | | columns.add(i.getColumn()); |
| | | } |
| | | // private String[] mapOrderToArray(Predicate<OrderItem> filter) { |
| | | // List<String> columns = new ArrayList(this.orders.size()); |
| | | // this.orders.forEach((i) -> { |
| | | // if (filter.test(i)) { |
| | | // columns.add(i.getColumn()); |
| | | // } |
| | | // |
| | | // }); |
| | | // return (String[])columns.toArray(new String[0]); |
| | | // } |
| | | |
| | | }); |
| | | return (String[])columns.toArray(new String[0]); |
| | | } |
| | | |
| | | private void removeOrder(Predicate<OrderItem> filter) { |
| | | for(int i = this.orders.size() - 1; i >= 0; --i) { |
| | | if (filter.test(this.orders.get(i))) { |
| | | this.orders.remove(i); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // private void removeOrder(Predicate<OrderItem> filter) { |
| | | // for(int i = this.orders.size() - 1; i >= 0; --i) { |
| | | // if (filter.test(this.orders.get(i))) { |
| | | // this.orders.remove(i); |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | public Page<T> addOrder(OrderItem... items) { |
| | | this.orders.addAll(Arrays.asList(items)); |
| | |
| | | 410.code.token.tenantId=000000 |
| | | 410.code.token.authorization=Basic c3dvcmQ6c3dvcmRfc2VjcmV0 |
| | | 410.code.token.contentType=application/x-www-form-urlencoded |
| | | |
| | | |
| | | 410.code.codeApply.classifyGroupCode=wupin#appendix#renyuanku |
| | |
| | | /** |
| | | * åç±»ç æ®µä¸»é®æ¾ç¤ºææ¬ |
| | | */ |
| | | private String codeclassifysecoidName; |
| | | private String codeClassifySecOidName; |
| | | |
| | | /** |
| | | * ç å¼åºå· |
| | |
| | | /** |
| | | * è·ååç±»ç æ®µä¸»é®æ¾ç¤ºææ¬ |
| | | */ |
| | | public String getCodeclassifysecoidName (){ |
| | | return codeclassifysecoidName; |
| | | public String getCodeClassifySecOidName (){ |
| | | return codeClassifySecOidName; |
| | | } |
| | | |
| | | /** |
| | | * 设置åç±»ç æ®µä¸»é®æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setCodeclassifysecoidName (String codeclassifysecoidName){ |
| | | this.codeclassifysecoidName = codeclassifysecoidName; |
| | | public void setCodeClassifySecOidName (String codeclassifysecoidName){ |
| | | this.codeClassifySecOidName = codeclassifysecoidName; |
| | | } |
| | | /** |
| | | * è·å ç å¼åºå· |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeClassifyValueVO{" + |
| | | "codeClassifySecOid='" + codeClassifySecOid + '\'' + |
| | | ", codeclassifysecoidName='" + codeclassifysecoidName + '\'' + |
| | | ", codeClassifySecOidName='" + codeClassifySecOidName + '\'' + |
| | | ", orderNum=" + orderNum + |
| | | ", parentClassifyValueOid='" + parentClassifyValueOid + '\'' + |
| | | ", id='" + id + '\'' + |
| | | ", name='" + name + '\'' + |
| | | "} " + super.toString(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Tree{oid='" + this.oid + '\'' + ", text='" + this.text + '\'' + ", leaf=" + this.leaf + ", showCheckbox=" + this.showCheckbox + ", checked=" + this.checked + ", children=" + this.children + ", icon='" + this.icon + '\'' + ", iconCls='" + this.iconCls + '\'' + ", parentId='" + this.parentId + '\'' + ", parentName='" + this.parentName + '\'' + ", parentBtmName='" + this.parentBtmName + '\'' + ", expanded=" + this.expanded + ", href='" + this.href + '\'' + ", index='" + this.index + '\'' + ", attributes=" + this.attributes + '}'; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.config; |
| | | |
| | | import org.springframework.web.servlet.HandlerInterceptor; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author ludc |
| | | * @date 2023/9/12 11:49 |
| | | */ |
| | | public class AuthenticationInterceptor implements HandlerInterceptor { |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | return HandlerInterceptor.super.preHandle(request, response, handler); |
| | | } |
| | | |
| | | @Override |
| | | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { |
| | | HandlerInterceptor.super.postHandle(request, response, handler, modelAndView); |
| | | } |
| | | |
| | | @Override |
| | | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { |
| | | HandlerInterceptor.super.afterCompletion(request, response, handler, ex); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.config; |
| | | |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | /** |
| | | * webserviceæ¥å£æ¦æªå¨ |
| | | * @author ludc |
| | | * @date 2023/9/12 11:16 |
| | | */ |
| | | @Configuration |
| | | public class WebConfig implements WebMvcConfigurer { |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(new AuthenticationInterceptor()) |
| | | .addPathPatterns("/api/protected/**"); |
| | | } |
| | | |
| | | } |
| | |
| | | public R checkKeyAttrOnOrderFordatas(@RequestBody CodeOrderDTO orderDTO) throws Exception { |
| | | return R.data(mdmEngineService.checkKeyAttrOnOrderFordatas(orderDTO)); |
| | | } |
| | | |
| | | /** |
| | | * éå¢/ä¼ä¸ç æ®µå¤æ |
| | | * @param parameter ä¼ å
¥æ°æ® ,classifyGroupCode:é
ç½®çä¸çå类顶èç¹ï¼oidï¼éæ©èç¹çoid--ï¼nowApplyCodeï¼å½åç³è¯·ç¼ç çåç±» |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @GetMapping("/checkGroupCode") |
| | | @VciBusinessLog(operateName = "éå¢/ä¼ä¸ç æ®µå¤æ") |
| | | public R checkGroupCode(Map<String,String> parameter) throws Exception { |
| | | return R.data(mdmEngineService.checkGroupCode(parameter)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.controller; |
| | | |
| | | import com.vci.ubcs.code.service.IPasswordFreeLoginService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author ludc |
| | | * @date 2023/9/12 9:07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/passwordFree") |
| | | @Api(value = "å
å¯ç»å½æ¥å£", tags = "å
å¯ç»å½æ¥å£") |
| | | public class PasswordFreeLoginController { |
| | | |
| | | @Resource |
| | | private IPasswordFreeLoginService passwordFreeLoginService; |
| | | |
| | | @GetMapping("/login") |
| | | public R passwordFreeLogin(String account) { |
| | | boolean resBoolean = passwordFreeLoginService.passwordFreeLogin(account); |
| | | return R.status(resBoolean); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @param classifyList |
| | | */ |
| | | void batchUpdateLcStatus(@Param("records") List<CodeClassify> classifyList); |
| | | |
| | | /** |
| | | * å䏿¥è¯¢æ å½¢ç»æ |
| | | * |
| | | * @param oid åç±»çä¸»é® |
| | | * @return æ°æ®éå |
| | | */ |
| | | List<CodeClassify> selectAllParents(@Param("oid") String oid); |
| | | } |
| | |
| | | |
| | | List<String> selectAllLevelChildOid(@Param("oid") String oid); |
| | | |
| | | List<String> selectChildOid(@Param("oid") String oid); |
| | | |
| | | Long countAllLevelChildOid(@Param("oid") String oid); |
| | | |
| | | String getClassifyValueStr(@Param("oid") String oid); |
| | |
| | | */ |
| | | public List<Map> checkKeyAttrOnOrderFordatas(CodeOrderDTO orderDTO) ; |
| | | |
| | | } |
| | | /** |
| | | * æ ¹æ®å½åç³è¯·ç¼ç çåç±»ï¼éå±å¾ä¸æ ¡éªæ¯å¦ç¬¦åå±äºé
ç½®çä¸çåç±»åèç¹çå |
| | | * ç±»ï¼å¦æç¬¦åï¼å该åç±»ç³è¯·çç¼ç 为éå¢ç è¿åtrueï¼åä¹å为ä¼ä¸ç¼ç è¿åfalse |
| | | * @param parameter ä¼ å
¥æ°æ®,classifyGroupCode:é
ç½®çä¸çå类顶èç¹ï¼oidï¼éæ©èç¹çoid |
| | | */ |
| | | R checkGroupCode(Map<String, String> parameter); |
| | | } |
| | |
| | | treeWrapperOptions.copyFromTreeQuery(treeQueryObject); |
| | | return revisionModelUtil.doList2Trees(voList,treeWrapperOptions,(CodeClassifyValueVO s) ->{ |
| | | //å¯ä»¥å¨è¿éå¤çæ èç¹çæ¾ç¤º |
| | | return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s |
| | | return s.getId() + " " + (Func.isNotEmpty(s.getName()) ? s.getName():"") + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s |
| | | .getLcStatus()) ? (" ãåç¨ã ") : ""); |
| | | }); |
| | | } |
| | |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeClassifyValueDTO,codeClassifyValueDO); |
| | | //å¡«å
ä¸äºé»è®¤å¼ |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeClassifyValueDO, MdmBtmTypeConstant.CODE_CLASSIFY_VALUE); |
| | | LambdaQueryWrapper<CodeClassifyValue> wrapper = Wrappers.<CodeClassifyValue>query() |
| | | .lambda().eq(CodeClassifyValue::getCodeClassifySecOid, codeClassifyValueDO.getCodeClassifySecOid()); |
| | | if(Func.isEmpty(codeClassifyValueDO.getParentClassifyValueOid())){ |
| | | wrapper.isNull(CodeClassifyValue::getParentClassifyValueOid); |
| | | }else{ |
| | | wrapper.eq(CodeClassifyValue::getParentClassifyValueOid, codeClassifyValueDO.getParentClassifyValueOid()); |
| | | } |
| | | //æ¥è¯¢ |
| | | List<CodeClassifyValue> existList = codeClassifyValueMapper.selectList(Wrappers.<CodeClassifyValue>query() |
| | | .lambda().eq(CodeClassifyValue::getCodeClassifySecOid, codeClassifyValueDO.getCodeClassifySecOid()) |
| | | .eq(CodeClassifyValue::getParentClassifyValueOid, codeClassifyValueDO.getParentClassifyValueOid()) |
| | | ); |
| | | List<CodeClassifyValue> existList = codeClassifyValueMapper.selectList(wrapper); |
| | | codeClassifyValueDO.setOrderNum(existList.size() + 1); |
| | | boolean resBoolean = codeClassifyValueMapper.insert(codeClassifyValueDO) > 0; |
| | | return resBoolean; |
| | |
| | | VciBaseUtil.alertNotNull(codeClassifyValueDTO,"åç±»ç æ®µçç 弿°æ®å¯¹è±¡",codeClassifyValueDTO.getOid(),"åç±»ç æ®µçç å¼ç主é®"); |
| | | CodeClassifyValue codeClassifyValueDO = selectByOid(codeClassifyValueDTO.getOid()); |
| | | R baseResult = checkIsCanDeleteForDO(codeClassifyValueDTO,codeClassifyValueDO); |
| | | if(!baseResult.isSuccess()) { |
| | | //æ¾ä¸çº§çï¼è¿ä¸ªæ¯å¯ä»¥å é¤çæ¶åR |
| | | List<String> childrenOids = codeClassifyValueMapper.selectAllLevelChildOid(codeClassifyValueDO.getOid().trim()); |
| | | if(baseResult.isSuccess()) { |
| | | //å
å é¤ä¸çº§ç å¼ï¼æ¾ä¸çº§çï¼è¿ä¸ªæ¯å¯ä»¥å é¤çæ¶å |
| | | List<String> childrenOids = codeClassifyValueMapper.selectChildOid(codeClassifyValueDO.getOid().trim()); |
| | | if (!CollectionUtils.isEmpty(childrenOids)) { |
| | | Collection<Collection<String>> childrenCollections = VciBaseUtil.switchCollectionForOracleIn(childrenOids); |
| | | for(Collection<String> s : childrenCollections){ |
| | | codeClassifyValueMapper.delete(Wrappers.<CodeClassifyValue>query().lambda().eq(CodeClassifyValue::getOid,s)); |
| | | codeClassifyValueMapper.deleteBatchIds(s); |
| | | } |
| | | } |
| | | }else{ |
| | | return baseResult; |
| | | } |
| | | //æ§è¡å é¤æä½ |
| | | //æ§è¡å 餿ä½ï¼åå é¤ç¶çç å¼ |
| | | boolean resBoolean = codeClassifyValueMapper.deleteById(codeClassifyValueDO.getOid()) > 0; |
| | | return R.status(resBoolean); |
| | | } |
| | |
| | | @Resource |
| | | private ICodeFixedValueService codeFixedValueService; |
| | | |
| | | @Resource |
| | | private ICodeClassifyValueService codeClassifyValueService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * @param query |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<CodeRuleVO> gridCodeRule(Query query, Map<String,Object> conidtionMap) { |
| | | public IPage<CodeRuleVO> gridCodeRule(Query query, Map<String,Object> conidtionMap) throws VciBaseException { |
| | | //妿çäºèªå·±é
ç½®ç管çç»ç§æ·idå管çç»è¶
管账å·ï¼å°±ä¸éè¦æç
§è§åææè
æ¥è¿è¡æ¥è¯¢ |
| | | if(!(AuthUtil.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId()) |
| | | && AuthUtil.getUserId().toString().equals(nacosConfigCache.getAdminUserInfo().getUserId().toString())) |
| | |
| | | * @return è¿åfalse表示æªéå¤ |
| | | */ |
| | | @Override |
| | | public boolean checkCodeRuleRepeat(CodeRuleDTO codeRuleDTO){ |
| | | public boolean checkCodeRuleRepeat(CodeRuleDTO codeRuleDTO)throws VciBaseException { |
| | | LambdaQueryWrapper<CodeRule> wrapper = Wrappers.<CodeRule>query() |
| | | .lambda().eq(CodeRule::getId, codeRuleDTO.getId()); |
| | | if(AuthUtil.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId())){ |
| | |
| | | * @return true表示已ç»ä½¿ç¨ï¼false表示æªè¢«ä½¿ç¨ |
| | | */ |
| | | @Override |
| | | public boolean isAlreadyInUse(String oid) { |
| | | public boolean isAlreadyInUse(String oid) throws VciBaseException { |
| | | Collection<CodeClassifyVO> codeClassifyVOS = listUseRangeInCodeClassify(oid); |
| | | if (codeClassifyVOS.size() > 0) { |
| | | return true; |
| | |
| | | * @return 主é¢åºå类使ç¨å°è¯¥ç¼ç è§åçææéå |
| | | */ |
| | | @Override |
| | | public Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid) { |
| | | public Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid) throws VciBaseException { |
| | | List<CodeClassify> codeClassifies = codeClassifyServcie.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getCodeRuleOid, oid)); |
| | | return CodeClassifyWrapper.build().listVO(codeClassifies); |
| | | } |
| | |
| | | * @param oidCollections 主é®çéå |
| | | * @return æ°æ®å¯¹è±¡å表 |
| | | */ |
| | | private List<CodeRule> listCodeRuleDOByOidCollections(Collection<String> oidCollections) { |
| | | private List<CodeRule> listCodeRuleDOByOidCollections(Collection<String> oidCollections) throws VciBaseException { |
| | | List<CodeRule> codeRuleDOList = new ArrayList<CodeRule>(); |
| | | if (!CollectionUtils.isEmpty(oidCollections)) { |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public R updateStatus(String oid, String update) { |
| | | public R updateStatus(String oid, String update) throws VciBaseException { |
| | | int count = 0; |
| | | //å
æ¥è¯¢å¯¹è±¡ |
| | | CodeRule codeRuleDO = selectByOid(oid); |
| | |
| | | * @return è§åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public CodeRuleVO getObjectHasSecByOid(String oid) { |
| | | public CodeRuleVO getObjectHasSecByOid(String oid) throws VciBaseException { |
| | | CodeRule ruleDO = selectByOid(oid); |
| | | return codeRuleDO2VO(ruleDO, true); |
| | | } |
| | |
| | | return dataList; |
| | | } |
| | | |
| | | /** |
| | | /** |
| | | * æ ¹æ®å½åç³è¯·ç¼ç çåç±»ï¼éå±å¾ä¸æ ¡éªæ¯å¦ç¬¦åå±äºé
ç½®çä¸çåç±»åèç¹çå |
| | | * ç±»ï¼å¦æç¬¦åï¼å该åç±»ç³è¯·çç¼ç 为éå¢ç è¿åtrueï¼åä¹å为ä¼ä¸ç¼ç è¿åfalse |
| | | * @param parameter ä¼ å
¥æ°æ®,classifyGroupCode:é
ç½®çä¸çå类顶èç¹ï¼oidï¼éæ©èç¹çoid |
| | | */ |
| | | @Override |
| | | public R checkGroupCode(Map<String, String> parameter) { |
| | | List<CodeClassify> codeClassifyList = classifyService.selectAllLevelParents(parameter.get("oid")); |
| | | Set<String> configGroupCode = Arrays.stream(parameter.get("classifyGroupCode").split("#")).collect(Collectors.toSet()); |
| | | // Boolean checkGroupFlag = false;//æ¯å¦æ¥è¯¢å°é
ç½®çé¡¶å±åç±»ä¸ |
| | | for (int i = codeClassifyList.size()-1; i >= 0; i--) { |
| | | if(configGroupCode.contains(codeClassifyList.get(i).getId())){ |
| | | // checkGroupFlag = true; |
| | | return R.data("true"); |
| | | } |
| | | // if(checkGroupFlag && parameter.get("nowApplyCode").equals(codeClassifyList.get(i).getId())){ |
| | | // return R.data(true); |
| | | // } |
| | | } |
| | | return R.data("false"); |
| | | } |
| | | |
| | | /** |
| | | * å°è£
å
³é®å±æ§çæ¥è¯¢è¯å¥ |
| | | * |
| | | * @param value å½åçå¼ |
| | |
| | | return phaseAttrService.listAttrByTemplateOidAndPhaseId(templateVO.getOid(), phase); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·¯å¾ä¸å
å«å½ååç±»çææåç±»ä¿¡æ¯ |
| | | * |
| | |
| | | CodeSecTypeEnum.CODE_FIXED_SEC.getValue(), |
| | | CodeSecTypeEnum.CODE_VARIABLE_SEC.getValue(), |
| | | CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue(), |
| | | CodeSecTypeEnum.CODE_REFER_SEC.getValue() |
| | | CodeSecTypeEnum.CODE_REFER_SEC.getValue(), |
| | | CodeSecTypeEnum.CODE_DATE_SEC.getValue() |
| | | ); |
| | | // åªè¯»ç 段类å |
| | | List<String> readOnlyTypes = Arrays.asList( |
| | | CodeSecTypeEnum.CODE_LEVEL_SEC.getValue(), |
| | | CodeSecTypeEnum.CODE_ATTR_SEC.getValue(), |
| | | CodeSecTypeEnum.CODE_DATE_SEC.getValue() |
| | | CodeSecTypeEnum.CODE_ATTR_SEC.getValue() |
| | | ); |
| | | // éèç æ®µç±»å |
| | | /*List<String> hideType = Arrays.asList( |
| | |
| | | } else { |
| | | if (CollectionUtils.isEmpty(fullInfoBO.getParentClassifyVOs())) { |
| | | //说æå·²ç»æ¯æé«å±çº§, |
| | | throw new VciBaseException("å½å主é¢åºåç±»ï¼ä»¥åå®çææçä¸çº§åç±»é½æ²¡æè®¾ç½®ç¼ç è§å"); |
| | | throw new ServiceException("å½å主é¢åºåç±»ï¼ä»¥åå®çææçä¸çº§åç±»é½æ²¡æè®¾ç½®ç¼ç è§å"); |
| | | } |
| | | List<CodeClassifyVO> parentClassifyVOList = fullInfoBO.getParentClassifyVOs().stream().sorted((o1, o2) -> o1.getDataLevel().compareTo(o2.getDataLevel())).collect(Collectors.toList()); |
| | | //仿é«çlevelå¼å§è·å |
| | |
| | | } |
| | | } |
| | | if (StringUtils.isBlank(codeRuleOid)) { |
| | | throw new VciBaseException("å½å主é¢åºåç±»ï¼ä»¥åå®çææçä¸çº§åç±»é½æ²¡æè®¾ç½®ç¼ç è§å"); |
| | | throw new ServiceException("å½å主é¢åºåç±»ï¼ä»¥åå®çææçä¸çº§åç±»é½æ²¡æè®¾ç½®ç¼ç è§å"); |
| | | } |
| | | } |
| | | return ruleService.getObjectHasSecByOid(codeRuleOid); |
| | |
| | | sb.append(" where 1=1 "); |
| | | sb.append(" and lastr=1 and lastv=1" ); |
| | | if(isCodeOrGroupCode) { |
| | | sb.append(" and groupcode in ("); |
| | | sb.append(" and ( groupcode in ("); |
| | | sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0]))); |
| | | sb.append(")"); |
| | | sb.append(" or id in ("); |
| | | sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0]))); |
| | | sb.append("))"); |
| | | }else{ |
| | | sb.append(" and id in ("); |
| | | sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0]))); |
| | | sb.append(")"); |
| | | } |
| | | sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0]))); |
| | | sb.append(")"); |
| | | |
| | | List<Map<String,String>> dataMapList=commonsMapper.queryByOnlySqlForMap(sb.toString()); |
| | | List<ClientBusinessObject> cboList= ChangeMapTOClientBusinessObjects(dataMapList); |
| | |
| | | List<CodeAllCode>newCodeAllCodeList= codeAllCodeService.selectByWrapper(Wrappers.<CodeAllCode>query().lambda().eq(CodeAllCode::getCreateCodeOid, cbo.getOid())); |
| | | log.info("codeCbos size:" + newCodeAllCodeList.size()); |
| | | if (!CollectionUtils.isEmpty(newCodeAllCodeList)) { |
| | | CodeAllCode codeCbo = codeAllCodeList.get(0); |
| | | CodeAllCode codeCbo = newCodeAllCodeList.get(0); |
| | | log.info("codeCbos code:" + codeCbo.getId()); |
| | | codeCbo.setLcStatus(CodeDefaultLC.TASK_BACK.getValue()); |
| | | codeAllCodeList.add(codeCbo); |
| | |
| | | //没æéå¶åç±»ï¼ä½æ¯ä¸ä¸ªæ¨¡æ¿åªå¯è½å¨ä¸ä¸ªä¸å¡ç±»åéé¢ï¼æä»¥ç´æ¥æ¥è¯¢è¿ä¸ªä¸å¡ç±»åå³å¯ |
| | | |
| | | if (!CollectionUtils.isEmpty(conditionMap)) { |
| | | final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmTypeId()) + " t where 1 = 1 "}; |
| | | String tableName=""; |
| | | R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId()); |
| | | if(r.isSuccess()) { |
| | | BtmTypeVO btmTypeVO = r.getData(); |
| | | if (btmTypeVO != null) { |
| | | tableName = btmTypeVO.getTableName(); |
| | | |
| | | } |
| | | } |
| | | if (StringUtils.isBlank(tableName)) { |
| | | String errormsg="æ ¹æ®ä¸å¡ç±»å为æ¥è¯¢å°ç¸å
³ä¸å¡è¡¨"; |
| | | errorMap.put(orderDTO.getId(),errorMap.getOrDefault(orderDTO.getId(),"")+errormsg); |
| | | return; |
| | | } |
| | | final String[] sql = {"select count(*) from " + tableName + " t where 1 = 1 "}; |
| | | conditionMap.forEach((key, value) -> { |
| | | if(StringUtils.isBlank(value)||value.equals(QueryOptionConstant.ISNULL)){ |
| | | sql[0] += " and " + key + " is null "; |
| | |
| | | ClientBusinessObject sysDataObject= codeSystemObjectMap.get(code); |
| | | if(isCodeOrGroupCode){ |
| | | code=sysDataObject.getAttributeValue("GROUPCODE"); |
| | | if(StringUtils.isBlank(code)){ |
| | | code=sysDataObject.getId(); |
| | | } |
| | | } |
| | | CodeOrderDTO orderDTO = new CodeOrderDTO(); |
| | | if(codeDataMap.containsKey(code)){ |
| | |
| | | orderDTO.setCodeClassifyOid(codeClassifyVO.getOid());//åç±»ä¸»é® |
| | | orderDTO.setOid(sysDataObject.getOid());//æ°æ®oid |
| | | orderDTO.setLcStatus(rowDatas.getStatus());//ç¶æ |
| | | if(isCodeOrGroupCode){ |
| | | orderDTO.setId(sysDataObject.getId()); |
| | | }else{ |
| | | orderDTO.setId(code); |
| | | } |
| | | orderDTO.setId(code); |
| | | orderDTO.setTs(sysDataObject.getTs()); |
| | | orderDTO.setBtmname(codeClassifyVO.getBtmname());//ä¸å¡ç±»å |
| | | orderDTO.setDescription("éæè°ç¨:æ´æ°");//æ°æ®æè¿° |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.vci.ubcs.code.service.IPasswordFreeLoginService; |
| | | import com.vci.ubcs.code.util.HttpUtils; |
| | | import org.apache.commons.collections4.MultiValuedMap; |
| | | import org.apache.commons.collections4.multimap.ArrayListValuedHashMap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cloud.client.ServiceInstance; |
| | | import org.springframework.cloud.client.discovery.DiscoveryClient; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
å¯ç»å½æå¡ |
| | | * @author ludc |
| | |
| | | @Service |
| | | public class PasswordFreeLoginServiceImpl implements IPasswordFreeLoginService { |
| | | |
| | | private RestTemplate restTemplate; |
| | | // éè¿æå¡æ³¨åä¸å¿è·åç½å
³ç端å£å· |
| | | @Autowired |
| | | private DiscoveryClient discoveryClient; |
| | | |
| | | /** |
| | | * è·åç½å
³ç«¯å£ |
| | | * @return |
| | | */ |
| | | public String getGatewayPort() { |
| | | List<ServiceInstance> instances = discoveryClient.getInstances("ubcs-gateway"); |
| | | if (!instances.isEmpty()) { |
| | | ServiceInstance gatewayInstance = instances.get(0); |
| | | return String.valueOf(gatewayInstance.getPort()); |
| | | } |
| | | return "80"; |
| | | } |
| | | |
| | | /** |
| | | * å
å¯ç»å½ |
| | |
| | | @Override |
| | | public boolean passwordFreeLogin(String account) { |
| | | // å
å¯ç»å½æ¥å£å°å |
| | | String loginUrl = "http://ubcs-auth/auth/login"; |
| | | String loginUrl = "http://localhost:"+this.getGatewayPort()+"/ubcs-auth/oauth/passwordFreeLogin?username=admin&grant_type=captcha&scope=all&type=account"; |
| | | |
| | | // 设置请æ±å¤´ |
| | | HttpHeaders headers = new HttpHeaders(); |
| | |
| | | MultiValueMap<String,String> bodyParams = new LinkedMultiValueMap<String,String>(); |
| | | bodyParams.add("account",account); |
| | | |
| | | // å建请æ±å®ä½ |
| | | HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(bodyParams, headers); |
| | | |
| | | // åéPOSTè¯·æ± |
| | | ResponseEntity<String> responseEntity = restTemplate.exchange(loginUrl, HttpMethod.POST, requestEntity, String.class); |
| | | String responseBody = responseEntity.getBody(); |
| | | |
| | | String responseBody = HttpUtils.post(loginUrl, bodyParams); |
| | | System.out.println(responseBody); |
| | | //æ¿å°ååºä½å°tokenåå
¥å°redisä¸ï¼ä»¥accountä½ä¸ºåå¨çkey |
| | | |
| | | // è§£æååºä½è·å令ç |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.DEFAULT_SYNC_ATTR_LIST; |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.IMPORT_ROW_INDEX; |
| | | import static com.vci.ubcs.code.enumpack.CodeSecTypeEnum.CODE_CLASSIFY_SEC; |
| | | |
| | | /*** |
| | |
| | | boolean isPersonApplyGroupCode= personAndDeptConfig.isPersonApplyGroupCode(); |
| | | String systemCode=personData.getSystemCode(); |
| | | List<ResultMdMapping> resultMdMappingList=new ArrayList<>(); |
| | | boolean success=true; |
| | | String message=""; |
| | | if(isUsedFlag){ |
| | | AtomicBoolean success= new AtomicBoolean(true); |
| | | List<PersonMasterData> masterDataList=new ArrayList<>(); |
| | | List<String> fields= VciBaseUtil.str2List(personAndDeptConfig.getPersonFields()); |
| | | try { |
| | |
| | | masterDataList = personData.getMasterData(); |
| | | String personLibrary = personAndDeptConfig.getPersonLibrary(); |
| | | if (StringUtils.isBlank(personLibrary)) { |
| | | success=false; |
| | | success.set(false); |
| | | log.info("éæé
置缺å°äººååºèç¹ä¿¡æ¯,personLibrary->" + personLibrary); |
| | | throw new Throwable("éæé
置缺å°äººååºèç¹ä¿¡æ¯,personLibrary->" + personLibrary); |
| | | } |
| | |
| | | log.info("endï¼åç±»æ¥è¯¢å®æ¯"); |
| | | //è·åå类模æ¿ä¿¡æ¯ |
| | | if(codeClassifyVO==null || StringUtils.isBlank(codeClassifyVO.getOid())){ |
| | | success=false; |
| | | success.set(false); |
| | | throw new Throwable ("æ ¹æ®é
ç½®åç±»çåç±»ç¼å·ï¼æªè·åå°å类信æ¯"); |
| | | } |
| | | CodeClassifyTemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(codeClassifyVO.getOid()); |
| | | if(templateVO==null||StringUtils.isBlank(templateVO.getOid())){ |
| | | success=false; |
| | | success.set(false); |
| | | throw new Throwable ("æ ¹æ®ä¼ è¾çåç±»ï¼æªè·åMDMç³»ç»ä¸å¯¹åºæ¨¡æ¿"); |
| | | } |
| | | |
| | |
| | | deleteDataVOList.add(object); |
| | | }else{ |
| | | String worker_category=personMasterData.getWorker_category(); |
| | | codeList.add(personMasterData.getLm_code()); |
| | | |
| | | object.setOperate("create"); |
| | | applyDataVOList.add(object); |
| | | } |
| | | codeList.add(personMasterData.getLm_code()); |
| | | }); |
| | | |
| | | R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId()); |
| | |
| | | orderDTO.setCodeRuleOid(ruleVO.getOid()); |
| | | orderDTO.setSecDTOList(codeOrderSecDTOList);//åå¨ç¼ç |
| | | orderDTO.setData(rowData.getFiledValue()); |
| | | engineService.addSaveCode(orderDTO); |
| | | String code=engineService.addSaveCode(orderDTO); |
| | | if(StringUtils.isNotBlank(code)) { |
| | | StringBuffer sqlsb = new StringBuffer(); |
| | | sqlsb.append(" select * from "); |
| | | sqlsb.append(tableName); |
| | | sqlsb.append(" where 1=1 "); |
| | | sqlsb.append(" and lastr=1 and lastv=1"); |
| | | sqlsb.append(" and id in ("); |
| | | sqlsb.append(VciBaseUtil.toInSql(code)); |
| | | sqlsb.append(")"); |
| | | List<Map<String, String>> newDataMapList = commonsMapper.queryByOnlySqlForMap(sqlsb.toString()); |
| | | if (!CollectionUtils.isEmpty(newDataMapList)) { |
| | | String oid = StringUtils.isBlank(newDataMapList.get(0).get("OID")) ? "" : newDataMapList.get(0).get("OID"); |
| | | List<String> oidList = new ArrayList<>(); |
| | | oidList.add(oid); |
| | | //妿æç³è¯·å°±å»è°ç¨ç³è¯·éå¢ç |
| | | if (isPersonApplyGroupCode) { |
| | | mdmIOService.sendApplyGroupcode(oidList, templateVO.getBtmTypeId(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue()); |
| | | success.set(true); |
| | | mesg = "æ°æ®ä¿åæåï¼çå¾
ç³è¯·éå¢ç "; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | mesg=e.getMessage(); |
| | | e.getMessage(); |
| | | e.printStackTrace(); |
| | | }finally { |
| | | XMLResultDataObjectDetailDO x=new XMLResultDataObjectDetailDO(); |
| | |
| | | } |
| | | }); |
| | | resultDataObjectDetailDOs.addAll(xDOs); |
| | | boolean finalSuccess1 = success; |
| | | boolean finalSuccess1 = success.get(); |
| | | String finalMessage1 = message; |
| | | resultDataObjectDetailDOs.stream().forEach(resultDataObjectDetailDO->{ |
| | | ResultMdMapping resultMdMapping=new ResultMdMapping(); |
| | |
| | | resultMdMappingList.add(resultMdMapping); |
| | | }); |
| | | log.info("endï¼ç³è¯·è·å宿¯"); |
| | | //妿æç³è¯·å°±å»è°ç¨ç³è¯·éå¢ç |
| | | if(isPersonApplyGroupCode){ |
| | | List<String> oidList=new ArrayList<>(); |
| | | mdmIOService.sendApplyGroupcode(oidList,templateVO.getBtmTypeId(),sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue()); |
| | | } |
| | | } |
| | | }catch (Throwable e){ |
| | | success=false; |
| | | success.set(false); |
| | | message="äººåæ°æ®æ¥å失败:"+e.getMessage(); |
| | | //ç»ç»è¿åç»æ |
| | | boolean finalSuccess = success; |
| | | boolean finalSuccess = success.get(); |
| | | String finalMessage = message; |
| | | masterDataList.stream().forEach(masterData -> { |
| | | ResultMdMapping resultMdMapping=new ResultMdMapping(); |
| | |
| | | }); |
| | | }finally { |
| | | resultOrgData.setMessage(message); |
| | | resultOrgData.setSuccess(success); |
| | | resultOrgData.setSuccess(success.get()); |
| | | resultOrgData.setMdMappings(resultMdMappingList); |
| | | Object object = JSONObject.toJSON(resultOrgData); |
| | | } |
| | |
| | | String data = JSONObject.toJSONString(personData); |
| | | try { |
| | | //è®°å½æ¥å¿ |
| | | this.saveLogs(systemCode, systemCode, data, resultStr, success, msg, "syncDataForPerson"); |
| | | this.saveLogs(systemCode, systemCode, data, resultStr, success.get(), msg, "syncDataForPerson"); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public ResultOrgData syncDataForOrg(OrgData orgData) { |
| | | boolean isUsedFlag= personAndDeptConfig.isUsedFlag(); |
| | | ResultOrgData resultOrgData=new ResultOrgData(); |
| | | |
| | | boolean isPersonApplyGroupCode= personAndDeptConfig.isPersonApplyGroupCode(); |
| | | List<ResultMdMapping> resultMdMappingList=new ArrayList<>(); |
| | | boolean success=true; |
| | | AtomicBoolean success= new AtomicBoolean(true); |
| | | String message=""; |
| | | String systemCode=""; |
| | | if(isUsedFlag){ |
| | |
| | | orgMasterDataList = orgData.getMasterData(); |
| | | String personLibrary = personAndDeptConfig.getPersonLibrary(); |
| | | if (StringUtils.isBlank(personLibrary)) { |
| | | success=false; |
| | | success.set(false); |
| | | log.info("éæé
置缺å°äººååºèç¹ä¿¡æ¯,personLibrary->" + personLibrary); |
| | | throw new Throwable("éæé
置缺å°äººååºèç¹ä¿¡æ¯,personLibrary->" + personLibrary); |
| | | } |
| | |
| | | log.info("endï¼åç±»æ¥è¯¢å®æ¯"); |
| | | //è·åå类模æ¿ä¿¡æ¯ |
| | | if(codeClassifyVO==null || StringUtils.isBlank(codeClassifyVO.getOid())){ |
| | | success=false; |
| | | success.set(false); |
| | | throw new Throwable ("æ ¹æ®é
ç½®åç±»çåç±»ç¼å·ï¼æªè·åå°å类信æ¯"); |
| | | } |
| | | CodeClassifyTemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(codeClassifyVO.getOid()); |
| | | if(templateVO==null||StringUtils.isBlank(templateVO.getOid())){ |
| | | success=false; |
| | | success.set(false); |
| | | throw new Throwable ("æ ¹æ®ä¼ è¾çåç±»ï¼æªè·åMDMç³»ç»ä¸å¯¹åºæ¨¡æ¿"); |
| | | } |
| | | |
| | |
| | | List<String> codeList=new ArrayList<>(); |
| | | List<ApplyDataVO> applyDataVOList=new ArrayList<>(); |
| | | List<ApplyDataVO> deleteDataVOList=new ArrayList<>(); |
| | | orgMasterDataList.stream().forEach(personMasterData -> { |
| | | orgMasterDataList.stream().forEach(orgMasterData -> { |
| | | ApplyDataVO object=new ApplyDataVO(); |
| | | object.setCode(personMasterData.getMdm_code());//ç¼ç |
| | | object.setCreator(personMasterData.getCreator());//å建è
|
| | | object.setEditor(personMasterData.getModifier());//ä¿®æ¹è
|
| | | object.setId(personMasterData.getPk_mdm());//ä¸»é® |
| | | object.setCode(orgMasterData.getMdm_code());//ç¼ç |
| | | object.setCreator(orgMasterData.getCreator());//å建è
|
| | | object.setEditor(orgMasterData.getModifier());//ä¿®æ¹è
|
| | | object.setId(orgMasterData.getPk_mdm());//ä¸»é® |
| | | object.setStatus(CodeDefaultLC.RELEASED.getValue());//ç¶æåéè¦å¤æ |
| | | Map<String,String> dataMap= VciBaseUtil.objectToMapString(personMasterData); |
| | | Map<String,String> dataMap= VciBaseUtil.objectToMapString(orgMasterData); |
| | | List<ProppertyVO> proppertyVOList=new ArrayList<>(); |
| | | /*** |
| | | * æ ¹æ®é
ç½®æä»¶è·åæä¸¾å¼ |
| | |
| | | }); |
| | | |
| | | object.setProp(proppertyVOList); |
| | | if(personMasterData.getDr()==1){ |
| | | if(orgMasterData.getDr()==1){ |
| | | object.setOperate("delete");//æä½ç±»å |
| | | deleteDataVOList.add(object); |
| | | }else{ |
| | | codeList.add(personMasterData.getMdm_code()); |
| | | |
| | | object.setOperate("create"); |
| | | applyDataVOList.add(object); |
| | | } |
| | | codeList.add(orgMasterData.getMdm_code()); |
| | | }); |
| | | |
| | | R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId()); |
| | |
| | | orderDTO.setCodeRuleOid(ruleVO.getOid()); |
| | | orderDTO.setSecDTOList(codeOrderSecDTOList);//åå¨ç¼ç |
| | | orderDTO.setData(rowData.getFiledValue()); |
| | | engineService.addSaveCode(orderDTO); |
| | | String code=engineService.addSaveCode(orderDTO); |
| | | if(StringUtils.isNotBlank(code)) { |
| | | StringBuffer sqlsb = new StringBuffer(); |
| | | sqlsb.append(" select * from "); |
| | | sqlsb.append(tableName); |
| | | sqlsb.append(" where 1=1 "); |
| | | sqlsb.append(" and lastr=1 and lastv=1"); |
| | | sqlsb.append(" and id in ("); |
| | | sqlsb.append(VciBaseUtil.toInSql(code)); |
| | | sqlsb.append(")"); |
| | | List<Map<String, String>> newDataMapList = commonsMapper.queryByOnlySqlForMap(sqlsb.toString()); |
| | | if (!CollectionUtils.isEmpty(newDataMapList)) { |
| | | String oid = StringUtils.isBlank(newDataMapList.get(0).get("OID")) ? "" : newDataMapList.get(0).get("OID"); |
| | | List<String> oidList = new ArrayList<>(); |
| | | oidList.add(oid); |
| | | //妿æç³è¯·å°±å»è°ç¨ç³è¯·éå¢ç |
| | | if (isPersonApplyGroupCode) { |
| | | mdmIOService.sendApplyGroupcode(oidList, templateVO.getBtmTypeId(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue()); |
| | | success.set(true); |
| | | mesg = "æ°æ®ä¿åæåï¼çå¾
ç³è¯·éå¢ç "; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | mesg=e.getMessage(); |
| | | e.getMessage(); |
| | |
| | | } |
| | | }); |
| | | resultDataObjectDetailDOs.addAll(xDOs); |
| | | boolean finalSuccess1 = success; |
| | | boolean finalSuccess1 = success.get(); |
| | | String finalMessage1 = message; |
| | | resultDataObjectDetailDOs.stream().forEach(resultDataObjectDetailDO->{ |
| | | ResultMdMapping resultMdMapping=new ResultMdMapping(); |
| | |
| | | resultMdMappingList.add(resultMdMapping); |
| | | }); |
| | | log.info("endï¼ç³è¯·è·å宿¯"); |
| | | //妿æç³è¯·å°±å»è°ç¨ç³è¯·éå¢ç |
| | | if(isPersonApplyGroupCode){ |
| | | List<String> oidList=new ArrayList<>(); |
| | | mdmIOService.sendApplyGroupcode(oidList,templateVO.getBtmTypeId(),sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue()); |
| | | } |
| | | } |
| | | }catch (Throwable e){ |
| | | success=false; |
| | | success.set(false); |
| | | message="äººåæ°æ®æ¥å失败:"+e.getMessage(); |
| | | //ç»ç»è¿åç»æ |
| | | boolean finalSuccess = success; |
| | | boolean finalSuccess = success.get(); |
| | | String finalMessage = message; |
| | | orgMasterDataList.stream().forEach(masterData -> { |
| | | ResultMdMapping resultMdMapping=new ResultMdMapping(); |
| | |
| | | }); |
| | | }finally { |
| | | resultOrgData.setMessage(message); |
| | | resultOrgData.setSuccess(success); |
| | | resultOrgData.setSuccess(success.get()); |
| | | resultOrgData.setMdMappings(resultMdMappingList); |
| | | Object object = JSONObject.toJSON(resultOrgData); |
| | | } |
| | |
| | | String data = JSONObject.toJSONString(orgData); |
| | | try { |
| | | //è®°å½æ¥å¿ |
| | | this.saveLogs(systemCode, systemCode, data, resultStr, success, msg, "syncDataForOrg"); |
| | | this.saveLogs(systemCode, systemCode, data, resultStr, success.get(), msg, "syncDataForOrg"); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | </foreach> |
| | | ;END; |
| | | </update> |
| | | |
| | | <select id="selectAllParents" resultMap="plCodeClassifyResultMap"> |
| | | select * from PL_CODE_CLASSIFY p |
| | | start with p.OID =#{oid} |
| | | connect by p.oid = prior p.PARENTCODECLASSIFYOID |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | CONNECT BY PRIOR PARENTCLASSIFYVALUEOID = OID |
| | | </select> |
| | | |
| | | <select id="selectChildOid" resultType="java.lang.String"> |
| | | select OID from PL_CODE_CLASSIFYVALUE where PARENTCLASSIFYVALUEOID =#{oid} |
| | | </select> |
| | | |
| | | <select id="countAllLevelChildOid" resultType="java.lang.Long"> |
| | | select count(OID) countsize |