编辑配置
This commit is contained in:
parent
0017d23164
commit
b8b59da4c3
@ -0,0 +1,105 @@
|
|||||||
|
package com.pusong.business.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.pusong.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import com.pusong.common.log.annotation.Log;
|
||||||
|
import com.pusong.common.web.core.BaseController;
|
||||||
|
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.pusong.common.core.domain.R;
|
||||||
|
import com.pusong.common.core.validate.AddGroup;
|
||||||
|
import com.pusong.common.core.validate.EditGroup;
|
||||||
|
import com.pusong.common.log.enums.BusinessType;
|
||||||
|
import com.pusong.common.excel.utils.ExcelUtil;
|
||||||
|
import com.pusong.business.domain.vo.PsApproverRecordVo;
|
||||||
|
import com.pusong.business.domain.bo.PsApproverRecordBo;
|
||||||
|
import com.pusong.business.service.IPsApproverRecordService;
|
||||||
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/business/approverRecord")
|
||||||
|
public class PsApproverRecordController extends BaseController {
|
||||||
|
|
||||||
|
private final IPsApproverRecordService psApproverRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询审批记录列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:approverRecord:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<PsApproverRecordVo> list(PsApproverRecordBo bo, PageQuery pageQuery) {
|
||||||
|
return psApproverRecordService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出审批记录列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:approverRecord:export")
|
||||||
|
@Log(title = "审批记录", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(PsApproverRecordBo bo, HttpServletResponse response) {
|
||||||
|
List<PsApproverRecordVo> list = psApproverRecordService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "审批记录", PsApproverRecordVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审批记录详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:approverRecord:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<PsApproverRecordVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(psApproverRecordService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增审批记录
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:approverRecord:add")
|
||||||
|
@Log(title = "审批记录", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody PsApproverRecordBo bo) {
|
||||||
|
return toAjax(psApproverRecordService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改审批记录
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:approverRecord:edit")
|
||||||
|
@Log(title = "审批记录", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PsApproverRecordBo bo) {
|
||||||
|
return toAjax(psApproverRecordService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除审批记录
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:approverRecord:remove")
|
||||||
|
@Log(title = "审批记录", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(psApproverRecordService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
@ -97,12 +97,34 @@ public class PsContractInfoController extends BaseController {
|
|||||||
* 修改合同
|
* 修改合同
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("business:contractList:edit")
|
@SaCheckPermission("business:contractList:edit")
|
||||||
@Log(title = "根据合同编码查询合同信息", businessType = BusinessType.INSERT)
|
@Log(title = "根据合同编码查询合同信息", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping("/edit")
|
@PutMapping("/edit")
|
||||||
public R<Boolean> updateContractByCode(@Validated(EditGroup.class) @RequestBody PsContractInfoBo bo) {
|
public R<Boolean> updateContractByCode(@Validated(EditGroup.class) @RequestBody PsContractInfoBo bo) {
|
||||||
return R.ok(psContractInfoService.updateContractByCode(bo));
|
return R.ok(psContractInfoService.updateContractByCode(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作废合同
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:contractList:cancellation")
|
||||||
|
@Log(title = "作废合同", businessType = BusinessType.DELETE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@GetMapping("/cancellation")
|
||||||
|
public R<Boolean> cancellation(@NotBlank String contractCode, String desc) {
|
||||||
|
return R.ok(psContractInfoService.cancellation(contractCode,desc));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重启合同
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:contractList:restart")
|
||||||
|
@Log(title = "重启合同", businessType = BusinessType.DELETE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@GetMapping("/restart")
|
||||||
|
public R<Boolean> restart(@NotBlank String contractCode) {
|
||||||
|
return R.ok(psContractInfoService.restart(contractCode));
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * 获取合同基本信息详细信息
|
// * 获取合同基本信息详细信息
|
||||||
|
@ -105,8 +105,8 @@ public class PsCustomController extends BaseController {
|
|||||||
@SaCheckPermission("business:customInfo:edit")
|
@SaCheckPermission("business:customInfo:edit")
|
||||||
@Log(title = "客户状态变更操作", businessType = BusinessType.UPDATE)
|
@Log(title = "客户状态变更操作", businessType = BusinessType.UPDATE)
|
||||||
@GetMapping("/updateStatus")
|
@GetMapping("/updateStatus")
|
||||||
public R<Void> updateStatus(@NotEmpty(message = "主键不能为空") Long id,
|
public R<Void> updateStatus(@NotNull(message = "主键不能为空") Long id,
|
||||||
@NotEmpty(message = "操作类型不能为空") Integer type,
|
@NotNull(message = "操作类型不能为空") Integer type,
|
||||||
String desc) {
|
String desc) {
|
||||||
return toAjax(psCustomInfoService.updateCustomerStatus(id, type,desc));
|
return toAjax(psCustomInfoService.updateCustomerStatus(id, type,desc));
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.pusong.business.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.pusong.business.domain.bo.DicDataBo;
|
||||||
|
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||||
|
import com.pusong.business.service.IPsApproverRecordService;
|
||||||
|
import com.pusong.business.service.IServiceConfigService;
|
||||||
|
import com.pusong.common.core.domain.R;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务配置类
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/business/serviceConfig")
|
||||||
|
public class ServiceConfigController {
|
||||||
|
private final IServiceConfigService configService;
|
||||||
|
/**
|
||||||
|
* 获取服务配置
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAllConfig")
|
||||||
|
public R<JSONArray> getAllConfig() {
|
||||||
|
return R.ok(configService.getAllConfig());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增服务配置
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<Void> add(@RequestBody DicDataBo bo) {
|
||||||
|
configService.add(bo);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改服务配置
|
||||||
|
*/
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public R<Void> edit(@RequestBody DicDataBo bo) {
|
||||||
|
configService.edit(bo);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除服务配置
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
public R<Void> delete(Long dictCode) {
|
||||||
|
configService.delete(dictCode);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.pusong.business.domain;
|
||||||
|
|
||||||
|
import com.pusong.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录对象 ps_approver_record
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ps_approver_record")
|
||||||
|
public class PsApproverRecord extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联业务id
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批业务类型
|
||||||
|
*/
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请日期
|
||||||
|
*/
|
||||||
|
private Date applyDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批日期
|
||||||
|
*/
|
||||||
|
private String approverType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批状态(1待审批,2成功,3失败)
|
||||||
|
*/
|
||||||
|
private String approverStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请说明
|
||||||
|
*/
|
||||||
|
private String applyDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批说明
|
||||||
|
*/
|
||||||
|
private String approverDesc;
|
||||||
|
/**
|
||||||
|
* 修改前数据
|
||||||
|
*/
|
||||||
|
private String beforeData;
|
||||||
|
/**
|
||||||
|
* 2逻辑删除 0 默认有效
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -44,15 +44,6 @@ public class PsContractBusiness extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal businessAmount;
|
private BigDecimal businessAmount;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否老账新接
|
|
||||||
*/
|
|
||||||
private String isOld;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否续费
|
|
||||||
*/
|
|
||||||
private String isDue;
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
|
@ -2,6 +2,7 @@ package com.pusong.business.domain;
|
|||||||
|
|
||||||
import com.pusong.common.tenant.core.TenantEntity;
|
import com.pusong.common.tenant.core.TenantEntity;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -89,7 +90,15 @@ public class PsContractInfo extends TenantEntity {
|
|||||||
* 是否代账
|
* 是否代账
|
||||||
*/
|
*/
|
||||||
private String isProxy;
|
private String isProxy;
|
||||||
|
/**
|
||||||
|
* 是否老账新接
|
||||||
|
*/
|
||||||
|
private String isOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否续费
|
||||||
|
*/
|
||||||
|
private String isDue;
|
||||||
/**
|
/**
|
||||||
* 签约备注
|
* 签约备注
|
||||||
*/
|
*/
|
||||||
@ -107,7 +116,20 @@ public class PsContractInfo extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long delFlag;
|
private Long delFlag;
|
||||||
/**
|
/**
|
||||||
* 合同回传状态0未回传1已回传
|
* 合同回传状态CommonStatusEnum
|
||||||
*/
|
*/
|
||||||
private String rollBackStatus;
|
private String rollBackStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同签章状态CommonStatusEnum
|
||||||
|
*/
|
||||||
|
private String signStatus;
|
||||||
|
/**
|
||||||
|
* 服务周期开始时间
|
||||||
|
*/
|
||||||
|
private Date startServiceDate;
|
||||||
|
/**
|
||||||
|
* 服务周期结束时间
|
||||||
|
*/
|
||||||
|
private Date endServiceDate;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,10 @@ public class PsContractPay extends TenantEntity {
|
|||||||
@TableId(value = "id")
|
@TableId(value = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付状态 PayStatusEnum
|
||||||
|
*/
|
||||||
|
private String payStatus;
|
||||||
/**
|
/**
|
||||||
* 合同编码
|
* 合同编码
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.pusong.business.domain.bo;
|
||||||
|
|
||||||
|
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.pusong.system.domain.bo.SysDictDataBo;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典数据业务对象 sys_dict_data
|
||||||
|
*
|
||||||
|
* @author Michelle.Chung
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode
|
||||||
|
@AutoMapper(target = SysDictDataBo.class)
|
||||||
|
public class DicDataBo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级字典编码
|
||||||
|
*/
|
||||||
|
private Long parentDictCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前字典编码
|
||||||
|
*/
|
||||||
|
private Long dictCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典排序
|
||||||
|
*/
|
||||||
|
private Integer dictSort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典描述
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "字典描述不能为空")
|
||||||
|
@Size(min = 0, max = 100, message = "字典描述长度不能超过{max}个字符")
|
||||||
|
private String dictLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注Map
|
||||||
|
*/
|
||||||
|
private Map<String,Object> remarkMap;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.pusong.business.domain.bo;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.PsApproverRecord;
|
||||||
|
import com.pusong.common.core.validate.AddGroup;
|
||||||
|
import com.pusong.common.core.validate.EditGroup;
|
||||||
|
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录业务对象 ps_approver_record
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = PsApproverRecord.class, reverseConvertGenerate = false)
|
||||||
|
public class PsApproverRecordBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联业务id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "关联业务id不能为空")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批业务类型
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "审批业务类型不能为空")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请日期
|
||||||
|
*/
|
||||||
|
@NotNull(message = "申请日期不能为空")
|
||||||
|
private Date applyDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批日期
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "审批日期不能为空")
|
||||||
|
private String approverType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批状态(1待审批,2成功,3失败)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "审批状态(1待审批,2成功,3失败)不能为空")
|
||||||
|
private String approverStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请说明
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "申请说明不能为空")
|
||||||
|
private String applyDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批说明
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "审批说明不能为空")
|
||||||
|
private String approverDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改前数据
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "修改前数据")
|
||||||
|
private String beforeData;
|
||||||
|
|
||||||
|
}
|
@ -48,17 +48,6 @@ public class PsContractBusinessBo {
|
|||||||
@NotNull(message = "服务总金额不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "服务总金额不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private BigDecimal businessAmount;
|
private BigDecimal businessAmount;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否老账新接
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "是否老账新接不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String isOld;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否续费
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "是否续费不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String isDue;
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
|
@ -52,10 +52,17 @@ public class PsContractInfoBo {
|
|||||||
private Date applyDate;
|
private Date applyDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 办理期限
|
* 服务周期开始时间
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "办理期限不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "服务周期开始时间")
|
||||||
private Integer timeLimit;
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date startServiceDate;
|
||||||
|
/**
|
||||||
|
* 服务周期结束时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "服务周期结束时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date endServiceDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户是否到达现场
|
* 客户是否到达现场
|
||||||
@ -77,7 +84,15 @@ public class PsContractInfoBo {
|
|||||||
* 付款方式描述
|
* 付款方式描述
|
||||||
*/
|
*/
|
||||||
private String payModeDesc;
|
private String payModeDesc;
|
||||||
|
/**
|
||||||
|
* 是否老账新接
|
||||||
|
*/
|
||||||
|
private String isOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否续费
|
||||||
|
*/
|
||||||
|
private String isDue;
|
||||||
/**
|
/**
|
||||||
* 合同服务类别
|
* 合同服务类别
|
||||||
*/
|
*/
|
||||||
@ -90,4 +105,16 @@ public class PsContractInfoBo {
|
|||||||
@NotEmpty(message = "公司信息不能为空")
|
@NotEmpty(message = "公司信息不能为空")
|
||||||
private PsCompanyInfoBo companyInfoBo;
|
private PsCompanyInfoBo companyInfoBo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改合同说明
|
||||||
|
*/
|
||||||
|
private String updateDesc;
|
||||||
|
/**
|
||||||
|
* 合同总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal contractAmount;
|
||||||
|
/**
|
||||||
|
* 合同签章状态CommonStatusEnum
|
||||||
|
*/
|
||||||
|
private String signStatus;
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ public class PsContractPayBo extends BaseEntity {
|
|||||||
* 回款日期
|
* 回款日期
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "回款日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "回款日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date payDate;
|
private Date payDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -78,7 +79,6 @@ public class PsContractPayBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 回款备注
|
* 回款备注
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "回款备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String payDesc;
|
private String payDesc;
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,14 +61,33 @@ public class PsCustomInfoBo {
|
|||||||
@NotBlank(message = "客户级别不能为空")
|
@NotBlank(message = "客户级别不能为空")
|
||||||
private String customLevel;
|
private String customLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
@NotNull(message = "公司名称")
|
||||||
|
private String companyName;
|
||||||
/**
|
/**
|
||||||
* 介绍人-仅支持本司内客户
|
* 介绍人-仅支持本司内客户
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "介绍人姓名")
|
@NotNull(message = "介绍人姓名")
|
||||||
private String customIntroducerName;
|
private String customIntroducerName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 颜色
|
||||||
|
*/
|
||||||
|
private String color;
|
||||||
|
/**
|
||||||
|
* 客户状态包含
|
||||||
|
*/
|
||||||
|
private List<String> inCustomStatus;
|
||||||
|
/**
|
||||||
|
* 客户状态不包含
|
||||||
|
*/
|
||||||
|
private List<String> notCustomStatus;
|
||||||
|
/**
|
||||||
|
* 拉黑标识 1是0否
|
||||||
|
*/
|
||||||
|
private String black;
|
||||||
/**
|
/**
|
||||||
* 报价信息
|
* 报价信息
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.pusong.business.domain.PsApproverRecord;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.pusong.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import com.pusong.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录视图对象 ps_approver_record
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = PsApproverRecord.class)
|
||||||
|
public class PsApproverRecordVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联业务id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "关联业务id")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批业务类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "审批业务类型")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "申请日期")
|
||||||
|
private Date applyDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "审批日期")
|
||||||
|
private String approverType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批状态(1待审批,2成功,3失败)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "审批状态", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "1=待审批,2成功,3失败")
|
||||||
|
private String approverStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请说明
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "申请说明")
|
||||||
|
private String applyDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批说明
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "审批说明")
|
||||||
|
private String approverDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改前数据
|
||||||
|
*/
|
||||||
|
private String beforeData;
|
||||||
|
}
|
@ -1,6 +1,9 @@
|
|||||||
package com.pusong.business.domain.vo;
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.pusong.business.domain.PsCompanyInfo;
|
import com.pusong.business.domain.PsCompanyInfo;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
@ -71,7 +74,10 @@ public class PsCompanyInfoVo implements Serializable {
|
|||||||
* 法人电话号
|
* 法人电话号
|
||||||
*/
|
*/
|
||||||
private String legalPersonPhone;
|
private String legalPersonPhone;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,15 +56,7 @@ public class PsContractBusinessVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal businessAmount;
|
private BigDecimal businessAmount;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否老账新接
|
|
||||||
*/
|
|
||||||
private String isOld;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否续费
|
|
||||||
*/
|
|
||||||
private String isDue;
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
|
@ -11,6 +11,7 @@ import com.pusong.common.excel.convert.ExcelDictConvert;
|
|||||||
import com.pusong.common.translation.annotation.Translation;
|
import com.pusong.common.translation.annotation.Translation;
|
||||||
import com.pusong.common.translation.constant.TransConstant;
|
import com.pusong.common.translation.constant.TransConstant;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -84,7 +85,16 @@ public class PsContractInfoVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date applyDate;
|
private Date applyDate;
|
||||||
|
/**
|
||||||
|
* 服务周期开始时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date startServiceDate;
|
||||||
|
/**
|
||||||
|
* 服务周期结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date endServiceDate;
|
||||||
/**
|
/**
|
||||||
* 办理期限
|
* 办理期限
|
||||||
*/
|
*/
|
||||||
@ -145,6 +155,19 @@ public class PsContractInfoVo implements Serializable {
|
|||||||
* 合同回传状态0未回传1已回传
|
* 合同回传状态0未回传1已回传
|
||||||
*/
|
*/
|
||||||
private String rollBackStatus;
|
private String rollBackStatus;
|
||||||
|
/**
|
||||||
|
* 合同签章状态CommonStatusEnum
|
||||||
|
*/
|
||||||
|
private String signStatus;
|
||||||
|
/**
|
||||||
|
* 是否老账新接
|
||||||
|
*/
|
||||||
|
private String isOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否续费
|
||||||
|
*/
|
||||||
|
private String isDue;
|
||||||
/**
|
/**
|
||||||
* 公司信息
|
* 公司信息
|
||||||
*/
|
*/
|
||||||
|
@ -2,6 +2,7 @@ package com.pusong.business.domain.vo;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.pusong.business.domain.PsCustomCallback;
|
||||||
import com.pusong.business.domain.PsCustomPrice;
|
import com.pusong.business.domain.PsCustomPrice;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -19,7 +20,7 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
@AutoMapper(target = PsCustomPrice.class)
|
@AutoMapper(target = PsCustomCallback.class)
|
||||||
public class PsCustomCallbackVo implements Serializable {
|
public class PsCustomCallbackVo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.pusong.business.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表状态枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ApproverStatusEnum {
|
||||||
|
|
||||||
|
INIT("1","待审批"),
|
||||||
|
SUCCESS("2","审批成功"),
|
||||||
|
FAIL("3","审批失败");
|
||||||
|
private String code;
|
||||||
|
private String text;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.pusong.business.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批类型美剧
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ApproverTypeEnum {
|
||||||
|
UPDATE("update","修改合同审批"),
|
||||||
|
CANCELLA("cancellation","作废合同审批");
|
||||||
|
private String code;
|
||||||
|
private String text;
|
||||||
|
}
|
@ -10,7 +10,12 @@ import lombok.Getter;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum CommonStatusEnum {
|
public enum CommonStatusEnum {
|
||||||
Y("1","是"),
|
Y("1","是"),
|
||||||
N("0","否");
|
N("0","否"),
|
||||||
|
//需要审批的字段
|
||||||
|
INIT("01","未进行"),
|
||||||
|
ING("02","审批中"),
|
||||||
|
SUCCESS("03","审批成功"),
|
||||||
|
FAIL("04","审批失败");
|
||||||
private String code;
|
private String code;
|
||||||
private String text;
|
private String text;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package com.pusong.business.enums;
|
package com.pusong.business.enums;
|
||||||
|
|
||||||
|
import com.pusong.common.core.utils.StringUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum ContractStatusEnum {
|
public enum ContractStatusEnum {
|
||||||
@ -11,7 +15,21 @@ public enum ContractStatusEnum {
|
|||||||
RETURN("30","已回款(待派单处理)"),
|
RETURN("30","已回款(待派单处理)"),
|
||||||
EXECUTION("40","已派单(处理中)"),
|
EXECUTION("40","已派单(处理中)"),
|
||||||
SUCCESS("50","已完成(任务已全部完成+回款全部完成+合同已回传)"),
|
SUCCESS("50","已完成(任务已全部完成+回款全部完成+合同已回传)"),
|
||||||
CANCELLATION("60","作废");
|
CANCELLATION("60","已作废"),
|
||||||
|
CANAPPROVER("61","作废审批中");
|
||||||
private String code;
|
private String code;
|
||||||
private String text;
|
private String text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为已回款之后的合同
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isReturn(String code){
|
||||||
|
List<String> list = List.of(INIT.code, CREATE.code,CANCELLATION.code,CANAPPROVER.getCode());
|
||||||
|
if(StringUtils.isNotBlank(code) && list.contains(code)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,4 +11,5 @@ public enum CustomerStatusEnum {
|
|||||||
PUBLIC("2","进入公海");
|
PUBLIC("2","进入公海");
|
||||||
private String code;
|
private String code;
|
||||||
private String text;
|
private String text;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pusong.business.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付状态美剧
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PayStatusEnum {
|
||||||
|
PAYING("0","支付中"),
|
||||||
|
SUCCESS("1","成功"),
|
||||||
|
FILE("2","失败");
|
||||||
|
private String code;
|
||||||
|
private String text;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.pusong.business.mapper;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.PsApproverRecord;
|
||||||
|
import com.pusong.business.domain.vo.PsApproverRecordVo;
|
||||||
|
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录Mapper接口
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
public interface PsApproverRecordMapper extends BaseMapperPlus<PsApproverRecord, PsApproverRecordVo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.pusong.business.service;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.vo.PsApproverRecordVo;
|
||||||
|
import com.pusong.business.domain.bo.PsApproverRecordBo;
|
||||||
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录Service接口
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
public interface IPsApproverRecordService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询审批记录
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 审批记录
|
||||||
|
*/
|
||||||
|
PsApproverRecordVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询审批记录列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 审批记录分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<PsApproverRecordVo> queryPageList(PsApproverRecordBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的审批记录列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 审批记录列表
|
||||||
|
*/
|
||||||
|
List<PsApproverRecordVo> queryList(PsApproverRecordBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增审批记录
|
||||||
|
*
|
||||||
|
* @param bo 审批记录
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(PsApproverRecordBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改审批记录
|
||||||
|
*
|
||||||
|
* @param bo 审批记录
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(PsApproverRecordBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除审批记录信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
@ -16,22 +16,22 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface IPsContractBusinessDetailService {
|
public interface IPsContractBusinessDetailService {
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 查询合同服务明细
|
// * 查询合同服务明细
|
||||||
*
|
// *
|
||||||
* @param id 主键
|
// * @param id 主键
|
||||||
* @return 合同服务明细
|
// * @return 合同服务明细
|
||||||
*/
|
// */
|
||||||
PsContractBusinessDetailVo queryById(Long id);
|
// PsContractBusinessDetailVo queryById(Long id);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 分页查询合同服务明细列表
|
// * 分页查询合同服务明细列表
|
||||||
*
|
// *
|
||||||
* @param bo 查询条件
|
// * @param bo 查询条件
|
||||||
* @param pageQuery 分页参数
|
// * @param pageQuery 分页参数
|
||||||
* @return 合同服务明细分页列表
|
// * @return 合同服务明细分页列表
|
||||||
*/
|
// */
|
||||||
TableDataInfo<PsContractBusinessDetailVo> queryPageList(PsContractBusinessDetailBo bo, PageQuery pageQuery);
|
// TableDataInfo<PsContractBusinessDetailVo> queryPageList(PsContractBusinessDetailBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的合同服务明细列表
|
* 查询符合条件的合同服务明细列表
|
||||||
@ -41,28 +41,28 @@ public interface IPsContractBusinessDetailService {
|
|||||||
*/
|
*/
|
||||||
List<PsContractBusinessDetailVo> queryList(PsContractBusinessDetailBo bo);
|
List<PsContractBusinessDetailVo> queryList(PsContractBusinessDetailBo bo);
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 新增合同服务明细
|
// * 新增合同服务明细
|
||||||
*
|
// *
|
||||||
* @param bo 合同服务明细
|
// * @param bo 合同服务明细
|
||||||
* @return 是否新增成功
|
// * @return 是否新增成功
|
||||||
*/
|
// */
|
||||||
Boolean insertByBo(PsContractBusinessDetailBo bo);
|
// Boolean insertByBo(PsContractBusinessDetailBo bo);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改合同服务明细
|
// * 修改合同服务明细
|
||||||
*
|
// *
|
||||||
* @param bo 合同服务明细
|
// * @param bo 合同服务明细
|
||||||
* @return 是否修改成功
|
// * @return 是否修改成功
|
||||||
*/
|
// */
|
||||||
Boolean updateByBo(PsContractBusinessDetailBo bo);
|
// Boolean updateByBo(PsContractBusinessDetailBo bo);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 校验并批量删除合同服务明细信息
|
// * 校验并批量删除合同服务明细信息
|
||||||
*
|
// *
|
||||||
* @param ids 待删除的主键集合
|
// * @param ids 待删除的主键集合
|
||||||
* @param isValid 是否进行有效性校验
|
// * @param isValid 是否进行有效性校验
|
||||||
* @return 是否删除成功
|
// * @return 是否删除成功
|
||||||
*/
|
// */
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
// Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,15 @@ public interface IPsContractBusinessService {
|
|||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
void saveList(List<PsContractBusinessBo> boList,String contractCode);
|
void saveList(List<PsContractBusinessBo> boList,String contractCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的合同服务类别列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 合同服务类别列表
|
||||||
|
*/
|
||||||
|
List<PsContractBusinessVo> queryList(PsContractBusinessBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询合同服务类别
|
* 查询合同服务类别
|
||||||
*
|
*
|
||||||
|
@ -59,6 +59,20 @@ public interface IPsContractInfoService {
|
|||||||
* @return 合同基本信息
|
* @return 合同基本信息
|
||||||
*/
|
*/
|
||||||
boolean updateContractByCode(PsContractInfoBo bo);
|
boolean updateContractByCode(PsContractInfoBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作废合同
|
||||||
|
*
|
||||||
|
* @param contractCode 合同编码
|
||||||
|
* @param desc 作废描述
|
||||||
|
*/
|
||||||
|
boolean cancellation(String contractCode,String desc);
|
||||||
|
/**
|
||||||
|
* 重启合同
|
||||||
|
*
|
||||||
|
* @param contractCode 合同编码
|
||||||
|
*/
|
||||||
|
boolean restart(String contractCode);
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的合同基本信息列表
|
* 查询符合条件的合同基本信息列表
|
||||||
*
|
*
|
||||||
|
@ -2,6 +2,7 @@ package com.pusong.business.service;
|
|||||||
|
|
||||||
import com.pusong.business.domain.vo.PsContractPayVo;
|
import com.pusong.business.domain.vo.PsContractPayVo;
|
||||||
import com.pusong.business.domain.bo.PsContractPayBo;
|
import com.pusong.business.domain.bo.PsContractPayBo;
|
||||||
|
import com.pusong.business.enums.PayStatusEnum;
|
||||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ public interface IPsContractPayService {
|
|||||||
* @param contractCode 合同编码
|
* @param contractCode 合同编码
|
||||||
* @return 合同回款记录分页列表
|
* @return 合同回款记录分页列表
|
||||||
*/
|
*/
|
||||||
List<PsContractPayVo> queryListByContractCode(String contractCode,String business);
|
List<PsContractPayVo> queryListByContractCode(String contractCode, String business, PayStatusEnum enu);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.pusong.business.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.pusong.business.domain.bo.DicDataBo;
|
||||||
|
import com.pusong.common.core.domain.R;
|
||||||
|
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import com.pusong.system.domain.bo.SysDictDataBo;
|
||||||
|
import com.pusong.system.domain.vo.SysDictDataVo;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典 业务层
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
public interface IServiceConfigService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全部配置信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONArray getAllConfig();
|
||||||
|
/**
|
||||||
|
* 新增配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void add(DicDataBo bo);
|
||||||
|
/**
|
||||||
|
* 修改配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void edit(DicDataBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void delete(Long dictCode);
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.pusong.business.service.approver;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批service容器
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class ApproverContainer {
|
||||||
|
private Map<String, ApproverService> services = new HashMap<String, ApproverService>();
|
||||||
|
|
||||||
|
public void registerService(String approverType, ApproverService service) {
|
||||||
|
services.put(approverType, service);
|
||||||
|
}
|
||||||
|
public ApproverService getService(String approverType) {
|
||||||
|
return services.get(approverType);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pusong.business.service.approver;
|
||||||
|
|
||||||
|
import com.pusong.business.enums.ApproverTypeEnum;
|
||||||
|
|
||||||
|
public interface ApproverService {
|
||||||
|
public void apply( String bussinessId, String desc, Object src);
|
||||||
|
/**
|
||||||
|
* 成功
|
||||||
|
*/
|
||||||
|
public void success(Object tag,Object src);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败
|
||||||
|
*/
|
||||||
|
public void fail(Object tag,Object src);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.pusong.business.service.approver.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.pusong.business.domain.PsApproverRecord;
|
||||||
|
import com.pusong.business.enums.ApproverStatusEnum;
|
||||||
|
import com.pusong.business.enums.ApproverTypeEnum;
|
||||||
|
import com.pusong.business.mapper.PsApproverRecordMapper;
|
||||||
|
import com.pusong.business.service.IPsApproverRecordService;
|
||||||
|
import com.pusong.business.service.approver.ApproverContainer;
|
||||||
|
import com.pusong.business.service.approver.ApproverService;
|
||||||
|
import com.pusong.common.core.exception.ServiceException;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录Service接口
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
public abstract class ApproverAbstractServiceImpl implements ApproverService {
|
||||||
|
@Resource
|
||||||
|
private PsApproverRecordMapper approverRecordMapper;
|
||||||
|
@Resource
|
||||||
|
private ApproverContainer approverContainer;
|
||||||
|
/**
|
||||||
|
* 通用申请方法
|
||||||
|
* @param bussinessId
|
||||||
|
* @param desc
|
||||||
|
* @param src
|
||||||
|
*/
|
||||||
|
public void apply(String bussinessId, String desc, Object src){
|
||||||
|
List<PsApproverRecord> list = approverRecordMapper.selectList(Wrappers.<PsApproverRecord>lambdaQuery().eq(PsApproverRecord::getDelFlag, "0")
|
||||||
|
.eq(PsApproverRecord::getBusinessId, bussinessId).eq(PsApproverRecord::getBusinessType,approverType())
|
||||||
|
.ne(PsApproverRecord::getApproverStatus, ApproverStatusEnum.INIT.getCode()));
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
|
throw new ServiceException("已存在同类型审批,请勿重复提交");
|
||||||
|
}
|
||||||
|
|
||||||
|
PsApproverRecord record = new PsApproverRecord();
|
||||||
|
record.setBusinessId(bussinessId);
|
||||||
|
record.setBusinessType(approverType());
|
||||||
|
record.setApplyDesc(desc);
|
||||||
|
record.setBeforeData(src == null?null:JSON.toJSONString(src));
|
||||||
|
record.setApplyDate(new Date());
|
||||||
|
record.setApproverStatus(ApproverStatusEnum.INIT.getCode());
|
||||||
|
approverRecordMapper.insert(record);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract String approverType();
|
||||||
|
@PostConstruct
|
||||||
|
public void register() {
|
||||||
|
approverContainer.registerService(approverType(), this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.pusong.business.service.approver.impl;
|
||||||
|
|
||||||
|
import com.pusong.business.enums.ApproverStatusEnum;
|
||||||
|
import com.pusong.business.enums.ApproverTypeEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UpdateContractApproverServiceImpl extends ApproverAbstractServiceImpl {
|
||||||
|
@Override
|
||||||
|
public String approverType() {
|
||||||
|
return ApproverTypeEnum.UPDATE.getCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1 审批成功合同已派单:任务重置
|
||||||
|
* @param tag
|
||||||
|
* @param src
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void success(Object tag, Object src) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fail(Object tag, Object src) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.pusong.business.service.approver;
|
||||||
|
/**
|
||||||
|
* 审批操作的service
|
||||||
|
*/
|
@ -0,0 +1,202 @@
|
|||||||
|
package com.pusong.business.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.pusong.business.domain.bo.DicDataBo;
|
||||||
|
import com.pusong.business.domain.bo.PsContractBusinessBo;
|
||||||
|
import com.pusong.business.domain.bo.PsContractBusinessDetailBo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessDetailVo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
||||||
|
import com.pusong.business.service.IPsContractBusinessDetailService;
|
||||||
|
import com.pusong.business.service.IPsContractBusinessService;
|
||||||
|
import com.pusong.business.service.IServiceConfigService;
|
||||||
|
import com.pusong.common.core.exception.ServiceException;
|
||||||
|
import com.pusong.common.core.utils.StringUtils;
|
||||||
|
import com.pusong.system.domain.bo.SysDictDataBo;
|
||||||
|
import com.pusong.system.domain.vo.SysDictDataVo;
|
||||||
|
import com.pusong.system.mapper.SysDictDataMapper;
|
||||||
|
import com.pusong.system.service.ISysDictDataService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典 业务层
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class IServiceConfigServiceImpl implements IServiceConfigService {
|
||||||
|
private final SysDictDataMapper dictDataMapper;
|
||||||
|
private final ISysDictDataService dictDataService;
|
||||||
|
|
||||||
|
//服务类型
|
||||||
|
private final String SERVICE_TYPE = "contract_type";
|
||||||
|
//服务项目
|
||||||
|
private final String SERVICE_PROJECT = "service_project";
|
||||||
|
//子项目
|
||||||
|
private final String CHILD_PROJECT = "child_project";
|
||||||
|
//连接符
|
||||||
|
private final String JOIN = "_";
|
||||||
|
private final IPsContractBusinessService businessService;
|
||||||
|
private final IPsContractBusinessDetailService detailService;
|
||||||
|
/**
|
||||||
|
* 获取全部配置信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public JSONArray getAllConfig() {
|
||||||
|
SysDictDataBo dictData = new SysDictDataBo();
|
||||||
|
dictData.setInDictType(List.of(SERVICE_TYPE,SERVICE_PROJECT,CHILD_PROJECT));
|
||||||
|
List<SysDictDataVo> list = dictDataService.selectDictDataList(dictData);
|
||||||
|
//分组排序
|
||||||
|
Map<String, List<SysDictDataVo>> map = list.stream().collect(Collectors.groupingBy(SysDictDataVo::getDictType));
|
||||||
|
map.entrySet().forEach(entry->{
|
||||||
|
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingInt(SysDictDataVo::getDictSort)).collect(Collectors.toList()));
|
||||||
|
});
|
||||||
|
JSONArray serviceArray = new JSONArray();
|
||||||
|
map.get(SERVICE_TYPE).forEach(item->{
|
||||||
|
//服务类型
|
||||||
|
JSONObject serviceObject = JSON.parseObject(JSON.toJSONString(item));
|
||||||
|
//服务项目
|
||||||
|
List<SysDictDataVo> projectList = map.get(SERVICE_PROJECT).stream().filter(it -> (it.getDictValue().indexOf(item.getDictValue()+JOIN) == 0)).collect(Collectors.toList());
|
||||||
|
JSONArray projectArray = new JSONArray();
|
||||||
|
if(projectList == null){projectList = new ArrayList<>();}
|
||||||
|
//子项目
|
||||||
|
projectList.forEach(project->{
|
||||||
|
JSONObject projectObject = JSON.parseObject(JSON.toJSONString(project));
|
||||||
|
List<SysDictDataVo> childList = map.get(CHILD_PROJECT).stream().filter(it -> (it.getDictValue().indexOf(project.getDictValue()+JOIN) == 0)).collect(Collectors.toList());
|
||||||
|
//服务项目中装填子项目
|
||||||
|
projectObject.put("children", childList);
|
||||||
|
projectObject.put("remarkMap",StringUtils.isBlank(projectObject.getString("remark"))?null:JSON.parseObject(projectObject.getString("remark")));
|
||||||
|
projectObject.remove("remark");
|
||||||
|
projectArray.add(projectObject);
|
||||||
|
});
|
||||||
|
serviceObject.put("children", projectArray);
|
||||||
|
serviceArray.add(serviceObject);
|
||||||
|
});
|
||||||
|
return serviceArray;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 新增配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void add(DicDataBo bo) {
|
||||||
|
String type =null ;
|
||||||
|
//父级字典对象
|
||||||
|
SysDictDataVo parent = new SysDictDataVo();
|
||||||
|
//找到当前新增的字典类型
|
||||||
|
if(bo.getParentDictCode() == null){
|
||||||
|
type = SERVICE_TYPE;
|
||||||
|
}else{
|
||||||
|
parent = dictDataService.selectDictDataById(bo.getParentDictCode());
|
||||||
|
if(StringUtils.equals(SERVICE_TYPE,parent.getDictType())){
|
||||||
|
type =SERVICE_PROJECT;
|
||||||
|
}else if(StringUtils.equals(SERVICE_PROJECT,parent.getDictType())){
|
||||||
|
type =CHILD_PROJECT;
|
||||||
|
}else{
|
||||||
|
throw new ServiceException("不支持的类型");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//查询当前类型的所有字典数据
|
||||||
|
SysDictDataBo query = new SysDictDataBo();
|
||||||
|
query.setInDictType(List.of(type));
|
||||||
|
List<SysDictDataVo> list = dictDataService.selectDictDataList(query);
|
||||||
|
//找到当前字典编码的最大值并加一(当作当前新增数据的字典编码)
|
||||||
|
int num = 1;
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
|
String val = parent.getDictValue();
|
||||||
|
//过滤找到属于父级的子类型,然后找到最大的编码值
|
||||||
|
SysDictDataVo maxData = list.stream().filter(item->(StringUtils.isNotBlank(val)? item.getDictValue().indexOf(val) ==0 : !item.getDictValue().contains(JOIN)))
|
||||||
|
.max(Comparator.comparingInt(item -> Integer.parseInt(!item.getDictValue().contains(JOIN) ?item.getDictValue():
|
||||||
|
item.getDictValue().substring(val.length()+1)))).orElse(null);
|
||||||
|
//最大编码值加一
|
||||||
|
if(maxData != null){
|
||||||
|
num = Integer.parseInt(maxData.getDictValue().contains(JOIN) ? maxData.getDictValue().substring(val.length()+1)
|
||||||
|
: maxData.getDictValue())+1 ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//组装dto数据
|
||||||
|
SysDictDataBo dictData = new SysDictDataBo();
|
||||||
|
dictData.setListClass("primary");
|
||||||
|
dictData.setIsDefault("N");
|
||||||
|
dictData.setDictSort(bo.getDictSort());
|
||||||
|
dictData.setDictType(type);
|
||||||
|
dictData.setDictLabel(bo.getDictLabel());
|
||||||
|
dictData.setDictValue(parent == null || parent.getDictCode() == null ? num+"" : parent.getDictValue()+JOIN+num);
|
||||||
|
dictData.setRemark(bo.getRemarkMap()!=null?JSON.toJSONString(bo.getRemarkMap()):null);
|
||||||
|
dictDataService.insertDictData(dictData);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void edit(DicDataBo bo) {
|
||||||
|
SysDictDataVo dict = dictDataService.selectDictDataById(bo.getDictCode());
|
||||||
|
validEntity(dict);
|
||||||
|
SysDictDataBo sysDictDataBo = new SysDictDataBo();
|
||||||
|
sysDictDataBo.setDictCode(dict.getDictCode());
|
||||||
|
sysDictDataBo.setDictType(dict.getDictType());
|
||||||
|
sysDictDataBo.setDictLabel(bo.getDictLabel());
|
||||||
|
sysDictDataBo.setRemark(bo.getRemarkMap()!=null?JSON.toJSONString(bo.getRemarkMap()):null);
|
||||||
|
sysDictDataBo.setDictSort(bo.getDictSort());
|
||||||
|
dictDataService.updateDictData(sysDictDataBo);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void delete(Long dictCode) {
|
||||||
|
SysDictDataVo dict = dictDataService.selectDictDataById(dictCode);
|
||||||
|
//开始校验
|
||||||
|
validEntity(dict);
|
||||||
|
//开始删除(不进行物理删除)
|
||||||
|
SysDictDataBo sysDictDataBo = new SysDictDataBo();
|
||||||
|
sysDictDataBo.setDictCode(dict.getDictCode());
|
||||||
|
sysDictDataBo.setDictType(dict.getDictType()+"-delete");
|
||||||
|
dictDataService.updateDictData(sysDictDataBo);
|
||||||
|
}
|
||||||
|
private void validEntity(SysDictDataVo dict ){
|
||||||
|
if(dict == null){
|
||||||
|
throw new ServiceException("无此数据请刷新页面");
|
||||||
|
}
|
||||||
|
//修改服务类型
|
||||||
|
if(StringUtils.equals(SERVICE_TYPE,dict.getDictType())){
|
||||||
|
PsContractBusinessBo psContractBusinessBo = new PsContractBusinessBo();
|
||||||
|
psContractBusinessBo.setBusinessType(dict.getDictValue());
|
||||||
|
List<PsContractBusinessVo> list = businessService.queryList(psContractBusinessBo);
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){throw new ServiceException("服务类型已使用不可修改");}
|
||||||
|
//修改服务项目
|
||||||
|
}else if(StringUtils.equals(SERVICE_PROJECT,dict.getDictType())){
|
||||||
|
PsContractBusinessDetailBo detailBo = new PsContractBusinessDetailBo();
|
||||||
|
detailBo.setBusinessProject(dict.getDictValue());
|
||||||
|
List<PsContractBusinessDetailVo> list = detailService.queryList(detailBo);
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){throw new ServiceException("服务项目已使用不可修改");}
|
||||||
|
//修改服务子项目
|
||||||
|
}else if(StringUtils.equals(CHILD_PROJECT,dict.getDictType())){
|
||||||
|
PsContractBusinessDetailBo detailBo = new PsContractBusinessDetailBo();
|
||||||
|
detailBo.setExtentInfo(dict.getDictValue());
|
||||||
|
List<PsContractBusinessDetailVo> list = detailService.queryList(detailBo);
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){throw new ServiceException("服务子项目已使用不可修改");}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String a = "7_3";
|
||||||
|
String b = "7";
|
||||||
|
System.out.println(a.substring(b.length()+1));
|
||||||
|
List<Integer> list = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
|
||||||
|
list.forEach(item ->{
|
||||||
|
if (item==6){return;}
|
||||||
|
System.out.println(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.pusong.business.service.impl;
|
||||||
|
|
||||||
|
import com.pusong.common.core.utils.MapstructUtils;
|
||||||
|
import com.pusong.common.core.utils.StringUtils;
|
||||||
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.pusong.business.domain.bo.PsApproverRecordBo;
|
||||||
|
import com.pusong.business.domain.vo.PsApproverRecordVo;
|
||||||
|
import com.pusong.business.domain.PsApproverRecord;
|
||||||
|
import com.pusong.business.mapper.PsApproverRecordMapper;
|
||||||
|
import com.pusong.business.service.IPsApproverRecordService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-08-05
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class PsApproverRecordServiceImpl implements IPsApproverRecordService {
|
||||||
|
|
||||||
|
private final PsApproverRecordMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询审批记录
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 审批记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PsApproverRecordVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询审批记录列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 审批记录分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<PsApproverRecordVo> queryPageList(PsApproverRecordBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<PsApproverRecord> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<PsApproverRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的审批记录列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 审批记录列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PsApproverRecordVo> queryList(PsApproverRecordBo bo) {
|
||||||
|
LambdaQueryWrapper<PsApproverRecord> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<PsApproverRecord> buildQueryWrapper(PsApproverRecordBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<PsApproverRecord> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getBusinessId() != null, PsApproverRecord::getBusinessId, bo.getBusinessId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getBusinessType()), PsApproverRecord::getBusinessType, bo.getBusinessType());
|
||||||
|
lqw.eq(bo.getApplyDate() != null, PsApproverRecord::getApplyDate, bo.getApplyDate());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getApproverType()), PsApproverRecord::getApproverType, bo.getApproverType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getApproverStatus()), PsApproverRecord::getApproverStatus, bo.getApproverStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getApplyDesc()), PsApproverRecord::getApplyDesc, bo.getApplyDesc());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getApproverDesc()), PsApproverRecord::getApproverDesc, bo.getApproverDesc());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增审批记录
|
||||||
|
*
|
||||||
|
* @param bo 审批记录
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(PsApproverRecordBo bo) {
|
||||||
|
PsApproverRecord add = MapstructUtils.convert(bo, PsApproverRecord.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改审批记录
|
||||||
|
*
|
||||||
|
* @param bo 审批记录
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(PsApproverRecordBo bo) {
|
||||||
|
PsApproverRecord update = MapstructUtils.convert(bo, PsApproverRecord.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(PsApproverRecord entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除审批记录信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.pusong.business.service.impl;
|
package com.pusong.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.pusong.common.core.utils.MapstructUtils;
|
import com.pusong.common.core.utils.MapstructUtils;
|
||||||
import com.pusong.common.core.utils.StringUtils;
|
import com.pusong.common.core.utils.StringUtils;
|
||||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -58,7 +59,7 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
|||||||
LambdaQueryWrapper<PsCompanyInfo> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<PsCompanyInfo> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getId() != null, PsCompanyInfo::getId, bo.getId());
|
lqw.eq(bo.getId() != null, PsCompanyInfo::getId, bo.getId());
|
||||||
lqw.eq(bo.getCustomId() != null, PsCompanyInfo::getCustomId, bo.getCustomId());
|
lqw.eq(bo.getCustomId() != null, PsCompanyInfo::getCustomId, bo.getCustomId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), PsCompanyInfo::getCompanyName, bo.getCompanyName());
|
lqw.eq(StringUtils.isNotBlank(bo.getCompanyName()), PsCompanyInfo::getCompanyName, bo.getCompanyName());
|
||||||
lqw.eq( PsCompanyInfo::getDelFlag, "0");
|
lqw.eq( PsCompanyInfo::getDelFlag, "0");
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
@ -71,6 +72,13 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean saveBo(PsCompanyInfoBo bo) {
|
public Boolean saveBo(PsCompanyInfoBo bo) {
|
||||||
|
//公司名称唯一
|
||||||
|
PsCompanyInfoBo query = new PsCompanyInfoBo();
|
||||||
|
query.setCompanyName(bo.getCompanyName());
|
||||||
|
query.setCustomId(bo.getCustomId());
|
||||||
|
List<PsCompanyInfoVo> list = this.queryList(bo);
|
||||||
|
//如果存在重复名称则修改
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){bo.setId(list.get(0).getId());}
|
||||||
PsCompanyInfo add = MapstructUtils.convert(bo, PsCompanyInfo.class);
|
PsCompanyInfo add = MapstructUtils.convert(bo, PsCompanyInfo.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
boolean flag = baseMapper.insertOrUpdate(add);
|
boolean flag = baseMapper.insertOrUpdate(add);
|
||||||
|
@ -31,30 +31,30 @@ public class PsContractBusinessDetailServiceImpl implements IPsContractBusinessD
|
|||||||
|
|
||||||
private final PsContractBusinessDetailMapper baseMapper;
|
private final PsContractBusinessDetailMapper baseMapper;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 查询合同服务明细
|
// * 查询合同服务明细
|
||||||
*
|
// *
|
||||||
* @param id 主键
|
// * @param id 主键
|
||||||
* @return 合同服务明细
|
// * @return 合同服务明细
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public PsContractBusinessDetailVo queryById(Long id){
|
// public PsContractBusinessDetailVo queryById(Long id){
|
||||||
return baseMapper.selectVoById(id);
|
// return baseMapper.selectVoById(id);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 分页查询合同服务明细列表
|
// * 分页查询合同服务明细列表
|
||||||
*
|
// *
|
||||||
* @param bo 查询条件
|
// * @param bo 查询条件
|
||||||
* @param pageQuery 分页参数
|
// * @param pageQuery 分页参数
|
||||||
* @return 合同服务明细分页列表
|
// * @return 合同服务明细分页列表
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public TableDataInfo<PsContractBusinessDetailVo> queryPageList(PsContractBusinessDetailBo bo, PageQuery pageQuery) {
|
// public TableDataInfo<PsContractBusinessDetailVo> queryPageList(PsContractBusinessDetailBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<PsContractBusinessDetail> lqw = buildQueryWrapper(bo);
|
// LambdaQueryWrapper<PsContractBusinessDetail> lqw = buildQueryWrapper(bo);
|
||||||
Page<PsContractBusinessDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
// Page<PsContractBusinessDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(result);
|
// return TableDataInfo.build(result);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的合同服务明细列表
|
* 查询符合条件的合同服务明细列表
|
||||||
@ -69,68 +69,62 @@ public class PsContractBusinessDetailServiceImpl implements IPsContractBusinessD
|
|||||||
}
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<PsContractBusinessDetail> buildQueryWrapper(PsContractBusinessDetailBo bo) {
|
private LambdaQueryWrapper<PsContractBusinessDetail> buildQueryWrapper(PsContractBusinessDetailBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
|
||||||
LambdaQueryWrapper<PsContractBusinessDetail> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<PsContractBusinessDetail> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getContractCode() != null, PsContractBusinessDetail::getContractCode, bo.getContractCode());
|
|
||||||
lqw.eq(bo.getBusinessId()!= null, PsContractBusinessDetail::getBusinessId, bo.getBusinessId());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getBusinessProject()), PsContractBusinessDetail::getBusinessProject, bo.getBusinessProject());
|
lqw.eq(StringUtils.isNotBlank(bo.getBusinessProject()), PsContractBusinessDetail::getBusinessProject, bo.getBusinessProject());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getBusinessProjectLabel()), PsContractBusinessDetail::getBusinessProjectLabel, bo.getBusinessProjectLabel());
|
lqw.like(StringUtils.isNotBlank(bo.getExtentInfo()), PsContractBusinessDetail::getExtentInfo, bo.getExtentInfo());
|
||||||
lqw.eq(bo.getAmount() != null, PsContractBusinessDetail::getAmount, bo.getAmount());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getAmountDesc()), PsContractBusinessDetail::getAmountDesc, bo.getAmountDesc());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getExtentInfo()), PsContractBusinessDetail::getExtentInfo, bo.getExtentInfo());
|
|
||||||
lqw.eq(PsContractBusinessDetail::getDelFlag, "0");
|
lqw.eq(PsContractBusinessDetail::getDelFlag, "0");
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 新增合同服务明细
|
// * 新增合同服务明细
|
||||||
*
|
// *
|
||||||
* @param bo 合同服务明细
|
// * @param bo 合同服务明细
|
||||||
* @return 是否新增成功
|
// * @return 是否新增成功
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public Boolean insertByBo(PsContractBusinessDetailBo bo) {
|
// public Boolean insertByBo(PsContractBusinessDetailBo bo) {
|
||||||
PsContractBusinessDetail add = MapstructUtils.convert(bo, PsContractBusinessDetail.class);
|
// PsContractBusinessDetail add = MapstructUtils.convert(bo, PsContractBusinessDetail.class);
|
||||||
validEntityBeforeSave(add);
|
// validEntityBeforeSave(add);
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
// boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
// if (flag) {
|
||||||
bo.setId(add.getId());
|
// bo.setId(add.getId());
|
||||||
}
|
// }
|
||||||
return flag;
|
// return flag;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改合同服务明细
|
// * 修改合同服务明细
|
||||||
*
|
// *
|
||||||
* @param bo 合同服务明细
|
// * @param bo 合同服务明细
|
||||||
* @return 是否修改成功
|
// * @return 是否修改成功
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public Boolean updateByBo(PsContractBusinessDetailBo bo) {
|
// public Boolean updateByBo(PsContractBusinessDetailBo bo) {
|
||||||
PsContractBusinessDetail update = MapstructUtils.convert(bo, PsContractBusinessDetail.class);
|
// PsContractBusinessDetail update = MapstructUtils.convert(bo, PsContractBusinessDetail.class);
|
||||||
validEntityBeforeSave(update);
|
// validEntityBeforeSave(update);
|
||||||
return baseMapper.updateById(update) > 0;
|
// return baseMapper.updateById(update) > 0;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 保存前的数据校验
|
// * 保存前的数据校验
|
||||||
*/
|
// */
|
||||||
private void validEntityBeforeSave(PsContractBusinessDetail entity){
|
// private void validEntityBeforeSave(PsContractBusinessDetail entity){
|
||||||
//TODO 做一些数据校验,如唯一约束
|
// //TODO 做一些数据校验,如唯一约束
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 校验并批量删除合同服务明细信息
|
// * 校验并批量删除合同服务明细信息
|
||||||
*
|
// *
|
||||||
* @param ids 待删除的主键集合
|
// * @param ids 待删除的主键集合
|
||||||
* @param isValid 是否进行有效性校验
|
// * @param isValid 是否进行有效性校验
|
||||||
* @return 是否删除成功
|
// * @return 是否删除成功
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
// public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if(isValid){
|
// if(isValid){
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
// //TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
// }
|
||||||
return baseMapper.deleteBatchIds(ids) > 0;
|
// return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,24 @@ public class PsContractBusinessServiceImpl implements IPsContractBusinessService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的合同服务类别列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 合同服务类别列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PsContractBusinessVo> queryList(PsContractBusinessBo bo) {
|
||||||
|
LambdaQueryWrapper<PsContractBusiness> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<PsContractBusiness> buildQueryWrapper(PsContractBusinessBo bo) {
|
||||||
|
LambdaQueryWrapper<PsContractBusiness> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getBusinessType()), PsContractBusiness::getBusinessType, bo.getBusinessType());
|
||||||
|
lqw.eq( PsContractBusiness::getDelFlag, "0");
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* *//**
|
/* *//**
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
package com.pusong.business.service.impl;
|
package com.pusong.business.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.pusong.business.domain.*;
|
import com.pusong.business.domain.*;
|
||||||
import com.pusong.business.domain.bo.*;
|
import com.pusong.business.domain.bo.*;
|
||||||
import com.pusong.business.domain.vo.*;
|
import com.pusong.business.domain.vo.*;
|
||||||
import com.pusong.business.enums.CommonStatusEnum;
|
import com.pusong.business.enums.*;
|
||||||
import com.pusong.business.enums.ContractStatusEnum;
|
|
||||||
import com.pusong.business.enums.PayBuinessStatusEnum;
|
|
||||||
import com.pusong.business.enums.TenplateEnum;
|
|
||||||
import com.pusong.business.mapper.PsCompanyInfoMapper;
|
|
||||||
import com.pusong.business.mapper.PsContractBusinessDetailMapper;
|
|
||||||
import com.pusong.business.mapper.PsContractBusinessMapper;
|
import com.pusong.business.mapper.PsContractBusinessMapper;
|
||||||
import com.pusong.business.service.*;
|
import com.pusong.business.service.*;
|
||||||
|
import com.pusong.business.service.approver.ApproverContainer;
|
||||||
|
import com.pusong.business.service.approver.ApproverService;
|
||||||
import com.pusong.common.core.constant.UserConstants;
|
import com.pusong.common.core.constant.UserConstants;
|
||||||
import com.pusong.common.core.exception.ServiceException;
|
import com.pusong.common.core.exception.ServiceException;
|
||||||
import com.pusong.common.core.utils.DateUtils;
|
import com.pusong.common.core.utils.DateUtils;
|
||||||
@ -24,19 +20,14 @@ import com.pusong.common.doc.util.PdfGenerator;
|
|||||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.pusong.common.satoken.utils.LoginHelper;
|
import com.pusong.common.satoken.utils.LoginHelper;
|
||||||
import com.pusong.common.translation.annotation.Translation;
|
|
||||||
import com.pusong.system.domain.vo.SysOssVo;
|
import com.pusong.system.domain.vo.SysOssVo;
|
||||||
import com.pusong.system.service.ISysOssService;
|
import com.pusong.system.service.ISysOssService;
|
||||||
import io.swagger.v3.core.util.Json;
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import jodd.util.StringUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.bytebuddy.implementation.bytecode.Throw;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.core.task.VirtualThreadTaskExecutor;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.pusong.business.mapper.PsContractInfoMapper;
|
import com.pusong.business.mapper.PsContractInfoMapper;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -44,7 +35,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同基本信息Service业务层处理
|
* 合同基本信息Service业务层处理
|
||||||
@ -71,6 +61,9 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private final IPsContractPayService contractPayService;
|
private final IPsContractPayService contractPayService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private final ApproverContainer container;
|
||||||
/**
|
/**
|
||||||
* 生成合同
|
* 生成合同
|
||||||
*
|
*
|
||||||
@ -92,9 +85,9 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
add = new PsContractInfo();
|
add = new PsContractInfo();
|
||||||
add.setContractCode(UUID.randomUUID().toString().replaceAll("-", ""));//合同编码
|
add.setContractCode(UUID.randomUUID().toString().replaceAll("-", ""));//合同编码
|
||||||
add.setContractName("合同名称");//todo 合同名称
|
add.setContractName("合同名称");//todo 合同名称
|
||||||
add.setCompanyId(bo.getCompanyInfoBo().getId());//公司id
|
|
||||||
add.setCustomManager(LoginHelper.getUserId());//所属销售经理id
|
add.setCustomManager(LoginHelper.getUserId());//所属销售经理id
|
||||||
}
|
}
|
||||||
|
add.setCompanyId(bo.getCompanyInfoBo().getId());//公司id
|
||||||
MapstructUtils.convert(bo, add);
|
MapstructUtils.convert(bo, add);
|
||||||
BigDecimal sum = bo.getBusinessList().stream().map(PsContractBusinessBo::getBusinessAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal sum = bo.getBusinessList().stream().map(PsContractBusinessBo::getBusinessAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
add.setContractAmount(sum);//合同总金额
|
add.setContractAmount(sum);//合同总金额
|
||||||
@ -194,22 +187,85 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public boolean updateContractByCode(PsContractInfoBo bo){
|
public boolean updateContractByCode(PsContractInfoBo bo){
|
||||||
//1获取合同详情
|
//1获取合同详情
|
||||||
PsContractInfoVo ps = queryContractByCode(bo.getContractCode());
|
PsContractInfoVo src = queryContractByCode(bo.getContractCode());
|
||||||
//2校验状态
|
//2校验状态
|
||||||
beforeUpdateValid(bo,ps);
|
beforeUpdateValid(bo, src);
|
||||||
//3.插入公司信息
|
//3.插入公司信息
|
||||||
companyInfoService.saveBo(bo.getCompanyInfoBo());
|
companyInfoService.saveBo(bo.getCompanyInfoBo());
|
||||||
//4.删除所有服务类型和服务项目,.插入服务类型
|
//4.装填合同信息
|
||||||
|
BigDecimal sum = bo.getBusinessList().stream().map(PsContractBusinessBo::getBusinessAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
bo.setContractAmount(sum);//合同总金额
|
||||||
|
//5.删除所有服务类型和服务项目,.插入服务类型
|
||||||
businessService.saveList(bo.getBusinessList(),bo.getContractCode());
|
businessService.saveList(bo.getBusinessList(),bo.getContractCode());
|
||||||
//5.修改后操作
|
//6.修改后操作
|
||||||
beforeUpdateOperate(bo,ps);
|
afterUpdateOperate(bo, src);
|
||||||
//合同审批
|
//插入合同
|
||||||
PsContractInfo info = MapstructUtils.convert(ps, PsContractInfo.class);
|
PsContractInfo add = new PsContractInfo();
|
||||||
//5.生成合同
|
add.setCompanyId(bo.getCompanyInfoBo().getId());//公司id
|
||||||
makePdf(info,bo);
|
MapstructUtils.convert(bo, add);
|
||||||
|
this.updateByCode(add);
|
||||||
|
//7.生成合同
|
||||||
|
makePdf(add,bo);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作废合同
|
||||||
|
*
|
||||||
|
* @param contractCode 合同编码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean cancellation(String contractCode,String desc) {
|
||||||
|
//创建变更对象
|
||||||
|
PsContractInfo info = new PsContractInfo();
|
||||||
|
info.setContractCode(contractCode);
|
||||||
|
//查询合同详细信息
|
||||||
|
PsContractInfoVo infoVo = this.queryContractByCode(contractCode);
|
||||||
|
//没有任何一笔收款:点击【作废】,直接作废合同
|
||||||
|
if(CollectionUtils.isEmpty(infoVo.getContractPayVoList())){
|
||||||
|
info.setContractStatus(ContractStatusEnum.CANCELLATION.getCode());
|
||||||
|
//todo (1)已派单:撤回任务派单,不在任务列表展示
|
||||||
|
// (2)未派单:更新任务列表,不在任务列表展示
|
||||||
|
}else{
|
||||||
|
if(StringUtils.isBlank(desc)){throw new ServiceException("请填写作废原因");}
|
||||||
|
//有收款:点击【作废】填写【作废原因】后发起【作废】审批
|
||||||
|
ApproverService service = container.getService(ApproverTypeEnum.CANCELLA.getCode());
|
||||||
|
service.apply(contractCode,desc, null);
|
||||||
|
info.setContractStatus(ContractStatusEnum.CANAPPROVER.getCode());
|
||||||
|
|
||||||
|
}
|
||||||
|
updateByCode(info);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 重启合同
|
||||||
|
*
|
||||||
|
* @param contractCode 合同编码
|
||||||
|
*/
|
||||||
|
public boolean restart(String contractCode){
|
||||||
|
//创建变更对象
|
||||||
|
PsContractInfo info = new PsContractInfo();
|
||||||
|
info.setContractCode(contractCode);
|
||||||
|
//查询合同详细信息
|
||||||
|
PsContractInfoVo infoVo = this.queryContractByCode(contractCode);
|
||||||
|
//查询是否有审批中的退款信息
|
||||||
|
List<PsContractPayVo> payList = contractPayService.queryListByContractCode(contractCode,null,PayStatusEnum.PAYING);
|
||||||
|
BigDecimal pay = payList.stream().map(PsContractPayVo::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
//有未完成的退款:【合同列表】状态更新为【处理中】;并显示在【已完成回款列表】,重新生成任务
|
||||||
|
if(infoVo.getPayMoney().subtract(pay).compareTo(BigDecimal.ZERO) > 0){
|
||||||
|
info.setContractStatus(ContractStatusEnum.EXECUTION.getCode());
|
||||||
|
}else{
|
||||||
|
//没有任何退款处理:【合同列表】状态更新为【待回款】,并显示在【待回款列表】中
|
||||||
|
info.setContractStatus(ContractStatusEnum.CREATE.getCode());
|
||||||
|
}
|
||||||
|
updateByCode(info);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PsContractInfo updateByCode(PsContractInfo info){
|
||||||
|
baseMapper.update(info,Wrappers.<PsContractInfo>lambdaUpdate().eq(PsContractInfo::getContractCode,info.getContractCode()).eq(PsContractInfo::getDelFlag,0));
|
||||||
|
return info;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 生成pdf
|
* 生成pdf
|
||||||
* @param add
|
* @param add
|
||||||
@ -234,9 +290,9 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
if(file.exists())file.delete();
|
if(file.exists())file.delete();
|
||||||
//更新合同id
|
//更新合同id
|
||||||
PsContractInfo psContractInfo = new PsContractInfo();
|
PsContractInfo psContractInfo = new PsContractInfo();
|
||||||
psContractInfo.setId(add.getId());
|
psContractInfo.setContractCode(add.getContractCode());
|
||||||
psContractInfo.setPdfId(sysOssVo.getOssId());
|
psContractInfo.setPdfId(sysOssVo.getOssId());
|
||||||
baseMapper.updateById(psContractInfo);
|
this.updateByCode(psContractInfo);
|
||||||
//删除原合同
|
//删除原合同
|
||||||
if(add.getPdfId() != null)ossService.deleteWithValidByIds(List.of(add.getPdfId()),false);
|
if(add.getPdfId() != null)ossService.deleteWithValidByIds(List.of(add.getPdfId()),false);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
@ -265,15 +321,18 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
List<PsContractBusinessVo> list = businessMapper.selectBusinessList(vo.getContractCode());
|
List<PsContractBusinessVo> list = businessMapper.selectBusinessList(vo.getContractCode());
|
||||||
vo.setBusinessVoList(list);
|
vo.setBusinessVoList(list);
|
||||||
//装填回款记录
|
//装填回款记录
|
||||||
List<PsContractPayVo> payList = contractPayService.queryListByContractCode(vo.getContractCode(),null);
|
List<PsContractPayVo> payList = contractPayService.queryListByContractCode(vo.getContractCode(),null,PayStatusEnum.SUCCESS);
|
||||||
vo.setContractPayVoList(payList);
|
vo.setContractPayVoList(payList);
|
||||||
//已付金额
|
|
||||||
vo.setPayMoney(payList.stream().filter(item->StringUtils.equals(item.getBusinessType(), PayBuinessStatusEnum.PAY.getCode()))
|
|
||||||
.map(PsContractPayVo::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
||||||
//退款金额
|
//退款金额
|
||||||
vo.setReturnMoney(payList.stream().filter(item->StringUtils.equals(item.getBusinessType(), PayBuinessStatusEnum.RETURN.getCode()))
|
vo.setReturnMoney(payList.stream().filter(item->StringUtils.equals(item.getBusinessType(), PayBuinessStatusEnum.RETURN.getCode()))
|
||||||
.map(PsContractPayVo::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add));
|
.map(PsContractPayVo::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
//未付金额
|
//收款金额
|
||||||
|
BigDecimal netPay = payList.stream().filter(item -> StringUtils.equals(item.getBusinessType(), PayBuinessStatusEnum.PAY.getCode()))
|
||||||
|
.map(PsContractPayVo::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal pay = netPay.subtract(vo.getReturnMoney());
|
||||||
|
//已付金额(收款-退款)
|
||||||
|
vo.setPayMoney(pay.compareTo(BigDecimal.ZERO)>=0?pay:BigDecimal.ZERO);
|
||||||
|
//未付金额(合同金额-已付金额)
|
||||||
vo.setResidualMoney((vo.getContractAmount() == null ? BigDecimal.ZERO:vo.getContractAmount()).subtract(vo.getPayMoney()));
|
vo.setResidualMoney((vo.getContractAmount() == null ? BigDecimal.ZERO:vo.getContractAmount()).subtract(vo.getPayMoney()));
|
||||||
//付款周期
|
//付款周期
|
||||||
if(payList.size() == 1){
|
if(payList.size() == 1){
|
||||||
@ -282,6 +341,7 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
//包含最后一天
|
//包含最后一天
|
||||||
vo.setPeriod(DateUtils.calWorkDate(payList.get(0).getPayDate(),payList.get(payList.size()-1).getPayDate()) + 1);
|
vo.setPeriod(DateUtils.calWorkDate(payList.get(0).getPayDate(),payList.get(payList.size()-1).getPayDate()) + 1);
|
||||||
}
|
}
|
||||||
|
//todo 签章未通过时查询未通过的原因
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -315,23 +375,41 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
/**
|
/**
|
||||||
* 修改合同前置的校验
|
* 修改合同前置的校验
|
||||||
* 1.合同已回传 不可修改
|
* 1.合同已回传 不可修改
|
||||||
*
|
* 2.已回款合同 必有修改合同说明(审批表的字段)
|
||||||
*/
|
*/
|
||||||
private void beforeUpdateValid( PsContractInfoBo updateBo,PsContractInfoVo srcVo){
|
private void beforeUpdateValid( PsContractInfoBo updateBo,PsContractInfoVo srcVo){
|
||||||
if(StringUtils.equals(CommonStatusEnum.N.getCode(),srcVo.getRollBackStatus())){
|
//1.合同已回传 不可修改
|
||||||
|
if(StringUtils.equals(CommonStatusEnum.SUCCESS.getCode(),srcVo.getRollBackStatus())){
|
||||||
throw new ServiceException("合同已回传,不可修改");
|
throw new ServiceException("合同已回传,不可修改");
|
||||||
}
|
}
|
||||||
|
//2.已回款之后的合同 必有修改合同说明(审批表的字段)
|
||||||
|
if(ContractStatusEnum.isReturn(srcVo.getContractStatus()) && StringUtil.isNotBlank(updateBo.getUpdateDesc())){
|
||||||
|
throw new ServiceException("合同已回款,请输入修改说明");
|
||||||
|
}
|
||||||
|
//3.已完成合同不可修改
|
||||||
|
if(StringUtils.equals(ContractStatusEnum.SUCCESS.getCode(),srcVo.getRollBackStatus())){
|
||||||
|
throw new ServiceException("合同已完成,不可修改");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 修改合同后操作
|
* 修改合同后操作
|
||||||
* 1.合同已派单:任务重置
|
* 1.已回款之后的合同修改后走审批
|
||||||
* 2.已回款合同:新的合同金额<已付金额:展示申请退款
|
* 2.已回款合同:新的合同金额<已付金额:展示申请退款
|
||||||
|
* 3.合同签字盖章成功:修改合同成功,合同签字盖章变回未签章状态,需重新进行签章申请
|
||||||
*/
|
*/
|
||||||
private void beforeUpdateOperate( PsContractInfoBo updateBo,PsContractInfoVo srcVo){
|
private void afterUpdateOperate( PsContractInfoBo updateBo,PsContractInfoVo srcVo){
|
||||||
|
//1.已回款之后的合同修改后走审批
|
||||||
if(StringUtils.equals(CommonStatusEnum.N.getCode(),srcVo.getRollBackStatus())){
|
if(ContractStatusEnum.isReturn(srcVo.getContractStatus())){
|
||||||
throw new ServiceException("合同已回传,不可修改");
|
//发起审批
|
||||||
|
ApproverService service = container.getService(ApproverTypeEnum.UPDATE.getCode());
|
||||||
|
service.apply(updateBo.getContractCode(),updateBo.getUpdateDesc(), JSON.toJSONString(srcVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//3.签章:合同签字盖章成功:修改合同成功,合同签字盖章变回未签章状态,需重新进行签章申请
|
||||||
|
if(StringUtils.equals(srcVo.getSignStatus(),CommonStatusEnum.SUCCESS.getCode()) ){
|
||||||
|
updateBo.setSignStatus(CommonStatusEnum.INIT.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 查询合同基本信息
|
* 查询合同基本信息
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.pusong.business.service.impl;
|
package com.pusong.business.service.impl;
|
||||||
|
|
||||||
|
import com.pusong.business.enums.PayStatusEnum;
|
||||||
import com.pusong.common.core.utils.MapstructUtils;
|
import com.pusong.common.core.utils.MapstructUtils;
|
||||||
import com.pusong.common.core.utils.StringUtils;
|
import com.pusong.common.core.utils.StringUtils;
|
||||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -39,11 +40,12 @@ public class PsContractPayServiceImpl implements IPsContractPayService {
|
|||||||
* @param contractCode 合同编码
|
* @param contractCode 合同编码
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<PsContractPayVo> queryListByContractCode(String contractCode,String business){
|
public List<PsContractPayVo> queryListByContractCode(String contractCode,String business,PayStatusEnum enu){
|
||||||
if(StringUtils.isBlank(contractCode)){return new ArrayList<>();}
|
if(StringUtils.isBlank(contractCode)){return new ArrayList<>();}
|
||||||
List<PsContractPayVo> list = baseMapper.selectVoList(Wrappers.<PsContractPay>lambdaQuery().
|
List<PsContractPayVo> list = baseMapper.selectVoList(Wrappers.<PsContractPay>lambdaQuery().
|
||||||
eq(PsContractPay::getContractCode, contractCode).eq(PsContractPay::getDelFlag,0)
|
eq(PsContractPay::getContractCode, contractCode).eq(PsContractPay::getDelFlag,0)
|
||||||
.eq(StringUtils.isNotBlank(business),PsContractPay::getBusinessType,business)
|
.eq(StringUtils.isNotBlank(business),PsContractPay::getBusinessType,business)
|
||||||
|
.eq(enu != null ,PsContractPay::getPayStatus, enu.getCode())
|
||||||
.orderByAsc(PsContractPay::getPayDate));
|
.orderByAsc(PsContractPay::getPayDate));
|
||||||
return list == null?new ArrayList<>():list;
|
return list == null?new ArrayList<>():list;
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
package com.pusong.business.service.impl;
|
package com.pusong.business.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.pusong.business.domain.PsCompanyInfo;
|
import com.pusong.business.domain.PsCompanyInfo;
|
||||||
import com.pusong.business.domain.PsCustomCallback;
|
import com.pusong.business.domain.PsCustomCallback;
|
||||||
import com.pusong.business.domain.PsCustomPrice;
|
import com.pusong.business.domain.PsCustomPrice;
|
||||||
import com.pusong.business.domain.bo.PsContractBusinessBo;
|
import com.pusong.business.domain.bo.*;
|
||||||
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
|
||||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
|
||||||
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||||
import com.pusong.business.domain.vo.PsCustomCallbackVo;
|
import com.pusong.business.domain.vo.PsCustomCallbackVo;
|
||||||
import com.pusong.business.domain.vo.PsCustomPriceVo;
|
import com.pusong.business.domain.vo.PsCustomPriceVo;
|
||||||
|
import com.pusong.business.enums.CommonStatusEnum;
|
||||||
import com.pusong.business.enums.CustomerStatusEnum;
|
import com.pusong.business.enums.CustomerStatusEnum;
|
||||||
import com.pusong.business.mapper.PsCompanyInfoMapper;
|
import com.pusong.business.mapper.PsCompanyInfoMapper;
|
||||||
import com.pusong.business.mapper.PsCustomCallbackMapper;
|
import com.pusong.business.mapper.PsCustomCallbackMapper;
|
||||||
import com.pusong.business.mapper.PsCustomPriceMapper;
|
import com.pusong.business.mapper.PsCustomPriceMapper;
|
||||||
|
import com.pusong.business.service.IPsCompanyInfoService;
|
||||||
import com.pusong.common.core.utils.MapstructUtils;
|
import com.pusong.common.core.utils.MapstructUtils;
|
||||||
import com.pusong.common.core.utils.StringUtils;
|
import com.pusong.common.core.utils.StringUtils;
|
||||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -23,10 +24,10 @@ import com.pusong.common.mybatis.core.page.PageQuery;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.pusong.common.satoken.utils.LoginHelper;
|
import com.pusong.common.satoken.utils.LoginHelper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
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.pusong.business.domain.bo.PsCustomInfoBo;
|
|
||||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||||
import com.pusong.business.domain.PsCustomInfo;
|
import com.pusong.business.domain.PsCustomInfo;
|
||||||
import com.pusong.business.mapper.PsCustomInfoMapper;
|
import com.pusong.business.mapper.PsCustomInfoMapper;
|
||||||
@ -51,6 +52,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
private final PsCustomPriceMapper priceMapper;
|
private final PsCustomPriceMapper priceMapper;
|
||||||
private final PsCustomCallbackMapper callbackMapper;
|
private final PsCustomCallbackMapper callbackMapper;
|
||||||
private final PsCompanyInfoMapper companyInfoMapper;
|
private final PsCompanyInfoMapper companyInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private final IPsCompanyInfoService companyInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询客户
|
* 根据id查询客户
|
||||||
@ -84,6 +87,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
@Override
|
@Override
|
||||||
public TableDataInfo<PsCustomInfoVo> queryPageList(PsCustomInfoBo bo, PageQuery pageQuery) {
|
public TableDataInfo<PsCustomInfoVo> queryPageList(PsCustomInfoBo bo, PageQuery pageQuery) {
|
||||||
//查询客户基本信息
|
//查询客户基本信息
|
||||||
|
bo.setNotCustomStatus(List.of(CustomerStatusEnum.PUBLIC.getCode()));
|
||||||
|
bo.setBlack(CommonStatusEnum.N.getCode());
|
||||||
Wrapper<PsCustomInfo> lqw = buildQueryWrapper(bo);
|
Wrapper<PsCustomInfo> lqw = buildQueryWrapper(bo);
|
||||||
Page<PsCustomInfoVo> result = baseMapper.selectPageCustomerList(pageQuery.build(), lqw);
|
Page<PsCustomInfoVo> result = baseMapper.selectPageCustomerList(pageQuery.build(), lqw);
|
||||||
if(CollectionUtils.isEmpty(result.getRecords())){
|
if(CollectionUtils.isEmpty(result.getRecords())){
|
||||||
@ -99,8 +104,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
//分组
|
//分组
|
||||||
id_piceMap = pices.stream().collect((Collectors.groupingBy(PsCustomPriceVo::getCustomId)));
|
id_piceMap = pices.stream().collect((Collectors.groupingBy(PsCustomPriceVo::getCustomId)));
|
||||||
//排序
|
//排序
|
||||||
id_piceMap.forEach((k,v)->{
|
id_piceMap.entrySet().forEach(entry->{
|
||||||
v = v.stream().sorted(Comparator.comparingInt(PsCustomPriceVo::getPriceBatch)).collect(Collectors.toList());
|
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingInt(PsCustomPriceVo::getPriceBatch)).collect(Collectors.toList()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,8 +118,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
//分组
|
//分组
|
||||||
id_callbackMap = callbacks.stream().collect((Collectors.groupingBy(PsCustomCallbackVo::getCustomId)));
|
id_callbackMap = callbacks.stream().collect((Collectors.groupingBy(PsCustomCallbackVo::getCustomId)));
|
||||||
//排序
|
//排序
|
||||||
id_callbackMap.forEach((k,v)->{
|
id_callbackMap.entrySet().forEach(entry->{
|
||||||
v = v.stream().sorted(Comparator.comparingLong(PsCustomCallbackVo::getId).reversed()).collect(Collectors.toList());
|
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingLong(PsCustomCallbackVo::getId).reversed()).collect(Collectors.toList()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,8 +132,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
//分组
|
//分组
|
||||||
id_companyMap = companyInfoVos.stream().collect((Collectors.groupingBy(PsCompanyInfoVo::getCustomId)));
|
id_companyMap = companyInfoVos.stream().collect((Collectors.groupingBy(PsCompanyInfoVo::getCustomId)));
|
||||||
//排序
|
//排序
|
||||||
id_companyMap.forEach((k,v)->{
|
id_companyMap.entrySet().forEach(entry->{
|
||||||
v = v.stream().sorted(Comparator.comparingLong(PsCompanyInfoVo::getId)).collect(Collectors.toList());
|
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingLong(PsCompanyInfoVo::getId)).collect(Collectors.toList()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +142,7 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
info.setPsCustomCallbackVo(id_callbackMap.get(info.getId()));
|
info.setPsCustomCallbackVo(id_callbackMap.get(info.getId()));
|
||||||
//装填报价金额vo
|
//装填报价金额vo
|
||||||
info.setPsCustomPriceVo(id_piceMap.get(info.getId()));
|
info.setPsCustomPriceVo(id_piceMap.get(info.getId()));
|
||||||
//装填报价金额vo
|
//装填公司信息vo
|
||||||
info.setPsCompanyInfoVos(id_companyMap.get(info.getId()));
|
info.setPsCompanyInfoVos(id_companyMap.get(info.getId()));
|
||||||
//报价金额
|
//报价金额
|
||||||
if(CollectionUtils.isNotEmpty(info.getPsCustomPriceVo())){
|
if(CollectionUtils.isNotEmpty(info.getPsCustomPriceVo())){
|
||||||
@ -149,7 +154,9 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
}
|
}
|
||||||
//最早的公司名称
|
//最早的公司名称
|
||||||
if(CollectionUtils.isNotEmpty(info.getPsCompanyInfoVos())){
|
if(CollectionUtils.isNotEmpty(info.getPsCompanyInfoVos())){
|
||||||
info.setCompanyName(info.getPsCompanyInfoVos().get(0).getCompanyName());
|
//找到最近修改的公司名称
|
||||||
|
info.setCompanyName(info.getPsCompanyInfoVos().stream().max(Comparator.comparingLong(item -> item.getUpdateTime().getTime()))
|
||||||
|
.orElse(new PsCompanyInfoVo()).getCompanyName());
|
||||||
info.setCompanyNum(info.getPsCompanyInfoVos().size());
|
info.setCompanyNum(info.getPsCompanyInfoVos().size());
|
||||||
}else{
|
}else{
|
||||||
info.setCompanyNum(0);
|
info.setCompanyNum(0);
|
||||||
@ -178,13 +185,16 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
qw.like(StringUtils.isNotBlank(bo.getCustomName()), "info.custom_name", bo.getCustomName());//姓名
|
qw.like(StringUtils.isNotBlank(bo.getCustomName()), "info.custom_name", bo.getCustomName());//姓名
|
||||||
qw.eq(StringUtils.isNotBlank(bo.getCustomSource()), "info.custom_source", bo.getCustomSource());//来源
|
qw.eq(StringUtils.isNotBlank(bo.getCustomSource()), "info.custom_source", bo.getCustomSource());//来源
|
||||||
qw.eq(StringUtils.isNotBlank(bo.getCustomLevel()), "info.custom_level", bo.getCustomLevel());//客户级别
|
qw.eq(StringUtils.isNotBlank(bo.getCustomLevel()), "info.custom_level", bo.getCustomLevel());//客户级别
|
||||||
qw.like(StringUtils.isNotBlank(bo.getCustomMobile()), "info.custom_mobile", bo.getCustomMobile());//客户级别
|
qw.like(StringUtils.isNotBlank(bo.getCustomMobile()), "info.custom_mobile", bo.getCustomMobile());//客户手机号
|
||||||
qw.like(StringUtils.isNotBlank(bo.getCustomMobile()), "info.custom_mobile", bo.getCustomMobile());//客户级别
|
qw.in(CollectionUtils.isNotEmpty(bo.getInCustomStatus()), "info.custom_status", bo.getInCustomStatus());//客户状态
|
||||||
|
qw.notIn(CollectionUtils.isNotEmpty(bo.getNotCustomStatus()), "info.custom_status", bo.getNotCustomStatus());//客户状态
|
||||||
|
qw.eq(StringUtils.isNotBlank(bo.getBlack()), "info.black", bo.getBlack());//客户状态
|
||||||
//用户信息表条件
|
//用户信息表条件
|
||||||
qw.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "use.custom_manager", bo.getCustomManagerName());//销售经理名称
|
qw.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "use.custom_manager", bo.getCustomManagerName());//销售经理名称
|
||||||
//关联客户信息表条件
|
//关联客户信息表条件
|
||||||
qw.eq(StringUtils.isNotBlank(bo.getCustomIntroducerName()), "psinfo.custom_introducer", bo.getCustomIntroducerName());//介绍人姓名
|
qw.eq(StringUtils.isNotBlank(bo.getCustomIntroducerName()), "psinfo.custom_introducer", bo.getCustomIntroducerName());//介绍人姓名
|
||||||
|
//公司名称
|
||||||
|
qw.exists(StringUtils.isNotBlank(bo.getCompanyName()), "select 1 from ps_company_info com where info.id = com.custom_id and com.company_name like '%"+bo.getCompanyName()+"%'");
|
||||||
qw.orderByDesc("info.create_time");//创建时间排序
|
qw.orderByDesc("info.create_time");//创建时间排序
|
||||||
return qw;
|
return qw;
|
||||||
}
|
}
|
||||||
@ -202,6 +212,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
//客户经理就是登录用户
|
//客户经理就是登录用户
|
||||||
add.setCustomManager(LoginHelper.getUserId());
|
add.setCustomManager(LoginHelper.getUserId());
|
||||||
|
add.setBlack(CommonStatusEnum.N.getCode());
|
||||||
|
add.setCustomStatus(CustomerStatusEnum.INIT.getCode());
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if(CollectionUtils.isNotEmpty(bo.getPriceBos())){
|
if(CollectionUtils.isNotEmpty(bo.getPriceBos())){
|
||||||
bo.getPriceBos().forEach(item->item.setCustomId(add.getId()));
|
bo.getPriceBos().forEach(item->item.setCustomId(add.getId()));
|
||||||
@ -211,8 +223,13 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
bo.getCallbackBos().forEach(item->item.setCustomId(add.getId()));
|
bo.getCallbackBos().forEach(item->item.setCustomId(add.getId()));
|
||||||
this.insertCallbackByBo(bo.getCallbackBos());
|
this.insertCallbackByBo(bo.getCallbackBos());
|
||||||
}
|
}
|
||||||
|
//新增公司信息
|
||||||
|
if(StringUtils.isNotBlank(bo.getCompanyName())){
|
||||||
|
PsCompanyInfoBo update = new PsCompanyInfoBo();
|
||||||
|
update.setCustomId(add.getId());
|
||||||
|
update.setCompanyName(bo.getCompanyName());
|
||||||
|
companyInfoService.saveBo(update);
|
||||||
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,7 +243,15 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
public Boolean updateByBo(PsCustomInfoBo bo) {
|
public Boolean updateByBo(PsCustomInfoBo bo) {
|
||||||
PsCustomInfo update = MapstructUtils.convert(bo, PsCustomInfo.class);
|
PsCustomInfo update = MapstructUtils.convert(bo, PsCustomInfo.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
return baseMapper.updateById(update) > 0;
|
baseMapper.updateById(update);
|
||||||
|
//修改公司信息
|
||||||
|
if(StringUtils.isNotBlank(bo.getCompanyName())){
|
||||||
|
PsCompanyInfoBo com = new PsCompanyInfoBo();
|
||||||
|
com.setCustomId(bo.getId());
|
||||||
|
com.setCompanyName(bo.getCompanyName());
|
||||||
|
companyInfoService.saveBo(com);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.pusong.business.mapper.PsApproverRecordMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -8,6 +8,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||||
import com.pusong.system.domain.SysDictData;
|
import com.pusong.system.domain.SysDictData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典数据业务对象 sys_dict_data
|
* 字典数据业务对象 sys_dict_data
|
||||||
*
|
*
|
||||||
@ -49,6 +51,10 @@ public class SysDictDataBo extends BaseEntity {
|
|||||||
@NotBlank(message = "字典类型不能为空")
|
@NotBlank(message = "字典类型不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型长度不能超过{max}个字符")
|
@Size(min = 0, max = 100, message = "字典类型长度不能超过{max}个字符")
|
||||||
private String dictType;
|
private String dictType;
|
||||||
|
/**
|
||||||
|
* 字典类型
|
||||||
|
*/
|
||||||
|
private List<String> inDictType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 样式属性(其他样式扩展)
|
* 样式属性(其他样式扩展)
|
||||||
|
@ -2,6 +2,7 @@ package com.pusong.system.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.pusong.common.core.constant.CacheNames;
|
import com.pusong.common.core.constant.CacheNames;
|
||||||
@ -57,6 +58,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
|||||||
lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort());
|
lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel());
|
lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType());
|
lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType());
|
||||||
|
lqw.in(CollectionUtils.isNotEmpty(bo.getInDictType()), SysDictData::getDictType, bo.getInDictType());
|
||||||
lqw.orderByAsc(SysDictData::getDictSort);
|
lqw.orderByAsc(SysDictData::getDictSort);
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user