# Conflicts:
#	pusong-admin/src/main/resources/application-dev.yml
This commit is contained in:
mx 2024-12-31 14:42:08 +08:00
commit 79a441234f
17 changed files with 110 additions and 43 deletions

View File

@ -42,9 +42,14 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://124.236.46.74:9100/pusongplus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: rwWhYfCe3Tzhatep
# url: jdbc:mysql://192.168.18.119:3308/pusongplus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username: root
# password: Ps123456
# url: jdbc:mysql://47.95.38.123:3306/pusongplus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username: root
# password: Ps123456@

View File

@ -50,8 +50,8 @@ public class PsCustomController extends BaseController {
*/
@SaCheckPermission("business:customInfo:list")
@GetMapping("/listByLoginUser")
public TableDataInfo<List<Map<String,Object>>> listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery) {
return psCustomInfoService.listByLoginUser(customName, customMobile, companyName, pageQuery);
public TableDataInfo<List<Map<String,Object>>> listByLoginUser(String customName, String customMobile, String companyName, String companyServiceName, PageQuery pageQuery) {
return psCustomInfoService.listByLoginUser(customName, customMobile, companyName, companyServiceName, pageQuery);
}
/**

View File

@ -11,6 +11,7 @@ import com.pusong.business.domain.vo.TaskPlanVo;
import com.pusong.business.service.IPsContractInfoService;
import com.pusong.business.service.IPsTaskService;
import com.pusong.common.core.domain.R;
import com.pusong.common.core.utils.DateUtils;
import com.pusong.common.core.validate.QueryGroup;
import com.pusong.common.idempotent.annotation.RepeatSubmit;
import com.pusong.common.log.annotation.Log;
@ -115,8 +116,9 @@ public class PsTaskController extends BaseController {
@Log(title = "主任务完成")
@SaCheckPermission("business:task:list")
@GetMapping("/mainFinish")
public R<Void> mainFinish(@NotNull Long id, Date firstFilingTime) {
contractInfoService.finish(psTaskMainService.finishMain(id, firstFilingTime));
public R<Void> mainFinish(@NotNull Long id, String firstFilingTime) {
Date date = DateUtils.parseDate(firstFilingTime);
contractInfoService.finish(psTaskMainService.finishMain(id, date));
return R.ok();
}

View File

@ -5,6 +5,7 @@ import com.pusong.business.domain.PsCompanyInfo;
import com.pusong.common.core.validate.AddGroup;
import com.pusong.common.core.validate.EditGroup;
import com.pusong.common.core.validate.QueryGroup;
import com.pusong.common.json.utils.JsonUtils;
import com.pusong.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
@ -64,6 +65,8 @@ public class PsCompanyQueryBo extends BaseEntity {
*/
private Integer type;
@JsonFormat(pattern = "yyyy-MM")
private String firstFilingTime;
}

View File

@ -101,7 +101,7 @@ public class PsContractInfoBo {
/**
* 是否续费
* o新签 1续费
* o新签(新客户) 1续费 2新签老客户
*/
private String isDue;

View File

@ -92,5 +92,10 @@ public class PsContractInfoQueryBo {
*/
private String isDue;
/**
* 是否代账
*/
private String isProxy;
}

View File

@ -281,4 +281,6 @@ public class PsCompanyInfoVo implements Serializable {
* 首次申报时间
*/
private Date firstFilingTime;
private String taskRemark;
}

View File

@ -92,4 +92,6 @@ public class PsContractBusinessVo implements Serializable {
* 剩余天数
*/
private int remainingDay;
private String pdfId;
}

View File

@ -18,7 +18,9 @@ public enum TaskStatusEnum {
FINISH("30","完成"),
PAUSE("40","暂停"),
CANCEL("50","作废"),
CANCELAPPO("55","作废审批中");
CANCELAPPO("55","作废审批中")
,DISABLED("60", "因合同修改失效")
;
private String code;
private String text;

View File

@ -32,7 +32,7 @@ public interface IPsCustomInfoService {
* 查询登陆人下所有的客户名称和id
* @return 客户id和姓名
*/
TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery);
TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, String companyServiceName, PageQuery pageQuery);
/**
* 分页查询客户基本信息列表
*

View File

@ -154,8 +154,11 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
lqw.like(bo.getCompanyName() != null,"com.company_name", bo.getCompanyName());
lqw.eq(bo.getServiceStatus() != null,"com.service_status", bo.getServiceStatus());
lqw.between(bo.getParams().get("beginTime") != null && bo.getParams().get("endTime") != null,
"com.first_filing_time", bo.getParams().get("beginTime"), bo.getParams().get("endTime"));
if (bo.getFirstFilingTime() != null){
Date endTimeByMonth = DateUtils.getEndTimeByMonth(DateUtils.parseDate(bo.getFirstFilingTime()));
lqw.between("com.first_filing_time", bo.getFirstFilingTime(), endTimeByMonth);
}
String followUserSql = "";

View File

@ -3,6 +3,7 @@ package com.pusong.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -112,6 +113,13 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
@Override
@Transactional//开启事务
public String createContract(PsContractInfoBo bo, Integer type) {
if ("0".equals(bo.getIsDue())){
bo.setIsOldCus((byte) 0);
}else if ("2".equals(bo.getIsDue())){
bo.setIsOldCus((byte) 1);
bo.setIsDue("0");
}
if (bo.getFirstPartyType() == PsContractInfoBo.FIRSTPARTYTYPE.INDIVIDUALS.getType()){
bo.setContactPersonName(bo.getCompanyInfoBo().getLegalPersonName());
bo.setContactPersonPhone(bo.getCompanyInfoBo().getLegalPersonPhone());
@ -221,6 +229,13 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
* @return 是否新增成功
*/
public Long preview(PsContractInfoBo bo){
if ("0".equals(bo.getIsDue())){
bo.setIsOldCus((byte) 0);
}else if ("2".equals(bo.getIsDue())){
bo.setIsOldCus((byte) 1);
bo.setIsDue("0");
}
//3.如果已存在合同则进行修改否则新增
PsContractInfo add = new PsContractInfo();
add.setContractCode(getContractCode());//合同编码
@ -552,7 +567,9 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
}
}
List<PsTaskMain> psTaskMainList = new ArrayList<>();
for (PsCompanyInfoBo companyInfoBo : addCompany) {
//服务公司加增加任务重新计算合同是待分配还是已分配
companyInfoBo.setCompanyType("2");
@ -566,6 +583,18 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
psContractBusinessBo.setCompanyId(companyInfoBo.getId());
}
}
}
//标记所有任务为 失效 合同号
UpdateWrapper wrapper = new UpdateWrapper();
wrapper.eq("contract_code", updateBo.getContractCode());
wrapper.set("task_status", TaskStatusEnum.DISABLED.getCode());
taskMainMapper.update(wrapper);
if(!"1".equals(updateBo.getIsDue())){
List<PsTaskMain> psTaskMainList = new ArrayList<>();
for (PsCompanyInfoBo companyInfoBo : updateBo.getServiceCompanyInfoList()){
if(ContractStatusEnum.isReturn(old.getContractStatus())){
//已回款的添加任务没回款的等审批后再添加
PsTaskMain psTaskMain = new PsTaskMain();
@ -581,6 +610,7 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
if (!psTaskMainList.isEmpty()){
taskMainService.insertBatch(psTaskMainList);
}
}
//保存公司合同关联表
@ -1090,16 +1120,18 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
qw.exists("select 1 from ps_contract_business bus where info.contract_code = bus.contract_code and bus.business_type = 2");
}else{
//托管类服务类型编码集合
qw.exists(bo.getServiceType() !=null && bo.getServiceType() == 1, "select 1 from ps_contract_business bus " +
qw.exists(bo.getServiceType() != null && bo.getServiceType() == 1, "select 1 from ps_contract_business bus " +
"where bus.contract_code = info.contract_code and bus.business_type = 2");
//非托管服务类型编码集合
qw.notExists(bo.getServiceType() !=null && bo.getServiceType() == 2, "select 1 from ps_contract_business bus " +
qw.notExists(bo.getServiceType() != null && bo.getServiceType() == 2, "select 1 from ps_contract_business bus " +
"where bus.contract_code = info.contract_code and bus.business_type = 2");
}
qw.exists(bo.getIsProxy() != null, "select 1 from ps_contract_business bus " +
"where bus.contract_code = info.contract_code and bus.is_proxy = '" + bo.getIsProxy() + "'");
//服务项目编码集合
qw.exists(CollectionUtils.isNotEmpty(bo.getServiceProjects()), "select 1 from ps_contract_business detail " +
"where detail.contract_code = info.contract_code and detail.business_type in ("+StringUtils.join(bo.getServiceProjects(),",")+")");//服务项目编码集合
qw.between(bo.getMoneyEnd() != null && bo.getMoneyStart() !=null,"info.contract_amount",bo.getMoneyStart(),bo.getMoneyEnd());
qw.between(bo.getMoneyEnd() != null && bo.getMoneyStart() != null,"info.contract_amount",bo.getMoneyStart(),bo.getMoneyEnd());
// qw.orderByDesc("info.create_time");
qw.orderByDesc("info.apply_date");
return qw;

View File

@ -72,7 +72,7 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
* @return 客户id和姓名
*/
@Override
public TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery) {
public TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, String companyServiceName, PageQuery pageQuery) {
//查询客户基本信息
Page<PsCustomInfoVo> list = baseMapper.selectPageCustomerList(pageQuery.build()
, new QueryWrapper<PsCustomInfo>()
@ -82,14 +82,21 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
.isNotNull("info.custom_name")
.ne("info.custom_name","")
.ne("info.custom_name","")
.and(StringUtils.isNotBlank(customName) || StringUtils.isNotBlank(customMobile) || StringUtils.isNotBlank(companyName)
, wq -> wq.like(StringUtils.isNotBlank(customName), "info.custom_name", customName)
.or()
// .and(StringUtils.isNotBlank(customName) || StringUtils.isNotBlank(customMobile) || StringUtils.isNotBlank(companyName)
// , wq -> wq.like(StringUtils.isNotBlank(customName), "info.custom_name", customName)
// .or()
// .like(StringUtils.isNotBlank(customMobile), "info.custom_mobile", customMobile)
// .or()
// .exists(StringUtils.isNotBlank(companyName), "select 1 from ps_company_info where ps_company_info.custom_id = info.id and ps_company_info.del_flag = 0 and company_type = 1 and company_name like '%" + companyName + "%'")
// .exists(StringUtils.isNotBlank(companyServiceName), "select 1 from ps_company_info where ps_company_info.custom_id = info.id and ps_company_info.del_flag = 0 and company_type = 2 and company_name like '%" + companyServiceName + "%'")
//
// )
.like(StringUtils.isNotBlank(customName), "info.custom_name", customName)
.like(StringUtils.isNotBlank(customMobile), "info.custom_mobile", customMobile)
.or()
.exists(StringUtils.isNotBlank(companyName), "select 1 from ps_company_info where ps_company_info.custom_id = ps_custom_info.id and ps_company_info.del_flag = 0 and company_type = 2 and company_name like '%" + companyName + "%'")
.exists(StringUtils.isNotBlank(companyName), "select 1 from ps_company_info where ps_company_info.custom_id = info.id and ps_company_info.del_flag = 0 and company_type = 1 and company_name like '%" + companyName + "%'")
.exists(StringUtils.isNotBlank(companyServiceName), "select 1 from ps_company_info where ps_company_info.custom_id = info.id and ps_company_info.del_flag = 0 and company_type = 2 and company_name like '%" + companyServiceName + "%'")
));
);
if (list.getRecords().isEmpty()){
TableDataInfo tableDataInfo = new TableDataInfo();
tableDataInfo.setRows(null);
@ -309,6 +316,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
//app搜索
qw.and(StringUtils.isNotBlank(bo.getAppKeyWord()), wrapper -> wrapper
.like("usr.nick_name", bo.getAppKeyWord())
.or()
.like("psinfo.custom_name", bo.getAppKeyWord())
.or()
.likeLeft("info.custom_mobile", bo.getAppKeyWord())

View File

@ -121,7 +121,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
lqw.orderByDesc("main.create_time");
page = baseMapper.queryTaskPageList(pageQuery.build(), lqw);
if (page.getSize() > 0){
if (page.getRecords().size() > 0){
QueryWrapper queryWrapper = new QueryWrapper();
List<Long> list = page.getRecords().stream().map(PsTaskMainVo::getId).toList();
queryWrapper.in("task_id", list);

View File

@ -105,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
--pcc.contract_code contract_code, 必须在 com.*, 上边否则company里的 contract_code值会被com表的字段覆盖
pcc.contract_code,
pcc.id pcc_id,
pcc.task_remark,
com.*,
bus.business_amount bus_business_amount,
bus.business_desc bus_business_desc,

View File

@ -38,9 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTuoGuanBusinessList" parameterType="String" resultType="com.pusong.business.domain.vo.PsContractBusinessVo">
select
bus.*
bus.*, info.pdf_id
from ps_contract_company cc
inner join ps_contract_business bus on bus.contract_code = cc.contract_code and bus.company_id = cc.company_id and business_type = '2'
left join ps_contract_info info on info.contract_code = cc.contract_code
${ew.getCustomSqlSegment}
</select>