Commit d6320625 authored by lcl's avatar lcl

u

parent d1b492f0
......@@ -9,7 +9,6 @@ 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;
......@@ -28,12 +27,9 @@ 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;
......@@ -44,8 +40,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 项目关联单位
*/
@Override
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id)
{
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id) {
return businessRelateCompanyMapper.selectBusinessRelateCompanyById(id);
}
......@@ -56,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);
}
......@@ -69,14 +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());
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));
businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
return businessRelateCompanyMapper.insertBusinessRelateCompany(businessRelateCompany);
}
......@@ -88,16 +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<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessRelateCompany.getCompanyName());
businessRelateCompany.setCompanyUipId(MapUtils.getString(map,"uipId",null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"companyId",null));
businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
return businessRelateCompanyMapper.updateBusinessRelateCompany(businessRelateCompany);
}
......@@ -108,8 +100,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果
*/
@Override
public int deleteBusinessRelateCompanyByIds(Long[] ids)
{
public int deleteBusinessRelateCompanyByIds(Long[] ids) {
return businessRelateCompanyMapper.deleteBusinessRelateCompanyByIds(ids);
}
......@@ -120,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,11 +6,9 @@ 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.domain.customer.vo.CustomerVo;
import com.dsk.system.dskService.EnterpriseService;
import com.dsk.system.mapper.ContactInfoMapper;
import com.dsk.system.service.IContactInfoService;
import com.dsk.system.service.ICustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,8 +35,8 @@ public class ContactInfoServiceImpl implements IContactInfoService {
@Autowired
private EnterpriseService enterpriseService;
@Resource
private ICustomerService customerService;
// @Resource
// private ICustomerService customerService;
@Override
public List<ContactInfoListVo> selectList(ContactInfoSearchDto dto) {
......@@ -73,17 +71,17 @@ public class ContactInfoServiceImpl implements IContactInfoService {
* 参数验证
*/
private void verifyParameter(ContactInfo bean) {
if (!ObjectUtils.isEmpty(bean.getCompanyName()) && !ObjectUtils.isEmpty(bean.getProjectId())) {
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());
}
// 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.setUpdateId(loginUser.getUserId());
bean.setUpdateBy(loginUser.getUser().getNickName());
......
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