Commit fe40394b authored by 施翔轲's avatar 施翔轲

供应商劳务分包队伍列表相关

parent 0735096e
......@@ -6,6 +6,7 @@ import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.cscec.domain.bo.AddDCustomerLaborLeaderBo;
import com.dsk.cscec.domain.bo.AdvisoryBodyBo;
import com.dsk.cscec.domain.bo.CustomerCooperationBo;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
......@@ -83,8 +84,24 @@ public class CustomerInfoController extends BaseController {
* 查询供应商基本情况
*/
@GetMapping("/queryBasicInfo")
public R<Map<String,Long>> queryBasicInfo() {
public R<Map<String, Long>> queryBasicInfo() {
return R.ok(iCustomerInfoService.queryBasicInfo());
}
/**
* 校验劳务队长身份证号是否存在
*/
@GetMapping("/checkLaborLeaderIdExist/{laborLeaderId}")
public R<List<CustomerInfoVo>> checkLaborLeaderIdExist(@PathVariable String laborLeaderId) {
return R.ok(iCustomerInfoService.checkLaborLeaderIdExist(laborLeaderId));
}
/**
* 添加劳务队队长
*/
@PostMapping("addLaborLeader")
public R<Void> addLaborLeader(@RequestBody AddDCustomerLaborLeaderBo bo) {
return toAjax(iCustomerInfoService.addLaborLeader(bo));
}
}
package com.dsk.cscec.domain.bo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
/**
* @author sxk
* @date 2024.06.04
* @time 14:25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AddDCustomerLaborLeaderBo {
/**
* ipm供应商名称
*/
@NotBlank(message = "供应商名称不能为空")
private String cusomerName;
/**
* 统一社会信用代码
*/
private String unifySocialCode;
/**
* 队长名称
*/
@NotBlank(message = "劳务队长姓名不能为空")
private String leaderName;
/**
* 劳务队长身份证号
*/
@NotBlank(message = "劳务队长身份证号不能为空")
private String laborCaptainIdcard;
/**
* 劳务队长联系电话
*/
private String laborCaptainPhone;
/**
* 队伍规模人数
*/
private Double serviceTeamPersonnum;
}
......@@ -3,7 +3,6 @@ package com.dsk.cscec.domain.bo;
import com.dsk.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
......@@ -92,6 +91,13 @@ public class CustomerInfoBo extends BaseEntity {
* 队长名称
*/
private String leaderName;
/**
* 队长身份证号
*/
private String laborCaptainIdCard;
/**
* 是否身份证查重
*/
private Boolean isIdCardRepeat;
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.AddDCustomerLaborLeaderBo;
import com.dsk.cscec.domain.bo.AdvisoryBodyBo;
import com.dsk.cscec.domain.bo.CustomerCooperationBo;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
......@@ -12,6 +13,7 @@ import com.dsk.cscec.domain.vo.CustomerApproveVo;
import com.dsk.cscec.domain.vo.CustomerCooperationVo;
import com.dsk.cscec.domain.vo.CustomerInfoVo;
import java.util.List;
import java.util.Map;
/**
......@@ -64,4 +66,14 @@ public interface ICustomerInfoService extends IService<DCustomer> {
* 查询供应商基本情况
*/
Map<String, Long> queryBasicInfo();
/**
* 校验劳务队长身份证号是否存在
*/
List<CustomerInfoVo> checkLaborLeaderIdExist(String laborLeaderId);
/**
* 添加劳务队队长
*/
Integer addLaborLeader(AddDCustomerLaborLeaderBo bo);
}
package com.dsk.cscec.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
......@@ -14,6 +15,7 @@ import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.StringUtils;
import com.dsk.cscec.constant.AdvisoryBodyManageQueryConstants;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.AddDCustomerLaborLeaderBo;
import com.dsk.cscec.domain.bo.AdvisoryBodyBo;
import com.dsk.cscec.domain.bo.CustomerCooperationBo;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
......@@ -29,6 +31,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -213,12 +216,12 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Long lwfbCount = baseMapper.selectCount(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getRecommendOrgId, "F17305B4EA4444CBAB12892C7B99E475")
.eq(DCustomer::getCustomerClass, "劳务分包")
.eq(DCustomer::getServiceTeamLogo,"N"));
.eq(DCustomer::getServiceTeamLogo, "N"));
//劳务分包队伍数量
Long lwfbdwCount = baseMapper.selectCount(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getRecommendOrgId, "F17305B4EA4444CBAB12892C7B99E475")
.eq(DCustomer::getCustomerClass, "劳务分包")
.eq(DCustomer::getServiceTeamLogo,"Y"));
.eq(DCustomer::getServiceTeamLogo, "Y"));
infoMap.put("customerTotal", zyfbCount + jxsgCount + wzsbCount + lwfbCount + lwfbdwCount);
infoMap.put("zyfbCount", zyfbCount);
infoMap.put("jxsgCount", jxsgCount);
......@@ -227,4 +230,106 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
infoMap.put("lwfbdwCount", lwfbdwCount);
return infoMap;
}
/**
* 校验劳务队长身份证号是否存在
*/
@Override
public List<CustomerInfoVo> checkLaborLeaderIdExist(String laborLeaderId) {
List<DCustomer> leaderList = baseMapper.selectList(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getLaborCaptainIdcard, laborLeaderId)
.eq(DCustomer::getCustomerClass, "劳务分包")
.eq(DCustomer::getServiceTeamLogo, "Y")
.eq(DCustomer::getRecommendOrgId, AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID));
if (!leaderList.isEmpty()) {
List<CustomerInfoVo> voList = BeanUtil.copyToList(leaderList, CustomerInfoVo.class);
voList.parallelStream().forEach(item -> {
DCustomerListVo vo = subcontractMapper.selectStatisticByCustomerId(item.getCustomerId());
//企业合作数量
item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount());
//项目合作数量
item.setProjectCooperationCount(vo.getProjectCooperationCount());
try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(item.getCustomerName());
if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
Integer companyId = MapUtil.getInt(data, "jskEid");
item.setCompanyId(companyId);
}
} catch (Exception e) {
log.error("CustomerInfoServiceImpl.checkLaborLeaderIdExist() error:" + e);
}
});
return voList;
}
return null;
}
/**
* 添加劳务队队长
*/
@Override
public Integer addLaborLeader(AddDCustomerLaborLeaderBo bo) {
DCustomer customer = BeanUtil.toBean(bo, DCustomer.class);
//如果数据库中存在该供应商,则填充相应信息
DCustomer originCustomer = baseMapper.selectList(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getCusomerName, bo.getCusomerName())
.orderByDesc(DCustomer::getApproveDate2)).get(0);
if (ObjectUtil.isNotNull(originCustomer)) {
//财务客商编码
customer.setFinCustomerCode(originCustomer.getFinCustomerCode());
//法人代表
customer.setRepresentative(originCustomer.getRepresentative());
//工商注册号
customer.setRegisterNo(originCustomer.getRegisterNo());
//注册资金
customer.setRegisterCapital(originCustomer.getRegisterCapital());
//注册地区域
customer.setRegisterRegion(originCustomer.getRegisterRegion());
//省份
customer.setRegisterProvince(originCustomer.getRegisterProvince());
//城市
customer.setRegisterCity(originCustomer.getRegisterCity());
//联系人
customer.setContactPerson(originCustomer.getContactPerson());
//电话
customer.setContactPhone(originCustomer.getContactPhone());
//一体化客商类型
customer.setFinCustomerType(originCustomer.getFinCustomerType());
//客商性质
customer.setCustomerKind(originCustomer.getCustomerKind());
//是否业主
customer.setIsowner(originCustomer.getIsowner());
//是否供应商
customer.setIscustomer(originCustomer.getIscustomer());
//税率类型
customer.setTaxType(originCustomer.getTaxType());
//是否冻结
customer.setIsfreeze(originCustomer.getIsfreeze());
} else {
//填充省市信息
Map<String, Object> map = opportunityRadarService.enterpriseByName(bo.getCusomerName());
if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
customer.setRegisterProvince(MapUtil.getStr(data, "province"));
customer.setRegisterCity(MapUtil.getStr(data, "city"));
}
}
customer.setCustomerKey(baseMapper.selectOne(new LambdaQueryWrapper<DCustomer>()
.orderByDesc(DCustomer::getCustomerKey)
.last("LIMIT 1")).getCustomerKey() + 1);
customer.setCustomerName(bo.getCusomerName());
customer.setFinCustomerName(bo.getCusomerName());
customer.setRecommendOrgId(AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID);
customer.setRecommendOrg(AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_NAME);
customer.setTaxNumber(bo.getUnifySocialCode());
customer.setBusinessLicense(bo.getUnifySocialCode());
customer.setOrgnizationCode(bo.getUnifySocialCode());
DateTime now = new DateTime();
customer.setApproveDate2(now);
customer.setUpdateDate(now.toDateStr());
customer.setLoadTime(now);
customer.setCustomerClass("劳务分包");
return baseMapper.insert(customer);
}
}
......@@ -113,6 +113,9 @@
<if test="bo.leaderName != null and bo.leaderName != ''">
and leader_name like concat('%',#{bo.leaderName},'%')
</if>
<if test="bo.laborCaptainIdCard != null and bo.laborCaptainIdCard != ''">
and labor_captain_idcard like concat('%',#{bo.laborCaptainIdCard},'%')
</if>
<if test="bo.customerName != null and bo.customerName != '' ">
and customer_name like concat('%',#{bo.customerName},'%')
</if>
......@@ -180,6 +183,15 @@
<if test="bo.approveDate2End != null">
and date(approve_date2) &lt;= #{bo.approveDate2End}
</if>
<if test="bo.isIdCardRepeat == true">
and labor_captain_idcard in (select labor_captain_idcard
from d_customer
where recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
and customer_class = '劳务分包'
and leader_name is not null
group by labor_captain_idcard
having count(*) > 1)
</if>
order by approve_date2 desc
</select>
<select id="selectBusinessLicense" resultType="com.dsk.cscec.domain.vo.CertificateVo">
......
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