| | |
| | | import com.vci.ubcs.code.enumpack.CodeGetValueTypeEnum; |
| | | 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.lifecycle.CodeAllCodeLC; |
| | | import com.vci.ubcs.code.mapper.CodeSerialValueMapper; |
| | | import com.vci.ubcs.code.service.ICodeWupinService; |
| | | import com.vci.ubcs.code.service.MdmProductCodeService; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.ubcs.starter.web.constant.RegExpConstant; |
| | | import com.vci.ubcs.starter.web.enumpck.OsCodeFillTypeEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciDateUtil; |
| | | 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.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.*; |
| | |
| | | private ICodeWupinService iCodeWupinService; |
| | | |
| | | @Override |
| | | public List<String> productCodeAndSaveData(CodeClassifyFullInfoBO classifyFullInfoBO, CodeClstemplateVO templateVO, CodeRuleVO ruleVO, List<CodeOrderSecDTO> secDTOList, List<CodeWupinEntity> dataCBOList) { |
| | | public List<String> productCodeAndSaveData(CodeClassifyFullInfoBO classifyFullInfoBO, CodeClassifyTemplateVO templateVO, CodeRuleVO ruleVO, List<CodeOrderSecDTO> secDTOList, List<CodeWupinEntity> dataCBOList) { |
| | | // BatchCBO batchCBO = new BatchCBO(); |
| | | // WebUtil.setPersistence(false); |
| | | // dataCBOList = dataCBOList.stream().sorted(((o1, o2) -> o1.getCreateTime().compareTo(o2.getCreateTime()))).collect(Collectors.toList()); |
| | |
| | | * @param allCodeDOList 所有的码值的对象列表 |
| | | */ |
| | | private void wrapperAllCode(CodeClassifyFullInfoBO classifyFullInfoBO,CodeRuleVO ruleVO, |
| | | CodeWupinEntity cbo,CodeClstemplateVO templateVO, |
| | | CodeWupinEntity cbo,CodeClassifyTemplateVO templateVO, |
| | | List<CodeAllCode> allCodeDOList,String serialUnitString,String serialValueString){ |
| | | CodeAllCode allCodeDO = new CodeAllCode(); |
| | | allCodeDO.setCodeClassifyOid(classifyFullInfoBO.getCurrentClassifyVO().getOid()); |
| | |
| | | return value; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 回收码值 |
| | | * |
| | | * @param btmId 业务数据的业务类型 |
| | | * @param businessOidCollection 业务数据的主键 |
| | | * @return 是否更新成功 |
| | | */ |
| | | @Override |
| | | public Boolean recycleCode(String btmId, Collection<String> businessOidCollection) { |
| | | // boolean oldPersistence = WebUtil.isPersistence(); |
| | | // WebUtil.setPersistence(false); |
| | | // BatchCBO batchCBO = new BatchCBO(); |
| | | AtomicReference<Boolean> updateFlag = new AtomicReference<>(false); |
| | | VciBaseUtil.switchCollectionForOracleIn(businessOidCollection).stream().forEach(oids-> { |
| | | // Map<String, String> conditionMap = new HashMap<>(); |
| | | // //编码要记录为回收的状态 |
| | | // conditionMap.put("createcodeoid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | // conditionMap.put("createcodebtm", btmId); |
| | | |
| | | QueryWrapper<CodeAllCode> wrapper = new QueryWrapper<>(); |
| | | wrapper.in("createcodeoid",QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | wrapper.eq("createcodebtm", btmId); |
| | | |
| | | |
| | | List<CodeAllCode> allCodeDOS = codeAllCodeService.selectByWrapper(wrapper); |
| | | // allCodeMapper.selectByCondition(conditionMap, new PageHelper(-1)); |
| | | if (!CollectionUtils.isEmpty(allCodeDOS)) { |
| | | allCodeDOS.stream().forEach(codeDO->{ |
| | | codeDO.setLcStatus(CodeAllCodeLC.TASK_BACK.getValue()); |
| | | }); |
| | | updateFlag.set(codeAllCodeService.updateBatchById(allCodeDOS)); |
| | | // batchCBO.copyFromOther(allCodeMapper.batchUpdate(allCodeDOS)); |
| | | } |
| | | }); |
| | | // WebUtil.setPersistence(oldPersistence); |
| | | return updateFlag.get(); |
| | | } |
| | | } |