Commit 252a220c authored by huangjie's avatar huangjie
parents 819348b5 7f448876
...@@ -88,10 +88,12 @@ public class BusinessFileController extends BaseController { ...@@ -88,10 +88,12 @@ public class BusinessFileController extends BaseController {
//校验是否上传同名文件 //校验是否上传同名文件
File newFile = new File(filePath); File newFile = new File(filePath);
// 获取当前目录下的文件和文件夹 if (newFile.exists()) {
File[] files = newFile.listFiles(); // 获取当前目录下的文件和文件夹
for (File allFile : files) { File[] files = newFile.listFiles();
if(filename.equals(allFile.getName())) return error("文件已存在"); for (File allFile : files) {
if (filename.equals(allFile.getName())) return error("文件已存在");
}
} }
// 上传并返回文件全路径 // 上传并返回文件全路径
......
...@@ -15,6 +15,11 @@ public class BusinessIdDto { ...@@ -15,6 +15,11 @@ public class BusinessIdDto {
*/ */
private Integer businessId; private Integer businessId;
/**
* 项目标签id
*/
private Integer labelId;
/** /**
* 项目标签名称 * 项目标签名称
*/ */
......
...@@ -2,8 +2,6 @@ package com.dsk.system.domain.vo; ...@@ -2,8 +2,6 @@ package com.dsk.system.domain.vo;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author lxl * @author lxl
* @Description: * @Description:
...@@ -90,7 +88,7 @@ public class BusinessBrowseVo { ...@@ -90,7 +88,7 @@ public class BusinessBrowseVo {
/** /**
* 项目标签 * 项目标签
*/ */
private List<String> labelList; private String labelList;
/** 建设单位 */ /** 建设单位 */
private String constructionUnit; private String constructionUnit;
......
package com.dsk.system.domain.vo;
import lombok.Data;
/**
* @author lxl
* @Description:
* @Date 2023/6/27 下午 2:51
**/
@Data
public class BusinessLabelVo {
//主键
private Integer id;
//标签
private String label;
}
...@@ -3,6 +3,7 @@ package com.dsk.system.service.impl; ...@@ -3,6 +3,7 @@ package com.dsk.system.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONObject;
import com.dsk.common.config.RuoYiConfig; import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.constant.HttpStatus; import com.dsk.common.constant.HttpStatus;
import com.dsk.common.core.domain.AjaxResult; import com.dsk.common.core.domain.AjaxResult;
...@@ -21,10 +22,10 @@ import com.dsk.system.domain.BusinessListDto; ...@@ -21,10 +22,10 @@ import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto; import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import com.dsk.system.domain.customer.vo.CustomerBusinessListVo; import com.dsk.system.domain.customer.vo.CustomerBusinessListVo;
import com.dsk.system.domain.vo.BusinessBrowseVo; import com.dsk.system.domain.vo.BusinessBrowseVo;
import com.dsk.system.domain.vo.BusinessLabelVo;
import com.dsk.system.domain.vo.BusinessListVo; import com.dsk.system.domain.vo.BusinessListVo;
import com.dsk.system.mapper.BusinessInfoMapper; import com.dsk.system.mapper.BusinessInfoMapper;
import com.dsk.system.mapper.BusinessLabelMapper; import com.dsk.system.mapper.BusinessLabelMapper;
import com.dsk.system.mapper.BusinessRelateCompanyMapper;
import com.dsk.system.mapper.BusinessUserMapper; import com.dsk.system.mapper.BusinessUserMapper;
import com.dsk.system.service.IBusinessInfoService; import com.dsk.system.service.IBusinessInfoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -36,7 +37,6 @@ import javax.annotation.Resource; ...@@ -36,7 +37,6 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 项目详情Service业务层处理 * 项目详情Service业务层处理
...@@ -52,8 +52,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -52,8 +52,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
@Resource @Resource
private BusinessUserMapper businessUserMapper; private BusinessUserMapper businessUserMapper;
@Resource @Resource
private BusinessRelateCompanyMapper businessRelateCompanyMapper;
@Resource
private BusinessLabelMapper businessLabelMapper; private BusinessLabelMapper businessLabelMapper;
@Resource @Resource
private ReadBusinessInfoExcel readBusinessInfoExcel; private ReadBusinessInfoExcel readBusinessInfoExcel;
...@@ -108,12 +106,14 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -108,12 +106,14 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
//商务团队 //商务团队
businessBrowseVo.setTeam(businessUserMapper.selectCreatorByBusinessId(businessId)); businessBrowseVo.setTeam(businessUserMapper.selectCreatorByBusinessId(businessId));
//查询是否是项目创建人 //查询是否是项目创建人
Long userId = SecurityUtils.getLoginUser().getUserId(); // Long userId = SecurityUtils.getLoginUser().getUserId();
if (userId == null) throw new BaseException("请登录"); // if (userId == null) throw new BaseException("请登录");
Long userId = 103l;
Integer founder = businessUserMapper.selectFounder(businessId, userId); Integer founder = businessUserMapper.selectFounder(businessId, userId);
businessBrowseVo.setIsFounder(founder == null ? 0 : founder); businessBrowseVo.setIsFounder(founder == null ? 0 : founder);
//查询项目标签 //查询项目标签
businessBrowseVo.setLabelList(businessLabelMapper.selectBusinessLabelList(new BusinessLabel(businessId)).stream().map(p -> p.getLabel()).collect(Collectors.toList())); List<BusinessLabel> labels = businessLabelMapper.selectBusinessLabelList(new BusinessLabel(businessId));
businessBrowseVo.setLabelList(JSONObject.toJSONString(BeanUtil.copyToList(labels, BusinessLabelVo.class)));
//相关数据统计 //相关数据统计
BusinessBrowseVo total = businessInfoMapper.selectTotal(businessId); BusinessBrowseVo total = businessInfoMapper.selectTotal(businessId);
businessBrowseVo.setBacklogCount(total.getBacklogCount()); businessBrowseVo.setBacklogCount(total.getBacklogCount());
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<delete id="deleteBusinessLabelById"> <delete id="deleteBusinessLabelById">
delete delete
from business_label from business_label
where business_id = #{businessId} and label = #{label} where id = #{labelId}
</delete> </delete>
<delete id="deleteBusinessLabelByIds" parameterType="String"> <delete id="deleteBusinessLabelByIds" parameterType="String">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment