| | |
| | | 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.bo.TreeWrapperOptions; |
| | | import com.vci.ubcs.code.dto.CodeClassifyValueDTO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValue; |
| | | import com.vci.ubcs.code.enumpack.FrameworkDataLCStatus; |
| | |
| | | import com.vci.ubcs.code.service.ICodeBasicSecService; |
| | | import com.vci.ubcs.code.service.ICodeClassifyValueService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyValueVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.TreeQueryObject; |
| | | import com.vci.ubcs.code.wrapper.CodeClassifyValueWrapper; |
| | | import com.vci.ubcs.com.vci.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.revision.model.TreeWrapperOptions; |
| | | import com.vci.ubcs.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | 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); |
| | |
| | | * @throws VciBaseException 查询条件和分页出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) throws VciBaseException{ |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) throws VciBaseException { |
| | | if(treeQueryObject == null){ |
| | | treeQueryObject = new TreeQueryObject(); |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |