| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.LC_STATUS; |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_CASCADE_LINKED_NOT_DELETE; |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_OID_NOT_EXIST; |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.*; |
| | | |
| | | @Service |
| | | public class CodeClassifyValueServiceImpl extends ServiceImpl<CodeClassifyValueMapper, CodeClassifyValue> implements ICodeClassifyValueService { |
| | |
| | | * @return success为true为可以删除,false表示有数据引用,obj为true表示有下级 |
| | | */ |
| | | private R checkIsCanDeleteForDO(CodeClassifyValueDTO codeClassifyValueDTO, CodeClassifyValue codeClassifyValueDO) { |
| | | //boService.checkTs(codeClassifyValueDTO); |
| | | if (!checkTs(codeClassifyValueDTO)) { |
| | | return R.fail(TS_NOT_PROCESS); |
| | | } |
| | | //校验下级是否有引用 |
| | | if(checkChildIsLinked(codeClassifyValueDO.getOid())){ |
| | | return R.fail(DATA_CASCADE_LINKED_NOT_DELETE); |
| | |
| | | return codeClassifyValueMapper.selectList(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 检查ts |
| | | * @param tempDO |
| | | * @return |
| | | */ |
| | | private boolean checkTs(CodeClassifyValueDTO tempDO){ |
| | | LambdaQueryWrapper<CodeClassifyValue> wrapper = Wrappers.<CodeClassifyValue>query() |
| | | .lambda().eq(CodeClassifyValue::getOid,tempDO.getOid()).select(CodeClassifyValue::getTs); |
| | | long dbTs = codeClassifyValueMapper.selectById(wrapper).getTs().getTime(); |
| | | long currentTs = tempDO.getTs().getTime(); |
| | | if(dbTs == currentTs){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |