rk
2026-01-29 8a1f94cee97ff1e3ee8a885197c98872c7066e9b
功能开发
已修改3个文件
45 ■■■■■ 文件已修改
server/services/src/main/java/com/doumee/dao/business/model/Category.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/dao/business/model/Multifile.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/dao/business/model/Category.java
@@ -87,4 +87,8 @@
    @ApiModelProperty(value = "图标全路径")
    @TableField(exist = false)
    private String iconFull;
    @ApiModelProperty(value = "商业图排行信息")
    @TableField(exist = false)
    private List<Multifile> multifileList;
}
server/services/src/main/java/com/doumee/dao/business/model/Multifile.java
@@ -55,7 +55,7 @@
//    @ApiModelProperty(value = "关联对象类型 0SHE上报 1跌绊滑上报 2跌绊滑处理 3跌绊滑分配物业主管 4跌绊滑分配处理人 5DCA风险上报 6DCA风险处理 7DCA工单图片", example = "1")
//    @ExcelExportColumn(name="关联对象类型 0SHE上报 1跌绊滑上报 2跌绊滑处理 3跌绊滑分配物业主管 4跌绊滑分配处理人 5DCA风险上报 6DCA风险处理 7DCA工单图片")
    @ApiModelProperty(value = "关联对象类型 0案例图集", example = "1")
    @ApiModelProperty(value = "关联对象类型  0案例图;1商业排行图", example = "1")
    private Integer objType;
    @ApiModelProperty(value = "文件地址")
server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
@@ -11,7 +11,9 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CategoryMapper;
import com.doumee.dao.business.MultifileMapper;
import com.doumee.dao.business.model.Category;
import com.doumee.dao.business.model.Multifile;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.CategoryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -44,6 +46,9 @@
    private CategoryMapper categoryMapper;
    @Autowired
    private MultifileMapper multifileMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Override
@@ -52,7 +57,6 @@
        if(Objects.isNull(category)
        || Objects.isNull(category.getType())
        || Objects.isNull(category.getName())
        || (!Constants.equalsInteger(category.getType(),Constants.ZERO)&& CollectionUtils.isEmpty(category.getDetailList()))
        || (Constants.equalsInteger(category.getType(),Constants.ONE) && (Objects.isNull(category.getIcon())||Objects.isNull(category.getIsFixed())) )
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
@@ -63,10 +67,6 @@
        category.setCreateUser(loginUserInfo.getId());
        category.setUpdateTime(new Date());
        category.setUpdateUser(loginUserInfo.getId());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())
                && !Constants.equalsInteger(category.getType(),Constants.THREE)){
            category.setDetail(category.getDetailList().toJSONString());
        }
        if(!Constants.equalsInteger(category.getType(),Constants.ONE)){
            category.setIsFixed(Constants.ZERO);
        }
@@ -102,7 +102,6 @@
                || Objects.isNull(category.getId())
                || Objects.isNull(category.getType())
                || Objects.isNull(category.getName())
                || (!Constants.equalsInteger(category.getType(),Constants.ZERO)&& CollectionUtils.isEmpty(category.getDetailList()))
                || (Constants.equalsInteger(category.getType(),Constants.ONE) && (Objects.isNull(category.getIcon())||Objects.isNull(category.getIsFixed())) )
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
@@ -111,10 +110,6 @@
        category.setUpdateTime(new Date());
        category.setIsFixed(null);
        category.setUpdateUser(loginUserInfo.getId());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())
                && !Constants.equalsInteger(category.getType(),Constants.THREE)){
            category.setDetail(category.getDetailList().toJSONString());
        }
        categoryMapper.updateById(category);
    }
    @Override
@@ -127,9 +122,6 @@
        category.setUpdateTime(new Date());
        category.setIsFixed(null);
        category.setUpdateUser(loginUserInfo.getId());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())){
            category.setDetail(category.getDetailList().toJSONString());
        }
        categoryMapper.updateById(category);
    }
@@ -250,11 +242,26 @@
                .orderByAsc(Category::getSortnum)
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)){
            String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
                    +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode();
            String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode();
            String categoryFile = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.CATEGORY_FILES).getCode();
            for (Category category:categoryList) {
                if(StringUtils.isNotBlank(category.getIcon())){
                    category.setIconFull(path + category.getIcon());
                    category.setIconFull(path + categoryFile +  category.getIcon());
                }
                //商业化排行榜图片
                if(Constants.equalsInteger(type,Constants.ONE)){
                    List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda()
                            .eq(Multifile::getIsdeleted,Constants.ZERO)
                            .eq(Multifile::getObjType,Constants.ONE)
                            .eq(Multifile::getObjId,category.getId())
                    );
                    if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){
                        String muFile = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.MEMBER_FILES).getCode();
                        multifileList.forEach(m->{
                            m.setFileurlFull(path + muFile + m.getFileurl());
                        });
                    }
                    category.setMultifileList(multifileList);
                }
            }
        }