Commit 5829b3b9 authored by fulixin's avatar fulixin

bug修改

parent 63d42baa
......@@ -33,7 +33,7 @@ public class LaborLeaderCustomerRiskController extends BaseController {
* 添加挂靠风险记录
*/
@PostMapping("/addRiskRecord")
public R<Void> addRiskRecord(@Validated @RequestBody AddLaborLeaderCustomerRiskBo addBo) {
public R<Void> addRiskRecord(@RequestBody AddLaborLeaderCustomerRiskBo addBo) {
return toAjax(baseService.addRiskRecord(addBo));
}
......
......@@ -39,12 +39,12 @@ public class AddLaborLeaderCustomerRiskBo {
/**
* 不良事由
*/
@NotBlank(message = "不良事由不能为空")
// @NotBlank(message = "不良事由不能为空")
private String badReason;
/**
* 不良行为情形
*/
@NotBlank(message = "不良行为情形不能为空")
// @NotBlank(message = "不良行为情形不能为空")
private String badBehaviorSituation;
/**
* 数据来源(0:自主添加,1:系统添加)
......
......@@ -22,6 +22,8 @@ import java.util.List;
*/
public interface DCustomerMapper extends BaseMapper<DCustomer> {
Integer allSearchListCount(@Param("bo") DCustomerSearchBo bo);
Page<DCustomerListVo> allSearchList(IPage<DCustomerSearchBo> build, @Param("bo") DCustomerSearchBo bo);
/**
......
......@@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -58,7 +59,8 @@ public class AdvisoryBodyServiceImpl extends ServiceImpl<AdvisoryBodyMapper, Adv
//先按照分页要求从咨询机构表中查出分页数据
QueryWrapper<AdvisoryBody> wrapper = Wrappers.query();
wrapper.like(StringUtils.isNotBlank(advisoryBodySearchBo.getAdvisoryBodyName()), "advisory_body_name", advisoryBodySearchBo.getAdvisoryBodyName())
.like(StringUtils.isNotBlank(advisoryBodySearchBo.getBusinessScope()), "business_scope", advisoryBodySearchBo.getBusinessScope());
.like(StringUtils.isNotBlank(advisoryBodySearchBo.getBusinessScope()), "business_scope", advisoryBodySearchBo.getBusinessScope())
.between("create_time",advisoryBodySearchBo.getMinLastCooperateDate(),advisoryBodySearchBo.getMaxLastCooperateDate());
Page<AdvisoryBodySearchVo> page = baseMapper.selectPageAdvisoryBodyList(pageQuery.build(), wrapper);
Date minLastCooperateDate = advisoryBodySearchBo.getMinLastCooperateDate();
......@@ -99,7 +101,9 @@ public class AdvisoryBodyServiceImpl extends ServiceImpl<AdvisoryBodyMapper, Adv
&& ObjectUtil.isNotNull(minLastCooperateDate)
&& ObjectUtil.isNotNull(maxLastCooperateDate)) {
if (DateUtil.isExpired(minLastCooperateDate, maxLastCooperateDate, lastCooperateDate)) {
iterator.remove();
iterator.remove();//这里是原逻辑 page的总条数是后面添加的逻辑 有问题就直接去掉这一批逻辑(不知道之前为什么写这个逻辑)
Long count = page.getTotal()-1;
page.setTotal(count);
continue;
}
}
......@@ -207,9 +211,11 @@ public class AdvisoryBodyServiceImpl extends ServiceImpl<AdvisoryBodyMapper, Adv
@Transactional(rollbackFor = Exception.class)
public Integer editAdvisoryBody(EditAdvisoryBodyInfoBo editInfoBo) {
long advisoryBodyId = IdUtil.getSnowflakeNextId();
AdvisoryBody newAdvisoryBody = BeanUtil.toBean(editInfoBo, AdvisoryBody.class);
AdvisoryBodyProject abpEntity = BeanUtil.toBean(editInfoBo, AdvisoryBodyProject.class);
//如果是新增咨询机构,则新增记录到咨询机构表
if (editInfoBo.getIsNewAdvisoryBody()) {
AdvisoryBody newAdvisoryBody = BeanUtil.toBean(editInfoBo, AdvisoryBody.class);
newAdvisoryBody.setAdvisoryBodyId(advisoryBodyId);
//考虑到咨询机构经营范围是列表中的一个查询条件,因此需要单独存入表中
//但考虑到经营范围又来自建设库,进而衍生出数据一致性问题,因此在项目中做了定时任务同步数据
......@@ -219,6 +225,32 @@ public class AdvisoryBodyServiceImpl extends ServiceImpl<AdvisoryBodyMapper, Adv
//校验咨询机构与项目关联表中是否有记录,无则新增,有则修改
return checkAdvisoryBodyProjectInfoAndEdit(editInfoBo, advisoryBodyId);
} else {
UpdateWrapper<AdvisoryBody> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("advisory_body_cid", newAdvisoryBody.getAdvisoryBodyCid()) // 设置更新条件
.set("legal_person", newAdvisoryBody.getLegalPerson()) // 法人
.set("credit_code", newAdvisoryBody.getCreditCode())//统一社会信用代码
.set("business_status", newAdvisoryBody.getBusinessStatus())//经营状态
.set("reg_date", newAdvisoryBody.getRegDate())//成立日期
.set("reg_capital", newAdvisoryBody.getRegCapital())//注册资本
.set("reg_address", newAdvisoryBody.getRegAddress())//注册地址
.set("business_scope", newAdvisoryBody.getBusinessScope());//统一社会信用代码
baseMapper.update(newAdvisoryBody, updateWrapper);
// UpdateWrapper<AdvisoryBodyProject> abp = new UpdateWrapper<>();
// updateWrapper.eq("advisory_body_cid", newAdvisoryBody.getAdvisoryBodyCid()) // 设置更新条件
// .set("owner_name", abpEntity.getOwnerName()) // 业主单位
// .set("project_manager_and_phone", abpEntity.getProjectManagerAndPhone()) // 项目经理及联系方式
// .set("business_manager_and_phone", abpEntity.getBusinessManagerAndPhone()) // 商务经理及联系方式
// .set("bid_agency_unit", abpEntity.getBidAgencyUnit()) // 招标代理单位
// .set("first_audit_unit", abpEntity.getFirstAuditUnit()) // 一审单位
// .set("second_audit_unit", abpEntity.getSecondAuditUnit())//二审单位
// .set("third_audit_unit", abpEntity.getThirdAuditUnit()); // 三审单位
// advisoryBodyProjectMapper.update(abpEntity,abp);
//如果不是新增咨询机构,则校验咨询机构与项目关联表中是否有记录,无则新增,有则修改
return checkAdvisoryBodyProjectInfoAndEdit(editInfoBo, advisoryBodyId);
}
......
......@@ -61,7 +61,9 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
public TableDataInfo<DCustomerListVo> allSearchList(DCustomerSearchBo bo, PageQuery query) {
dealWithCustomerClass(bo);
ArrayList<Integer> companyIdList = new ArrayList<>();
Integer count = baseMapper.allSearchListCount(bo);
Page<DCustomerListVo> page = baseMapper.allSearchList(query.build(), bo);
page.setTotal(count);
if (CollectionUtils.isNotEmpty(page.getRecords())) {
page.getRecords().parallelStream().forEach(item -> {
//根据customerName查询出creditLevel 设置进来 表d_everydaydispose fsuppliername --》fcreditlevel
......
......@@ -131,9 +131,10 @@
<select id="queryAdvisoryBodyByProjectKey" resultType="com.dsk.cscec.domain.AdvisoryBody">
select ab.*
from advisory_body ab
left join advisory_body_project abp
on abp.advisory_body_cid = ab.advisory_body_cid
where abp.project_key = ${projectKey};
LEFT JOIN advisory_body_project abp on ab.advisory_body_cid = abp.advisory_body_cid
left join d_contract dc on dc.contract_key = abp.project_key
where abp.project_key = #{projectKey}
</select>
<sql id="allColumn">
......
......@@ -19,7 +19,7 @@
left join advisory_body_project abp on c.contract_key = abp.project_key
left join advisory_body ab on ab.advisory_body_cid = abp.advisory_body_cid
<where>
<if test="bo.projectName != null and bo.projectName != ''">
<if test='bo.projectName != null and bo.projectName != " "'>
c.project_name like concat('%',#{bo.projectName},'%')
</if>
<if test="bo.ownerUnit != null and bo.ownerUnit != ''">
......@@ -29,6 +29,6 @@
and ab.advisory_body_name like concat('%',#{bo.advisoryBodyName},'%')
</if>
</where>
order by c.contract_sign_date desc
order by c.contract_sign_date desc,c.contract_key desc
</select>
</mapper>
......@@ -4,6 +4,75 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.cscec.mapper.DCustomerMapper">
<select id="allSearchListCount" resultType="int">
select count(*) as total from (
select
dc.customer_key, dc.customer_id, dc.customer_code, dc.customer_name, dc.recommend_org, dc.register_region, dc.register_province, dc.register_city, dc.customer_class, dc.primary_business,
dc.paytax_type, dc.tax_rate, dc.customer_state, dc.leader_name, dc.labor_captain_phone, dc.labor_captain_idcard, dc.service_team_personnum, dc.service_team_speciality,
dc.construct_job_scope, dc.credential, dc.register_capital, dc.contact_person, dc.contact_phone, dc.approve_date2, dc.credit_level, dc.group_specialty, fsl.fstate badnessState
from d_customer dc
left join f_supplier_limited fsl on (fsl.flaowufbid = dc.customer_id
or fsl.fzhuanyefbid = dc.customer_id or fsl.ffgid = dc.customer_id or fsl.fzlid = dc.customer_id)
where dc.recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
<if test="bo.customerName != null and bo.customerName != '' "> and dc.customer_name like concat('%',#{bo.customerName},'%')</if>
<if test="bo.province != null and bo.province.size > 0 and (bo.city == null or bo.city.size == 0) ">
and dc.register_province in
<foreach collection="bo.province" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.city != null and bo.city.size > 0 and (bo.province == null or bo.province.size == 0) ">
and dc.register_city in
<foreach collection="bo.city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.province != null and bo.province.size > 0 and bo.city != null and bo.city.size > 0 " >
and ( dc.register_province in
<foreach collection="bo.province" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or dc.register_city in
<foreach collection="bo.city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
<if test="bo.customerClass != null and bo.customerClass.size > 0 ">
and dc.customer_class in
<foreach collection="bo.customerClass" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.customerState != null and bo.customerState.size > 0 ">
and dc.customer_state in
<foreach collection="bo.customerState" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.creditLevel != null and bo.creditLevel.size > 0 ">
and dc.credit_level in
<foreach collection="bo.creditLevel" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.credential != null and bo.credential.size > 0 ">
and dc.credential in
<foreach collection="bo.credential" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.approveDateBegion != null and bo.approveDateBegion != '' ">and dc.approve_date2 &gt;= #{bo.approveDateBegion}</if>
<if test="bo.approveDateEnd != null and bo.approveDateEnd != '' ">and dc.approve_date2 &lt;= #{bo.approveDateEnd} </if>
<if test="bo.isTeam != null"> and dc.leader_name is <if test="bo.isTeam == 1">not</if> null </if>
<if test="bo.badnessState != null and bo.badnessState != ''"> and fsl.fstate = #{bo.badnessState} </if>
)aa
</select>
<select id="allSearchList" resultType="com.dsk.cscec.domain.vo.DCustomerListVo">
select
dc.customer_key, dc.customer_id, dc.customer_code, dc.customer_name, dc.recommend_org, dc.register_region, dc.register_province, dc.register_city, dc.customer_class, dc.primary_business,
......
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