Commit c174d571 authored by lcl's avatar lcl

update

parent 8414a28f
...@@ -90,7 +90,7 @@ public class BusinessInfoController extends BaseController ...@@ -90,7 +90,7 @@ public class BusinessInfoController extends BaseController
/** /**
* 新增项目详情 * 新增项目详情
*/ */
// @PreAuthorize("@ss.hasPermi('system:business:add')") // @PreAuthorize("@ss.hasPermi('system:business:add')")Z
// @Log(title = "项目管理", businessType = BusinessType.INSERT) // @Log(title = "项目管理", businessType = BusinessType.INSERT)
@PostMapping("/add") @PostMapping("/add")
public AjaxResult add(@RequestBody BusinessAddDto dto) public AjaxResult add(@RequestBody BusinessAddDto dto)
......
...@@ -54,36 +54,6 @@ public class BusinessRelateCompany extends BaseEntity ...@@ -54,36 +54,6 @@ public class BusinessRelateCompany extends BaseEntity
@Excel(name = "对接深度/竞争力度") @Excel(name = "对接深度/竞争力度")
private String depth; private String depth;
/** 企业类型 */ /** 是否业主单位 0:否 1:是 */
@Excel(name = "企业类型") private Integer isProprietor;
private String companyType;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("businessId", getBusinessId())
.append("companyId", getCompanyId())
.append("companyName", getCompanyName())
.append("companyRole", getCompanyRole())
.append("responsiblePerson", getResponsiblePerson())
.append("phone", getPhone())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("depth", getDepth())
.append("companyType", getCompanyType())
.append("companyUipId", getCompanyUipId())
.toString();
}
public BusinessRelateCompany(Integer businessId, Integer companyId, String companyName, String companyRole) {
this.businessId = businessId;
this.companyId = companyId;
this.companyName = companyName;
this.companyRole = companyRole;
}
public BusinessRelateCompany(Integer businessId) {
this.businessId = businessId;
}
} }
...@@ -24,7 +24,7 @@ public class BusinessListDto { ...@@ -24,7 +24,7 @@ public class BusinessListDto {
/** /**
* 用户查看全部他人可见项目标示 * 用户查看全部他人可见项目标示
*/ */
private Integer others; private Long others;
/** /**
* 省id * 省id
......
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
/** /**
* 项目关联单位Mapper接口 * 项目关联单位Mapper接口
* *
* @author lxl * @author lxl
* @date 2023-05-17 * @date 2023-05-17
*/ */
...@@ -16,7 +16,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo ...@@ -16,7 +16,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo
{ {
/** /**
* 查询项目关联单位 * 查询项目关联单位
* *
* @param id 项目关联单位主键 * @param id 项目关联单位主键
* @return 项目关联单位 * @return 项目关联单位
*/ */
...@@ -24,7 +24,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo ...@@ -24,7 +24,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo
/** /**
* 查询项目关联单位列表 * 查询项目关联单位列表
* *
* @param businessRelateCompany 项目关联单位 * @param businessRelateCompany 项目关联单位
* @return 项目关联单位集合 * @return 项目关联单位集合
*/ */
...@@ -32,7 +32,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo ...@@ -32,7 +32,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo
/** /**
* 新增项目关联单位 * 新增项目关联单位
* *
* @param businessRelateCompany 项目关联单位 * @param businessRelateCompany 项目关联单位
* @return 结果 * @return 结果
*/ */
...@@ -40,7 +40,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo ...@@ -40,7 +40,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo
/** /**
* 修改项目关联单位 * 修改项目关联单位
* *
* @param businessRelateCompany 项目关联单位 * @param businessRelateCompany 项目关联单位
* @return 结果 * @return 结果
*/ */
...@@ -48,7 +48,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo ...@@ -48,7 +48,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo
/** /**
* 删除项目关联单位 * 删除项目关联单位
* *
* @param id 项目关联单位主键 * @param id 项目关联单位主键
* @return 结果 * @return 结果
*/ */
...@@ -56,9 +56,12 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo ...@@ -56,9 +56,12 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo
/** /**
* 批量删除项目关联单位 * 批量删除项目关联单位
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteBusinessRelateCompanyByIds(Long[] ids); public int deleteBusinessRelateCompanyByIds(Long[] ids);
BusinessRelateCompany selectByProprietor(Integer id);
} }
...@@ -63,7 +63,9 @@ public class BusinessBacklogServiceImpl implements IBusinessBacklogService { ...@@ -63,7 +63,9 @@ public class BusinessBacklogServiceImpl implements IBusinessBacklogService {
@Override @Override
@Transactional @Transactional
public int insertBusinessBacklog(BusinessBacklog businessBacklog) { public int insertBusinessBacklog(BusinessBacklog businessBacklog) {
if (businessBacklog.getDueTime().before(new Date())) throw new BaseException("到期时间必须大于当前时间"); if(ObjectUtil.isNotEmpty(businessBacklog.getDueTime())){
if (businessBacklog.getDueTime().before(new Date())) throw new BaseException("到期时间必须大于当前时间");
}
return businessBacklogMapper.insertBusinessBacklog(businessBacklog); return businessBacklogMapper.insertBusinessBacklog(businessBacklog);
} }
......
...@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.acc.openapi.client.util.CommonUtils; import com.dsk.acc.openapi.client.util.CommonUtils;
import com.dsk.common.config.RuoYiConfig; import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.constant.HttpStatus; import com.dsk.common.constant.HttpStatus;
...@@ -97,13 +98,10 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -97,13 +98,10 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
*/ */
@Override @Override
public List<BusinessListVo> selectBusinessInfoList(BusinessListDto dto) { public List<BusinessListVo> selectBusinessInfoList(BusinessListDto dto) {
if (StringUtils.isEmpty(dto.getMinAmount())) dto.setMinAmount("0");
List<BusinessListVo> othersList = new ArrayList<>(); List<BusinessListVo> othersList = new ArrayList<>();
//userId不传值,就查询全部他人可见项目+自己的 //userId不传值,就查询全部他人可见项目+自己的
if (dto.getUserId() == null) { if (dto.getUserId() == null) {
Long userId = SecurityUtils.getLoginUser().getUserId(); dto.setOthers(SecurityUtils.getUserId());
if (userId == null) throw new BaseException("请登录");
dto.setOthers(userId.intValue());
//查询他人可见项目 //查询他人可见项目
othersList = businessInfoMapper.selectBusinessInfoList(dto); othersList = businessInfoMapper.selectBusinessInfoList(dto);
} }
...@@ -234,9 +232,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -234,9 +232,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
} }
} }
BusinessRelateCompany relateCompany = dealwithCustomer(vo); int i = relateCompanyMapper.insertBusinessRelateCompany(dealwithCustomer(businessInfo));
relateCompany.setBusinessId(businessInfo.getId());
int i = relateCompanyMapper.insertBusinessRelateCompany(relateCompany);
if (i == 0) { if (i == 0) {
throw new ServiceException("业主单位信息添加失败!"); throw new ServiceException("业主单位信息添加失败!");
} }
...@@ -253,8 +249,11 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -253,8 +249,11 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
@Override @Override
@Transactional @Transactional
public int updateBusinessInfo(BusinessInfo businessInfo) { public int updateBusinessInfo(BusinessInfo businessInfo) {
if (ObjectUtil.isEmpty(businessInfo.getId())) {
throw new BaseException("项目id不能为空!");
}
//判断资金Double类型的位数 //判断资金Double类型的位数
if (businessInfo.getInvestmentAmount() != null) { if (ObjectUtil.isNotEmpty(businessInfo.getInvestmentAmount())) {
int front = CheckUtils.checkIntegerPlaces(businessInfo.getInvestmentAmount()); int front = CheckUtils.checkIntegerPlaces(businessInfo.getInvestmentAmount());
int later = CheckUtils.checkDecimalPlaces(businessInfo.getInvestmentAmount()); int later = CheckUtils.checkDecimalPlaces(businessInfo.getInvestmentAmount());
if (front > 9) throw new BaseException("500", "小数点前最多支持9位"); if (front > 9) throw new BaseException("500", "小数点前最多支持9位");
...@@ -264,13 +263,45 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -264,13 +263,45 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
if (!CheckUtils.isPhone(businessInfo.getConstructionPhone()) || !CheckUtils.isPhone(businessInfo.getSupervisorPhone())) if (!CheckUtils.isPhone(businessInfo.getConstructionPhone()) || !CheckUtils.isPhone(businessInfo.getSupervisorPhone()))
throw new BaseException("500", "请输入正确的电话号码"); throw new BaseException("500", "请输入正确的电话号码");
} }
BusinessInfo info = businessInfoMapper.selectBusinessInfoById(businessInfo.getId());
//查询企业的城投id和建设库id //查询企业的城投id和建设库id
Map map = queryUipIdOrCid(businessInfo.getConstructionUnit()); BusinessRelateCompany relateCompany = relateCompanyMapper.selectByProprietor(businessInfo.getId());
if (map.containsKey("jskEid")) { if (ObjectUtil.isNotEmpty(businessInfo.getConstructionUnit())) {
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "jskEid", null)); Map map = queryUipIdOrCid(businessInfo.getConstructionUnit());
} else { if (map.containsKey("jskEid")) {
businessInfo.setConstructionUnitUipId(MapUtils.getString(map, "uipId", null)); businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "jskEid", null));
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "companyId", null)); } else {
businessInfo.setConstructionUnitUipId(MapUtils.getString(map, "uipId", null));
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "companyId", null));
}
//相关企业
if (ObjectUtil.isEmpty(relateCompany)) {
relateCompanyMapper.insertBusinessRelateCompany(dealwithCustomer(businessInfo));
}
if(ObjectUtil.isNotEmpty(relateCompany) && !businessInfo.getConstructionUnit().equals(relateCompany.getCompanyName())){
relateCompany.setCompanyId(businessInfo.getConstructionUnitCid());
relateCompany.setCompanyUipId(businessInfo.getConstructionUnitUipId());
relateCompany.setCompanyName(businessInfo.getConstructionUnit());
relateCompanyMapper.updateBusinessRelateCompany(relateCompany);
}
// //客户信息
// if(ObjectUtil.isNotEmpty(info.getCustomerId())){
// CustomerVo customerVo = customerService.info(info.getCustomerId());
// customerVo
// customerService.edit(customerVo);
// }else {
// Customer customer = new Customer();
// customer.setCompanyName()
// customerService.add()
// }
}
if (ObjectUtil.isNotEmpty(relateCompany)&&
(ObjectUtil.isNotEmpty(businessInfo.getConstructionPhone())
||ObjectUtil.isNotEmpty(businessInfo.getConstructionPrincipal()))) {
relateCompany.setPhone(businessInfo.getConstructionPhone());
relateCompany.setResponsiblePerson(businessInfo.getConstructionPrincipal());
relateCompanyMapper.updateBusinessRelateCompany(relateCompany);
} }
return businessInfoMapper.updateBusinessInfo(businessInfo); return businessInfoMapper.updateBusinessInfo(businessInfo);
} }
...@@ -364,14 +395,17 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -364,14 +395,17 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
} }
private BusinessRelateCompany dealwithCustomer(Customer bean) { private BusinessRelateCompany dealwithCustomer(BusinessInfo bean) {
BusinessRelateCompany relateCompany = new BusinessRelateCompany(); BusinessRelateCompany relateCompany = new BusinessRelateCompany();
relateCompany.setCompanyId(bean.getCompanyId()); relateCompany.setBusinessId(bean.getId());
relateCompany.setCompanyUipId(bean.getUipId()); relateCompany.setCompanyId(bean.getConstructionUnitCid());
relateCompany.setCompanyName(bean.getCompanyName()); relateCompany.setCompanyUipId(bean.getConstructionUnitUipId());
relateCompany.setCompanyRole("业主"); relateCompany.setCompanyName(bean.getConstructionUnit());
relateCompany.setResponsiblePerson(bean.getLegalPerson()); relateCompany.setPhone(bean.getConstructionPhone());
relateCompany.setCompanyType("业主单位"); relateCompany.setCompanyRole("招采单位");
relateCompany.setResponsiblePerson(bean.getConstructionPrincipal());
relateCompany.setIsProprietor(1);
relateCompany.setRemark("业主单位");
return relateCompany; return relateCompany;
} }
} }
package com.dsk.system.service.impl; package com.dsk.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.core.domain.entity.BusinessRelateCompany; import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils;
import com.dsk.common.utils.DateUtils; import com.dsk.common.utils.DateUtils;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.mapper.BusinessRelateCompanyMapper; import com.dsk.system.mapper.BusinessRelateCompanyMapper;
...@@ -87,7 +90,9 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -87,7 +90,9 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
@Transactional @Transactional
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany)
{ {
// if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的电话号码"); if(ObjectUtil.isNotEmpty(businessRelateCompany.getPhone())){
if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的电话号码");
}
businessRelateCompany.setUpdateTime(DateUtils.getNowDate()); businessRelateCompany.setUpdateTime(DateUtils.getNowDate());
//查询企业的城投id和建设库id //查询企业的城投id和建设库id
Map map = businessInfoService.queryUipIdOrCid(businessRelateCompany.getCompanyName()); Map map = businessInfoService.queryUipIdOrCid(businessRelateCompany.getCompanyName());
......
...@@ -100,10 +100,10 @@ ...@@ -100,10 +100,10 @@
u.nick_name nickName, u.nick_name nickName,
GROUP_CONCAT(DISTINCT l.label) label GROUP_CONCAT(DISTINCT l.label) label
FROM business_info i FROM business_info i
LEFT JOIN business_user bu on bu.business_id = i.id
LEFT JOIN business_follow_record f on f.business_id = i.id LEFT JOIN business_follow_record f on f.business_id = i.id
LEFT JOIN business_label l on l.business_id = i.id LEFT JOIN business_label l on l.business_id = i.id
LEFT JOIN business_user bu on bu.business_id = i.id LEFT JOIN sys_user u on u.user_id = bu.user_id
LEFT JOIN sys_user u on u.user_id = f.user_id
<where> <where>
<if test="userId != null"> <if test="userId != null">
and bu.user_id = #{userId} and bu.user_id = #{userId}
...@@ -114,20 +114,8 @@ ...@@ -114,20 +114,8 @@
#{projectType} #{projectType}
</foreach> </foreach>
</if> </if>
<if test="minAmount != null and minAmount != '' and minAmount != '0' and maxAmount != minAmount"> <if test="minAmount != null and minAmount != ''"> and i.investment_amount &gt;= #{minAmount} </if>
and i.investment_amount &gt; #{minAmount} <if test="maxAmount != null and maxAmount != ''"> and i.investment_amount &lt;= #{maxAmount}</if>
</if>
<if test="minAmount == '0' and maxAmount != minAmount">
and ((i.investment_amount &gt; #{minAmount}
and i.investment_amount &lt;= #{maxAmount})
or i.investment_amount is null)
</if>
<if test="maxAmount != null and maxAmount != '' and maxAmount != minAmount and minAmount != '0'">
and i.investment_amount &lt;= #{maxAmount}
</if>
<if test="minAmount != null and minAmount != '' and maxAmount != null and maxAmount != '' and maxAmount == minAmount">
and i.investment_amount = #{minAmount}
</if>
<if test="projectStage != null and projectStage != ''"> <if test="projectStage != null and projectStage != ''">
and i.project_stage in and i.project_stage in
<foreach collection="projectStage" item="projectStage" open="(" separator="," close=")"> <foreach collection="projectStage" item="projectStage" open="(" separator="," close=")">
......
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
<result property="companyRole" column="company_role"/> <result property="companyRole" column="company_role"/>
<result property="responsiblePerson" column="responsible_person"/> <result property="responsiblePerson" column="responsible_person"/>
<result property="phone" column="phone"/> <result property="phone" column="phone"/>
<result property="isProprietor" column="is_proprietor"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="depth" column="depth"/> <result property="depth" column="depth"/>
<result property="companyType" column="company_type"/>
<result property="companyUipId" column="company_uip_id"/> <result property="companyUipId" column="company_uip_id"/>
</resultMap> </resultMap>
...@@ -28,9 +29,10 @@ ...@@ -28,9 +29,10 @@
responsible_person, responsible_person,
phone, phone,
depth, depth,
is_proprietor,
remark,
create_time, create_time,
update_time, update_time,
company_type,
company_uip_id company_uip_id
from business_relate_company from business_relate_company
</sql> </sql>
...@@ -50,7 +52,6 @@ ...@@ -50,7 +52,6 @@
#{responsiblePerson} #{responsiblePerson}
</if> </if>
<if test="phone != null and phone != ''">and phone = #{phone}</if> <if test="phone != null and phone != ''">and phone = #{phone}</if>
<if test="companyType != null and companyType != ''">and company_type = #{companyType}</if>
</where> </where>
</select> </select>
...@@ -70,7 +71,8 @@ ...@@ -70,7 +71,8 @@
<if test="companyRole != null">company_role,</if> <if test="companyRole != null">company_role,</if>
<if test="responsiblePerson != null">responsible_person,</if> <if test="responsiblePerson != null">responsible_person,</if>
<if test="phone != null">phone,</if> <if test="phone != null">phone,</if>
<if test="companyType != null">company_type,</if> <if test="isProprietor != null">is_proprietor,</if>
<if test="remark != null and remark != '' ">remark,</if>
<if test="companyUipId != null">company_uip_id,</if> <if test="companyUipId != null">company_uip_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -81,26 +83,24 @@ ...@@ -81,26 +83,24 @@
<if test="companyRole != null">#{companyRole},</if> <if test="companyRole != null">#{companyRole},</if>
<if test="responsiblePerson != null">#{responsiblePerson},</if> <if test="responsiblePerson != null">#{responsiblePerson},</if>
<if test="phone != null">#{phone},</if> <if test="phone != null">#{phone},</if>
<if test="companyType != null">#{companyType},</if> <if test="isProprietor != null">#{isProprietor},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="companyUipId != null">#{companyUipId},</if> <if test="companyUipId != null">#{companyUipId},</if>
</trim> </trim>
</insert> </insert>
<update id="updateBusinessRelateCompany" parameterType="com.dsk.common.core.domain.entity.BusinessRelateCompany"> <update id="updateBusinessRelateCompany" parameterType="com.dsk.common.core.domain.entity.BusinessRelateCompany">
update business_relate_company update business_relate_company
<trim prefix="SET" suffixOverrides=","> <set>
<if test="businessId != null">business_id = #{businessId},</if> <if test="companyId != null">company_id = #{companyId},</if>
company_id = #{companyId}, <if test="companyUipId != null">company_uip_id = #{companyUipId},</if>
company_uip_id = #{companyUipId},
<if test="companyName != null">company_name = #{companyName},</if> <if test="companyName != null">company_name = #{companyName},</if>
<if test="depth != null">depth = #{depth},</if> <if test="depth != null">depth = #{depth},</if>
<if test="companyRole != null">company_role = #{companyRole},</if> <if test="companyRole != null">company_role = #{companyRole},</if>
<if test="responsiblePerson != null">responsible_person = #{responsiblePerson},</if> <if test="responsiblePerson != null">responsible_person = #{responsiblePerson},</if>
<if test="phone != null">phone = #{phone},</if> <if test="phone != null">phone = #{phone},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> </set>
<if test="companyType != null">company_type = #{companyType},</if>
</trim>
where id = #{id} where id = #{id}
</update> </update>
...@@ -116,4 +116,9 @@ ...@@ -116,4 +116,9 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectByProprietor" resultType="com.dsk.common.core.domain.entity.BusinessRelateCompany">
<include refid="selectBusinessRelateCompanyVo"/>
where business_id = #{businessId} and is_proprietor = 1
</select>
</mapper> </mapper>
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