| | |
| | | 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.lifecycle.CodeAllCodeLC; |
| | | import com.vci.ubcs.code.mapper.CodeSerialValueMapper; |
| | | import com.vci.ubcs.code.service.ICodeWupinService; |
| | | import com.vci.ubcs.code.service.MdmProductCodeService; |
| | |
| | | |
| | | 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.*; |
| | |
| | | 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(); |
| | | } |
| | | } |