bug修复
This commit is contained in:
parent
6e27be0849
commit
19963dcc82
|
|
@ -146,4 +146,7 @@ public class BmProject extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "往来单位id")
|
@ApiModelProperty(value = "往来单位id")
|
||||||
private Long unitId;
|
private Long unitId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "往来单位ids")
|
||||||
|
private int[] unitIds;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.bonus.material.common.domain.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 10488
|
* @author 10488
|
||||||
*/
|
*/
|
||||||
|
|
@ -37,4 +39,5 @@ public class SelectDto {
|
||||||
/** 计量单位*/
|
/** 计量单位*/
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
|
private List<Integer> unitIds;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.bonus.material.common.domain.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 10488
|
* @author 10488
|
||||||
* 协议信息
|
* 协议信息
|
||||||
|
|
@ -17,4 +19,8 @@ public class AgreementVo {
|
||||||
|
|
||||||
/** 是否结算*/
|
/** 是否结算*/
|
||||||
private String isSlt;
|
private String isSlt;
|
||||||
|
|
||||||
|
// private List<Integer> agreementIdList;
|
||||||
|
//
|
||||||
|
// private List<String> agreementCodeList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ import cn.hutool.core.convert.Convert;
|
||||||
import com.bonus.common.biz.config.PoiOutPage;
|
import com.bonus.common.biz.config.PoiOutPage;
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||||
import com.bonus.material.lease.domain.vo.LeaseOutVo;
|
import com.bonus.material.lease.domain.vo.LeaseOutVo;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementApply;
|
import com.bonus.material.settlement.domain.SltAgreementApply;
|
||||||
|
|
@ -96,6 +98,19 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "工程下拉选")
|
||||||
|
@PostMapping("getProjectListByUnitIds")
|
||||||
|
public AjaxResult getProjectListByUnitIds(@RequestBody BmProject bmProject) {
|
||||||
|
return sltAgreementInfoService.getProjectListByUnitIds(bmProject);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "往来单位id和标段工程id获取协议信息")
|
||||||
|
@PostMapping("getAgreementInfoById")
|
||||||
|
public AjaxResult getAgreementInfoById(@RequestBody SelectDto dto){
|
||||||
|
return sltAgreementInfoService.getAgreementInfoById(dto);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "根据协议获取结算清单")
|
@ApiOperation(value = "根据协议获取结算清单")
|
||||||
@PostMapping("/getSltInfo")
|
@PostMapping("/getSltInfo")
|
||||||
public AjaxResult getSltInfo(@RequestBody SltAgreementInfo info) {
|
public AjaxResult getSltInfo(@RequestBody SltAgreementInfo info) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.bonus.material.settlement.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
@ -30,6 +32,7 @@ public class SltAgreementInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "协议id")
|
@ApiModelProperty(value = "协议id")
|
||||||
private Long agreementId;
|
private Long agreementId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 协议编号
|
* 协议编号
|
||||||
*/
|
*/
|
||||||
|
|
@ -162,6 +165,7 @@ public class SltAgreementInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "往来单位id")
|
@ApiModelProperty(value = "往来单位id")
|
||||||
private Long unitId;
|
private Long unitId;
|
||||||
|
|
||||||
|
private List<Long> unitIds;
|
||||||
/**
|
/**
|
||||||
* 工程标段ID
|
* 工程标段ID
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
package com.bonus.material.settlement.mapper;
|
package com.bonus.material.settlement.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.domain.ProjectTreeNode;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
|
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||||
import com.bonus.material.ma.domain.Type;
|
import com.bonus.material.ma.domain.Type;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementApply;
|
import com.bonus.material.settlement.domain.SltAgreementApply;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
|
|
@ -203,4 +208,10 @@ public interface SltAgreementInfoMapper {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateBmAgreementReject(SltAgreementApply sltAgreementApply);
|
public int updateBmAgreementReject(SltAgreementApply sltAgreementApply);
|
||||||
|
|
||||||
|
int[] getProjectListByUnitIds(int unitId);
|
||||||
|
|
||||||
|
List<ProjectTreeNode> getProjectList(int projectId);
|
||||||
|
|
||||||
|
List<AgreementVo> getAgreementInfoById(@Param("unitIds") List<Integer> unitIds, @Param("projectId") int projectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.bonus.material.settlement.service;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementApply;
|
import com.bonus.material.settlement.domain.SltAgreementApply;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
|
|
@ -105,4 +107,15 @@ public interface ISltAgreementInfoService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
SltInfoVo getSltRecordDetailsList(SltAgreementInfo info);
|
SltInfoVo getSltRecordDetailsList(SltAgreementInfo info);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉框
|
||||||
|
*
|
||||||
|
* @param bmProject 工程下拉框
|
||||||
|
* @return 工程下拉框
|
||||||
|
*/
|
||||||
|
AjaxResult getProjectListByUnitIds(BmProject bmProject);
|
||||||
|
|
||||||
|
|
||||||
|
AjaxResult getAgreementInfoById(SelectDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
package com.bonus.material.settlement.service.impl;
|
package com.bonus.material.settlement.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
import com.bonus.common.biz.domain.ProjectTreeBuild;
|
||||||
|
import com.bonus.common.biz.domain.ProjectTreeNode;
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
|
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementApply;
|
import com.bonus.material.settlement.domain.SltAgreementApply;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
||||||
|
|
@ -17,6 +21,7 @@ import com.bonus.material.settlement.domain.vo.SltInfoVo;
|
||||||
import com.bonus.material.settlement.mapper.SltAgreementReduceMapper;
|
import com.bonus.material.settlement.mapper.SltAgreementReduceMapper;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.settlement.mapper.SltAgreementInfoMapper;
|
import com.bonus.material.settlement.mapper.SltAgreementInfoMapper;
|
||||||
|
|
@ -576,5 +581,80 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
||||||
return sltInfoVo;
|
return sltInfoVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程类型树
|
||||||
|
* @param bmProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getProjectListByUnitIds(BmProject bmProject) {
|
||||||
|
List<ProjectTreeNode> groupList = new ArrayList<>();
|
||||||
|
List<ProjectTreeNode> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
if(bmProject.getUnitIds()!=null){
|
||||||
|
Map<Integer,Integer> map= new HashMap<>();
|
||||||
|
for (int i = 0; i < bmProject.getUnitIds().length; i++) {
|
||||||
|
int id = bmProject.getUnitIds()[i];
|
||||||
|
int[] projectIds= sltAgreementInfoMapper.getProjectListByUnitIds(bmProject.getUnitIds()[i]);
|
||||||
|
Map<Integer,Integer> mapTemp=new HashMap<>();
|
||||||
|
for (int j = 0; j < projectIds.length; j++) {
|
||||||
|
mapTemp.put(projectIds[j],1);
|
||||||
|
}
|
||||||
|
mapTemp.forEach((k,v)->{
|
||||||
|
if(map.containsKey(k)){
|
||||||
|
map.put(Integer.valueOf(k),map.get(k)+v);
|
||||||
|
}else{
|
||||||
|
map.put(Integer.valueOf(k),v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(map.size()>0){
|
||||||
|
List<Integer> keys = new ArrayList<>();
|
||||||
|
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
|
||||||
|
if (entry.getValue() == bmProject.getUnitIds().length) {
|
||||||
|
keys.add(entry.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Integer key : keys) {
|
||||||
|
List<ProjectTreeNode> listTemp = sltAgreementInfoMapper.getProjectList(key);
|
||||||
|
for (ProjectTreeNode node : listTemp) {
|
||||||
|
if (!list.contains(node)) {
|
||||||
|
list.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// list = sltAgreementInfoMapper.getProjectListByUnitIds(bmProject);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
// 创建树形结构(数据集合作为参数)
|
||||||
|
ProjectTreeBuild treeBuild = new ProjectTreeBuild(list);
|
||||||
|
// 原查询结果转换树形结构
|
||||||
|
groupList = treeBuild.buildTree();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error(e+"工程下拉树查询失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(groupList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getAgreementInfoById(SelectDto dto) {
|
||||||
|
List<AgreementVo> vo = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
List<AgreementVo> list = sltAgreementInfoMapper.getAgreementInfoById(dto.getUnitIds(), dto.getProjectId());
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
vo = list;
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("未找到匹配的协议信息");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error(e+"协议查询失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(vo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,8 +191,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||||
LEFT JOIN slt_agreement_apply saa on saa.agreement_id = bai.agreement_id
|
LEFT JOIN slt_agreement_apply saa on saa.agreement_id = bai.agreement_id
|
||||||
where bai.status = '1'
|
where bai.status = '1'
|
||||||
<if test="unitId != null and unitId != ''">
|
<if test="unitIds != null">
|
||||||
and bui.unit_id = #{unitId}
|
and bui.unit_id in
|
||||||
|
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="projectId != null and projectId != ''">
|
<if test="projectId != null and projectId != ''">
|
||||||
and bp.pro_id = #{projectId}
|
and bp.pro_id = #{projectId}
|
||||||
|
|
@ -580,4 +583,88 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where
|
where
|
||||||
bai.agreement_id = #{agreementId}
|
bai.agreement_id = #{agreementId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getProjectListByUnitIds" resultType="int">
|
||||||
|
/*根据往来单位id关联协议查询工程*/
|
||||||
|
SELECT
|
||||||
|
bmp.pro_id AS id
|
||||||
|
FROM
|
||||||
|
bm_project bmp
|
||||||
|
LEFT JOIN sys_dept sd ON sd.dept_id = bmp.imp_unit
|
||||||
|
LEFT JOIN bm_agreement_info bai ON bai.project_id = bmp.pro_id
|
||||||
|
AND bai.`status` = '1'
|
||||||
|
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||||
|
AND bu.del_flag = '0'
|
||||||
|
WHERE
|
||||||
|
sd.del_flag = '0'
|
||||||
|
AND sd.`status` = '0'
|
||||||
|
AND bmp.del_flag = '0'
|
||||||
|
<if test="unitId != null">
|
||||||
|
AND bu.unit_id = #{unitId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getProjectList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
||||||
|
/*根据往来单位id关联协议查询工程*/
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
bmp.pro_id AS id,
|
||||||
|
bmp.pro_name AS name,
|
||||||
|
concat( 'gs', bmp.imp_unit ) AS parentId,
|
||||||
|
2 AS level
|
||||||
|
FROM
|
||||||
|
bm_project bmp
|
||||||
|
LEFT JOIN sys_dept sd ON sd.dept_id = bmp.imp_unit
|
||||||
|
LEFT JOIN bm_agreement_info bai ON bai.project_id = bmp.pro_id
|
||||||
|
AND bai.`status` = '1'
|
||||||
|
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||||
|
AND bu.del_flag = '0'
|
||||||
|
WHERE
|
||||||
|
sd.del_flag = '0'
|
||||||
|
AND sd.`status` = '0'
|
||||||
|
AND bmp.del_flag = '0'
|
||||||
|
<if test="projectId != null">
|
||||||
|
AND bmp.pro_id = #{projectId}
|
||||||
|
</if>
|
||||||
|
UNION
|
||||||
|
SELECT DISTINCT
|
||||||
|
concat( 'gs', sd.dept_id ) AS id,
|
||||||
|
sd.dept_name AS proName,
|
||||||
|
'0' AS parentId,
|
||||||
|
1 AS level
|
||||||
|
FROM
|
||||||
|
sys_dept sd
|
||||||
|
LEFT JOIN bm_project bmp ON sd.dept_id = bmp.imp_unit
|
||||||
|
LEFT JOIN bm_agreement_info bai ON bai.project_id = bmp.pro_id
|
||||||
|
AND bai.`status` = '1'
|
||||||
|
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||||
|
WHERE
|
||||||
|
bmp.pro_id IS NOT NULL
|
||||||
|
AND sd.del_flag = '0'
|
||||||
|
AND sd.`status` = '0'
|
||||||
|
AND bmp.del_flag = '0'
|
||||||
|
<if test="projectId != null">
|
||||||
|
AND bmp.pro_id = #{projectId}
|
||||||
|
</if>
|
||||||
|
) a
|
||||||
|
ORDER BY
|
||||||
|
level
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAgreementInfoById" resultType="com.bonus.material.common.domain.vo.AgreementVo">
|
||||||
|
SELECT agreement_id AS agreementId,
|
||||||
|
agreement_code AS agreementCode,
|
||||||
|
is_slt AS isSlt
|
||||||
|
FROM bm_agreement_info
|
||||||
|
WHERE
|
||||||
|
unit_id IN
|
||||||
|
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND project_id = #{projectId} AND status = '1'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue