生成合同
This commit is contained in:
parent
a591fe024b
commit
e679221603
pusong-modules/pusong-business/src/main
java/com/pusong/business
controller
domain
enums
mapper
service
resources/mapper/business
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
||||
import com.pusong.business.domain.vo.PsCustomerRecordVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
@ -111,6 +112,93 @@ public class PsCustomController extends BaseController {
|
||||
return toAjax(psCustomInfoService.updateCustomerStatus(id, type,desc));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name 客户名
|
||||
* @param mobile 客户电话
|
||||
* @param companyName 公司名
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:record")
|
||||
@Log(title = "客户档案" )
|
||||
@GetMapping("/record")
|
||||
public TableDataInfo<PsCustomerRecordVo> record(String name, String mobile, String companyName, PageQuery pageQuery) {
|
||||
return psCustomInfoService.getCustomerRecordList(name,mobile,companyName,pageQuery);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 移出黑名单
|
||||
* @param customerId 客户id
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:removeblack")
|
||||
@RepeatSubmit
|
||||
@Log(title = "移除黑名单" )
|
||||
@GetMapping("/removeblack")
|
||||
public R<Void> removeblack(@NotNull Long customerId) {
|
||||
psCustomInfoService.removeblack(customerId);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 彻底删除
|
||||
* @param customerId 客户id
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:delete")
|
||||
@RepeatSubmit
|
||||
@Log(title = "彻底删除", businessType=BusinessType.DELETE)
|
||||
@GetMapping("/delete")
|
||||
public R<Void> delete(@NotNull Long customerId) {
|
||||
psCustomInfoService.delete(customerId);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 中止合作
|
||||
* @param customerId 客户id
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:stop")
|
||||
@RepeatSubmit
|
||||
@Log(title = "中止合作", businessType=BusinessType.DELETE)
|
||||
@GetMapping("/stop")
|
||||
public R<Void> stop(@NotNull Long customerId) {
|
||||
psCustomInfoService.stop(customerId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动认领
|
||||
* @param customerId 客户id
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:list")
|
||||
@RepeatSubmit
|
||||
@Log(title = "主动认领")
|
||||
@GetMapping("/stop")
|
||||
public R<Void> claim(@NotNull Long customerId) {
|
||||
psCustomInfoService.claim(customerId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 指派
|
||||
* @param customerId 客户id
|
||||
* @param userId 被指派者id
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:list")
|
||||
@RepeatSubmit
|
||||
@Log(title = "主动认领")
|
||||
@GetMapping("/assign")
|
||||
public R<Void> assign(@NotNull Long customerId,@NotNull Long userId) {
|
||||
psCustomInfoService.assign(customerId,userId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出客户基本信息列表
|
||||
*/
|
||||
|
@ -143,6 +143,20 @@ public class PsTaskController extends BaseController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 免费派单
|
||||
* @param contractCode 合同编码
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "免费派单")
|
||||
@SaCheckPermission("business:task:list")
|
||||
@GetMapping("/freeWork")
|
||||
public R<Void> freeWork(@NotNull String contractCode) {
|
||||
psTaskMainService.freeWork(contractCode);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出主任务列表
|
||||
// */
|
||||
|
@ -55,7 +55,15 @@ public class PsTaskMain extends TenantEntity {
|
||||
* 任务状态
|
||||
*/
|
||||
private String taskStatus;
|
||||
/**
|
||||
* 免费工单的服务类别
|
||||
*/
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 免费工单的服务内容
|
||||
*/
|
||||
private String businessProject;
|
||||
/**
|
||||
* 2逻辑删除 0 默认有效
|
||||
*/
|
||||
|
@ -0,0 +1,117 @@
|
||||
package com.pusong.business.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.pusong.business.domain.PsTaskMain;
|
||||
import com.pusong.common.translation.annotation.Translation;
|
||||
import com.pusong.common.translation.constant.TransConstant;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 客户档案列表返回VO
|
||||
*
|
||||
* @author wls
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PsCustomerRecordVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 客户表主键id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 合同编码
|
||||
*/
|
||||
private String contractCode;
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
private String customName;
|
||||
|
||||
/**
|
||||
* 客户电话客户电话(多个用英文逗号分割)
|
||||
*/
|
||||
private String customMobile;
|
||||
/**
|
||||
* 服务类别名(多个是用逗号分隔)
|
||||
*/
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL,other = "contract_type")
|
||||
private String businessTypeName;
|
||||
|
||||
/**
|
||||
* 派单时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date startDate;
|
||||
/**
|
||||
* 任务进行天数
|
||||
*/
|
||||
private int numOfDat;
|
||||
/**
|
||||
* 账套号
|
||||
*/
|
||||
private String financeAccountNo;
|
||||
/**
|
||||
* 销售经理
|
||||
*/
|
||||
private String customManager;
|
||||
/**
|
||||
* 所属区域
|
||||
*/
|
||||
private String companyAdress;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String customerNum;
|
||||
/**
|
||||
* 纳税人资格
|
||||
*/
|
||||
private String customerCert;
|
||||
/**
|
||||
* 法人姓名
|
||||
*/
|
||||
private String legalPersonName;
|
||||
|
||||
/**
|
||||
* 法人证件号
|
||||
*/
|
||||
private String legalPersonIdcard;
|
||||
|
||||
/**
|
||||
* 法人电话号
|
||||
*/
|
||||
private String legalPersonPhone;
|
||||
/**
|
||||
* 当前服务人
|
||||
*/
|
||||
private String executors;
|
||||
/**
|
||||
* 当前服务人名字
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME,mapper = "executor")
|
||||
private String executorName;
|
||||
|
||||
/**
|
||||
* 签约备注
|
||||
*/
|
||||
private String signDesc;
|
||||
|
||||
|
||||
|
||||
}
|
@ -53,6 +53,15 @@ public class PsTaskMainVo implements Serializable {
|
||||
* 任务进行天数
|
||||
*/
|
||||
private int numOfDat;
|
||||
/**
|
||||
* 免费工单的服务类别
|
||||
*/
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 免费工单的服务内容
|
||||
*/
|
||||
private String businessProject;
|
||||
|
||||
/**
|
||||
* 主任务状态
|
||||
|
@ -14,7 +14,8 @@ public enum ApproverTypeEnum {
|
||||
PAY("pay","合同回款审批"),
|
||||
SIGN("sign","合同签章审批"),
|
||||
ROLBACK("rolback","回传合同审批"),
|
||||
TASKFINISH("taskFinish","任务完成审批");
|
||||
TASKFINISH("taskFinish","任务完成审批"),
|
||||
PUBLIC("PUBLIC","公海认领审批");
|
||||
private String code;
|
||||
private String text;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.pusong.common.core.utils.StringUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@ -27,10 +28,18 @@ public enum ContractStatusEnum {
|
||||
* @return
|
||||
*/
|
||||
public static boolean isReturn(String code){
|
||||
List<String> list = List.of(INIT.code, CREATE.code,CANCELLATION.code,CANAPPROVER.getCode());
|
||||
List<String> list = List.of(INIT.code, CREATE.code,CANCELLATION.code,CANAPPROVER.code);
|
||||
if(StringUtils.isNotBlank(code) && list.contains(code)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回无效合同集合
|
||||
* @return
|
||||
*/
|
||||
public static List<String> isValid(){
|
||||
return List.of(INIT.code, CANAPPROVER.code);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import lombok.Getter;
|
||||
public enum CustomerStatusEnum {
|
||||
|
||||
INIT("1","初始化"),
|
||||
PUBLIC("2","进入公海");
|
||||
PUBLIC("2","进入公海"),
|
||||
CLAIMAPPROVER("20","认领审批中"),
|
||||
STOP("3","终止合作");
|
||||
private String code;
|
||||
private String text;
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||
import com.pusong.business.domain.vo.PsCustomerRecordVo;
|
||||
import com.pusong.common.mybatis.annotation.DataColumn;
|
||||
import com.pusong.common.mybatis.annotation.DataPermission;
|
||||
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
@ -29,13 +30,13 @@ public interface PsCustomInfoMapper extends BaseMapperPlus<PsCustomInfo, PsCusto
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "info.create_dept"),
|
||||
@DataColumn(key = "userName", value = "info.create_by")
|
||||
@DataColumn(key = "userName", value = "info.custom_manager")
|
||||
})
|
||||
Page<PsCustomInfoVo> selectPageCustomerList(@Param("page") Page<PsCustomInfo> page, @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "info.create_dept"),
|
||||
@DataColumn(key = "userName", value = "info.create_by")
|
||||
@DataColumn(key = "userName", value = "info.custom_manager")
|
||||
})
|
||||
List<PsCustomInfoVo> selectCustomerList( @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
//
|
||||
@ -45,5 +46,10 @@ public interface PsCustomInfoMapper extends BaseMapperPlus<PsCustomInfo, PsCusto
|
||||
// })
|
||||
// Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "info.create_dept"),
|
||||
@DataColumn(key = "userName", value = "info.create_by")
|
||||
})
|
||||
Page<PsCustomerRecordVo> selectPageCustomerRecordList(@Param("page") Page<PsCustomInfo> page, @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.pusong.business.domain.PsContractInfo;
|
||||
import com.pusong.business.domain.bo.PsContractInfoQueryBo;
|
||||
import com.pusong.business.domain.vo.PsContractInfoVo;
|
||||
import com.pusong.business.domain.bo.PsContractInfoBo;
|
||||
import com.pusong.business.enums.ContractStatusEnum;
|
||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||
|
||||
@ -42,7 +43,7 @@ public interface IPsContractInfoService {
|
||||
*/
|
||||
PsContractInfoVo queryInfoByCustomId(Long customerId);
|
||||
|
||||
|
||||
List<PsContractInfo> queryByCode(Long customId, String code, ContractStatusEnum enu);
|
||||
/**
|
||||
* 分页查询合同基本信息列表
|
||||
*
|
||||
|
@ -6,6 +6,7 @@ import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||
import com.pusong.business.domain.bo.PsCustomInfoBo;
|
||||
import com.pusong.business.domain.vo.PsCustomerRecordVo;
|
||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||
|
||||
@ -88,4 +89,41 @@ public interface IPsCustomInfoService {
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertCallbackByBo(List<PsCustomCallbackBo> bos);
|
||||
|
||||
/**
|
||||
* 客户档案查询列表
|
||||
* @param name
|
||||
* @param mobile
|
||||
* @param companyName
|
||||
* @return
|
||||
*/
|
||||
TableDataInfo<PsCustomerRecordVo> getCustomerRecordList(String name, String mobile, String companyName, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 移除黑名单
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
void removeblack(Long customerId);
|
||||
/**
|
||||
* 删除
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
void delete(Long customerId);
|
||||
/**
|
||||
* 中止合作
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
void stop(Long customerId);
|
||||
|
||||
/**
|
||||
* 主动认领
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
void claim(Long customerId);
|
||||
/**
|
||||
* 指派
|
||||
* @param customerId 客户id
|
||||
* @param userId 被指派者
|
||||
*/
|
||||
void assign(Long customerId,Long userId);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public interface IPsTaskMediaService {
|
||||
* @param companyId 公司id
|
||||
* @return 任务资料
|
||||
*/
|
||||
List<PsTaskMediaVo> queryByTaskId(Long customerId,Long companyId);
|
||||
List<PsTaskMediaVo> queryMediaList(Long customerId,Long companyId);
|
||||
|
||||
/**
|
||||
* 保存影响资料信息
|
||||
|
@ -99,7 +99,11 @@ public interface IPsTaskService {
|
||||
* @param executorId 任务新的执行者id
|
||||
*/
|
||||
void taskReset(Long id,Long executorId);
|
||||
|
||||
/**
|
||||
* 免费工单
|
||||
* @param contractCode 合同编码
|
||||
*/
|
||||
void freeWork(String contractCode);
|
||||
/* *//**
|
||||
* 查询主任务
|
||||
*
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.pusong.business.service.approver.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.pusong.business.domain.PsApproverRecord;
|
||||
import com.pusong.business.domain.PsContractInfo;
|
||||
import com.pusong.business.domain.bo.PsContractBusinessBo;
|
||||
import com.pusong.business.domain.bo.PsContractBusinessDetailBo;
|
||||
import com.pusong.business.domain.bo.PsContractInfoBo;
|
||||
import com.pusong.business.domain.vo.PsContractInfoVo;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.enums.CommonStatusEnum;
|
||||
import com.pusong.business.service.IPsContractBusinessService;
|
||||
import com.pusong.business.service.IPsContractInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 回传合同审批
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RolbackApproverServiceImpl extends ApproverAbstractServiceImpl {
|
||||
@Override
|
||||
public String approverType() {
|
||||
return ApproverTypeEnum.ROLBACK.getCode();
|
||||
}
|
||||
private final IPsContractBusinessService businessService;
|
||||
private final IPsContractInfoService contractInfoService;
|
||||
|
||||
/**
|
||||
* 1 审批成功修改回传状态,并把回传的合同ossid放入合同表
|
||||
* @param psApproverRecord 神瀑类
|
||||
*/
|
||||
@Override
|
||||
public void success(PsApproverRecord psApproverRecord) {
|
||||
//1查询源数据
|
||||
PsContractInfo psContractInfo = new PsContractInfo();
|
||||
psContractInfo.setContractCode(psApproverRecord.getContractCode());
|
||||
psContractInfo.setRollBackStatus(CommonStatusEnum.SUCCESS.getCode());
|
||||
psContractInfo.setRollBackPdf(Long.valueOf(psApproverRecord.getUpdateData()));
|
||||
contractInfoService.updateByCode(psContractInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fail(PsApproverRecord psApproverRecord) {
|
||||
PsContractInfo info = new PsContractInfo();
|
||||
info.setContractCode(psApproverRecord.getContractCode());
|
||||
info.setRollBackStatus(CommonStatusEnum.FAIL.getCode());
|
||||
contractInfoService.updateByCode(info);
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.pusong.business.service.approver.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.pusong.business.domain.PsApproverRecord;
|
||||
import com.pusong.business.domain.PsContractInfo;
|
||||
import com.pusong.business.domain.bo.PsContractBusinessBo;
|
||||
import com.pusong.business.domain.bo.PsContractBusinessDetailBo;
|
||||
import com.pusong.business.domain.bo.PsContractInfoBo;
|
||||
import com.pusong.business.domain.vo.PsContractInfoVo;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.enums.CommonStatusEnum;
|
||||
import com.pusong.business.service.IPsContractBusinessService;
|
||||
import com.pusong.business.service.IPsContractInfoService;
|
||||
import com.pusong.common.core.utils.MapstructUtils;
|
||||
import com.pusong.common.core.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签章审批
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SignApproverServiceImpl extends ApproverAbstractServiceImpl {
|
||||
@Override
|
||||
public String approverType() {
|
||||
return ApproverTypeEnum.SIGN.getCode();
|
||||
}
|
||||
private final IPsContractBusinessService businessService;
|
||||
private final IPsContractInfoService contractInfoService;
|
||||
|
||||
/**
|
||||
* 1 审批成功生成签章合同 修改签章状态
|
||||
* @param psApproverRecord 神瀑类
|
||||
*/
|
||||
@Override
|
||||
public void success(PsApproverRecord psApproverRecord) {
|
||||
//1查询源数据
|
||||
PsContractInfoVo vo = contractInfoService.queryContractByCode(psApproverRecord.getContractCode());
|
||||
//合同信息bo
|
||||
PsContractInfoBo bo =new PsContractInfoBo();
|
||||
//合同信息
|
||||
PsContractInfo info = new PsContractInfo();
|
||||
BeanUtils.copyProperties(vo,info);
|
||||
|
||||
List<PsContractBusinessBo> businessBos = new ArrayList<>();
|
||||
vo.getBusinessVoList().forEach(item->{
|
||||
List<PsContractBusinessDetailBo> detailBos = new ArrayList<>();
|
||||
item.getDetailVoList().forEach(it->{
|
||||
PsContractBusinessDetailBo detailBo = new PsContractBusinessDetailBo();
|
||||
BeanUtils.copyProperties(it,detailBo);
|
||||
detailBos.add(detailBo);
|
||||
});
|
||||
PsContractBusinessBo businessBo = new PsContractBusinessBo();
|
||||
BeanUtils.copyProperties(item,businessBo);
|
||||
businessBo.setDetailBos(detailBos);
|
||||
businessBos.add(businessBo);
|
||||
});
|
||||
bo.setBusinessList(businessBos);
|
||||
info.setSignStatus(CommonStatusEnum.SUCCESS.getCode());
|
||||
contractInfoService.updateByCode(info);
|
||||
//生成合同
|
||||
contractInfoService.makePdf(info,bo);
|
||||
}
|
||||
|
||||
//修改签章状态
|
||||
@Override
|
||||
public void fail(PsApproverRecord psApproverRecord) {
|
||||
PsContractInfo info = new PsContractInfo();
|
||||
info.setContractCode(psApproverRecord.getContractCode());
|
||||
info.setSignStatus(CommonStatusEnum.FAIL.getCode());
|
||||
contractInfoService.updateByCode(info);
|
||||
}
|
||||
}
|
@ -16,6 +16,9 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 修改合同审批处理类
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
|
@ -75,12 +75,11 @@ public class IPsContractOperateServiceImpl implements IPsContractOperateService
|
||||
SysOssVo vo = ossService.upload(file);
|
||||
//发起回传合同审批
|
||||
ApproverService service = container.getService(ApproverTypeEnum.ROLBACK.getCode());
|
||||
service.apply(contractCode,contractCode,null, null);
|
||||
service.apply(contractCode,contractCode,null, vo.getOssId());
|
||||
//修改合同信息
|
||||
PsContractInfo psContractInfo = new PsContractInfo();
|
||||
psContractInfo.setContractCode(contractCode);
|
||||
psContractInfo.setRollBackStatus(CommonStatusEnum.ING.getCode());
|
||||
psContractInfo.setRollBackPdf(vo.getOssId());
|
||||
contractInfoService.updateByCode(psContractInfo);
|
||||
//若已存在回传的合同,则删除
|
||||
if(info.getRollBackPdf() != null){
|
||||
|
@ -107,6 +107,9 @@ public class PsApproverRecordServiceImpl implements IPsApproverRecordService {
|
||||
}else{
|
||||
throw new ServiceException("操作失败:不支持的操作类型");
|
||||
}
|
||||
info.setApproverStatus(ApproverStatusEnum.SUCCESS.getCode());
|
||||
info.setApproverDesc(desc);
|
||||
baseMapper.insert(info);
|
||||
}
|
||||
// /**
|
||||
// * 新增审批记录
|
||||
|
@ -64,7 +64,6 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
private final IPsCustomInfoService customInfoService;
|
||||
@Resource
|
||||
private final ISysOssService ossService;
|
||||
|
||||
@Resource
|
||||
private final IPsContractPayService contractPayService;
|
||||
|
||||
@ -352,7 +351,7 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
//合同标题
|
||||
map.put(PdfGenerator.HEAD,head);
|
||||
//是否签章
|
||||
map.put(PdfGenerator.SIGN,StringUtils.equals(CommonStatusEnum.SUCCESS.getCode(),bo.getSignStatus()));
|
||||
map.put(PdfGenerator.SIGN,StringUtils.equals(CommonStatusEnum.SUCCESS.getCode(),add.getSignStatus()));
|
||||
String path = System.getProperty("user.dir")+"test.pdf";
|
||||
log.info(JSON.toJSONString(map));
|
||||
// path = "D:/王立帅/临时/output.pdf";
|
||||
@ -383,7 +382,10 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
*/
|
||||
public void invoice(String contractCode){
|
||||
log.info("合同未回款过,初始化任务主表");
|
||||
PsContractInfoVo info = this.queryContractByCode(contractCode);
|
||||
PsTaskMain psTaskMain = new PsTaskMain();
|
||||
psTaskMain.setCompanyId(info.getCompanyId());
|
||||
psTaskMain.setCustomId(info.getCustomId());
|
||||
psTaskMain.setContractCode(contractCode);
|
||||
psTaskMain.setTaskType(TaskTypeEnum.INVOICE.getCode());
|
||||
psTaskMain.setTaskStatus(TaskStatusEnum.INIT.getCode());
|
||||
|
@ -10,15 +10,18 @@ import com.pusong.business.domain.PsCompanyInfo;
|
||||
import com.pusong.business.domain.PsCustomCallback;
|
||||
import com.pusong.business.domain.PsCustomPrice;
|
||||
import com.pusong.business.domain.bo.*;
|
||||
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||
import com.pusong.business.domain.vo.PsCustomCallbackVo;
|
||||
import com.pusong.business.domain.vo.PsCustomPriceVo;
|
||||
import com.pusong.business.domain.vo.*;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.enums.CommonStatusEnum;
|
||||
import com.pusong.business.enums.ContractStatusEnum;
|
||||
import com.pusong.business.enums.CustomerStatusEnum;
|
||||
import com.pusong.business.mapper.PsCompanyInfoMapper;
|
||||
import com.pusong.business.mapper.PsCustomCallbackMapper;
|
||||
import com.pusong.business.mapper.PsCustomPriceMapper;
|
||||
import com.pusong.business.service.IPsCompanyInfoService;
|
||||
import com.pusong.business.service.approver.ApproverContainer;
|
||||
import com.pusong.business.service.approver.ApproverService;
|
||||
import com.pusong.common.core.exception.ServiceException;
|
||||
import com.pusong.common.core.utils.MapstructUtils;
|
||||
import com.pusong.common.core.utils.StringUtils;
|
||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||
@ -30,7 +33,6 @@ import jakarta.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.business.mapper.PsCustomInfoMapper;
|
||||
import com.pusong.business.service.IPsCustomInfoService;
|
||||
@ -57,6 +59,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
@Resource
|
||||
private final IPsCompanyInfoService companyInfoService;
|
||||
|
||||
private final ApproverContainer approverContainer;
|
||||
|
||||
/**
|
||||
* 根据id查询客户
|
||||
* @return 客户id和姓名
|
||||
@ -190,7 +194,7 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
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.eq(StringUtils.isNotBlank(bo.getBlack()), "info.black", bo.getBlack());//拉黑标识
|
||||
//用户信息表条件
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "usr.nick_name", bo.getCustomManagerName());//销售经理名称
|
||||
//关联客户信息表条件
|
||||
@ -290,7 +294,7 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
psCustomInfo.setCustomManager(null);
|
||||
break;
|
||||
case 2://拉黑
|
||||
psCustomInfo.setBlack("1");
|
||||
psCustomInfo.setBlack(CommonStatusEnum.Y.getCode());
|
||||
psCustomInfo.setBlackDesc(desc);
|
||||
break;
|
||||
}
|
||||
@ -327,4 +331,89 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
List<PsCustomCallback> adds = MapstructUtils.convert(bos, PsCustomCallback.class);
|
||||
return callbackMapper.insertBatch(adds);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 客户档案查询列表
|
||||
* @param name
|
||||
* @param mobile
|
||||
* @param companyName
|
||||
* @return
|
||||
*/
|
||||
public TableDataInfo<PsCustomerRecordVo> getCustomerRecordList(String name, String mobile, String companyName, PageQuery pageQuery){
|
||||
QueryWrapper<PsCustomInfo> qw = Wrappers.query();
|
||||
|
||||
qw.like(StringUtils.isNotBlank(companyName), "com.company_name", companyName);
|
||||
qw.like(StringUtils.isNotBlank(name), "custom.custom_name", name);
|
||||
qw.like(StringUtils.isNotBlank(mobile), "custom.custom_mobile", mobile);
|
||||
qw.notIn("con.contract_status", ContractStatusEnum.isValid());
|
||||
Page<PsCustomerRecordVo> list = baseMapper.selectPageCustomerRecordList(pageQuery.build(), qw);
|
||||
return TableDataInfo.build(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除黑名单
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
public void removeblack(Long customerId){
|
||||
PsCustomInfo psCustomInfo = baseMapper.selectById(customerId);
|
||||
if(!StringUtils.equals(CommonStatusEnum.Y.getCode(),psCustomInfo.getBlack()) || psCustomInfo.getDelFlag()!=0){
|
||||
throw new ServiceException("数据状态已变更,请刷新后重试");
|
||||
}
|
||||
psCustomInfo.setBlack(CommonStatusEnum.N.getCode());
|
||||
baseMapper.updateById(psCustomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
public void delete(Long customerId){
|
||||
PsCustomInfo psCustomInfo = baseMapper.selectById(customerId);
|
||||
if(!StringUtils.equals(CommonStatusEnum.Y.getCode(),psCustomInfo.getBlack()) || psCustomInfo.getDelFlag()!=0){
|
||||
throw new ServiceException("数据状态已变更,请刷新后重试");
|
||||
}
|
||||
psCustomInfo.setDelFlag(2);
|
||||
baseMapper.updateById(psCustomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止合作
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
public void stop(Long customerId){
|
||||
PsCustomInfo psCustomInfo = baseMapper.selectById(customerId);
|
||||
if(StringUtils.equals(CommonStatusEnum.Y.getCode(),psCustomInfo.getBlack()) || psCustomInfo.getDelFlag()!=0){
|
||||
throw new ServiceException("数据状态已变更,请刷新后重试");
|
||||
}
|
||||
psCustomInfo.setCustomStatus(CustomerStatusEnum.STOP.getCode());
|
||||
baseMapper.updateById(psCustomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动认领
|
||||
* @param customerId 客户id
|
||||
*/
|
||||
public void claim(Long customerId){
|
||||
PsCustomInfo psCustomInfo = baseMapper.selectById(customerId);
|
||||
psCustomInfo.setCustomStatus(CustomerStatusEnum.CLAIMAPPROVER.getCode());
|
||||
// psCustomInfo.setCustomManager(LoginHelper.getUserId());
|
||||
baseMapper.updateById(psCustomInfo);
|
||||
//发起审批
|
||||
ApproverService service = approverContainer.getService(ApproverTypeEnum.PUBLIC.getCode());
|
||||
service.apply(customerId+"",null,null,LoginHelper.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 指派
|
||||
* @param customerId 客户id
|
||||
* @param userId 被指派者
|
||||
*/
|
||||
public void assign(Long customerId,Long userId){
|
||||
PsCustomInfo psCustomInfo = baseMapper.selectById(customerId);
|
||||
psCustomInfo.setCustomStatus(CustomerStatusEnum.INIT.getCode());
|
||||
psCustomInfo.setCustomManager(userId);
|
||||
baseMapper.updateById(psCustomInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class PsTaskMediaServiceImpl implements IPsTaskMediaService {
|
||||
* @return 任务资料
|
||||
*/
|
||||
@Override
|
||||
public List<PsTaskMediaVo> queryByTaskId(Long customerId,Long companyId){
|
||||
public List<PsTaskMediaVo> queryMediaList(Long customerId,Long companyId){
|
||||
PsTaskMediaBo bo = new PsTaskMediaBo();
|
||||
bo.setCustomId(customerId);
|
||||
bo.setCompanyId(companyId);
|
||||
|
@ -16,9 +16,11 @@ import com.pusong.business.domain.vo.*;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.enums.TaskStatusEnum;
|
||||
import com.pusong.business.enums.TaskStatusEnum.*;
|
||||
import com.pusong.business.enums.TaskTypeEnum;
|
||||
import com.pusong.business.mapper.PsContractBusinessMapper;
|
||||
import com.pusong.business.mapper.PsTaskAppointMapper;
|
||||
import com.pusong.business.service.IPsCompanyInfoService;
|
||||
import com.pusong.business.service.IPsContractInfoService;
|
||||
import com.pusong.business.service.IPsTaskMediaService;
|
||||
import com.pusong.business.service.approver.ApproverContainer;
|
||||
import com.pusong.business.service.approver.ApproverService;
|
||||
@ -60,6 +62,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
private final IPsTaskMediaService mediaService;
|
||||
private final IPsCompanyInfoService companyInfoService;
|
||||
private final ISysOssService ossService;
|
||||
private final IPsContractInfoService psContractInfoService;
|
||||
@Resource
|
||||
private ApproverContainer approverContainer;
|
||||
/**
|
||||
@ -124,7 +127,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
//查询公司信息
|
||||
PsCompanyInfoVo companyInfoVo = companyInfoService.queryById(mainTask.getCompanyId());
|
||||
//查询资料信息
|
||||
List<PsTaskMediaVo> list = mediaService.queryByTaskId(mainTask.getCustomId(),mainTask.getCompanyId());
|
||||
List<PsTaskMediaVo> list = mediaService.queryMediaList(mainTask.getCustomId(),mainTask.getCompanyId());
|
||||
PsTaskMainVo psTaskMainVo = new PsTaskMainVo();
|
||||
psTaskMainVo.setCompanyInfoVo(companyInfoVo);
|
||||
psTaskMainVo.setTaskMediaVoList(list);
|
||||
@ -166,7 +169,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
return;
|
||||
}
|
||||
//2.1查询原始的合同资料信息
|
||||
List<PsTaskMediaVo> mediaList = mediaService.queryByTaskId(taskMain.getCustomId(),taskMain.getCompanyId());
|
||||
List<PsTaskMediaVo> mediaList = mediaService.queryMediaList(taskMain.getCustomId(),taskMain.getCompanyId());
|
||||
//此次需要保存的资料id(后续删除使用)
|
||||
List<String> ossIdList = new ArrayList<>();
|
||||
save.getMediaBoList().forEach(item->{
|
||||
@ -296,6 +299,20 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
appointMapper.updateById(appoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* 免费工单
|
||||
* @param contractCode 合同编码
|
||||
*/
|
||||
public void freeWork(String contractCode) {
|
||||
PsContractInfoVo info = psContractInfoService.queryContractByCode(contractCode);
|
||||
PsTaskMain psTaskMain = new PsTaskMain();
|
||||
psTaskMain.setCompanyId(info.getCompanyId());
|
||||
psTaskMain.setCustomId(info.getCustomId());
|
||||
psTaskMain.setContractCode(contractCode);
|
||||
psTaskMain.setTaskType(TaskTypeEnum.FREE.getCode());
|
||||
psTaskMain.setTaskStatus(TaskStatusEnum.INIT.getCode());
|
||||
this.insert(psTaskMain);
|
||||
}
|
||||
|
||||
private QueryWrapper<PsTaskMain> buildQueryWrapper(PsTaskQueryBo bo) {
|
||||
QueryWrapper<PsTaskMain> lqw = new QueryWrapper<PsTaskMain>();
|
||||
|
@ -25,4 +25,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="queryCustomerList"/>
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPageCustomerRecordList" resultType="com.pusong.business.domain.vo.PsCustomerRecordVo">
|
||||
select
|
||||
custom.id,
|
||||
con.contractCode,
|
||||
custom.custom_name,
|
||||
custom.custom_mobile,
|
||||
(select GROUP_CONCAT(business.business_type SEPARATOR ',')
|
||||
from ps_contract_business business where business.contract_code = con.contract_code) as business_type_name,
|
||||
task.start_date,
|
||||
com.finance_account_no,
|
||||
custom.custom_manager,
|
||||
custom.company_adress,
|
||||
custom.company_name,
|
||||
custom.customer_num,
|
||||
custom.customer_cert,
|
||||
custom.legal_person_name,
|
||||
custom.legal_person_idcard,
|
||||
custom.legal_person_phone,
|
||||
(select GROUP_CONCAT(appoint.executor SEPARATOR ',')
|
||||
from ps_task_appoint appoint where appoint.task_id = task.id) as executors,
|
||||
info.sign_desc
|
||||
from
|
||||
ps_custom_info custom
|
||||
left join
|
||||
(select * from ps_task_main main where main.start_date in (select max(ma.start_date) start_date from ps_task_main ma group by ma.custom_id))
|
||||
task on custom.id = task.custom_id
|
||||
left join
|
||||
ps_company_info com on com.id = task.company_id
|
||||
left join
|
||||
ps_contract_info con on con.contract_code = task.contract_code
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user