bug
This commit is contained in:
parent
54f8a71d8a
commit
5e932d56af
@ -48,7 +48,7 @@ public class JacksonConfig {
|
|||||||
//去掉最后面的0并转为字符串
|
//去掉最后面的0并转为字符串
|
||||||
// gen.writeString(value.stripTrailingZeros().toPlainString());
|
// gen.writeString(value.stripTrailingZeros().toPlainString());
|
||||||
//保留两位小数
|
//保留两位小数
|
||||||
gen.writeString(value.setScale(2, RoundingMode.HALF_UP).toPlainString());
|
gen.writeString(value.setScale(0, RoundingMode.HALF_UP).toPlainString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
import com.pusong.business.domain.bo.PsContractInfoQueryBo;
|
import com.pusong.business.domain.bo.PsContractInfoQueryBo;
|
||||||
import com.pusong.business.domain.bo.PsInvoiceBo;
|
import com.pusong.business.domain.bo.PsInvoiceBo;
|
||||||
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractCountVo;
|
||||||
import com.pusong.business.domain.vo.ServiceScheduleVo;
|
import com.pusong.business.domain.vo.ServiceScheduleVo;
|
||||||
import com.pusong.business.service.IPsContractBusinessService;
|
import com.pusong.business.service.IPsContractBusinessService;
|
||||||
import com.pusong.common.satoken.utils.LoginHelper;
|
import com.pusong.common.satoken.utils.LoginHelper;
|
||||||
@ -60,7 +61,7 @@ public class PsContractInfoController extends BaseController {
|
|||||||
@Log(title = "暂存合同", businessType = BusinessType.INSERT)
|
@Log(title = "暂存合同", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/hold")
|
@PostMapping("/hold")
|
||||||
public R<Long> hold( @RequestBody PsContractInfoBo bo) {
|
public R<Long> hold(@RequestBody PsContractInfoBo bo) {
|
||||||
return R.ok(psContractInfoService.createContract(bo,1));
|
return R.ok(psContractInfoService.createContract(bo,1));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -89,7 +90,16 @@ public class PsContractInfoController extends BaseController {
|
|||||||
@SaCheckPermission("business:contractInfo:LIST")
|
@SaCheckPermission("business:contractInfo:LIST")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<PsContractInfoVo> list(PsContractInfoQueryBo bo, PageQuery pageQuery) {
|
public TableDataInfo<PsContractInfoVo> list(PsContractInfoQueryBo bo, PageQuery pageQuery) {
|
||||||
return psContractInfoService.queryPageList(bo, pageQuery);
|
TableDataInfo<PsContractInfoVo> psContractInfoVoTableDataInfo = psContractInfoService.queryPageList(bo, pageQuery);
|
||||||
|
|
||||||
|
PsContractCountVo contractCountVo = psContractInfoService.countContractInfo(bo);
|
||||||
|
return psContractInfoVoTableDataInfo;
|
||||||
|
}
|
||||||
|
@SaCheckPermission("business:contractInfo:LIST")
|
||||||
|
@GetMapping("/countContractInfo")
|
||||||
|
public R<PsContractCountVo> countContractInfo(PsContractInfoQueryBo bo, PageQuery pageQuery) {
|
||||||
|
PsContractCountVo contractCountVo = psContractInfoService.countContractInfo(bo);
|
||||||
|
return R.ok(contractCountVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,8 +50,8 @@ public class PsCustomController extends BaseController {
|
|||||||
|
|
||||||
@SaCheckPermission("business:customInfo:list")
|
@SaCheckPermission("business:customInfo:list")
|
||||||
@GetMapping("/listByLoginUser")
|
@GetMapping("/listByLoginUser")
|
||||||
public R<List<Map<String,Object>>> listByLoginUser(String name) {
|
public R<List<Map<String,Object>>> listByLoginUser(String name, PageQuery pageQuery) {
|
||||||
return R.ok(psCustomInfoService.listByLoginUser(name));
|
return R.ok(psCustomInfoService.listByLoginUser(name, pageQuery));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 查询客户信息列表
|
* 查询客户信息列表
|
||||||
|
@ -42,6 +42,11 @@ public class PsContractCompany extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long delFlag;
|
private Long delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单备注
|
||||||
|
*/
|
||||||
|
private String taskRemark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -245,4 +245,10 @@ public class PsCompanyInfoBo {
|
|||||||
this.businessAmount = businessList == null ? new BigDecimal(0) : businessList.stream().map(PsContractBusinessBo::getBusinessAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
this.businessAmount = businessList == null ? new BigDecimal(0) : businessList.stream().map(PsContractBusinessBo::getBusinessAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
return this.businessAmount;
|
return this.businessAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单备注
|
||||||
|
*/
|
||||||
|
private String taskRemark;
|
||||||
}
|
}
|
||||||
|
@ -163,6 +163,7 @@ public class PsContractInfoBo {
|
|||||||
*/
|
*/
|
||||||
private int firstPartyType;
|
private int firstPartyType;
|
||||||
|
|
||||||
|
|
||||||
public enum FIRSTPARTYTYPE{
|
public enum FIRSTPARTYTYPE{
|
||||||
COMPANY(1),
|
COMPANY(1),
|
||||||
INDIVIDUALS(2);
|
INDIVIDUALS(2);
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
@Data
|
||||||
|
public class ContractAmountVo {
|
||||||
|
private String contractCode;
|
||||||
|
/**
|
||||||
|
* 合同金额
|
||||||
|
*/
|
||||||
|
private BigDecimal contractAmount;
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.pusong.business.domain.PsContractInfo;
|
||||||
|
import com.pusong.common.translation.annotation.Translation;
|
||||||
|
import com.pusong.common.translation.constant.TransConstant;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同基本信息视图对象 ps_contract_info
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = PsContractInfo.class)
|
||||||
|
public class PsContractCountVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal contractAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已付金额
|
||||||
|
*/
|
||||||
|
private BigDecimal payMoney;
|
||||||
|
/**
|
||||||
|
* 退款金额
|
||||||
|
*/
|
||||||
|
private BigDecimal returnMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未付金额 = 所有已有回款合同的总金额 - 所有已有回款合同的已回款金额
|
||||||
|
*/
|
||||||
|
private BigDecimal residualMoney;
|
||||||
|
/**
|
||||||
|
* 待付金额 = 所有没有回款合同的总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal waitPayMoney;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -289,4 +289,7 @@ public class PsContractInfoVo implements Serializable {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PsContractCountVo psContractCountVo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -178,5 +178,10 @@ public class PsTaskMainVo implements Serializable {
|
|||||||
* 工单时间
|
* 工单时间
|
||||||
*/
|
*/
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单备注
|
||||||
|
*/
|
||||||
|
private String taskRemark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,13 +29,13 @@ public class ChannelAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 成交总金额
|
* 成交总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal all;
|
private BigDecimal all;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总roi
|
* 总roi
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal roi;
|
private BigDecimal roi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,7 +24,7 @@ public class ChannelPayInfo {
|
|||||||
/**
|
/**
|
||||||
* 合同金额
|
* 合同金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal contractAmount;
|
private BigDecimal contractAmount;
|
||||||
/**
|
/**
|
||||||
* 支付类型1回款2退款
|
* 支付类型1回款2退款
|
||||||
@ -33,12 +33,12 @@ public class ChannelPayInfo {
|
|||||||
/**
|
/**
|
||||||
* 回款/退款金额
|
* 回款/退款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal money;
|
private BigDecimal money;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成本
|
* 成本
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal cost;
|
private BigDecimal cost;
|
||||||
}
|
}
|
||||||
|
@ -22,35 +22,35 @@ public class DataAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 合同金额
|
* 合同金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal money;
|
private BigDecimal money;
|
||||||
/**
|
/**
|
||||||
* 已回款金额
|
* 已回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal payMoney;
|
private BigDecimal payMoney;
|
||||||
/**
|
/**
|
||||||
* 未回款金额
|
* 未回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal unPayMoney;
|
private BigDecimal unPayMoney;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目成本
|
* 项目成本
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal cost;
|
private BigDecimal cost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投入
|
* 投入
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal investCapital;
|
private BigDecimal investCapital;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* roi
|
* roi
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal roi;
|
private BigDecimal roi;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ public class MakeAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 成交总金额
|
* 成交总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal all;
|
private BigDecimal all;
|
||||||
/**
|
/**
|
||||||
* 新签合同信息
|
* 新签合同信息
|
||||||
|
@ -26,7 +26,7 @@ public class RenewalInfoVo {
|
|||||||
/**
|
/**
|
||||||
* 到期合同总额
|
* 到期合同总额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal contractAmount;
|
private BigDecimal contractAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,12 +42,12 @@ public class RenewalInfoVo {
|
|||||||
/**
|
/**
|
||||||
* 已续费金额
|
* 已续费金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal payMoney;
|
private BigDecimal payMoney;
|
||||||
/**
|
/**
|
||||||
* 当月未续费金额
|
* 当月未续费金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal unPayMoney;
|
private BigDecimal unPayMoney;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ public class ReturnAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 成交总金额
|
* 成交总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal all;
|
private BigDecimal all;
|
||||||
/**
|
/**
|
||||||
* 新签合同信息
|
* 新签合同信息
|
||||||
@ -56,17 +56,17 @@ public class ReturnAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 合同金额
|
* 合同金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal money;
|
private BigDecimal money;
|
||||||
/**
|
/**
|
||||||
* 已回款金额
|
* 已回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal payMoney;
|
private BigDecimal payMoney;
|
||||||
/**
|
/**
|
||||||
* 未回款金额
|
* 未回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal unPayMoney;
|
private BigDecimal unPayMoney;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,17 +35,17 @@ public class ReturnMoneyInfoVo {
|
|||||||
/**
|
/**
|
||||||
* 当月合同回款金额
|
* 当月合同回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal sumMoney;
|
private BigDecimal sumMoney;
|
||||||
/**
|
/**
|
||||||
* 当月已回款金额
|
* 当月已回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal payMoney;
|
private BigDecimal payMoney;
|
||||||
/**
|
/**
|
||||||
* 当月未回款金额
|
* 当月未回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal unPayMoney;
|
private BigDecimal unPayMoney;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,19 +47,19 @@ public class SalasVo {
|
|||||||
/**
|
/**
|
||||||
* 已成交总额
|
* 已成交总额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal sumContractAmount;
|
private BigDecimal sumContractAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已回款金额
|
* 已回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal payContractAmount;
|
private BigDecimal payContractAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 未回款金额
|
* 未回款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal unPayContractAmount;
|
private BigDecimal unPayContractAmount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,43 +24,43 @@ public class UserAmountInfoVo {
|
|||||||
/**
|
/**
|
||||||
* 合同总金额
|
* 合同总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal sumAmount = new BigDecimal(0);
|
private BigDecimal sumAmount = new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 已支付总金额
|
* 已支付总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal payedSumAmount = new BigDecimal(0);
|
private BigDecimal payedSumAmount = new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 未支付金额
|
* 未支付金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal unPaySumAmount = new BigDecimal(0);
|
private BigDecimal unPaySumAmount = new BigDecimal(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 托管类型合同总金额 类型号:4
|
* 托管类型合同总金额 类型号:4
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal tuoGuanAmount = new BigDecimal(0);
|
private BigDecimal tuoGuanAmount = new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 续费类型合同总金额
|
* 续费类型合同总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal xuFeiAmount = new BigDecimal(0);
|
private BigDecimal xuFeiAmount = new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 软件定制类型合同总金额 类型号:9
|
* 软件定制类型合同总金额 类型号:9
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal softwareDevAmount = new BigDecimal(0);
|
private BigDecimal softwareDevAmount = new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 其他类型合同总金额
|
* 其他类型合同总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal otherAmount = new BigDecimal(0);
|
private BigDecimal otherAmount = new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 转介绍的合同金额
|
* 转介绍的合同金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal jieShaoAmount = new BigDecimal(0);
|
private BigDecimal jieShaoAmount = new BigDecimal(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,14 +24,9 @@ public class UserAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 成交总金额
|
* 成交总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal all;
|
private BigDecimal all;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 各人员成交金额
|
* 各人员成交金额
|
||||||
*/
|
*/
|
||||||
|
@ -35,17 +35,17 @@ public class UserContractAmountInfo {
|
|||||||
/**
|
/**
|
||||||
* 服务类型金额
|
* 服务类型金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal businessAmount;
|
private BigDecimal businessAmount;
|
||||||
/**
|
/**
|
||||||
* 客户来源
|
* 客户来源
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private String customSource;
|
private String customSource;
|
||||||
/**
|
/**
|
||||||
* 合同价格
|
* 合同价格
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal contractAmount;
|
private BigDecimal contractAmount;
|
||||||
/**
|
/**
|
||||||
* payId
|
* payId
|
||||||
@ -54,7 +54,7 @@ public class UserContractAmountInfo {
|
|||||||
/**
|
/**
|
||||||
* 已付款金额
|
* 已付款金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal payedMoney;
|
private BigDecimal payedMoney;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,19 +29,19 @@ public class UserContractAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 用户所有合同总金额
|
* 用户所有合同总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal sumAmount = new BigDecimal(0);
|
private BigDecimal sumAmount = new BigDecimal(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转介绍的合同金额
|
* 转介绍的合同金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal jieShaoAmount = new BigDecimal(0);
|
private BigDecimal jieShaoAmount = new BigDecimal(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他类型合同总金额
|
* 其他类型合同总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal otherAmount = new BigDecimal(0);
|
private BigDecimal otherAmount = new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 转介绍合同数量
|
* 转介绍合同数量
|
||||||
@ -55,16 +55,16 @@ public class UserContractAmountVo {
|
|||||||
/**
|
/**
|
||||||
* 已支付总金额
|
* 已支付总金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal jsPayedSumAmount=new BigDecimal(0);
|
private BigDecimal jsPayedSumAmount=new BigDecimal(0);
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal otherPayedSumAmount=new BigDecimal(0);
|
private BigDecimal otherPayedSumAmount=new BigDecimal(0);
|
||||||
/**
|
/**
|
||||||
* 未支付金额
|
* 未支付金额
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal jsUnPaySumAmount=new BigDecimal(0);
|
private BigDecimal jsUnPaySumAmount=new BigDecimal(0);
|
||||||
@JsonSerialize(using = BigDecimalSerializer.class)
|
// @JsonSerialize(using = BigDecimalSerializer.class)
|
||||||
private BigDecimal otherUnPaySumAmount=new BigDecimal(0);
|
private BigDecimal otherUnPaySumAmount=new BigDecimal(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,6 +29,6 @@ public enum PayStatusEnum {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static List<String> getStatus() {
|
public static List<String> getStatus() {
|
||||||
return List.of(PAYAPPO.getCode(),FILE.getCode());
|
return List.of(FILE.getCode(),PAYAPPO.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.pusong.business.domain.PsContractInfo;
|
import com.pusong.business.domain.PsContractInfo;
|
||||||
import com.pusong.business.domain.PsCustomInfo;
|
import com.pusong.business.domain.PsCustomInfo;
|
||||||
import com.pusong.business.domain.PsSalaryContract;
|
import com.pusong.business.domain.PsSalaryContract;
|
||||||
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
import com.pusong.business.domain.vo.*;
|
||||||
import com.pusong.business.domain.vo.PsContractInfoVo;
|
|
||||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
|
||||||
import com.pusong.business.domain.vo.PsSalaryContractVo;
|
|
||||||
import com.pusong.business.domain.vo.home.ChannelPayInfo;
|
import com.pusong.business.domain.vo.home.ChannelPayInfo;
|
||||||
import com.pusong.business.domain.vo.home.SalasVo;
|
import com.pusong.business.domain.vo.home.SalasVo;
|
||||||
import com.pusong.business.domain.vo.home.UserContractAmountInfo;
|
import com.pusong.business.domain.vo.home.UserContractAmountInfo;
|
||||||
@ -19,6 +16,7 @@ import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
import com.pusong.common.mybatis.enums.DataScopeType;
|
import com.pusong.common.mybatis.enums.DataScopeType;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.temporal.Temporal;
|
import java.time.temporal.Temporal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -33,6 +31,18 @@ import java.util.Map;
|
|||||||
public interface PsContractInfoMapper extends BaseMapperPlus<PsContractInfo, PsContractInfoVo> {
|
public interface PsContractInfoMapper extends BaseMapperPlus<PsContractInfo, PsContractInfoVo> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@DataPermission({
|
||||||
|
@DataColumn(key = "userName", value = "info.custom_manager"),
|
||||||
|
@DataColumn(key = "deptName", value = "us.dept_id", dataScopeType = DataScopeType.CAIWU_HETONG)
|
||||||
|
})
|
||||||
|
List<ContractAmountVo> selectCountContract(@Param(Constants.WRAPPER) Wrapper<PsContractInfo> queryWrapper);
|
||||||
|
@DataPermission({
|
||||||
|
@DataColumn(key = "userName", value = "info.custom_manager"),
|
||||||
|
@DataColumn(key = "deptName", value = "us.dept_id", dataScopeType = DataScopeType.CAIWU_HETONG)
|
||||||
|
})
|
||||||
|
PsContractCountVo selectCountContractPay(@Param(Constants.WRAPPER) Wrapper<PsContractInfo> queryWrapper);
|
||||||
|
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "userName", value = "info.custom_manager"),
|
@DataColumn(key = "userName", value = "info.custom_manager"),
|
||||||
@DataColumn(key = "deptName", value = "us.dept_id", dataScopeType = DataScopeType.CAIWU_HETONG)
|
@DataColumn(key = "deptName", value = "us.dept_id", dataScopeType = DataScopeType.CAIWU_HETONG)
|
||||||
|
@ -3,6 +3,7 @@ package com.pusong.business.service;
|
|||||||
import com.pusong.business.domain.PsContractInfo;
|
import com.pusong.business.domain.PsContractInfo;
|
||||||
import com.pusong.business.domain.bo.PsContractInfoQueryBo;
|
import com.pusong.business.domain.bo.PsContractInfoQueryBo;
|
||||||
import com.pusong.business.domain.bo.PsInvoiceBo;
|
import com.pusong.business.domain.bo.PsInvoiceBo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractCountVo;
|
||||||
import com.pusong.business.domain.vo.PsContractInfoVo;
|
import com.pusong.business.domain.vo.PsContractInfoVo;
|
||||||
import com.pusong.business.domain.bo.PsContractInfoBo;
|
import com.pusong.business.domain.bo.PsContractInfoBo;
|
||||||
import com.pusong.business.domain.vo.PsSalaryContractVo;
|
import com.pusong.business.domain.vo.PsSalaryContractVo;
|
||||||
@ -47,6 +48,8 @@ public interface IPsContractInfoService {
|
|||||||
PsContractInfoVo queryInfoByCustomId(Long customerId);
|
PsContractInfoVo queryInfoByCustomId(Long customerId);
|
||||||
void fillMoney(PsContractInfoVo vo);
|
void fillMoney(PsContractInfoVo vo);
|
||||||
List<PsContractInfo> queryByCode(Long customId, String code, String status);
|
List<PsContractInfo> queryByCode(Long customId, String code, String status);
|
||||||
|
|
||||||
|
PsContractCountVo countContractInfo(PsContractInfoQueryBo bo);
|
||||||
/**
|
/**
|
||||||
* 分页查询合同基本信息列表
|
* 分页查询合同基本信息列表
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@ public interface IPsCustomInfoService {
|
|||||||
* 查询登陆人下所有的客户名称和id
|
* 查询登陆人下所有的客户名称和id
|
||||||
* @return 客户id和姓名
|
* @return 客户id和姓名
|
||||||
*/
|
*/
|
||||||
List<Map<String,Object>> listByLoginUser(String name);
|
List<Map<String,Object>> listByLoginUser(String name, PageQuery pageQuery);
|
||||||
/**
|
/**
|
||||||
* 分页查询客户基本信息列表
|
* 分页查询客户基本信息列表
|
||||||
*
|
*
|
||||||
|
@ -321,13 +321,14 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
|||||||
/**
|
/**
|
||||||
* 保存公司合同关联表
|
* 保存公司合同关联表
|
||||||
*/
|
*/
|
||||||
public void saveContractCompany(List<PsCompanyInfoBo> list,String contractCode ){
|
public void saveContractCompany(List<PsCompanyInfoBo> list, String contractCode){
|
||||||
contractCompanyMapper.delete(Wrappers.<PsContractCompany>lambdaQuery().eq(PsContractCompany::getContractCode, contractCode));
|
contractCompanyMapper.delete(Wrappers.<PsContractCompany>lambdaQuery().eq(PsContractCompany::getContractCode, contractCode));
|
||||||
List <PsContractCompany> saveList = new ArrayList<>();
|
List <PsContractCompany> saveList = new ArrayList<>();
|
||||||
for(PsCompanyInfoBo bo:list){
|
for(PsCompanyInfoBo bo : list){
|
||||||
PsContractCompany contractCompany = new PsContractCompany();
|
PsContractCompany contractCompany = new PsContractCompany();
|
||||||
contractCompany.setContractCode(contractCode);
|
contractCompany.setContractCode(contractCode);
|
||||||
contractCompany.setCompanyId(bo.getId());
|
contractCompany.setCompanyId(bo.getId());
|
||||||
|
contractCompany.setTaskRemark(bo.getTaskRemark());
|
||||||
saveList.add(contractCompany);
|
saveList.add(contractCompany);
|
||||||
}
|
}
|
||||||
contractCompanyMapper.insertBatch(saveList);
|
contractCompanyMapper.insertBatch(saveList);
|
||||||
|
@ -95,6 +95,8 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
private final SysUserMapper sysUserMapper;
|
private final SysUserMapper sysUserMapper;
|
||||||
private final ISysNoticeService noticeService;
|
private final ISysNoticeService noticeService;
|
||||||
|
|
||||||
|
private final PsContractPayMapper psContractPayMapper;
|
||||||
|
|
||||||
public static String getContractCode(){
|
public static String getContractCode(){
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
int randomNumber = random.nextInt(8999) + 1000;
|
int randomNumber = random.nextInt(8999) + 1000;
|
||||||
@ -302,6 +304,77 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PsContractCountVo countContractInfo(PsContractInfoQueryBo bo){
|
||||||
|
if(bo.getType() == null || bo.getType() == 1){//合同列表(要作废数据)
|
||||||
|
}else if(bo.getType() == 2){//待回款(不要作废数据)
|
||||||
|
bo.setInContractStatus(List.of(ContractStatusEnum.CREATE.getCode()));
|
||||||
|
}else if (bo.getType() == 3){//已回款(要特定的作废数据)
|
||||||
|
bo.setInContractStatus(ContractStatusEnum.getReturn());
|
||||||
|
}else if (bo.getType() == 4){//托管续费合同
|
||||||
|
bo.setInContractStatus(List.of(ContractStatusEnum.SUCCESS.getCode()));
|
||||||
|
log.info("托管服务");
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryWrapper<PsContractInfo> lqw = buildQueryWrapper(bo);
|
||||||
|
List<ContractAmountVo> contractCountList = baseMapper.selectCountContract(lqw);
|
||||||
|
if (contractCountList.isEmpty()){
|
||||||
|
return new PsContractCountVo();
|
||||||
|
}
|
||||||
|
Set<String> allCode = new HashSet<>();
|
||||||
|
BigDecimal allAmount = new BigDecimal(0);
|
||||||
|
for (ContractAmountVo contractAmountRes : contractCountList) {
|
||||||
|
allCode.add(contractAmountRes.getContractCode());
|
||||||
|
allAmount = allAmount.add(contractAmountRes.getContractAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryWrapper<PsContractPay> payVoQueryWrapper = new QueryWrapper<>();
|
||||||
|
payVoQueryWrapper.in("contract_code", allCode);
|
||||||
|
payVoQueryWrapper.eq("del_flag", 0);
|
||||||
|
payVoQueryWrapper.eq("pay_status", '1');
|
||||||
|
List<PsContractPayVo> psContractPayVos = psContractPayMapper.selectVoList(payVoQueryWrapper);
|
||||||
|
Map<String, BigDecimal> contractPay = new HashMap<>();//每个合同支付了多少钱
|
||||||
|
BigDecimal payAll = new BigDecimal(0);
|
||||||
|
for (PsContractPayVo psContractPayVo : psContractPayVos) {
|
||||||
|
if ("1".equals(psContractPayVo.getBusinessType())){
|
||||||
|
payAll = payAll.add(psContractPayVo.getMoney());
|
||||||
|
BigDecimal nowPay = contractPay.getOrDefault(psContractPayVo.getContractCode(), new BigDecimal(0));
|
||||||
|
nowPay = nowPay.add(psContractPayVo.getMoney());
|
||||||
|
contractPay.put(psContractPayVo.getContractCode(), nowPay);
|
||||||
|
}else if ("2".equals(psContractPayVo.getBusinessType())) {
|
||||||
|
payAll = payAll.subtract(psContractPayVo.getMoney());
|
||||||
|
BigDecimal nowPay = contractPay.getOrDefault(psContractPayVo.getContractCode(), new BigDecimal(0));
|
||||||
|
nowPay = nowPay.subtract(psContractPayVo.getMoney());
|
||||||
|
contractPay.put(psContractPayVo.getContractCode(), nowPay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Set<String> payedContract = new HashSet<>();//已支付的合同
|
||||||
|
for (Map.Entry<String, BigDecimal> stringBigDecimalEntry : contractPay.entrySet()) {
|
||||||
|
if(stringBigDecimalEntry.getValue().doubleValue() > 0){
|
||||||
|
payedContract.add(stringBigDecimalEntry.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//已有回款合同 总金额
|
||||||
|
BigDecimal hasPayContractAmount = new BigDecimal(0);
|
||||||
|
//没有回款的合同
|
||||||
|
BigDecimal noPayContractAmount = new BigDecimal(0);
|
||||||
|
for (ContractAmountVo contractAmountRes : contractCountList) {
|
||||||
|
if (payedContract.contains(contractAmountRes.getContractCode())) {
|
||||||
|
hasPayContractAmount = hasPayContractAmount.add(contractAmountRes.getContractAmount());
|
||||||
|
}else{
|
||||||
|
noPayContractAmount = noPayContractAmount.add(contractAmountRes.getContractAmount());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PsContractCountVo contractCountVo = new PsContractCountVo();
|
||||||
|
contractCountVo.setContractAmount(allAmount);
|
||||||
|
contractCountVo.setPayMoney(payAll);
|
||||||
|
contractCountVo.setResidualMoney(hasPayContractAmount.subtract(payAll));
|
||||||
|
contractCountVo.setWaitPayMoney(noPayContractAmount);
|
||||||
|
|
||||||
|
return contractCountVo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询合同信息列表
|
* 分页查询合同信息列表
|
||||||
*
|
*
|
||||||
@ -1007,8 +1080,8 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
qw.exists(CollectionUtils.isNotEmpty(bo.getServiceProjects()), "select 1 from ps_contract_business detail " +
|
qw.exists(CollectionUtils.isNotEmpty(bo.getServiceProjects()), "select 1 from ps_contract_business detail " +
|
||||||
"where detail.contract_code = info.contract_code and detail.business_type in ("+StringUtils.join(bo.getServiceProjects(),",")+")");//服务项目编码集合
|
"where detail.contract_code = info.contract_code and detail.business_type in ("+StringUtils.join(bo.getServiceProjects(),",")+")");//服务项目编码集合
|
||||||
qw.between(bo.getMoneyEnd() != null && bo.getMoneyStart() !=null,"info.contract_amount",bo.getMoneyStart(),bo.getMoneyEnd());
|
qw.between(bo.getMoneyEnd() != null && bo.getMoneyStart() !=null,"info.contract_amount",bo.getMoneyStart(),bo.getMoneyEnd());
|
||||||
qw.orderByDesc("info.create_time");
|
// qw.orderByDesc("info.create_time");
|
||||||
|
qw.orderByDesc("info.apply_date");
|
||||||
return qw;
|
return qw;
|
||||||
}
|
}
|
||||||
private List<PsContractInfoVo> fillContractInfo(List<PsContractInfoVo> vos){
|
private List<PsContractInfoVo> fillContractInfo(List<PsContractInfoVo> vos){
|
||||||
|
@ -76,7 +76,7 @@ public class PsContractPayServiceImpl implements IPsContractPayService {
|
|||||||
.eq(code != null ,PsContractPay::getPayStatus, code)
|
.eq(code != null ,PsContractPay::getPayStatus, code)
|
||||||
.notIn(PsContractPay::getPayStatus, PayStatusEnum.getStatus())//去掉无用的状态
|
.notIn(PsContractPay::getPayStatus, PayStatusEnum.getStatus())//去掉无用的状态
|
||||||
.orderByAsc(PsContractPay::getPayDate));
|
.orderByAsc(PsContractPay::getPayDate));
|
||||||
return list == null?new ArrayList<>():list;
|
return list == null ? new ArrayList<>() : list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PsContractPayVo> queryListByContractCode(List<String> contractCode, String business, PayStatusEnum enu){
|
public List<PsContractPayVo> queryListByContractCode(List<String> contractCode, String business, PayStatusEnum enu){
|
||||||
@ -84,8 +84,8 @@ public class PsContractPayServiceImpl implements IPsContractPayService {
|
|||||||
String code = enu == null ? null :enu.getCode();
|
String code = enu == null ? null :enu.getCode();
|
||||||
List<PsContractPayVo> list = baseMapper.selectVoList(Wrappers.<PsContractPay>lambdaQuery().
|
List<PsContractPayVo> list = baseMapper.selectVoList(Wrappers.<PsContractPay>lambdaQuery().
|
||||||
in(PsContractPay::getContractCode, contractCode).eq(PsContractPay::getDelFlag,0)
|
in(PsContractPay::getContractCode, contractCode).eq(PsContractPay::getDelFlag,0)
|
||||||
.eq(StringUtils.isNotBlank(business),PsContractPay::getBusinessType,business)
|
.eq(StringUtils.isNotBlank(business), PsContractPay::getBusinessType, business)
|
||||||
.eq(code != null ,PsContractPay::getPayStatus, code)
|
.eq(code != null, PsContractPay::getPayStatus, code)
|
||||||
.notIn(PsContractPay::getPayStatus, PayStatusEnum.getStatus())//去掉无用的状态
|
.notIn(PsContractPay::getPayStatus, PayStatusEnum.getStatus())//去掉无用的状态
|
||||||
.orderByAsc(PsContractPay::getPayDate));
|
.orderByAsc(PsContractPay::getPayDate));
|
||||||
return list == null?new ArrayList<>():list;
|
return list == null?new ArrayList<>():list;
|
||||||
|
@ -72,22 +72,43 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
* @return 客户id和姓名
|
* @return 客户id和姓名
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String,Object>> listByLoginUser(String name) {
|
public List<Map<String,Object>> listByLoginUser(String name, PageQuery pageQuery) {
|
||||||
|
|
||||||
//查询客户基本信息
|
//查询客户基本信息
|
||||||
List<PsCustomInfo> list = baseMapper.selectList(new QueryWrapper<PsCustomInfo>().select("id", "custom_name","custom_mobile","create_time","custom_source")
|
Page<PsCustomInfoVo> list = baseMapper.selectVoPage(pageQuery.build()
|
||||||
.lambda().eq(PsCustomInfo::getDelFlag, 0).isNotNull(PsCustomInfo::getCustomName).ne(PsCustomInfo::getCustomName,"").ne(PsCustomInfo::getCustomName,"无")
|
, new QueryWrapper<PsCustomInfo>()
|
||||||
.and(StringUtils.isNotBlank(name),wq->wq.like(PsCustomInfo::getCustomName,name).or().like(PsCustomInfo::getCustomMobile,name)));
|
.select("id", "custom_name", "custom_mobile", "create_time", "custom_source")
|
||||||
|
.lambda().eq(PsCustomInfo::getDelFlag, 0).isNotNull(PsCustomInfo::getCustomName).ne(PsCustomInfo::getCustomName,"").ne(PsCustomInfo::getCustomName,"无")
|
||||||
|
.and(StringUtils.isNotBlank(name), wq->wq.like(PsCustomInfo::getCustomName,name).or().like(PsCustomInfo::getCustomMobile,name)));
|
||||||
|
|
||||||
|
List<Long> ids = list.getRecords().stream().map(PsCustomInfoVo::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//查询公司信息
|
||||||
|
List<PsCompanyInfoVo> companyInfoVos = companyInfoMapper.selectVoList(Wrappers.<PsCompanyInfo>lambdaQuery()
|
||||||
|
.in(PsCompanyInfo::getCustomId, ids)
|
||||||
|
.eq(PsCompanyInfo::getDelFlag, 0)
|
||||||
|
.eq(PsCompanyInfo::getCompanyType, "2")
|
||||||
|
);
|
||||||
|
Map<Long, List<PsCompanyInfoVo>> id_companyMap = new HashMap<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(companyInfoVos)){
|
||||||
|
//分组
|
||||||
|
id_companyMap = companyInfoVos.stream().collect((Collectors.groupingBy(PsCompanyInfoVo::getCustomId)));
|
||||||
|
//排序
|
||||||
|
id_companyMap.entrySet().forEach(entry->{
|
||||||
|
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingLong(PsCompanyInfoVo::getId)).collect(Collectors.toList()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
List<Map<String,Object>> listmap = new ArrayList<>();
|
List<Map<String,Object>> listmap = new ArrayList<>();
|
||||||
list.forEach(item->{
|
for (PsCustomInfoVo item : list.getRecords()) {
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String,Object> map = new HashMap<>();
|
||||||
map.put("id", item.getId());
|
map.put("id", item.getId());
|
||||||
map.put("customName", item.getCustomName());
|
map.put("customName", item.getCustomName());
|
||||||
map.put("custom_mobile", item.getCustomMobile());
|
map.put("custom_mobile", item.getCustomMobile());
|
||||||
map.put("createTime", DateUtils.toString(item.getCreateTime(),"yyyy-MM-dd"));
|
map.put("createTime", DateUtils.toString(item.getCreateTime(),"yyyy-MM-dd"));
|
||||||
map.put("customSource", item.getCustomSource());
|
map.put("customSource", item.getCustomSource());
|
||||||
|
map.put("psCompanySerivceVo", id_companyMap.get(item.getId()));
|
||||||
listmap.add(map);
|
listmap.add(map);
|
||||||
});
|
}
|
||||||
|
|
||||||
return listmap;
|
return listmap;
|
||||||
}
|
}
|
||||||
@ -151,7 +172,6 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingLong(PsCustomCallbackVo::getId).reversed()).collect(Collectors.toList()));
|
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingLong(PsCustomCallbackVo::getId).reversed()).collect(Collectors.toList()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询公司信息
|
//查询公司信息
|
||||||
List<PsCompanyInfoVo> companyInfoVos = companyInfoMapper.selectVoList(Wrappers.<PsCompanyInfo>lambdaQuery()
|
List<PsCompanyInfoVo> companyInfoVos = companyInfoMapper.selectVoList(Wrappers.<PsCompanyInfo>lambdaQuery()
|
||||||
.in(PsCompanyInfo::getCustomId, ids)
|
.in(PsCompanyInfo::getCustomId, ids)
|
||||||
|
@ -66,6 +66,17 @@ public class PsSalaryServiceImpl implements IPsSalaryService {
|
|||||||
LocalDateTime deadline = bo.getEndDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
LocalDateTime deadline = bo.getEndDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
LocalDate thisMonth = DateUtils.getFirstDayZeroTimeByMonth().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
LocalDate thisMonth = DateUtils.getFirstDayZeroTimeByMonth().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
List<PsSalaryVo> adds = calSalaryBatch.calcData(deadline, thisMonth, false);
|
List<PsSalaryVo> adds = calSalaryBatch.calcData(deadline, thisMonth, false);
|
||||||
|
Collections.sort(adds, new Comparator<PsSalaryVo>() {
|
||||||
|
@Override
|
||||||
|
public int compare(PsSalaryVo o1, PsSalaryVo o2) {
|
||||||
|
if (o1.getSalaryMoney().doubleValue() > o2.getSalaryMoney().doubleValue()){
|
||||||
|
return -1;
|
||||||
|
}else{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
List<PsSalaryVo> records = new ArrayList<>();
|
List<PsSalaryVo> records = new ArrayList<>();
|
||||||
records.addAll(result.getRecords());
|
records.addAll(result.getRecords());
|
||||||
|
|
||||||
@ -97,6 +108,8 @@ public class PsSalaryServiceImpl implements IPsSalaryService {
|
|||||||
lqw.le(bo.getEndDate() != null, "salary_date", bo.getEndDate());
|
lqw.le(bo.getEndDate() != null, "salary_date", bo.getEndDate());
|
||||||
lqw.ge(bo.getStartDate() != null, "salary_date", bo.getStartDate());
|
lqw.ge(bo.getStartDate() != null, "salary_date", bo.getStartDate());
|
||||||
lqw.exists(StringUtils.isNotBlank(bo.getName()),"select 1 from sys_user su where su.user_id = ps_salary.user_id and su.nick_name like %"+bo.getName()+"%");
|
lqw.exists(StringUtils.isNotBlank(bo.getName()),"select 1 from sys_user su where su.user_id = ps_salary.user_id and su.nick_name like %"+bo.getName()+"%");
|
||||||
|
lqw.orderByDesc("salary_money");
|
||||||
|
// lqw.orderByAsc("CASE WHEN salary_money = 0 THEN 9999999999 ELSE salary_money END, salary_money");
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -119,8 +119,8 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
|||||||
vo.setExtend(null);
|
vo.setExtend(null);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
lqw.orderByAsc("CASE WHEN main.task_status = '30' THEN 1 ELSE 0 END ");
|
// lqw.orderByAsc("CASE WHEN main.task_status = '30' THEN 1 ELSE 0 END ");
|
||||||
lqw.orderByAsc("assigned");
|
// lqw.orderByAsc("assigned");
|
||||||
lqw.orderByDesc("main.create_time");
|
lqw.orderByDesc("main.create_time");
|
||||||
page = baseMapper.queryTaskPageList(pageQuery.build(), lqw);
|
page = baseMapper.queryTaskPageList(pageQuery.build(), lqw);
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
${ew.getCustomSqlSegment}
|
${ew.getCustomSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCountContract" resultType="com.pusong.business.domain.vo.ContractAmountVo">
|
||||||
|
select
|
||||||
|
-- sum(info.contract_amount) contract_amount
|
||||||
|
info.contract_code, info.contract_amount
|
||||||
|
from ps_contract_info info
|
||||||
|
left join ps_company_info com on info.company_id = com.id
|
||||||
|
left join ps_custom_info cus on info.custom_id = cus.id
|
||||||
|
left join sys_user us on info.custom_manager = us.user_id
|
||||||
|
${ew.getCustomSqlSegment}
|
||||||
|
</select>
|
||||||
|
<select id="selectCountContractPay" resultType="com.pusong.business.domain.vo.PsContractCountVo">
|
||||||
|
select
|
||||||
|
(
|
||||||
|
select
|
||||||
|
sum(pay.money) pay_money
|
||||||
|
from ps_contract_info info
|
||||||
|
left join ps_company_info com on info.company_id = com.id
|
||||||
|
left join ps_custom_info cus on info.custom_id = cus.id
|
||||||
|
left join sys_user us on info.custom_manager = us.user_id
|
||||||
|
left join ps_contract_pay pay on pay.contract_code = info.contract_code
|
||||||
|
and pay.del_flag = 0 and pay.business_type = '1' and pay.pay_status = '1'
|
||||||
|
${ew.getCustomSqlSegment}
|
||||||
|
) pay_money
|
||||||
|
,
|
||||||
|
(
|
||||||
|
select
|
||||||
|
sum(ret_pay.money) return_money
|
||||||
|
from ps_contract_info info
|
||||||
|
left join ps_company_info com on info.company_id = com.id
|
||||||
|
left join ps_custom_info cus on info.custom_id = cus.id
|
||||||
|
left join sys_user us on info.custom_manager = us.user_id
|
||||||
|
left join ps_contract_pay ret_pay on ret_pay.contract_code = info.contract_code
|
||||||
|
and ret_pay.del_flag = 0 and ret_pay.business_type = '2' and ret_pay.pay_status = '1'
|
||||||
|
${ew.getCustomSqlSegment}
|
||||||
|
) return_money
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectPageContractListByCustomId" resultMap="contractResult">
|
<select id="selectPageContractListByCustomId" resultMap="contractResult">
|
||||||
<include refid="queryContractList"/>
|
<include refid="queryContractList"/>
|
||||||
<where>
|
<where>
|
||||||
|
@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
cus.custom_mobile cus_custom_mobile,
|
cus.custom_mobile cus_custom_mobile,
|
||||||
cus.custom_manager cus_custom_manager,
|
cus.custom_manager cus_custom_manager,
|
||||||
usr.nick_name cus_custom_manager_name,
|
usr.nick_name cus_custom_manager_name,
|
||||||
|
pcc.task_remark,
|
||||||
|
|
||||||
(select pta.id from ps_task_appoint pta where pta.task_id=main.id and pta.appoint_type=1 and pta.appoint_status != '50' and pta.del_flag = '0' order by id desc limit 0,1) as inAppo,
|
(select pta.id from ps_task_appoint pta where pta.task_id=main.id and pta.appoint_type=1 and pta.appoint_status != '50' and pta.del_flag = '0' order by id desc limit 0,1) as inAppo,
|
||||||
(select pta.id from ps_task_appoint pta where pta.task_id=main.id and pta.appoint_type=2 and pta.appoint_status != '50' and pta.del_flag = '0' order by id desc limit 0,1) as outAppo,
|
(select pta.id from ps_task_appoint pta where pta.task_id=main.id and pta.appoint_type=2 and pta.appoint_status != '50' and pta.del_flag = '0' order by id desc limit 0,1) as outAppo,
|
||||||
@ -77,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
left join ps_company_info com on main.company_id = com.id
|
left join ps_company_info com on main.company_id = com.id
|
||||||
left join ps_custom_info cus on main.custom_id = cus.id
|
left join ps_custom_info cus on main.custom_id = cus.id
|
||||||
left join sys_user usr on cus.custom_manager = usr.user_id
|
left join sys_user usr on cus.custom_manager = usr.user_id
|
||||||
|
left join ps_contract_company pcc on pcc.contract_code = con.contract_code and pcc.company_id = scom.id
|
||||||
</sql><!-- 这注释是上边sql 的,不知道为啥要加这个来着, 因为任务列表分页受影响,所以删除,left join ps_contract_business bus on bus.contract_code = con.contract_code and bus.company_id = main.service_company_id and bus.del_flag = '0'-->
|
</sql><!-- 这注释是上边sql 的,不知道为啥要加这个来着, 因为任务列表分页受影响,所以删除,left join ps_contract_business bus on bus.contract_code = con.contract_code and bus.company_id = main.service_company_id and bus.del_flag = '0'-->
|
||||||
|
|
||||||
|
|
||||||
@ -104,21 +106,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
con.is_proxy con_is_proxy,
|
con.is_proxy con_is_proxy,
|
||||||
con.custom_scene con_custom_scene,
|
con.custom_scene con_custom_scene,
|
||||||
con.sign_desc con_sign_desc,
|
con.sign_desc con_sign_desc,
|
||||||
com.id scom_id,
|
scom.id scom_id,
|
||||||
usr.nick_name scom_custom_manager_name,
|
usr.nick_name scom_custom_manager_name,
|
||||||
com.company_adress scom_company_adress,
|
scom.company_adress scom_company_adress,
|
||||||
com.company_name scom_company_name,
|
scom.company_name scom_company_name,
|
||||||
com.legal_person_name scom_legal_person_name,
|
scom.legal_person_name scom_legal_person_name,
|
||||||
com.legal_person_idcard scom_legal_person_idcard,
|
scom.legal_person_idcard scom_legal_person_idcard,
|
||||||
com.legal_person_phone scom_legal_person_phone,
|
scom.legal_person_phone scom_legal_person_phone,
|
||||||
com.contact_person_name scom_contact_person_name,
|
scom.contact_person_name scom_contact_person_name,
|
||||||
com.contact_person_phone scom_contact_person_phone,
|
scom.contact_person_phone scom_contact_person_phone,
|
||||||
com.customer_num scom_customer_num,
|
scom.customer_num scom_customer_num,
|
||||||
com.customer_cert scom_customer_cert,
|
scom.customer_cert scom_customer_cert,
|
||||||
com.finance_account_no scom_finance_account_no,
|
scom.finance_account_no scom_finance_account_no,
|
||||||
cus.id cus_id,
|
cus.id cus_id,
|
||||||
cus.custom_name cus_custom_name ,
|
cus.custom_name cus_custom_name ,
|
||||||
cus.custom_mobile cus_custom_mobile,
|
cus.custom_mobile cus_custom_mobile,
|
||||||
|
pcc.task_remark,
|
||||||
(CASE WHEN (con.contract_amount -
|
(CASE WHEN (con.contract_amount -
|
||||||
(select IFNULL(sum(money),0) from ps_contract_pay pay where pay.business_type =1 and pay.contract_code = main.contract_code and pay.pay_status = '1' ) +
|
(select IFNULL(sum(money),0) from ps_contract_pay pay where pay.business_type =1 and pay.contract_code = main.contract_code and pay.pay_status = '1' ) +
|
||||||
(select IFNULL(sum(money),0) from ps_contract_pay cpay where cpay.business_type =2 and cpay.contract_code = main.contract_code )
|
(select IFNULL(sum(money),0) from ps_contract_pay cpay where cpay.business_type =2 and cpay.contract_code = main.contract_code )
|
||||||
@ -134,10 +137,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from ps_task_appoint appo
|
from ps_task_appoint appo
|
||||||
left join ps_task_main main on appo.task_id = main.id and appo.appoint_status != '50'
|
left join ps_task_main main on appo.task_id = main.id and appo.appoint_status != '50'
|
||||||
left join ps_contract_info con on main.contract_code = con.contract_code
|
left join ps_contract_info con on main.contract_code = con.contract_code
|
||||||
left join ps_company_info com on main.service_company_id = com.id
|
left join ps_company_info scom on main.service_company_id = scom.id
|
||||||
left join ps_custom_info cus on main.custom_id = cus.id
|
left join ps_custom_info cus on main.custom_id = cus.id
|
||||||
left join sys_user usr on cus.custom_manager = usr.user_id
|
left join sys_user usr on cus.custom_manager = usr.user_id
|
||||||
|
left join ps_contract_company pcc on pcc.contract_code = con.contract_code and pcc.company_id = scom.id
|
||||||
-- left join ps_task_appoint appoint on appoint.task_id = main.id and appoint.appoint_status != '50' and appoint.del_flag = '0'
|
-- left join ps_task_appoint appoint on appoint.task_id = main.id and appoint.appoint_status != '50' and appoint.del_flag = '0'
|
||||||
|
|
||||||
${ew.getCustomSqlSegment}
|
${ew.getCustomSqlSegment}
|
||||||
|
Loading…
Reference in New Issue
Block a user