jiangping
2023-09-18 74d80f67e70666dbd38b1f0b5e4c0c7772fa5b8c
server/service/src/main/java/com/doumee/service/business/impl/WebParamServiceImpl.java
@@ -1,8 +1,10 @@
package com.doumee.service.business.impl;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.WebParamMapper;
import com.doumee.dao.business.model.WebParam;
@@ -33,13 +35,21 @@
    @Autowired
    private WebParamMapper webParamMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Override
    public WebParam findOne() {
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        QueryWrapper<WebParam> wrapper = new QueryWrapper<>();
        wrapper.eq("COMPANY_ID",user.getCompanyId());
        wrapper.last(" limit 1  ");
        return webParamMapper.selectOne(wrapper);
        WebParam webParam = webParamMapper.selectOne(wrapper);
        if(!Objects.isNull(webParam)){
            webParam.setResourcePath(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() +
                    systemDictDataBiz.queryByCode(Constants.OSS,Constants.WEB_PARAM).getCode());
        }
        return webParam;
    }
@@ -54,6 +64,7 @@
            webParam = new WebParam();
            BeanUtils.copyProperties(updateWebParamDTO,webParam);
            webParam.setCreateTime(new Date());
            webParam.setDeleted(Constants.ZERO);
            webParam.setCompanyId(user.getCompanyId());
            webParam.setCreateUser(user.getId());
            webParamMapper.insert(webParam);