lyh
2025-01-16 700ac5685214d37f128b3ad3dfda59e80381b9f6
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocInfoServiceImpl.java
@@ -11,6 +11,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.FileUploadResult;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.dnc.exception.ExceptionCast;
import org.jeecg.modules.dnc.mapper.DocInfoMapper;
@@ -24,6 +25,7 @@
import org.jeecg.modules.dnc.entity.*;
import org.jeecg.modules.dnc.response.*;
import org.jeecg.modules.system.service.ISysDictService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@@ -349,11 +351,10 @@
        if(file == null || file.isEmpty() || !ValidateUtil.validateString(id))
            ExceptionCast.cast(CommonCode.INVALID_PARAM);
        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String userId = user.getId();
        if(!ValidateUtil.validateString(userId))
        if(!ValidateUtil.validateString(user.getUsername()))
            ExceptionCast.cast(UcenterCode.UCENTER_ACCOUNT_NOT_EXIST);
        FileOperate operate = fileOperateService.getByDocId(id);
        if(operate == null || !userId.equals(operate.getCreateUser()))
        if(operate == null || !user.getUsername().equals(operate.getCreateBy()))
            ExceptionCast.cast(DocumentCode.DOC_OPERATE_PUSH_FAIL);
        DocInfo en = super.getById(id);
        if(en == null)
@@ -525,11 +526,10 @@
        if(!ValidateUtil.validateString(id))
            ExceptionCast.cast(CommonCode.INVALID_PARAM);
        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String userId = user.getId();
        if(!ValidateUtil.validateString(userId))
        if(!ValidateUtil.validateString(user.getUsername()))
            ExceptionCast.cast(UcenterCode.UCENTER_ACCOUNT_NOT_EXIST);
        FileOperate operate = fileOperateService.getByDocId(id);
        if(operate == null || !userId.equals(operate.getCreateUser()))
        if(operate == null || !user.getUsername().equals(operate.getCreateBy()))
            ExceptionCast.cast(DocumentCode.DOC_CANCEL_PULL_ERROR);
        DocInfo en = super.getById(id);
        if(en == null)
@@ -547,7 +547,7 @@
    }
    @Override
    public QueryPageResponseResult<DocInfo> findPageList(int page, int size, DocInfoQueryRequest docQuery) {
    public Result<?> findPageList(int page, int size, DocInfoQueryRequest docQuery) {
        if(page < 1 || size < 1) {
            ExceptionCast.cast(CommonCode.INVALID_PAGE);
        }
@@ -589,7 +589,7 @@
//            ((Page<DocInfo>) pageData).setDesc(descStr);
        }
        IPage<DocInfo> docInfoIPage = super.getBaseMapper().findDocExtList(pageData, queryWrapper);
        return new QueryPageResponseResult<>(CommonCode.SUCCESS, docInfoIPage);
        return Result.ok(docInfoIPage);
    }
    @Override