| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.constant.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.code.dto.CodeFixedValueDTO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyProcessTemp; |
| | | import com.vci.ubcs.code.entity.CodeFixedValue; |
| | | import com.vci.ubcs.code.mapper.CodeFixedValueMapper; |
| | | import com.vci.ubcs.code.service.ICodeFixedValueService; |
| | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_LINKED_NOT_DELETE; |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_OID_NOT_EXIST; |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.*; |
| | | |
| | | /** |
| | | * 固定码段的码值服务 |
| | |
| | | * @return success为true为可以删除,false表示有数据引用,obj为true表示有下级 |
| | | */ |
| | | private R checkIsCanDeleteForDO(CodeFixedValueDTO codeFixedValueDTO, CodeFixedValue codeFixedValueDO) { |
| | | //boService.checkTs(codeFixedValueDTO); |
| | | if (checkTs(codeFixedValueDTO)) { |
| | | return R.fail(TS_NOT_PROCESS); |
| | | } |
| | | if(!checkIsLinked(codeFixedValueDO.getOid())) { |
| | | return R.status(true); |
| | | }else{ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 检查ts |
| | | * @param tempDO |
| | | * @return |
| | | */ |
| | | private boolean checkTs(CodeFixedValueDTO tempDO){ |
| | | LambdaQueryWrapper<CodeFixedValue> wrapper = Wrappers.<CodeFixedValue>query() |
| | | .lambda().eq(CodeFixedValue::getOid,tempDO.getOid()).select(CodeFixedValue::getTs); |
| | | long dbTs = codeFixedValueMapper.selectById(wrapper).getTs().getTime(); |
| | | long currentTs = tempDO.getTs().getTime(); |
| | | if(dbTs == currentTs){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 校验是否被引用 |
| | | * @param oid 主键 |
| | | * @throws VciBaseException 被引用的时候会抛出异常 |