Commit 97abc1f1 authored by danfuman's avatar danfuman

Merge branch 'dev20230707' of http://192.168.60.201/root/dsk-operate-sys into dev20230707

parents 9ccf7c3a 58f49330
......@@ -28,7 +28,7 @@ public class ContactInfoController extends BaseController {
/**
* 联系人列表
*/
// @PreAuthorize("@ss.hasPermi('contact:list')")
// @PreAuthorize("@ss.hasPermi('contact:info:list')")
@GetMapping("/list")
public TableDataInfo selectPageList(ContactInfoSearchDto dto){
startPage();
......@@ -47,7 +47,7 @@ public class ContactInfoController extends BaseController {
/**
* 添加用户联系人
*/
// @PreAuthorize("@ss.hasPermi('contact:add')")
// @PreAuthorize("@ss.hasPermi('contact:info:add')")
@PostMapping()
@RepeatSubmit()
public AjaxResult add(@RequestBody ContactInfo baen){
......@@ -57,7 +57,7 @@ public class ContactInfoController extends BaseController {
/**
* 编辑用户联系人
*/
// @PreAuthorize("@ss.hasPermi('contact:edit')")
// @PreAuthorize("@ss.hasPermi('contact:info:edit')")
@PutMapping()
@RepeatSubmit()
public AjaxResult edit(@RequestBody ContactInfo baen){
......@@ -67,7 +67,7 @@ public class ContactInfoController extends BaseController {
/**
* 删除用户联系人
*/
// @PreAuthorize("@ss.hasPermi('contact:del')")
// @PreAuthorize("@ss.hasPermi('contact:info:del')")
@DeleteMapping("/{id}")
@RepeatSubmit()
public AjaxResult del(@PathVariable("id") Long id){
......
......@@ -65,7 +65,8 @@ export function removeLabel(param) {
//查询项目联系人
export function getLXR(param) {
return request({
url: '/business/contacts/list',
// url: '/business/contacts/list',
url: '/contact/info/list',
method: 'GET',
params:param
})
......@@ -73,8 +74,9 @@ export function getLXR(param) {
//修改项目联系人
export function editLXR(param) {
return request({
url: '/business/contacts/edit',
method: 'POST',
// url: '/business/contacts/edit',
url: '/contact/info',
method: 'PUT',
data:param
})
}
......@@ -82,12 +84,21 @@ export function editLXR(param) {
//新增项目联系人
export function addLXR(param) {
return request({
url: '/business/contacts/add',
// url: '/business/contacts/add',
url: '/contact/info',
method: 'POST',
data:param
})
}
//删除项目联系人
export function delLXR(param) {
return request({
url: '/contact/info/'+param,
method: 'DELETE',
})
}
//跟进记录
export function getGJJL(param) {
return request({
......
......@@ -11,7 +11,7 @@
<div class="flex-box avatar-wrapper">
<img v-if="avatar" class="pic-avatar" :src="avatar">
<span v-else class="user-avatar">{{ name&&name.slice(0, 1).toUpperCase() }}</span>
{{ name }}
{{ name.length>10?name.slice(0, 10)+'...':name}}
</div>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
<router-link to="/user/profile">
......
......@@ -384,14 +384,14 @@ export default {
}
}
.alltags{
position: absolute;
position: fixed;
align-items: center;
border-radius: 9px;
height: 17px;
justify-content: center;
width: 36px;
right: -130px;
bottom: 0px;
right: 10px;
top: 37px;
cursor: pointer;
text-align: center;
&:hover{
......
......@@ -117,7 +117,7 @@
<!--建设内容-->
<jsnr v-if="thistag == 'jsnr'" :key="keys1" :isDisabled='isDisabled' @Refrehmoney="getXMSL" :detailId="detailId"></jsnr>
<!--联系人-->
<lxr v-if="thistag == 'lxr'" :isDisabled='isDisabled' :detailId="detailId"></lxr>
<lxr v-if="thistag == 'lxr'" :isDisabled='isDisabled' :detailId="detailId" listtype="project"></lxr>
<!--跟进记录-->
<gjjl v-if="thistag == 'gjjl'" :isDisabled='isDisabled' types="gjjl" :detailId="detailId"></gjjl>
<!--工作待办-->
......
......@@ -100,11 +100,4 @@ public interface IBusinessInfoService
List<CustomerBusinessListVo> selectCustomerBusinessList(CustomerBusinessSearchDto dto);
/**
* 查询企业的城投id和建设库id
* @param companyName
* @return
*/
Map queryUipIdOrCid (String companyName);
}
......@@ -26,6 +26,7 @@ import com.dsk.system.domain.customer.vo.CustomerVo;
import com.dsk.system.domain.business.vo.BusinessBrowseVo;
import com.dsk.system.domain.business.vo.BusinessLabelVo;
import com.dsk.system.domain.business.vo.BusinessListVo;
import com.dsk.system.dskService.EnterpriseService;
import com.dsk.system.mapper.BusinessInfoMapper;
import com.dsk.system.mapper.BusinessLabelMapper;
import com.dsk.system.mapper.BusinessRelateCompanyMapper;
......@@ -66,6 +67,8 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
private DskOpenApiUtil dskOpenApiUtil;
@Autowired
private ICustomerService customerService;
@Autowired
private EnterpriseService enterpriseService;
/**
......@@ -98,8 +101,8 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
List<BusinessListVo> businessListVos = businessInfoMapper.selectBusinessInfoList(dto);
if (!CollectionUtils.isEmpty(businessListVos) && ObjectUtil.isNotEmpty(dto.getProjectName())) {
for (BusinessListVo vo : businessListVos) {
vo.setProjectName(StringUtils.markInRed(vo.getProjectName(),dto.getProjectName()));
vo.setOwnerCompany(StringUtils.markInRed(vo.getOwnerCompany(),dto.getProjectName()));
vo.setProjectName(StringUtils.markInRed(vo.getProjectName(), dto.getProjectName()));
vo.setOwnerCompany(StringUtils.markInRed(vo.getOwnerCompany(), dto.getProjectName()));
}
}
return businessListVos;
......@@ -144,7 +147,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
if (!CollectionUtils.isEmpty(list)) {
for (Map<String, Object> map : list) {
BusinessLikeProjectNameListVo vo = new BusinessLikeProjectNameListVo();
vo.setProjectName(StringUtils.markInRed(MapUtil.getStr(map, "projectName"),dto.getProjectName()));
vo.setProjectName(StringUtils.markInRed(MapUtil.getStr(map, "projectName"), dto.getProjectName()));
vo.setCompanyName(MapUtil.getStr(map, "tenderee"));
vo.setInvestmentAmount(Double.parseDouble(MapUtil.getStr(map, "projectContractAmount")));
vo.setProjectType(MapUtil.getStr(map, "projectType"));
......@@ -288,17 +291,12 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
if (!CheckUtils.isPhone(businessInfo.getConstructionPhone()) || !CheckUtils.isPhone(businessInfo.getSupervisorPhone()))
throw new BaseException("500", "请输入正确的电话号码");
}
// BusinessInfo info = businessInfoMapper.selectBusinessInfoById(businessInfo.getId());
//查询企业的城投id和建设库id
BusinessRelateCompany relateCompany = relateCompanyMapper.selectByProprietor(businessInfo.getId());
if (ObjectUtil.isNotEmpty(businessInfo.getConstructionUnit())) {
Map map = queryUipIdOrCid(businessInfo.getConstructionUnit());
if (map.containsKey("jskEid")) {
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "jskEid", null));
} else {
businessInfo.setConstructionUnitUipId(MapUtils.getString(map, "uipId", null));
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "companyId", null));
}
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessInfo.getConstructionUnit());
businessInfo.setConstructionUnitUipId(MapUtils.getString(map, "uipId"));
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "companyId"));
//相关企业
if (ObjectUtil.isEmpty(relateCompany)) {
relateCompanyMapper.insertBusinessRelateCompany(dealwithCustomer(businessInfo));
......@@ -309,16 +307,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
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) &&
......@@ -382,43 +370,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
return businessInfoMapper.selectCustomerBusinessList(dto);
}
@Override
public Map queryUipIdOrCid(String companyName) {
Map<Object, Object> map = MapUtil.builder().build();
if (StringUtils.isEmpty(companyName)) return map;
//查询城投企业
Map<String, Object> paramMap = MapUtil.<String, Object>builder().put("companyName", companyName).build();
Map<String, Object> resultMap = dskOpenApiUtil.requestBody("/urbanInvestment/detailsByCompanyName", paramMap);
Integer code = MapUtils.getInteger(resultMap, "code", 300);
if (code == HttpStatus.SUCCESS) {
Map data = MapUtils.getMap(resultMap, "data", null);
if (data != null) {
map.put("uipId", MapUtils.getString(data, "uipId", null));
map.put("companyId", MapUtils.getInteger(data, "companyId", null));
}
}
if (MapUtil.isEmpty(map)) {
//查村建设库企业
Map<String, Object> jskParamMap = MapUtil.<String, Object>builder()
.put("keyword", companyName)
.put("page", MapUtil.<String, Object>builder().put("page", 1).put("limit", 10).build())
.build();
Map<String, Object> jskResultMap = dskOpenApiUtil.requestBody("/enterprise/index", jskParamMap);
if (MapUtils.getInteger(resultMap, "code", 300).equals(HttpStatus.SUCCESS)) {
Map data = MapUtils.getMap(jskResultMap, "data", null);
if (data != null) {
List<Object> list = CommonUtils.assertAsArray(MapUtils.getObject(data, "list", ""));
if (CollectionUtil.isNotEmpty(list)) {
for (Object obj : list) {
map.put("jskEid", MapUtils.getInteger(BeanUtil.beanToMap(obj, false, false), "jskEid", null));
}
}
}
}
}
return map;
}
private BusinessRelateCompany dealwithCustomer(BusinessInfo bean) {
BusinessRelateCompany relateCompany = new BusinessRelateCompany();
relateCompany.setBusinessId(bean.getId());
......
......@@ -7,10 +7,11 @@ import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils;
import com.dsk.common.utils.DateUtils;
import com.dsk.system.domain.business.dto.BusinessIdDto;
import com.dsk.system.dskService.EnterpriseService;
import com.dsk.system.mapper.BusinessRelateCompanyMapper;
import com.dsk.system.service.IBusinessInfoService;
import com.dsk.system.service.IBusinessRelateCompanyService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -26,12 +27,11 @@ import java.util.stream.Collectors;
* @date 2023-05-17
*/
@Service
public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyService
{
public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyService {
@Resource
private BusinessRelateCompanyMapper businessRelateCompanyMapper;
@Resource
private IBusinessInfoService businessInfoService;
@Autowired
private EnterpriseService enterpriseService;
/**
* 查询项目关联单位
......@@ -40,8 +40,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 项目关联单位
*/
@Override
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id)
{
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id) {
return businessRelateCompanyMapper.selectBusinessRelateCompanyById(id);
}
......@@ -52,8 +51,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 项目关联单位
*/
@Override
public List<BusinessRelateCompany> selectBusinessRelateCompanyList(BusinessRelateCompany businessRelateCompany)
{
public List<BusinessRelateCompany> selectBusinessRelateCompanyList(BusinessRelateCompany businessRelateCompany) {
return businessRelateCompanyMapper.selectBusinessRelateCompanyList(businessRelateCompany);
}
......@@ -65,18 +63,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
*/
@Override
@Transactional
public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany)
{
// if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的电话号码");
businessRelateCompany.setCreateTime(DateUtils.getNowDate());
//查询企业的城投id和建设库id
Map map = businessInfoService.queryUipIdOrCid(businessRelateCompany.getCompanyName());
if(map.containsKey("jskEid")){
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"jskEid",null));
}else {
businessRelateCompany.setCompanyUipId(MapUtils.getString(map,"uipId",null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"companyId",null));
public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) {
if (ObjectUtil.isNotEmpty(businessRelateCompany.getPhone()) && !CheckUtils.isPhone(businessRelateCompany.getPhone())) {
throw new BaseException("500", "请输入正确的电话号码");
}
//查询企业的城投id和建设库id
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessRelateCompany.getCompanyName());
businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
return businessRelateCompanyMapper.insertBusinessRelateCompany(businessRelateCompany);
}
......@@ -88,20 +82,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
*/
@Override
@Transactional
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany)
{
if(ObjectUtil.isNotEmpty(businessRelateCompany.getPhone())){
if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的电话号码");
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) {
if (ObjectUtil.isNotEmpty(businessRelateCompany.getPhone()) && !CheckUtils.isPhone(businessRelateCompany.getPhone())) {
throw new BaseException("500", "请输入正确的电话号码");
}
businessRelateCompany.setUpdateTime(DateUtils.getNowDate());
//查询企业的城投id和建设库id
Map map = businessInfoService.queryUipIdOrCid(businessRelateCompany.getCompanyName());
if(map.containsKey("jskEid")){
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"jskEid",null));
}else {
businessRelateCompany.setCompanyUipId(MapUtils.getString(map,"uipId",null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"companyId",null));
}
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessRelateCompany.getCompanyName());
businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
return businessRelateCompanyMapper.updateBusinessRelateCompany(businessRelateCompany);
}
......@@ -112,8 +100,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果
*/
@Override
public int deleteBusinessRelateCompanyByIds(Long[] ids)
{
public int deleteBusinessRelateCompanyByIds(Long[] ids) {
return businessRelateCompanyMapper.deleteBusinessRelateCompanyByIds(ids);
}
......@@ -124,18 +111,17 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果
*/
@Override
public int deleteBusinessRelateCompanyById(Long id)
{
public int deleteBusinessRelateCompanyById(Long id) {
return businessRelateCompanyMapper.deleteBusinessRelateCompanyById(id);
}
@Override
public List<String> companyRoleList(BusinessIdDto dto) {
List<BusinessRelateCompany> roleList = businessRelateCompanyMapper.selectList(Wrappers.<BusinessRelateCompany>lambdaQuery()
List<BusinessRelateCompany> roleList = businessRelateCompanyMapper.selectList(Wrappers.<BusinessRelateCompany>lambdaQuery()
.select(BusinessRelateCompany::getCompanyRole)
.eq(BusinessRelateCompany::getBusinessId, dto.getBusinessId())
.groupBy(BusinessRelateCompany::getCompanyRole)
.orderByDesc(BusinessRelateCompany::getCreateTime));
return roleList.stream().map(p ->p.getCompanyRole()).collect(Collectors.toList());
return roleList.stream().map(p -> p.getCompanyRole()).collect(Collectors.toList());
}
}
......@@ -6,14 +6,18 @@ import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.customer.ContactInfo;
import com.dsk.system.domain.customer.dto.ContactInfoSearchDto;
import com.dsk.system.domain.customer.vo.ContactInfoListVo;
import com.dsk.system.dskService.EnterpriseService;
import com.dsk.system.mapper.ContactInfoMapper;
import com.dsk.system.service.IContactInfoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* 用户联系人(CustomerContact)表服务实现类
......@@ -28,6 +32,12 @@ public class ContactInfoServiceImpl implements IContactInfoService {
@Resource
private ContactInfoMapper baseMapper;
@Autowired
private EnterpriseService enterpriseService;
// @Resource
// private ICustomerService customerService;
@Override
public List<ContactInfoListVo> selectList(ContactInfoSearchDto dto) {
return baseMapper.selectPageList(dto);
......@@ -41,6 +51,7 @@ public class ContactInfoServiceImpl implements IContactInfoService {
@Override
public boolean insert(ContactInfo bean) {
verifyParameter(bean);
bean.setCreateBy(bean.getUpdateBy());
return baseMapper.insert(bean) > 0;
}
......@@ -60,9 +71,18 @@ public class ContactInfoServiceImpl implements IContactInfoService {
* 参数验证
*/
private void verifyParameter(ContactInfo bean) {
// if (ObjectUtils.isEmpty(bean.getCustomerId())) throw new BeanException("客户id不能为空!");
if (!ObjectUtils.isEmpty(bean.getCompanyName())) {
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(bean.getCompanyName());
bean.setCompanyId(MapUtils.getInteger(map, "companyId"));
bean.setUipId(MapUtils.getString(map, "uipId"));
}
// if (!ObjectUtils.isEmpty(bean.getCustomerId()) && ObjectUtils.isEmpty(bean.getId())) {
// CustomerVo info = customerService.info(bean.getCustomerId());
// bean.setCompanyName(info.getCompanyName());
// bean.setCompanyId(info.getCompanyId());
// bean.setUipId(info.getUipId());
// }
LoginUser loginUser = SecurityUtils.getLoginUser();
bean.setCreateBy(loginUser.getUser().getNickName());
bean.setUpdateId(loginUser.getUserId());
bean.setUpdateBy(loginUser.getUser().getNickName());
}
......
......@@ -10,8 +10,8 @@
from contact_info cc
left join business_info bi on cc.project_id = bi.id
<where>
<if test="cc.customerId != null and cc.customerId !='' "> and (cc.customer_id = #{customerId} or cc.company_name =#{companyName})</if>
<if test="cc.projectId != null "> and cc.project_id = #{projectId} </if>
<if test="customerId != null and customerId !='' "> and (cc.customer_id = #{customerId} or bi.customer_id = #{customerId})</if>
<if test="projectId != null "> and cc.project_id = #{projectId} </if>
</where>
order by cc.create_time desc
</select>
......
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