协议联调

This commit is contained in:
mashuai 2024-08-26 14:45:34 +08:00
parent 6d769fbf61
commit c207c54583
7 changed files with 109 additions and 52 deletions

View File

@ -24,7 +24,7 @@ public class BmAgreement extends BaseEntity implements Serializable {
private Integer id;
@ApiModelProperty(value="签订日期")
@Excel(name = "协议签订日期")
//@Excel(name = "协议签订日期")
private String signDate;
@ApiModelProperty(value="协议编号")
@ -47,10 +47,10 @@ public class BmAgreement extends BaseEntity implements Serializable {
private Integer leaseCompany;
@ApiModelProperty(value="工程id")
private Integer project;
private String project;
@ApiModelProperty(value="往来单位id")
private Integer customer;
private String customer;
@ApiModelProperty(value="开始时间")
@Excel(name = "开始日期")

View File

@ -0,0 +1,51 @@
package com.bonus.base.api.domain;
import com.bonus.system.api.domain.SysUser;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.stream.Collectors;
/**
* 协议新建往来单位和工程树结构信息 id和parentId为构建所得采用字符串类型
* @Author ma_sh
* @create 2024/8/26 13:37
*/
@Setter
@Getter
public class SysDeptTreeSelect {
private static final long serialVersionUID = 1L;
/** 节点ID */
private String id;
/** 节点名称 */
private String label;
private Integer level;
/**
* 编码
*/
private String code;
private String parentId;
private String companyId;
/** 子节点 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<SysDeptTreeSelect> children;
private List<SysUser> userList;
public SysDeptTreeSelect(SysDeptTree dept) {
this.id = dept.getDeptId();
this.parentId = dept.getParentId();
this.label = dept.getDeptName();
this.children = dept.getChildren().stream().map(SysDeptTreeSelect::new).collect(Collectors.toList());
}
}

View File

@ -2,6 +2,7 @@ package com.bonus.base.controller;
import com.bonus.base.api.domain.BmCustomer;
import com.bonus.base.api.domain.SysDeptTree;
import com.bonus.base.api.domain.SysDeptTreeSelect;
import com.bonus.base.api.domain.TreeSelect;
import com.bonus.base.service.IBmCustomerService;
import com.bonus.common.core.domain.R;
@ -75,8 +76,8 @@ public class BmCustomerController extends BaseController {
@ApiOperation(value = "往来单位树")
@RequiresPermissions("material:maType:query")
@GetMapping("/customerTree")
public R<List<TreeSelect>> selectCustomerTree(SysDeptTree sysDept) {
List<TreeSelect> deptList = customerService.selectCustomerTree(sysDept);
public R<List<SysDeptTreeSelect>> selectCustomerTree(SysDeptTree sysDept) {
List<SysDeptTreeSelect> deptList = customerService.selectCustomerTree(sysDept);
return R.ok(deptList);
}
@ -88,8 +89,8 @@ public class BmCustomerController extends BaseController {
@ApiOperation(value = "工程树")
@RequiresPermissions("material:maType:query")
@GetMapping("/projectTree")
public R<List<TreeSelect>> selectProjectTree(SysDeptTree sysDept) {
List<TreeSelect> deptList = customerService.selectProjectTree(sysDept);
public R<List<SysDeptTreeSelect>> selectProjectTree(SysDeptTree sysDept) {
List<SysDeptTreeSelect> deptList = customerService.selectProjectTree(sysDept);
return R.ok(deptList);
}

View File

@ -62,7 +62,7 @@ public interface BmAgreementMapper {
* @param project
* @return
*/
BmAgreement select(@Param(value ="customer") Integer customer, @Param(value ="project") Integer project);
BmAgreement select(@Param(value ="customer") String customer, @Param(value ="project") String project);
/**
* 查询code

View File

@ -2,6 +2,7 @@ package com.bonus.base.service;
import com.bonus.base.api.domain.BmCustomer;
import com.bonus.base.api.domain.SysDeptTree;
import com.bonus.base.api.domain.SysDeptTreeSelect;
import com.bonus.base.api.domain.TreeSelect;
import com.bonus.common.core.web.domain.AjaxResult;
@ -72,12 +73,12 @@ public interface IBmCustomerService
* 查询往来单位下拉树结构
* @return
*/
List<TreeSelect> selectCustomerTree(SysDeptTree sysDept);
List<SysDeptTreeSelect> selectCustomerTree(SysDeptTree sysDept);
/**
* 查询工程下拉树结构
* @param sysDept
* @return
*/
List<TreeSelect> selectProjectTree(SysDeptTree sysDept);
List<SysDeptTreeSelect> selectProjectTree(SysDeptTree sysDept);
}

View File

@ -3,12 +3,12 @@ package com.bonus.base.service.impl;
import cn.hutool.core.util.PhoneUtil;
import com.bonus.base.api.domain.BmCustomer;
import com.bonus.base.api.domain.SysDeptTree;
import com.bonus.base.api.domain.SysDeptTreeSelect;
import com.bonus.base.api.domain.TreeSelect;
import com.bonus.base.mapper.BmCustomerMapper;
import com.bonus.base.service.IBmCustomerService;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.core.web.domain.AjaxResult;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -107,9 +107,19 @@ public class BmCustomerServiceImpl implements IBmCustomerService
* @return
*/
@Override
public List<TreeSelect> selectCustomerTree(SysDeptTree sysDept) {
public List<SysDeptTreeSelect> selectCustomerTree(SysDeptTree sysDept) {
List<SysDeptTree> deptList = bmCustomerMapper.selectCustomerTree(sysDept);
return buildDeptTreeSelect(deptList);
return buildDeptSelect(deptList);
}
/**
* 往来单位树单独构建树结构
* @param deptList
* @return
*/
private List<SysDeptTreeSelect> buildDeptSelect(List<SysDeptTree> deptList) {
List<SysDeptTree> deptTrees = buildDeptTree(deptList);
return deptTrees.stream().map(SysDeptTreeSelect::new).collect(Collectors.toList());
}
/**
@ -118,9 +128,9 @@ public class BmCustomerServiceImpl implements IBmCustomerService
* @return
*/
@Override
public List<TreeSelect> selectProjectTree(SysDeptTree sysDept) {
public List<SysDeptTreeSelect> selectProjectTree(SysDeptTree sysDept) {
List<SysDeptTree> deptList = bmCustomerMapper.selectProjectTree(sysDept);
return buildDeptTreeSelect(deptList);
return buildDeptSelect(deptList);
}
private List<TreeSelect> buildDeptTreeSelect(List<SysDeptTree> deptList) {

View File

@ -224,64 +224,58 @@
update bm_agreement
<set>
<if test="code != null and code != ''">
code = #{code,jdbcType=VARCHAR},
code = #{code},
</if>
<if test="signDate != null and signDate != ''">
sign_date = #{signDate,jdbcType=VARCHAR},
<if test="signDate != null ">
sign_date = #{signDate},
</if>
<if test="customer != null">
customer = #{customer,jdbcType=INTEGER},
customer = #{customer},
</if>
<if test="project != null">
project = #{project,jdbcType=INTEGER},
project = #{project},
</if>
<if test="startTime != null and startTime != ''">
start_time = #{startTime,jdbcType=VARCHAR},
<if test="startTime != null ">
start_time = #{startTime},
</if>
<if test="leaseTerm != null and leaseTerm != ''">
lease_term = #{leaseTerm,jdbcType=VARCHAR},
<if test="leaseTerm != null ">
lease_term = #{leaseTerm},
</if>
<if test="advanceCharge != null and advanceCharge != ''">
advance_charge = #{advanceCharge,jdbcType=VARCHAR},
<if test="advanceCharge != null ">
advance_charge = #{advanceCharge},
</if>
<if test="authorizingPerson != null and authorizingPerson != ''">
authorizing_person = #{authorizingPerson,jdbcType=VARCHAR},
<if test="authorizingPerson != null ">
authorizing_person = #{authorizingPerson},
</if>
<if test="authorizingPhone != null and authorizingPhone != ''">
authorizing_phone = #{authorizingPhone,jdbcType=VARCHAR},
<if test="authorizingPhone != null ">
authorizing_phone = #{authorizingPhone},
</if>
<if test="contractNumber != null and contractNumber != ''">
contract_number = #{contractNumber,jdbcType=VARCHAR},
<if test="contractNumber != null ">
contract_number = #{contractNumber},
</if>
<if test="creator != null and creator != ''">
creator = #{creator,jdbcType=VARCHAR},
<if test="remark != null ">
remark = #{remark},
</if>
<if test="createTime != null and createTime != ''">
create_time = #{createTime,jdbcType=VARCHAR},
<if test="settlementTime != null ">
settlement_time = #{settlementTime},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
<if test="isBalance != null ">
is_balance = #{isBalance},
</if>
<if test="settlementTime != null and settlementTime != ''">
settlement_time = #{settlementTime,jdbcType=VARCHAR},
<if test="url != null ">
url = #{url},
</if>
<if test="isBalance != null and isBalance != ''">
is_balance = #{isBalance,jdbcType=VARCHAR},
</if>
<if test="url != null and url != ''">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="isSure != null and isSure != ''">
is_sure = #{isSure,jdbcType=VARCHAR},
<if test="isSure != null ">
is_sure = #{isSure},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
company_id = #{companyId},
</if>
<if test="isPush != null and isPush != ''">
is_push = #{isPush,jdbcType=VARCHAR},
<if test="isPush != null ">
is_push = #{isPush},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
where id = #{id}
</update>
<update id="updateByPrimaryKey" parameterType="com.bonus.base.api.domain.BmAgreement">
<!--@mbg.generated-->