¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sun.corba.se.impl.orbutil.ObjectUtility; |
| | | import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; |
| | | import com.vci.ubcs.code.dto.CodeOrderDTO; |
| | | import com.vci.ubcs.code.dto.datapush.BaseModelDTO; |
| | | import com.vci.ubcs.code.entity.CodeAllCode; |
| | | import com.vci.ubcs.code.entity.CodeOsbtmtypeEntity; |
| | | import com.vci.ubcs.code.entity.CodeRule; |
| | | import com.vci.ubcs.code.entity.CodeWupinEntity; |
| | | import com.vci.ubcs.code.enumpack.CodeDefaultLC; |
| | | import com.vci.ubcs.code.enumpack.CodeLevelTypeEnum; |
| | | import com.vci.ubcs.code.enumpack.CodeSecTypeEnum; |
| | | import com.vci.ubcs.code.mapper.CodeAllCodeMapper; |
| | | import com.vci.ubcs.code.mapper.CodeOsbtmtypeMapper; |
| | | import com.vci.ubcs.code.mapper.CodeRuleMapper; |
| | | import com.vci.ubcs.code.service.*; |
| | | import com.vci.ubcs.code.vo.CodeClstempattrVO; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import com.vci.ubcs.code.vo.CodeKeyattrrepeatVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.omd.entity.Dict; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.web.enumpck.UserSecretEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.toolmodel.DateConverter; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciDateUtil; |
| | | import com.vci.ubcs.starter.web.util.VciQueryWrapperForDO; |
| | | import com.vci.ubcs.starter.web.util.WebUtil; |
| | | import com.vci.ubcs.system.entity.DictBiz; |
| | | import com.vci.ubcs.system.feign.IDictBizClient; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®å¼ææå¡ |
| | | * |
| | | * @author weidy |
| | | * @date 2022-2-22 |
| | | */ |
| | | @Service |
| | | public class MdmEngineServiceImpl extends ServiceImpl<CodeAllCodeMapper, CodeAllCode> implements MdmEngineService { |
| | | |
| | | |
| | | /** |
| | | * 模æ¿çæå¡ |
| | | */ |
| | | @Resource |
| | | private CodeClstemplateServiceImpl templateService; |
| | | /** |
| | | * 模æ¿çæå¡ |
| | | */ |
| | | @Resource |
| | | private CodeOsbtmtypeMapper codeOsbtmtypeMapper; |
| | | /** |
| | | * çæç¼ç çæå¡ |
| | | */ |
| | | @Resource |
| | | private MdmProductCodeService productCodeService; |
| | | /** |
| | | * åå
¸çæå¡ |
| | | */ |
| | | @Resource |
| | | IDictBizClient iDictBizClient; |
| | | |
| | | /** |
| | | * ç¼ç è§åçæå¡ |
| | | */ |
| | | @Autowired |
| | | private ICodeRuleService ruleService; |
| | | |
| | | /** |
| | | * åç±»çæå¡ |
| | | */ |
| | | @Resource |
| | | private ICodeClassifyService classifyService; |
| | | |
| | | /** |
| | | * å
³é®å±æ§çé
ç½® |
| | | */ |
| | | @Autowired |
| | | private ICodeKeyattrrepeatService keyRuleService; |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | // @Autowired |
| | | // private CodeOsbtmtypeMapper codeOsbtmtypeMapper; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 使ç¨åç±»ç主é®è·åå¯ä»¥ä½¿ç¨ç模æ¿å¯¹è±¡ |
| | | * |
| | | * @param codeClassifyOid åç±»çä¸»é® |
| | | * @return 模æ¿çæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public CodeClstemplateVO getUsedTemplateByClassifyOid(String codeClassifyOid) { |
| | | return getUsedTemplateByClassifyOid(codeClassifyOid, true); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨åç±»ç主é®è·åå¯ä»¥ä½¿ç¨ç模æ¿å¯¹è±¡ |
| | | * |
| | | * @param codeClassifyOid åç±»çä¸»é® |
| | | * @param hasAttr å
å«å±æ§ |
| | | * @return 模æ¿çæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public CodeClstemplateVO getUsedTemplateByClassifyOid(String codeClassifyOid, boolean hasAttr) { |
| | | List<CodeClstemplateVO> templateVOs = templateService.listReleaseTemplateByClassifyOid(codeClassifyOid, hasAttr); |
| | | return templateVOs.get(templateVOs.size() - 1); |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ç䏿é项 |
| | | * |
| | | * @param attrVO 模æ¿å±æ§ç对象 |
| | | * @return 䏿é项 |
| | | */ |
| | | @Override |
| | | public List<KeyValue> listComboboxItems(CodeClstempattrVO attrVO) { |
| | | List<KeyValue> comboboxKVs = null; |
| | | if (StringUtils.isNotBlank(attrVO.getEnumstring())) { |
| | | comboboxKVs = JSONObject.parseArray(attrVO.getEnumstring(), KeyValue.class); |
| | | } else { |
| | | // comboboxKVs = enumService.getEnum(attrVO.getEnumid()); |
| | | // Dict dict = new Dict(); |
| | | // dict.setParentId(Long.valueOf(attrVO.getEnumid())); |
| | | R<List<DictBiz>> list = iDictBizClient.getList(attrVO.getEnumid()); |
| | | if(list.isSuccess()){ |
| | | for (DictBiz datum : list.getData()) { |
| | | KeyValue keyValue = new KeyValue(); |
| | | keyValue.setKey(datum.getDictKey()); |
| | | keyValue.setValue(datum.getDictValue()); |
| | | comboboxKVs.add(keyValue); |
| | | } |
| | | } |
| | | } |
| | | return comboboxKVs; |
| | | } |
| | | /** |
| | | * ä¿®æ¹ç¶æ |
| | | * |
| | | * @param baseModelDTO æ°æ®ä¼ è¾å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public void changeStatus(BaseModelDTO baseModelDTO) { |
| | | VciBaseUtil.alertNotNull(baseModelDTO, "æ°æ®ä¿¡æ¯", baseModelDTO.getOid(), "主é®", baseModelDTO.getBtmname(), "ä¸å¡ç±»å", baseModelDTO.getLcStatus(), "ç®æ ç¶æ"); |
| | | List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid()); |
| | | // List<ClientBusinessObject> cboList = boService.selectCBOByOidCollection(oids, baseModelDTO.getBtmname()); |
| | | //æä¸ªç¹ ä¸å¡ç±»å宿åéè¦ä¿®æ¹ |
| | | QueryWrapper<CodeOsbtmtypeEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("BTMNAME",baseModelDTO.getBtmname()); |
| | | wrapper.in("OID",oids); |
| | | List<CodeOsbtmtypeEntity> cboList = codeOsbtmtypeMapper.selectList(wrapper); |
| | | //è¿éè¦ä¿®æ¹allCodeççå½å¨æ |
| | | // Map<String, String> conditionMap = new HashMap<>(); |
| | | QueryWrapper<CodeAllCode> allCodeWrapper = new QueryWrapper<>(); |
| | | allCodeWrapper.eq("createcodebtm",baseModelDTO.getBtmname()); |
| | | allCodeWrapper.in("createcodeoid",oids); |
| | | // conditionMap.put("createcodeoid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | // conditionMap.put("createcodebtm", baseModelDTO.getBtmname()); |
| | | List<CodeAllCode> codeCbos = baseMapper.selectList(allCodeWrapper); |
| | | // List<ClientBusinessObject> codeCbos = boService.queryCBO(MdmBtmTypeConstant.CODE_ALL_CODE, conditionMap); |
| | | // åæ¶éè¦ä¸å¡æ°æ®å é¤ |
| | | // if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) { |
| | | //// BatchCBO batchCBO = new BatchCBO(); |
| | | //// batchCBO.getDeleteCbos().addAll(cboList); |
| | | // codeOsbtmtypeMapper.deleteBatchIds(cboList); |
| | | //// boService.persistenceBatch(batchCBO); |
| | | // } else { |
| | | // lifeCycleService.transCboStatus(cboList, baseModelDTO.getLcStatus()); |
| | | // } |
| | | // lifeCycleService.transCboStatus(codeCbos, baseModelDTO.getLcStatus()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç¼ç |
| | | * |
| | | * @param orderDTO ç³è¯·çä¿¡æ¯ï¼éè¦å
å«å±æ§çå
容åç æ®µç¸å
³çå
容 |
| | | * @return è¿åç¼ç çå
容 |
| | | */ |
| | | @Override |
| | | public String addSaveCode(CodeOrderDTO orderDTO) { |
| | | VciBaseUtil.alertNotNull(orderDTO, "ç¼ç ç³è¯·ç¸å
³ç屿§åç æ®µçå
容é½ä¸ºç©º", orderDTO.getCodeClassifyOid(), "主é¢åºåç±»ç主é®", |
| | | orderDTO.getTemplateOid(), "模æ¿ç主é®", orderDTO.getCodeRuleOid(), "ç¼ç è§åç主é®"); |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | CodeClstemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); |
| | | CodeRuleVO ruleVO = ruleService.getObjectHasSecByOid(orderDTO.getCodeRuleOid()); |
| | | //1.夿è§åä¸é¤äºæµæ°´ç æ®µï¼æ¯å¦æå
¶ä»ç 段 |
| | | checkSecValueOnOrder(ruleVO, orderDTO); |
| | | //2.夿å¿
è¾é¡¹ |
| | | checkRequiredAttrOnOrder(templateVO, orderDTO); |
| | | //3.å
注å
¥ï¼åç»åï¼æåæ ¡éª |
| | | switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO); |
| | | //4.å¤çç»åè§åãç»åè§åä¸è½ä½¿ç¨ç¼ç ç屿§ï¼å 为ç¼ç ççæå¯è½æ¯éè¦å±æ§ç |
| | | switchComponentAttrOnOrder(templateVO, orderDTO); |
| | | //5.æ ¡éªè§å |
| | | checkVerifyOnOrder(templateVO, orderDTO); |
| | | //6.å
³é®å±æ§ |
| | | checkKeyAttrOnOrder(classifyFullInfo, templateVO, orderDTO); |
| | | //7.æä¸¾è½¬æ¢ |
| | | checkEnumOnOrder(templateVO, orderDTO); |
| | | //8.å¤çæ¶é´æ ¼å¼ï¼å¨æ°æ®åºéé¢ä¸è®ºæ¯åç¬¦ä¸²è¿æ¯æ¥ææ ¼å¼ï¼é½ä½¿ç¨ç¸åçæ ¼å¼åå¨ |
| | | switchDateAttrOnOrder(templateVO, orderDTO); |
| | | //9.çæç¼ç çä¿¡æ¯ |
| | | // ClientBusinessObject cbo = boService.createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | // CodeWupinEntity cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | // //é»è®¤ç屿§é½ä¸ç¨ä»å端æ·è´ |
| | | // //设置ç¼ç éè¦çé»è®¤å±æ§çå
容 |
| | | // copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false); |
| | | // //TODO:å 为é»è®¤ç屿§é½ä¸æ·è´ï¼ç®åéå¢ç å«nameï¼å¹¶æ²¡æä»DTOæ·è´å°cboéãå¢å ä¸ä¸ªåç¬å¤çï¼ä»¥ååçè¦ä¸è¦è°æ´ |
| | | // cbo.setName(orderDTO.getName() == null ? "" : orderDTO.getName()); |
| | | // //end -- modify by lihang @20220407 |
| | | // List<CodeWupinEntity> cboList = new ArrayList<>(); |
| | | // |
| | | // //夿³¨ |
| | | // cbo.setDescription(orderDTO.getDescription()); |
| | | // |
| | | // cboList.add(cbo); |
| | | // List<String> codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(),cboList); |
| | | //// batchSaveSelectChar(templateVO, cboList); |
| | | // return codeList.size() > 0 ? codeList.get(0) : ""; |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * å¤çå类注å
¥çä¿¡æ¯ |
| | | * |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ï¼å¿
é¡»è¦å模æ¿ç屿§ |
| | | * @param classifyFullInfoBO åç±»çå
¨è·¯å¾ |
| | | * @param orderDTO ç¼ç ç³è¯·çä¿¡æ¯ |
| | | */ |
| | | private void switchClassifyLevelOnOrder(CodeClstemplateVO templateVO, CodeClassifyFullInfoBO classifyFullInfoBO, CodeOrderDTO orderDTO) { |
| | | Map<String,CodeClstempattrVO> classifyAttrVOMap = templateVO.getAttributes().stream().filter( |
| | | s -> StringUtils.isNotBlank(s.getClassifyinvokeattr()) && StringUtils.isNotBlank(s.getClassifyinvokelevel()) |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (classifyFullInfoBO.getTopClassifyVO() == null) { |
| | | //éè¦éæ°æ¥è¯¢ä¸ä¸ï¼å 为è¿ä¸ªæ¯æå®çåç±»è¿æ¥ç |
| | | |
| | | } |
| | | if (!CollectionUtils.isEmpty(classifyAttrVOMap)) { |
| | | classifyAttrVOMap.forEach((attrId, attrVO) -> { |
| | | //å类注å
¥çç¼å·æè
åç§°ï¼ |
| | | //å±çº§å
嫿å®å±åæå°å± |
| | | CodeClassifyVO classifyVO = null; |
| | | if (!CodeLevelTypeEnum.MIN.getValue().equalsIgnoreCase(attrVO.getClassifyinvokelevel()) && !"min".equalsIgnoreCase(attrVO.getClassifyinvokelevel())) { |
| | | //æå®äºå±çº§ç |
| | | //注æï¼å 为æ¥è¯¢ä¸çº§åç±»åºæ¥çå±çº§æ¯ååºçï¼å³é¡¶å±èç¹æ¯æå¤§çå¼ |
| | | List<CodeClassifyVO> classifyVOS = classifyFullInfoBO.getParentClassifyVOs().stream().sorted(((o1, o2) -> o2.getDataLevel().compareTo(o1.getDataLevel()))).collect(Collectors.toList()); |
| | | int level = VciBaseUtil.getInt(attrVO.getClassifyinvokelevel()); |
| | | if (classifyVOS.size() >= level && level > 0) { |
| | | classifyVO = classifyVOS.get(level - 1); |
| | | } |
| | | } else { |
| | | //å½åçåç±» |
| | | classifyVO = classifyFullInfoBO.getCurrentClassifyVO(); |
| | | } |
| | | if (classifyVO == null) { |
| | | //说æå±çº§æè¯¯ |
| | | orderDTO.getData().put(attrId, "åç±»æ 䏿²¡æå±çº§[" + attrVO.getClassifyinvokelevel() + "]"); |
| | | // classifyVO = classifyFullInfoBO.getCurrentClassifyVO(); |
| | | } else { |
| | | Map<String, String> classifyDataMap = VciBaseUtil.objectToMapString(classifyVO); |
| | | String value = classifyDataMap.getOrDefault(attrVO.getClassifyinvokeattr(), ""); |
| | | orderDTO.getData().put(attrId, value); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 夿ç¼ç çç æ®µæ¯å¦è¾å
¥æè
éæ©äºç å¼ |
| | | * |
| | | * @param ruleVO è§åçæ¾ç¤ºå¯¹è±¡ |
| | | * @param orderDTO ç¼ç ç³è¯·çå
容 |
| | | */ |
| | | @Override |
| | | public void checkSecValueOnOrder(CodeRuleVO ruleVO, CodeOrderDTO orderDTO) { |
| | | List<String> unSerialSecOidList = ruleVO.getSecVOList().stream().filter( |
| | | s -> !(CodeSecTypeEnum.CODE_SERIAL_SEC.getValue().equalsIgnoreCase(s.getSecType()) |
| | | || CodeSecTypeEnum.CODE_ATTR_SEC.getValue().equalsIgnoreCase(s.getSecType()) |
| | | || CodeSecTypeEnum.CODE_DATE_SEC.getValue().equalsIgnoreCase(s.getSecType()) |
| | | || CodeSecTypeEnum.CODE_LEVEL_SEC.getValue().equalsIgnoreCase(s.getSecType()) |
| | | || VciBaseUtil.getBoolean(s.getNullableFlag())) |
| | | ).map(CodeBasicSecVO::getOid).collect(Collectors.toList()); |
| | | if (!CollectionUtils.isEmpty(unSerialSecOidList)) { |
| | | if (CollectionUtils.isEmpty(orderDTO.getSecDTOList())) { |
| | | throw new VciBaseException("éæµæ°´ç æ®µ(æè
å¿
è¾ç 段ï¼å¿
é¡»è¦è¾å
¥(æéæ©)ç å¼"); |
| | | } |
| | | if (orderDTO.getSecDTOList().stream().anyMatch(s -> !unSerialSecOidList.contains(s.getSecOid()) |
| | | && StringUtils.isBlank(s.getSecValue()))) { |
| | | throw new VciBaseException("éæµæ°´ç æ®µ(æè
å¿
è¾ç 段ï¼å¿
é¡»è¦è¾å
¥(æéæ©)ç å¼"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå±æ§æ¯å¦ä¸ºå¿
è¾ |
| | | * |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ï¼éè¦å
嫿¨¡æ¿å±æ§ |
| | | * @param orderDTO ç¼ç ç³è¯·çä¿¡æ¯ |
| | | */ |
| | | private void checkRequiredAttrOnOrder(CodeClstemplateVO templateVO, CodeOrderDTO orderDTO) { |
| | | Map<String, CodeClstempattrVO> requiredAttrMap = templateVO.getAttributes().stream().filter( |
| | | s -> VciBaseUtil.getBoolean(s.getRequireflag()) && StringUtils.isBlank(s.getComponentrule()) |
| | | && StringUtils.isBlank(s.getClassifyinvokeattr())) |
| | | .collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (!CollectionUtils.isEmpty(requiredAttrMap)) { |
| | | requiredAttrMap.forEach((attrId, attrVO) -> { |
| | | //åªæä¼ä¸ç¼ç ï¼ç¶æï¼å¤æ³¨ï¼æ¨¡æ¿ä¸»é®ï¼å类主é®è¿å 个æ¯åºå®çï¼å
¶ä½é½æ¯èªè¡é
ç½®ç |
| | | if (StringUtils.isBlank(getValueFromOrderDTO(orderDTO, attrId))) { |
| | | throw new VciBaseException("屿§ã{0}ãå¿
é¡»è¦è¾å
¥(éæ©)å
容", new String[]{attrVO.getName()}); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä»ç¼ç ç³è¯·ä¿¡æ¯å¯¹è±¡ä¸è·åæä¸ªå±æ§çå¼ |
| | | * |
| | | * @param orderDTO ç¼ç ç³è¯·å¯¹è±¡ |
| | | * @param attrId 屿§çç¼å· |
| | | * @return å¼ |
| | | */ |
| | | private String getValueFromOrderDTO(CodeOrderDTO orderDTO, String attrId) { |
| | | attrId = attrId.toLowerCase(Locale.ROOT); |
| | | String value = null; |
| | | if (VciQueryWrapperForDO.BASIC_FIELD_MAP.containsKey(attrId)) { |
| | | value = WebUtil.getStringValueFromObject(WebUtil.getValueFromField(WebUtil.getFieldForObject(attrId, orderDTO.getClass()).getName(), orderDTO)); |
| | | } else { |
| | | //è¯´ææ¯èªè¡é
ç½®ç |
| | | //å端å¿
é¡»è¦ä¼ éå°åç屿§ |
| | | value = orderDTO.getData().getOrDefault(attrId, ""); |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 转æ¢ç»åè§åçå¼ |
| | | * |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ï¼éè¦å
嫿¨¡æ¿å±æ§ |
| | | * @param orderDTO ç¼ç ç³è¯·çä¿¡æ¯ |
| | | */ |
| | | private void switchComponentAttrOnOrder(CodeClstemplateVO templateVO, CodeOrderDTO orderDTO) { |
| | | Map<String, CodeClstempattrVO> compAttrVOMap = templateVO.getAttributes().stream().filter(s -> StringUtils.isNotBlank(s.getComponentrule())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (!CollectionUtils.isEmpty(compAttrVOMap)) { |
| | | Map<String, String> dataMap = WebUtil.objectToMapString(orderDTO); |
| | | |
| | | Map<String, String> dataLowMap = new HashMap<>(); |
| | | if (!CollectionUtils.isEmpty(dataMap)) { |
| | | dataMap.forEach((key, value) -> { |
| | | dataLowMap.put(key.toLowerCase(Locale.ROOT), value); |
| | | }); |
| | | } |
| | | dataLowMap.putAll(orderDTO.getData()); |
| | | compAttrVOMap.forEach((attrId, attrVO) -> { |
| | | // dataLowMap.put(attrId, formulaService.getValueByFormula(dataLowMap, attrVO.getComponentrule())); |
| | | }); |
| | | dataLowMap.forEach((key, value) -> { |
| | | setValueToOrderDTO(orderDTO, key, value); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置æ°çå¼å°ç³è¯·å¯¹è±¡ä¸ |
| | | * |
| | | * @param orderDTO ç¼ç ç³è¯·å¯¹è±¡ |
| | | * @param attrId 屿§çç¼å· |
| | | * @param value å¼ |
| | | */ |
| | | private void setValueToOrderDTO(CodeOrderDTO orderDTO, String attrId, String value) { |
| | | attrId = attrId.toLowerCase(Locale.ROOT); |
| | | if (VciQueryWrapperForDO.BASIC_FIELD_MAP.containsKey(attrId)) { |
| | | WebUtil.setValueToField(WebUtil.getFieldForObject(attrId, orderDTO.getClass()).getName(), orderDTO, value); |
| | | } else { |
| | | orderDTO.getData().put(attrId, value); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ£åè¡¨è¾¾å¼æ¯å¦æ£ç¡® |
| | | * |
| | | * @param templateVO 模æ¿çä¿¡æ¯ï¼å¿
é¡»å
å«å±æ§çå
容 |
| | | * @param orderDTO ç¼ç ç³è¯·çç¸å
³çä¿¡æ¯ |
| | | */ |
| | | private void checkVerifyOnOrder(CodeClstemplateVO templateVO, CodeOrderDTO orderDTO) { |
| | | Map<String, CodeClstempattrVO> verifyAttrVOMap = templateVO.getAttributes().stream().filter(s -> StringUtils.isNotBlank(s.getVerifyrule())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (!CollectionUtils.isEmpty(verifyAttrVOMap)) { |
| | | verifyAttrVOMap.forEach((attrId, attrVO) -> { |
| | | String value = getValueFromOrderDTO(orderDTO, attrId); |
| | | if (StringUtils.isNotBlank(value) && !value.matches(attrVO.getVerifyrule())) { |
| | | //æ ¡éªæ£åè¡¨è¾¾å¼ |
| | | throw new VciBaseException("屿§[{0}]çå¼ä¸ç¬¦åæ ¡éªè§åçè¦æ±", new String[]{attrVO.getName()}); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå
³é®å±æ§ |
| | | * |
| | | * @param classifyFullInfo åç±»çå
¨é¨ä¿¡æ¯ |
| | | * @param templateVO 模æ¿çå
容ï¼å¿
é¡»å
嫿¨¡æ¿å±æ§ |
| | | * @param orderDTO ç¼ç ç³è¯·çç¸å
³çä¿¡æ¯ |
| | | */ |
| | | private void checkKeyAttrOnOrder(CodeClassifyFullInfoBO classifyFullInfo, CodeClstemplateVO templateVO, CodeOrderDTO orderDTO) { |
| | | //å
è·åå
³é®å±æ§çè§åï¼ä¹å©ç¨ç»§æ¿çæ¹å¼ |
| | | CodeKeyattrrepeatVO keyRuleVO = keyRuleService.getRuleByClassifyFullInfo(classifyFullInfo); |
| | | //注æçæ¯keyRuleVOå¯è½ä¸ºç©ºï¼è¡¨ç¤ºä¸ä½¿ç¨è§åæ§å¶ |
| | | //è·åææçå
³é®å±æ§ |
| | | Map<String, CodeClstempattrVO> ketAttrMap = templateVO.getAttributes().stream().filter(s -> VciBaseUtil.getBoolean(s.getKeyattrflag())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | boolean trimAll = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag()); |
| | | //å
¨é¨å»ç©ºçä¼å
级大äºå»ç©º |
| | | boolean trim = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorespaceflag()); |
| | | boolean ignoreCase = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorecaseflag()); |
| | | boolean ignoreWidth = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorewidthflag()); |
| | | ketAttrMap.forEach((attrId, attrVO) -> { |
| | | String value = getValueFromOrderDTO(orderDTO, attrId); |
| | | if (value == null) { |
| | | value = ""; |
| | | } |
| | | // wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap); |
| | | }); |
| | | |
| | | //没æéå¶åç±»ï¼ä½æ¯ä¸ä¸ªæ¨¡æ¿åªå¯è½å¨ä¸ä¸ªä¸å¡ç±»åéé¢ï¼æä»¥ç´æ¥æ¥è¯¢è¿ä¸ªä¸å¡ç±»åå³å¯ |
| | | |
| | | // if (!CollectionUtils.isEmpty(conditionMap)) { |
| | | // final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "}; |
| | | // conditionMap.forEach((key, value) -> { |
| | | // sql[0] += " and " + key + " = " + value; |
| | | // }); |
| | | // if (StringUtils.isNotBlank(orderDTO.getOid())) { |
| | | // //ä¿®æ¹çæ¶åï¼éè¦æé¤èªå·± |
| | | // sql[0] += " and oid != '" + orderDTO.getOid() + "'"; |
| | | // } else if (StringUtils.isNotBlank(orderDTO.getCopyFromVersion())) { |
| | | // sql[0] += " and oid != '" + orderDTO.getCopyFromVersion() + "'"; |
| | | // } |
| | | // sql[0] += " and islastR = '1' and islastV = '1' "; |
| | | // if (boService.queryCountBySql(sql[0], new HashMap<>()) > 0) { |
| | | // String ruleInfoMsg = keyRuleVO == null ? "" : "æ¥è¯¢è§åï¼å»é¤ç©ºæ ¼--{0},忽ç¥å¤§å°å--{1},忽ç¥å
¨åè§--{2},忽ç¥å
¨é¨ç©ºæ ¼--{3}"; |
| | | // String[] objs = new String[]{trim ? "æ¯" : "å¦", ignoreCase ? "æ¯" : "å¦", ignoreWidth ? "æ¯" : "å¦", trimAll ? "æ¯" : "å¦"}; |
| | | // throw new VciBaseException("æ ¹æ®æ¨å¡«åçå
³é®å±æ§çå
容ï¼ç»åå
³é®å±æ§æ¥è¯¢è§åï¼åç°è¿ä¸ªæ°æ®å·²ç»å¨ç³»ç»ä¸åå¨äºã请修æ£!ã" + ruleInfoMsg, objs); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | | * å°è£
å
³é®å±æ§çæ¥è¯¢è¯å¥ |
| | | * |
| | | * @param value å½åçå¼ |
| | | * @param keyRuleVO å
³é®å±æ§çæ§å¶è§åï¼å¯ä»¥ä¸ºç©º |
| | | * @param attrId 屿§çç¼å· |
| | | * @param trim æ¯å¦å»é¤ç©ºæ ¼ |
| | | * @param ignoreCase æ¯å¦ä¸åºå大å°å |
| | | * @param ignoreWidth æ¯å¦å¿½ç¥å
¨åè§ |
| | | * @param trimAll æ¯å¦å¿½ç¥å
¨é¨ç©ºæ ¼ |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | */ |
| | | // @Override |
| | | // public void wrapperKeyAttrConditionMap(String value, CodeKeyattrrepeatVO keyRuleVO, String attrId, |
| | | // boolean trim, boolean ignoreCase, boolean ignoreWidth, |
| | | // boolean trimAll, Map<String, String> conditionMap) { |
| | | // boolean ignoreSpace = trim || trimAll; |
| | | // if (StringUtils.isBlank(value)) { |
| | | // //ä¸ºç©ºçæ¶åï¼ä¸è½ç¨QueryOperation.ISNULLï¼å¹³å°ä¸ç¥é奿¶åä¸å¤çè¿ç§äº |
| | | // conditionMap.put("t."+attrId, "null"); |
| | | // } else { |
| | | // if (keyRuleVO != null) { |
| | | // String queryKey = ""; |
| | | // String queryValue = ""; |
| | | // |
| | | // String temp = ""; |
| | | // if (ignoreCase && ignoreSpace && ignoreWidth) { |
| | | // //忽ç¥å¤§å°åï¼ä¸å»ç©ºï¼å¿½ç¥å
¨åè§ |
| | | // temp = (trimAll ? "REPLACE" : "TRIM") + "(UPPER(to_single_byte(%s)) " + (trimAll ? ",' ','')" : ")"); |
| | | // } else if (ignoreCase && ignoreSpace && !ignoreWidth) { |
| | | // //忽ç¥å¤§å°åãå»ç©ºãä¸å¿½ç¥å
¨åè§ |
| | | // temp = (trimAll ? "REPLACE" : "TRIM") + "(UPPER(%s) " + (trimAll ? ",' ','')" : ")"); |
| | | // } else if (ignoreCase && !ignoreSpace && ignoreWidth) { |
| | | // //忽ç¥å¤§å°åãä¸å»ç©ºã忽ç¥å
¨åè§ |
| | | // temp = "UPPER(to_single_byte(%s))"; |
| | | // } else if (!ignoreCase && ignoreSpace && ignoreWidth) { |
| | | // //ä¸å¿½ç¥å¤§å°åãå»ç©ºã忽ç¥å
¨åè§ |
| | | // temp = (trimAll ? "REPLACE" : "TRIM") + "(to_single_byte(%s) " + (trimAll ? ",' ','')" : ")"); |
| | | // } else if (ignoreCase && !ignoreSpace && !ignoreWidth) { |
| | | // //忽ç¥å¤§å°åãä¸å»ç©ºãä¸å¿½ç¥å
¨åè§ |
| | | // temp = "UPPER(%s)"; |
| | | // } else if (!ignoreCase && !ignoreCase && ignoreWidth) { |
| | | // //ä¸å¿½ç¥å¤§å°åãä¸å»ç©ºã忽ç¥å
¨åè§ |
| | | // temp = "to_single_byte(%s)"; |
| | | // } else if (!ignoreCase && ignoreSpace && !ignoreWidth) { |
| | | // //ä¸å¿½ç¥å¤§å°åãå»ç©ºãä¸å¿½ç¥å
¨åè§ |
| | | // temp = (trimAll ? "REPLACE" : "TRIM") + "(%s " + (trimAll ? ",' ','')" : ")"); |
| | | // } else if (!ignoreCase && !ignoreSpace && !ignoreWidth) { |
| | | // //ä¸å¿½ç¥å¤§å°åãä¸å»ç©ºãä¸å¿½ç¥å
¨åè§ |
| | | // temp = "%s"; |
| | | // } |
| | | // queryKey = String.format(temp, "t."+attrId); |
| | | // queryValue = String.format(temp, "'" + (trim ? value.trim() : value) + "'"); |
| | | // conditionMap.put(queryKey, queryValue); |
| | | // } else { |
| | | // //ä¸ºç©ºçæ¶åä¸ä»£è¡¨ä¸æ ¡éªï¼åªæ¯ä¸å»é¤ç¸å
³çä¿¡æ¯ |
| | | // conditionMap.put("t."+attrId, value); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * æ ¡éªæä¸¾çå
容 |
| | | * |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ï¼éè¦å
å«å±æ§ |
| | | * @param orderDTO ç¼ç ç³è¯·çä¿¡æ¯ |
| | | */ |
| | | private void checkEnumOnOrder(CodeClstemplateVO templateVO, CodeOrderDTO orderDTO) { |
| | | //妿æä¸¾å¯ä»¥ä¿®æ¹ï¼åä¸éè¦æ ¡éªæ¯å¦ç¬¦åæä¸¾çé项 |
| | | |
| | | Map<String, CodeClstempattrVO> enumAttrVOMap = templateVO.getAttributes().stream().filter(s -> (StringUtils.isNotBlank(s.getEnumstring()) || StringUtils.isNotBlank(s.getEnumid())) && !VciBaseUtil.getBoolean(s.getEnumeditflag())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (!CollectionUtils.isEmpty(enumAttrVOMap)) { |
| | | enumAttrVOMap.forEach((attrId, attrVO) -> { |
| | | String value = getValueFromOrderDTO(orderDTO, attrId); |
| | | if (StringUtils.isNotBlank(value)) { |
| | | //æå¼æè½æ ¡éª |
| | | List<KeyValue> comboboxKVs = listComboboxItems(attrVO); |
| | | if (!comboboxKVs.stream().anyMatch(s -> value.equalsIgnoreCase(s.getKey()))) { |
| | | throw new VciBaseException("屿§ã{0}ãçå¼ä¸ç¬¦åæä¸¾çè¦æ±", new String[]{attrVO.getName()}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è½¬æ¢æ¶é´çæ ¼å¼ |
| | | * |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ï¼éè¦å
å«å±æ§ |
| | | * @param orderDTO ç¼ç ç³è¯·çä¿¡æ¯ |
| | | */ |
| | | private void switchDateAttrOnOrder(CodeClstemplateVO templateVO, CodeOrderDTO orderDTO) { |
| | | Map<String, CodeClstempattrVO> dateAttrVOMap = templateVO.getAttributes().stream().filter(s -> StringUtils.isNotBlank(s.getCodedateformat())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (!CollectionUtils.isEmpty(dateAttrVOMap)) { |
| | | dateAttrVOMap.forEach((attrId, attrVO) -> { |
| | | String value = getValueFromOrderDTO(orderDTO, attrId); |
| | | if (StringUtils.isNotBlank(value)) { |
| | | DateConverter dateConverter = new DateConverter(); |
| | | dateConverter.setAsText(value); |
| | | value = VciDateUtil.date2Str(dateConverter.getValue(), VciDateUtil.DateTimeMillFormat); |
| | | setValueToOrderDTO(orderDTO, attrId, value); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·è´æ°æ®å°cboå¯¹è±¡ä¸ |
| | | * |
| | | * @param classifyFullInfo åç±»çå
¨é¨ä¿¡æ¯ |
| | | * @param cbo ä¸å¡æ°æ® |
| | | * @param orderDTO ç¼ç ç³è¯·çä¿¡æ¯ |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ |
| | | * @param edit æ¯å¦ä¸ºä¿®æ¹ |
| | | */ |
| | | private void copyValueToCBO(CodeClassifyFullInfoBO classifyFullInfo, CodeWupinEntity cbo, |
| | | CodeOrderDTO orderDTO, CodeClstemplateVO templateVO, |
| | | boolean edit) { |
| | | String fullPath = ""; |
| | | if (!CollectionUtils.isEmpty(classifyFullInfo.getParentClassifyVOs())) { |
| | | fullPath = classifyFullInfo.getParentClassifyVOs().stream().sorted(((o1, o2) -> o2.getDataLevel().compareTo(o1.getDataLevel()))) |
| | | .map(CodeClassifyVO::getOid).collect(Collectors.joining("##")); |
| | | } else { |
| | | fullPath = classifyFullInfo.getCurrentClassifyVO().getOid(); |
| | | } |
| | | |
| | | // BeanUtils. |
| | | BeanUtils.copyProperties(orderDTO.getData(),cbo); |
| | | cbo.setMaterialtype(Short.valueOf("1001")); |
| | | // orderDTO.getData().forEach((key, value) -> { |
| | | // if (!edit || (!checkUnAttrUnEdit(key) && |
| | | // !VciQueryWrapperForDO.LC_STATUS_FIELD.equalsIgnoreCase(key))) { |
| | | // try { |
| | | // cbo.setAttributeValue(key, value); |
| | | // } catch (Exception e) { |
| | | // logger.error("è®¾ç½®å±æ§çå¼é误", e); |
| | | // } |
| | | // } |
| | | // }); |
| | | try { |
| | | |
| | | cbo.setCodeclsfid(classifyFullInfo.getCurrentClassifyVO().getOid()); |
| | | cbo.setCodetemplateoid(templateVO.getOid()); |
| | | cbo.setCodeclsfpath(fullPath); |
| | | // cbo.setMaterialclassify("model_type"); |
| | | // cbo.setMaterialname(orderDTO.getData().get("materialname")); |
| | | // cbo.setShifoupihaoguanli("true"); |
| | | // cbo.setKucunwl("true"); |
| | | // cbo.setXiaoshouwl("false"); |
| | | if (!edit && StringUtils.isBlank(orderDTO.getLcStatus())) { |
| | | //æ¾çå½å¨æçèµ·å§ç¶æï¼æä¸ªç¹ï¼ççå½å¨ææ¯å¦éè¦å建 |
| | | if (StringUtils.isNotBlank(cbo.getLctid())) { |
| | | // OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(cbo.getLctid()); |
| | | // if (lifeCycleVO != null) { |
| | | // cbo.setLcStatus("Editing"); |
| | | //// cbo.setLcStatus(lifeCycleVO.getStartStatus()); |
| | | // } else { |
| | | cbo.setLcStatus(CodeDefaultLC.EDITING.getValue()); |
| | | // } |
| | | } else { |
| | | cbo.setLcStatus(CodeDefaultLC.EDITING.getValue()); |
| | | } |
| | | |
| | | } |
| | | |
| | | int secret = VciBaseUtil.getInt(cbo.getSecretGrade().toString()); |
| | | //æä¸ªç¹ï¼åç»çå¯çº§æå¡æ¯å¦å¯ç¨ |
| | | // if (secret == 0 || !secretService.checkDataSecret(secret)) { |
| | | if (secret == 0 ) { |
| | | Integer userSecret = VciBaseUtil.getCurrentUserSecret(); |
| | | // cbo.setAttributeValue(SECRET_FIELD, String.valueOf((userSecret == null || userSecret == 0) ? UserSecretEnum.NONE.getValue() : userSecret)); |
| | | cbo.setSecretGrade(userSecret == null || userSecret == 0 ? UserSecretEnum.NONE.getValue() : userSecret); |
| | | } |
| | | } catch (Throwable e) { |
| | | logger.error("设置é»è®¤ç屿§çå¼é误", e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åå§åä¸å¡ç±»å |
| | | * --å建人é»è®¤ä¸ºå½åç¨æ·ï¼å¦æéè¦ä¿®æ¹ï¼å¯ä»¥å¨è·ååèªè¡å¤ç |
| | | * @param btmName ä¸å¡ç±»åçåç§°ï¼ä¼èªå¨åæå°å |
| | | * @return CodeWupinEntity |
| | | * @throws VciBaseException åå§ååºéçæ¯ä¼æåºå¼å¸¸ |
| | | */ |
| | | // @Override |
| | | // public CodeWupinEntity createCBOByBtmName(String btmName) |
| | | // throws VciBaseException { |
| | | // if(btmName!=null){ |
| | | // btmName = btmName.trim().toLowerCase(); |
| | | // } |
| | | // String userid = AuthUtil.getUser().getUserName(); |
| | | //// if(!hasCreatedCbos.containsKey(btmName)){ |
| | | //// if(StringUtils.isEmpty(userid)){ |
| | | //// throw new VciBaseException(msgCodePrefix +"noHasUserid"); |
| | | //// } |
| | | //// try { |
| | | //// hasCreatedCbos.put(btmName, createBusinessObject(btmName)); |
| | | //// } catch (Exception e) { |
| | | //// logger.error("å建ä¸å¡ç±»å对象",e); |
| | | //// throw new VciBaseException(msgCodePrefix + "initBoError",new String[]{btmName}); |
| | | //// } |
| | | //// } |
| | | //// ClientBusinessObject cbo = cloneClientBusinessObject(hasCreatedCbos.get(btmName)); |
| | | // |
| | | // QueryWrapper<CodeOsbtmtypeEntity> btmWrapper = new QueryWrapper<>(); |
| | | // btmWrapper.eq("ID",btmName); |
| | | // CodeOsbtmtypeEntity btmTypeVO = codeOsbtmtypeMapper.selectOne(btmWrapper); |
| | | //// OsBtmTypeVO btmTypeVO = btmService.getBtmById(boName); |
| | | // String userName = AuthUtil.getUser().getUserName(); |
| | | // CodeWupinEntity wupinEntity = new CodeWupinEntity(); |
| | | // wupinEntity.setOid(null); |
| | | //// bo.setRevisionid((new ObjectUtility()).getNewObjectID36()); |
| | | //// bo.setNameoid((new ObjectUtility()).getNewObjectID36()); |
| | | // wupinEntity.setBtmname(btmName); |
| | | // wupinEntity.setLastR(String.valueOf(1)); |
| | | // wupinEntity.setFirstR(String.valueOf(1)); |
| | | // wupinEntity.setFirstV(String.valueOf(1)); |
| | | // wupinEntity.setLastV(String.valueOf(1)); |
| | | // wupinEntity.setCreator(userName); |
| | | // wupinEntity.setCreateTime(new Date()); |
| | | // wupinEntity.setLastModifier(userName); |
| | | // wupinEntity.setLastModifyTime(new Date()); |
| | | // wupinEntity.setRevisionRule(btmTypeVO.getRevisionruleid()); |
| | | // wupinEntity.setVersionRule(String.valueOf(btmTypeVO.getVersionRule())); |
| | | // if(StringUtils.isNotBlank(btmTypeVO.getRevisionruleid())){ |
| | | // //æä¸ªç¹ï¼éè¦é®åå¥çæ¬é®é¢ï¼å±ç¤ºé»è®¤ä¸º1 |
| | | //// OsRevisionRuleVO revisionRuleVO = revisionRuleService.getRevisionRuleById(btmTypeVO.getRevisionruleid()); |
| | | // wupinEntity.setRevisionValue("1"); |
| | | // } |
| | | // |
| | | // wupinEntity.setRevisionSeq(1); |
| | | // wupinEntity.setVersionSeq(1); |
| | | // //æä¸ªç¹ï¼éè¦é®åå¥çæ¬é®é¢ï¼å±ç¤ºé»è®¤ä¸º1 |
| | | // wupinEntity.setVersionValue("1"); |
| | | // wupinEntity.setLctid("wupinLC"); |
| | | // wupinEntity.setLcStatus("Editing"); |
| | | // wupinEntity.setId(""); |
| | | // wupinEntity.setName(""); |
| | | // wupinEntity.setDescription(""); |
| | | // wupinEntity.setOwner(userName); |
| | | // wupinEntity.setCheckinby(userName); |
| | | // wupinEntity.setCopyFromVersion(""); |
| | | // wupinEntity.setMaterialtype((short) 1001); |
| | | // wupinEntity.setCaigouwl("true"); |
| | | // wupinEntity.setShifoupihaoguanli("true"); |
| | | // wupinEntity.setKucunwl("true"); |
| | | // wupinEntity.setXiaoshouwl("false"); |
| | | // wupinEntity.setPassing("true"); |
| | | // |
| | | //// this.initTypeAttributeValue(wupinEntity,btmTypeVO); |
| | | // return wupinEntity; |
| | | // |
| | | // |
| | | //// return cbo; |
| | | // } |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºä¿®æ¹å¿½ç¥ç屿§ |
| | | * @param attrName 屿§çåå |
| | | * @return true 表示åºè¯¥å¿½ç¥ |
| | | */ |
| | | boolean checkUnAttrUnEdit(String attrName){ |
| | | return (VciQueryWrapperForDO.OID_FIELD.equalsIgnoreCase(attrName) |
| | | ||"ts".equalsIgnoreCase(attrName) |
| | | || "lastmodifier".equalsIgnoreCase(attrName) |
| | | || "lastmodifytime".equalsIgnoreCase(attrName) |
| | | || "createtime".equalsIgnoreCase(attrName) |
| | | || "checkintime".equalsIgnoreCase(attrName) |
| | | ||"checkouttime".equalsIgnoreCase(attrName)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿åå¯è¾å¯éçä¿¡æ¯ |
| | | * |
| | | * @param templateVO 模æ¿ç对象 |
| | | * @param cboList æ°æ®çå
容 |
| | | */ |
| | | // @Override |
| | | // public void batchSaveSelectChar(CodeClstemplateVO templateVO, List<ClientBusinessObject> cboList) { |
| | | // if (templateVO != null && !CollectionUtils.isEmpty(cboList)) { |
| | | // //æ¯å¼æ¥çï¼æä»¥ç´æ¥å¾ªç¯ |
| | | // List<CodeClstempattrVO> selectAttrVOs = templateVO.getAttributes().stream().filter(s -> StringUtils.isNotBlank(s.getLibraryidentification())).collect(Collectors.toList()); |
| | | // |
| | | // if (!CollectionUtils.isEmpty(selectAttrVOs)) { |
| | | //// SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | // selectAttrVOs.parallelStream().forEach(attrVO -> { |
| | | // List<String> valuesList = new CopyOnWriteArrayList<>(); |
| | | // cboList.parallelStream().forEach(cbo -> { |
| | | // String value = cbo.getAttributeValue(attrVO.getId()); |
| | | // if (StringUtils.isNotBlank(value)) { |
| | | // valuesList.add(value); |
| | | // } |
| | | // }); |
| | | // if (!CollectionUtils.isEmpty(valuesList)) { |
| | | // charService.saveBySameNamespaceAndFlag(templateVO.getBtmTypeId(), attrVO.getLibraryIdentification(), valuesList, sessionInfo); |
| | | // } |
| | | // }); |
| | | // } |
| | | // } |
| | | // } |
| | | } |