生成合同
This commit is contained in:
parent
6b9a1d135a
commit
cf4f820efa
BIN
doc/image/allZ.png
Normal file
BIN
doc/image/allZ.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
BIN
doc/image/leftZ.png
Normal file
BIN
doc/image/leftZ.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
BIN
doc/image/pay.png
Normal file
BIN
doc/image/pay.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 199 KiB |
BIN
doc/image/rightZ.png
Normal file
BIN
doc/image/rightZ.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
226
doc/report.ftl
Normal file
226
doc/report.ftl
Normal file
@ -0,0 +1,226 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Report</title>
|
||||||
|
</head>
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
font-size:9pt;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
font-size:9.1pt;
|
||||||
|
border-collapse: collapse; /* 合并边框 */
|
||||||
|
border: 0.1pt solid black; /* 设置表格整体边框 */
|
||||||
|
}
|
||||||
|
td{
|
||||||
|
border: 0.1pt solid black; /* 设置单元格边框 */
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
text-indent:18pt;
|
||||||
|
text-align:justify;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
.content{
|
||||||
|
/*margin-bottom:0pt;*/
|
||||||
|
text-indent:27pt;
|
||||||
|
text-align:justify;
|
||||||
|
line-height:100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<div style="width: 100%;">
|
||||||
|
<div style="width: 100% ;height: 5pt; "></div>
|
||||||
|
<div >
|
||||||
|
<p style="text-align:center;margin-left:300px;margin-top:1pt; margin-bottom:0pt;">
|
||||||
|
<span style="">合同编号:PS- </span>
|
||||||
|
<span style=" text-decoration:underline">${contract.contractCode} </span>
|
||||||
|
<span style=""> 客户编号: </span>
|
||||||
|
<span style=" text-decoration:underline">${contract.customId}
|
||||||
|
</span></p>
|
||||||
|
</div>
|
||||||
|
<div style="width: 100% ;height: 3pt; "></div>
|
||||||
|
<div style="width: 100% ;height: 0.75pt; background-color: black"></div>
|
||||||
|
|
||||||
|
<#--<div style="width: 100% ;height: 17pt; "></div>-->
|
||||||
|
<p style=" text-align:center; margin: 0 auto; font-size:14pt">
|
||||||
|
<span style=" font-weight: bold">${company.companyName}</span></p>
|
||||||
|
<p style=" margin: 0 auto; text-align:center; font-size:16pt">
|
||||||
|
<span style=" font-weight:bold">服务合同</span></p>
|
||||||
|
<p class="content" style="margin-left:21pt; text-indent:19pt;">本合同由缔约双方在自愿、平等、公平及诚实信用原则的基础上,本着共赢互利原则,根据《中华人民共和国民法典》等</p>
|
||||||
|
<p class="content" >相关法律、法规的规定,双方签订以下服务合同以资信守,本服务合同后附的《服务通用条款》为本服务单的有效组成部分</p>
|
||||||
|
<p class="content" >(以下合称为“本协议”),对双方均具有约束力。</p>
|
||||||
|
<div style="text-align:center">
|
||||||
|
<table style="width:526.55pt; margin-right:auto; margin-left:auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr >
|
||||||
|
<td style="width:88.2pt;height: 30pt">
|
||||||
|
服务类别
|
||||||
|
</td>
|
||||||
|
<td style="width:416pt;" colspan="2">
|
||||||
|
具体内容
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<#list business as item>
|
||||||
|
<tr >
|
||||||
|
<td>
|
||||||
|
${item.businessType}
|
||||||
|
</td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div style="height: 5pt;width: 1pt"></div>
|
||||||
|
<#list item.detailBos as detail>
|
||||||
|
<p class="content" style="text-indent:5pt">${detail.businessProjectLabel}——${detail.amount}</p>
|
||||||
|
</#list>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
<tr >
|
||||||
|
<td >
|
||||||
|
付款账号
|
||||||
|
</td>
|
||||||
|
<td colspan="2" >
|
||||||
|
<div style="height: 5pt;width: 1pt"></div>
|
||||||
|
<div style="float: left;">
|
||||||
|
<p class="content" style="text-indent:5pt">公司名称:${company.companyName}</p>
|
||||||
|
<p class="content" style="text-indent:5pt">账号:${company.companyAccountBank}</p>
|
||||||
|
<p class="content" style="text-indent:5pt">开户行:${company.companyAccountBankAdress}</p>
|
||||||
|
</div>
|
||||||
|
<div style="float: left;">
|
||||||
|
<img style=" width:50pt; height:50pt; " src="${imagePath}/doc/image/pay.png"/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr >
|
||||||
|
<td colspan="3" style="width:515pt; ">
|
||||||
|
<div style="height: 5pt;width: 1pt"></div>
|
||||||
|
<p style="margin:5pt; text-indent:18pt; text-align:justify; ">
|
||||||
|
<span style="">合同金额:共计¥</span>
|
||||||
|
<span style=" text-decoration:underline"> ${contract.contractAmount}</span>
|
||||||
|
<span style="">元(大写金额:</span>
|
||||||
|
<span style=" text-decoration:underline"> </span>
|
||||||
|
<span style="">元整),垫付项目中涉及银行开户、刻章等,实际价格以第三方机构及政府规定为准。除此之外,甲方无需向乙方支付其他任何费用。</span></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr >
|
||||||
|
<td >
|
||||||
|
付款方式
|
||||||
|
</td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div style="height: 5pt;width: 1pt"></div>
|
||||||
|
<p class="content" style="text-indent:5pt">${contract.payModeDesc}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr >
|
||||||
|
<td >
|
||||||
|
合同备注
|
||||||
|
</td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div style="height: 5pt;width: 1pt"></div>
|
||||||
|
<p class="content" style="text-indent:5pt">
|
||||||
|
<#if text2?? && text2 != "">
|
||||||
|
${contract.signDesc}
|
||||||
|
<#else>
|
||||||
|
无
|
||||||
|
</#if>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<p style=" text-indent:9pt; text-align:justify; ">
|
||||||
|
<span style=""> </span></p>
|
||||||
|
<p class="title">一、服务期限</p>
|
||||||
|
<p class="content">本合同中的服务周期为 至 。</p>
|
||||||
|
<p class="content">本合同中的企业托管服务,在合同到期前 30 天,乙方有义务告知甲方。如果双方在合同期满前 30 天内未提出终止或变更要</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">求,未办理交接手续,本合同将自行延期一年。如为其他业务,则与双方约定时间为准。</p>
|
||||||
|
|
||||||
|
<p class="title">二、甲方权利与义务</p>
|
||||||
|
<p class="content">(一)甲方须按本合同约定,按时足额支付服务费用,否则乙方有权拒绝提供服务;</p>
|
||||||
|
<p class="content">(二)甲方应无保留地向乙方陈述与代理事务有关的真实情况,提供的资料必须真实合法,且法定代表人、监事、股东等信息</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">的提交须经过其本人同意,否则因此导致的所有风险与责任均由甲方自行承担;</p>
|
||||||
|
|
||||||
|
<p class="title">三、乙方权利和义务</p>
|
||||||
|
<p class="content">(一)乙方在收到甲方支付的款项后,立即启动本合同约定的服务;</p>
|
||||||
|
<p class="content">(二)乙方按照甲方提供的真实有效的企业信息,为甲方办理企业的委托服务;</p>
|
||||||
|
<p class="content">(三)乙方应及时将服务办理完毕后形成的相关资料交予甲方;</p>
|
||||||
|
<p class="content">(四)除为履行本合同所需外,未经甲方事先同意,乙方不得擅自向第三方泄露甲方的商业信息及其他资料。</p>
|
||||||
|
<p class="content">(五)甲方若有违法违规经营情形,或甲方示意乙方提供不当的服务以及其他不符合法律、行政法规的要求,乙方有权拒</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">绝;若 甲方坚持其不当要求,乙方有权单方解除本合同,本合同自乙方向甲方发出通知之日起终止,由此造成的相关责任由甲方</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">自行承担。</p>
|
||||||
|
<p class="content">(六)如甲方不按乙方要求完整、及时地准备和提供相应的资料,导致乙方受托事项办理的延误或未完成,由此所发生的一切</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">后果完全由甲方承担,乙方不承担任何责任。</p>
|
||||||
|
|
||||||
|
<p class="title">四、违约责任</p>
|
||||||
|
<p class="content">(一)甲乙双方任何一方无正当理由提前终止本合同的,应按照本合同服务总金额的 20%向守约方支付违约金,乙方扣除违约</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">金后退还剩余服务期费用;如乙方为甲方注册成立公司后,甲方无正当理由提前解除或终止合同的,乙方不予退还本合同的服务费</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">用。</p>
|
||||||
|
<p class="content">(二)若甲方拖欠乙方服务费,以应付而未付的金额为基础,按每天万分之五的日利率计收每日逾期利息。若甲方逾期支付达</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">1个月,视为甲方主动终止本合同,乙方有权终止提供服务,由此产生的经济、法律及其他责任由甲方自行承担,在甲方未按照本合</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">同约定支付服务费和其他费用的情况下,乙方有权将甲方资料予 以留置,在甲方所欠费用结清后,乙方归还甲方相关资料。</p>
|
||||||
|
<p class="content">(三)任何一方违反本合同部分条款约定的,不影响其余条款的效力和继续履行。对违约情形,守约方有权要求违约方予以更</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">正,若违约方拒绝纠正的,守约方有权单方解除本合同并要求违约方承担违约赔偿责任</p>
|
||||||
|
<p class="content">(四)由于乙方过错给甲方造成损失的,乙方应承担赔偿责任,但赔偿责任以该合作周期内所收取的该项服务的服务费用为赔</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">偿上限。</p>
|
||||||
|
|
||||||
|
<p class="title">五、不可抗力</p>
|
||||||
|
<p class="content">不可抗力是指法律规章或政策变化、社会异常事件(如罢工、骚乱、盗窃、抢劫以及其它不能预见的客观情况)、自然灾害</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">(如台风、洪水、冰雹、地震、海啸、火灾、旱灾、大雪、山崩)等对其发生和后果不能防止或避免的事件。</p>
|
||||||
|
<p class="content">发生不可抗力事件时,双方应互相协商,寻求公平合理的解决争议途经,并尽一切努力减轻不可抗力造成的不良后果。在不可</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">抗力造成本合同无法履行的情况下,双方互不承担责任,且甲方和乙方均有权选择终止本合同,乙方已收款项在扣除已经完成的服务</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">费用和已经产生的成本后进行返还。</p>
|
||||||
|
|
||||||
|
<p class="title">六、通知与送达</p>
|
||||||
|
<p>甲方确保其通信地址、联系人、联系电话的准确性及有效性,因乙方经努力而无法与甲方取得联系而引起的一切后果,由甲方承担;</p>
|
||||||
|
<p class="content">(一)如果是专人送交,则在对方签收视为已送达。</p>
|
||||||
|
<p class="content">(二)如用快递、传真发送,则在收到传输确认书的当天被视为送到,如果传输当天不是工作日,或传输时工作日已结束营</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">业,则在下一个工作日被视作已送达日。</p>
|
||||||
|
<p class="content">(三)以电子邮件、微信等工具发出的,则为发送人的邮件系统确认电子邮件发送至收件人的邮件接收系统后的当天为送达</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">日。</p>
|
||||||
|
<p class="content">(四)各方均应积极履行通知义务,且确保送达地址的有效及准确,任何一方不得以拒绝签收、无人签收、变更地址未收到等</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">理由否定送达效力。</p>
|
||||||
|
<p class="content">(五)乙方工商注册环节的企业营业执照、印章等物品的快递费用由乙方承担,注册企业之后所产生的快递(到付)费用由甲</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">方自行承担。</p>
|
||||||
|
|
||||||
|
<p class="title">七、合同份数及法律效力</p>
|
||||||
|
<p class="content">本合同一式贰份,甲方持壹份,乙方持壹份,每份合同具有相同的法律效力。本合同自双方签署后生效。</p>
|
||||||
|
|
||||||
|
<p class="title">八、其他</p>
|
||||||
|
<p class="content">(一)乙方出于宣传目的而采取发放宣传册、广告、网页推广、销售人员宣讲等方式展现的内容不具有合同效力,双方权利义</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">务内容以本合同为准。</p>
|
||||||
|
<p class="content">(二)乙方工作人员无权向甲方作出超出本合同内容的承诺以及代表乙方以个人形式签署任何文件,双方均应以加盖印章的文</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">件作为双方权利义务约定的唯一形式。</p>
|
||||||
|
<p class="content">(三)本合同内容若需做出任何修改补充,甲、乙双方共同协商,可形成补充协议,补充协议与本合同冲突的,以补充协议为准。</p>
|
||||||
|
<p class="content">(四)因本合同发生争议,双方协商解决;如果协商不成,甲、乙双方一致同意提交仲裁委员会按照其仲裁规则进行裁决,其</p>
|
||||||
|
<p class="content" style="text-indent:0pt;">裁决是终局性的,对双方具有约束力。因争议解决产生的案件受理费、律师费、保全费、公证费、鉴定费等由败诉方承担。</p>
|
||||||
|
<p class="content">(五)本合同传真及扫描件与合同原件具有同等法律效力。</p>
|
||||||
|
<p class="content"> </p>
|
||||||
|
<p class="content">甲方名称(签章): ${customer.customName}</p>
|
||||||
|
<p class="content">甲方联系人: ${customer.customName}</p>
|
||||||
|
<p class="content">联系方式: ${customer.customMobile}</p>
|
||||||
|
<p class="content">签约日期: ${contract.applyDate?string('yyyy年MM月dd日')}
|
||||||
|
<#--<span style=" text-decoration:underline"></span> 年
|
||||||
|
<span style=" text-decoration:underline"></span> 月
|
||||||
|
<span style=" text-decoration:underline"></span> 日-->
|
||||||
|
</p>
|
||||||
|
<p class="content"> </p>
|
||||||
|
|
||||||
|
<p class="content">乙方名称(签章): ${customer.customName}</p>
|
||||||
|
<p class="content">乙方联系人: ${customer.customName}</p>
|
||||||
|
<p class="content">联系方式: ${customer.customName}</p>
|
||||||
|
<p class="content">签约日期: ${contract.applyDate?string('yyyy年MM月dd日')}
|
||||||
|
<#--<span style=" text-decoration:underline"> </span> 年
|
||||||
|
<span style=" text-decoration:underline"> </span> 月
|
||||||
|
<span style=" text-decoration:underline"> </span> 日-->
|
||||||
|
</p>
|
||||||
|
<div style="height: 500px;width: 100%;padding-top: -120px;padding-left: 120px">
|
||||||
|
<img style="width:150px; height:150px; " src="${imagePath}/doc/image/allZ.png"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -45,8 +45,8 @@ server:
|
|||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
org.dromara: @logging.level@
|
org.dromara: @logging.level@
|
||||||
org.springframework: warn
|
org.springframework: info
|
||||||
org.mybatis.spring.mapper: error
|
org.mybatis.spring.mapper: debug
|
||||||
config: classpath:logback-plus.xml
|
config: classpath:logback-plus.xml
|
||||||
|
|
||||||
# 用户配置
|
# 用户配置
|
||||||
|
@ -36,6 +36,27 @@
|
|||||||
<artifactId>jackson-module-kotlin</artifactId>
|
<artifactId>jackson-module-kotlin</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--pdf所需pom begin-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>itextpdf</artifactId>
|
||||||
|
<version>5.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf.tool</groupId>
|
||||||
|
<artifactId>xmlworker</artifactId>
|
||||||
|
<version>5.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>itext-asian</artifactId>
|
||||||
|
<version>5.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!--pdf所需pom end-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.pusong.common.doc.util;
|
||||||
|
|
||||||
|
import com.itextpdf.text.BaseColor;
|
||||||
|
import com.itextpdf.text.Font;
|
||||||
|
import com.itextpdf.text.pdf.BaseFont;
|
||||||
|
import com.itextpdf.tool.xml.XMLWorkerFontProvider;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解决XMLWorkerHelper中文不显示。
|
||||||
|
* <p>使用iTextAsian.jar中自带的中文字体
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class CustomXMLWorkerFontProvider extends XMLWorkerFontProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Font getFont(final String fontName, final String encoding, final boolean embedded, final float size, final int style,
|
||||||
|
final BaseColor color) {
|
||||||
|
BaseFont bf = null;
|
||||||
|
try {
|
||||||
|
// bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);
|
||||||
|
bf =BaseFont.createFont("STSong-Light", "UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
|
||||||
|
|
||||||
|
Font font = new Font(bf, size, style, color);
|
||||||
|
font.setColor(color);
|
||||||
|
// log.info("PDF文档字体初始化完成!");
|
||||||
|
return font;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("exception:", e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,220 @@
|
|||||||
|
package com.pusong.common.doc.util;
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.itextpdf.text.Document;
|
||||||
|
import com.itextpdf.text.DocumentException;
|
||||||
|
import com.itextpdf.text.Element;
|
||||||
|
import com.itextpdf.text.Font;
|
||||||
|
import com.itextpdf.text.Image;
|
||||||
|
import com.itextpdf.text.PageSize;
|
||||||
|
import com.itextpdf.text.Phrase;
|
||||||
|
import com.itextpdf.text.Rectangle;
|
||||||
|
import com.itextpdf.text.pdf.*;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置页面附加属性
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PDFBuilder extends PdfPageEventHelper {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PDFBuilder.class);
|
||||||
|
/**
|
||||||
|
* 页眉
|
||||||
|
*/
|
||||||
|
public String header = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档字体大小,页脚页眉最好和文本大小一致
|
||||||
|
*/
|
||||||
|
public int presentFontSize = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档页面大小,最好前面传入,否则默认为A4纸张
|
||||||
|
*/
|
||||||
|
public Rectangle pageSize = PageSize.A4;
|
||||||
|
|
||||||
|
// 模板
|
||||||
|
public PdfTemplate total;
|
||||||
|
|
||||||
|
// 基础字体对象
|
||||||
|
public BaseFont bf = null;
|
||||||
|
|
||||||
|
// 利用基础字体生成的字体对象,一般用于生成中文文字
|
||||||
|
public Font fontDetail = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Creates a new instance of PdfReportM1HeaderFooter 无参构造方法.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public PDFBuilder() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Creates a new instance of PdfReportM1HeaderFooter 构造方法.
|
||||||
|
*
|
||||||
|
* @param yeMei
|
||||||
|
* 页眉字符串
|
||||||
|
* @param presentFontSize
|
||||||
|
* 数据体字体大小
|
||||||
|
* @param pageSize
|
||||||
|
* 页面文档大小,A4,A5,A6横转翻转等Rectangle对象
|
||||||
|
*/
|
||||||
|
public PDFBuilder(String yeMei, int presentFontSize, Rectangle pageSize) {
|
||||||
|
this.header = yeMei;
|
||||||
|
this.presentFontSize = presentFontSize;
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeader(String header) {
|
||||||
|
this.header = header;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPresentFontSize(int presentFontSize) {
|
||||||
|
this.presentFontSize = presentFontSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* TODO 文档打开时创建模板
|
||||||
|
*
|
||||||
|
* @see com.itextpdf.text.pdf.PdfPageEventHelper#onOpenDocument(com.itextpdf.text.pdf.PdfWriter,
|
||||||
|
* com.itextpdf.text.Document)
|
||||||
|
*/
|
||||||
|
/* public void onOpenDocument(PdfWriter writer, Document document) {
|
||||||
|
total = writer.getDirectContent().createTemplate(50, 50);// 共 页 的矩形的长宽高
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* TODO 关闭每页的时候,写入页眉,写入'第几页共'这几个字。
|
||||||
|
*
|
||||||
|
* @see com.itextpdf.text.pdf.PdfPageEventHelper#onEndPage(com.itextpdf.text.pdf.PdfWriter,
|
||||||
|
* com.itextpdf.text.Document)
|
||||||
|
*/
|
||||||
|
public void onEndPage(PdfWriter writer, Document document) {
|
||||||
|
// this.addPage(writer, document);
|
||||||
|
this.addWatermark(writer);
|
||||||
|
}
|
||||||
|
|
||||||
|
//加分页
|
||||||
|
public void addPage(PdfWriter writer, Document document){
|
||||||
|
try {
|
||||||
|
if (bf == null) {
|
||||||
|
bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
|
||||||
|
}
|
||||||
|
if (fontDetail == null) {
|
||||||
|
fontDetail = new Font(bf, presentFontSize, Font.NORMAL);// 数据体字体
|
||||||
|
}
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1.写入页眉
|
||||||
|
ColumnText.showTextAligned(writer.getDirectContent(),
|
||||||
|
Element.ALIGN_LEFT, new Phrase(header, fontDetail),
|
||||||
|
document.right()/2, document.top() - 17, 0);
|
||||||
|
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < 210; i++) {
|
||||||
|
sb.append("\u00a0");
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnText.showTextAligned(writer.getDirectContent(),
|
||||||
|
Element.ALIGN_LEFT, new Phrase(sb.toString(), fontDetail),
|
||||||
|
document.left(-1), document.top() -50, 0);
|
||||||
|
|
||||||
|
// // 2.写入前半部分的 第 X页/共
|
||||||
|
// int pageS = writer.getPageNumber();
|
||||||
|
// String foot1 = "第 " + pageS + " 页 /共";
|
||||||
|
// Phrase footer = new Phrase(foot1, fontDetail);
|
||||||
|
//
|
||||||
|
// // 3.计算前半部分的foot1的长度,后面好定位最后一部分的'Y页'这俩字的x轴坐标,字体长度也要计算进去 = len
|
||||||
|
// float len = bf.getWidthPoint(foot1, presentFontSize);
|
||||||
|
//
|
||||||
|
// // 4.拿到当前的PdfContentByte
|
||||||
|
// PdfContentByte cb = writer.getDirectContent();
|
||||||
|
//
|
||||||
|
// // 5.写入页脚1,x轴就是(右margin+左margin + right() -left()- len)/2.0F
|
||||||
|
// // 再给偏移20F适合人类视觉感受,否则肉眼看上去就太偏左了
|
||||||
|
// // ,y轴就是底边界-20,否则就贴边重叠到数据体里了就不是页脚了;注意Y轴是从下往上累加的,最上方的Top值是大于Bottom好几百开外的。
|
||||||
|
// ColumnText
|
||||||
|
// .showTextAligned(
|
||||||
|
// cb,
|
||||||
|
// Element.ALIGN_CENTER,
|
||||||
|
// footer,
|
||||||
|
// (document.rightMargin() + document.right()
|
||||||
|
// + document.leftMargin() - document.left() - len) / 2.0F + 20F,
|
||||||
|
// document.bottom() - 20, 0);
|
||||||
|
//
|
||||||
|
// // 6.写入页脚2的模板(就是页脚的Y页这俩字)添加到文档中,计算模板的和Y轴,X=(右边界-左边界 - 前半部分的len值)/2.0F +
|
||||||
|
// // len , y 轴和之前的保持一致,底边界-20
|
||||||
|
// cb.addTemplate(total, (document.rightMargin() + document.right()
|
||||||
|
// + document.leftMargin() - document.left()) / 2.0F + 20F,
|
||||||
|
// document.bottom() - 20); // 调节模版显示的位置
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(System.getProperty("user.dir"));
|
||||||
|
}
|
||||||
|
//加水印
|
||||||
|
public void addWatermark(PdfWriter writer){
|
||||||
|
String psth;
|
||||||
|
if(writer.getPageNumber() == 1){
|
||||||
|
psth = System.getProperty("user.dir")+"\\doc\\image\\leftZ.png";
|
||||||
|
}else if (writer.getPageNumber() == 2){
|
||||||
|
psth = System.getProperty("user.dir")+"\\doc\\image\\rightZ.png";
|
||||||
|
}else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 水印图片
|
||||||
|
Image image;
|
||||||
|
try {
|
||||||
|
image = Image.getInstance(psth);
|
||||||
|
image.scaleAbsolute(75,150);
|
||||||
|
PdfContentByte content = writer.getDirectContentUnder();
|
||||||
|
content.beginText();
|
||||||
|
image.setAbsolutePosition(450+75,400);
|
||||||
|
content.addImage(image);
|
||||||
|
// // 开始写入水印
|
||||||
|
// for(int k=0;k<5;k++){
|
||||||
|
// for (int j = 0; j <4; j++) {
|
||||||
|
// image.setAbsolutePosition(150*j,170*k);
|
||||||
|
// content.addImage(image);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
content.endText();
|
||||||
|
} catch (IOException | DocumentException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* TODO 关闭文档时,替换模板,完成整个页眉页脚组件
|
||||||
|
*
|
||||||
|
* @see com.itextpdf.text.pdf.PdfPageEventHelper#onCloseDocument(com.itextpdf.text.pdf.PdfWriter,
|
||||||
|
* com.itextpdf.text.Document)
|
||||||
|
*/
|
||||||
|
/* public void onCloseDocument(PdfWriter writer, Document document) {
|
||||||
|
// 7.最后一步了,就是关闭文档的时候,将模板替换成实际的 Y 值,至此,page x of y 制作完毕,完美兼容各种文档size。
|
||||||
|
total.beginText();
|
||||||
|
total.setFontAndSize(bf, presentFontSize);// 生成的模版的字体、颜色
|
||||||
|
String foot2 = " " + (writer.getPageNumber()-1) + " 页";
|
||||||
|
total.showText(foot2);// 模版显示的内容
|
||||||
|
total.endText();
|
||||||
|
total.closePath();
|
||||||
|
}*/
|
||||||
|
}
|
@ -0,0 +1,99 @@
|
|||||||
|
package com.pusong.common.doc.util;
|
||||||
|
|
||||||
|
import com.itextpdf.text.Document;
|
||||||
|
import com.itextpdf.text.pdf.PdfWriter;
|
||||||
|
import com.itextpdf.tool.xml.XMLWorkerHelper;
|
||||||
|
import freemarker.template.Configuration;
|
||||||
|
import freemarker.template.Template;
|
||||||
|
import freemarker.template.TemplateException;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class PdfGenerator {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PdfGenerator.class);
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
// 创建数据模型
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("text1", "天津浦颂企业管理咨询有限公司");
|
||||||
|
data.put("text2", "");
|
||||||
|
data.put("total", 1000);
|
||||||
|
List<Map<String,String>> map = new ArrayList<>();
|
||||||
|
Map<String,String> map1=new HashMap<>();
|
||||||
|
map1.put("id","7894564123");
|
||||||
|
map.add(map1);
|
||||||
|
Map<String,String> map2 =new HashMap<>();
|
||||||
|
map2.put("id","7894564123");
|
||||||
|
map.add(map2);
|
||||||
|
data.put("items",map);
|
||||||
|
|
||||||
|
// 设置模板目录
|
||||||
|
Configuration configuration = new Configuration(Configuration.VERSION_2_3_31);
|
||||||
|
configuration.setDirectoryForTemplateLoading(new File(System.getProperty("user.dir")+"\\doc"));
|
||||||
|
// 加载模板
|
||||||
|
Template template = configuration.getTemplate("report.ftl");
|
||||||
|
data.put("imagePath",System.getProperty("user.dir"));
|
||||||
|
// 生成HTML
|
||||||
|
String html = processTemplate(template, data);
|
||||||
|
// 生成PDF
|
||||||
|
generatePdf(html, "D:/王立帅/临时/output.pdf");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void makePdf(Map<String, Object> data ,String pdfpath,String templateName) throws Exception{
|
||||||
|
// 设置模板目录
|
||||||
|
Configuration configuration = new Configuration(Configuration.VERSION_2_3_31);
|
||||||
|
File file = new File(System.getProperty("user.dir") + "\\doc");
|
||||||
|
configuration.setDirectoryForTemplateLoading(file);
|
||||||
|
// 加载模板
|
||||||
|
Template template = configuration.getTemplate(templateName);
|
||||||
|
data.put("imagePath",System.getProperty("user.dir"));
|
||||||
|
// 生成HTML
|
||||||
|
String html = processTemplate(template, data);
|
||||||
|
// 生成PDF
|
||||||
|
generatePdf(html, "D:/王立帅/临时/output.pdf");
|
||||||
|
generatePdf(html, pdfpath);
|
||||||
|
}
|
||||||
|
private static String processTemplate(Template template, Map<String, Object> data) throws IOException, TemplateException {
|
||||||
|
StringWriter writer = new StringWriter();
|
||||||
|
template.process(data, writer);
|
||||||
|
return writer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void generatePdf(String html, String outputPath) {
|
||||||
|
Document document = null;
|
||||||
|
PdfWriter writer = null;
|
||||||
|
try{
|
||||||
|
document = new Document();
|
||||||
|
writer = PdfWriter.getInstance(document, new FileOutputStream(outputPath));
|
||||||
|
PDFBuilder builder = new PDFBuilder();
|
||||||
|
writer.setPageEvent(builder);
|
||||||
|
document.open();
|
||||||
|
XMLWorkerHelper.getInstance().parseXHtml(writer, document, new ByteArrayInputStream(html.getBytes()),
|
||||||
|
XMLWorkerHelper.class.getResourceAsStream("/default.css"),
|
||||||
|
Charset.forName("UTF-8"),
|
||||||
|
new CustomXMLWorkerFontProvider());
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("生成pdf异常",e);
|
||||||
|
}finally {
|
||||||
|
if(document != null){
|
||||||
|
document.close();
|
||||||
|
}
|
||||||
|
if(writer != null){
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -102,7 +102,14 @@
|
|||||||
<groupId>com.pusong</groupId>
|
<groupId>com.pusong</groupId>
|
||||||
<artifactId>pusong-common-websocket</artifactId>
|
<artifactId>pusong-common-websocket</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pusong</groupId>
|
||||||
|
<artifactId>pusong-system</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.pusong.business.common;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
|||||||
|
package com.pusong.business.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.pusong.common.core.validate.QueryGroup;
|
||||||
|
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.PsCompanyInfoVo;
|
||||||
|
import com.pusong.business.domain.bo.PsCompanyInfoBo;
|
||||||
|
import com.pusong.business.service.IPsCompanyInfoService;
|
||||||
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/business/companyInfo")
|
||||||
|
public class PsCompanyInfoController extends BaseController {
|
||||||
|
|
||||||
|
private final IPsCompanyInfoService psCompanyInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司信息列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:companyInfo:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public R<List<PsCompanyInfoVo>> list(@Validated(QueryGroup.class) PsCompanyInfoBo bo) {
|
||||||
|
return R.ok(psCompanyInfoService.queryList(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公司信息
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:companyInfo:add")
|
||||||
|
@Log(title = "公司信息", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody PsCompanyInfoBo bo) {
|
||||||
|
return toAjax(psCompanyInfoService.saveBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公司信息
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:companyInfo:edit")
|
||||||
|
@Log(title = "公司信息", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PsCompanyInfoBo bo) {
|
||||||
|
return toAjax(psCompanyInfoService.saveBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公司信息
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:companyInfo:remove")
|
||||||
|
@Log(title = "公司信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(psCompanyInfoService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
package com.pusong.business.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.pusong.common.core.validate.QueryGroup;
|
||||||
|
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.PsContractInfoVo;
|
||||||
|
import com.pusong.business.domain.bo.PsContractInfoBo;
|
||||||
|
import com.pusong.business.service.IPsContractInfoService;
|
||||||
|
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
import javax.management.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同基本信息
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/business/contractInfo")
|
||||||
|
public class PsContractInfoController extends BaseController {
|
||||||
|
|
||||||
|
private final IPsContractInfoService psContractInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成合同
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:customInfo:addContract")
|
||||||
|
@Log(title = "生成合同", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/create")
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody PsContractInfoBo bo) {
|
||||||
|
return toAjax(psContractInfoService.createContract(bo,2));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 暂存合同
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:customInfo:addContract")
|
||||||
|
@Log(title = "暂存合同", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/hold")
|
||||||
|
public R<Void> hold( @RequestBody PsContractInfoBo bo) {
|
||||||
|
return toAjax(psContractInfoService.createContract(bo,1));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户id查询暂存的合同详情信息
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:contractInfo:add")
|
||||||
|
@Log(title = "根据客户id查询暂存的合同详情信息", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@GetMapping("/queryContract")
|
||||||
|
public R<PsContractInfoVo> queryContract(@NotEmpty Long customerId) {
|
||||||
|
return R.ok(psContractInfoService.queryInfoByCustomId(customerId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询合同列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("business:contractInfo:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<PsContractInfoVo> list(PsContractInfoBo bo, PageQuery pageQuery) {
|
||||||
|
return psContractInfoService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取合同基本信息详细信息
|
||||||
|
// *
|
||||||
|
// * @param id 主键
|
||||||
|
// */
|
||||||
|
// @SaCheckPermission("business:contractInfo:query")
|
||||||
|
// @GetMapping("/{id}")
|
||||||
|
// public R<PsContractInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
// @PathVariable Long id) {
|
||||||
|
// return R.ok(psContractInfoService.queryById(id));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 修改合同基本信息
|
||||||
|
// */
|
||||||
|
// @SaCheckPermission("business:contractInfo:edit")
|
||||||
|
// @Log(title = "合同基本信息", businessType = BusinessType.UPDATE)
|
||||||
|
// @RepeatSubmit()
|
||||||
|
// @PutMapping()
|
||||||
|
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody PsContractInfoBo bo) {
|
||||||
|
// return toAjax(psContractInfoService.updateByBo(bo));
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -104,21 +104,23 @@ public class PsCustomController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("business:customInfo:edit")
|
@SaCheckPermission("business:customInfo:edit")
|
||||||
@Log(title = "客户状态变更操作", businessType = BusinessType.UPDATE)
|
@Log(title = "客户状态变更操作", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/updateStatus")
|
@GetMapping("/updateStatus")
|
||||||
public R<Void> updateStatus(@NotEmpty(message = "主键不能为空") @PathVariable Long id,
|
public R<Void> updateStatus(@NotEmpty(message = "主键不能为空") Long id,
|
||||||
@NotEmpty(message = "操作类型不能为空") @PathVariable Integer type) {
|
@NotEmpty(message = "操作类型不能为空") Integer type,
|
||||||
return toAjax(psCustomInfoService.updateCustomerStatus(id, type));
|
String desc) {
|
||||||
|
return toAjax(psCustomInfoService.updateCustomerStatus(id, type,desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出客户基本信息列表
|
* 导出客户基本信息列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("business:customInfo:export")
|
// @SaCheckPermission("business:customInfo:export")
|
||||||
@Log(title = "客户基本信息", businessType = BusinessType.EXPORT)
|
// @Log(title = "客户基本信息", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
// @PostMapping("/export")
|
||||||
public void export(PsCustomInfoBo bo, HttpServletResponse response) {
|
// public void export(PsCustomInfoBo bo, HttpServletResponse response) {
|
||||||
List<PsCustomInfoVo> list = psCustomInfoService.queryList(bo);
|
// //todo 导出接口
|
||||||
ExcelUtil.exportExcel(list, "客户基本信息", PsCustomInfoVo.class, response);
|
// List<PsCustomInfoVo> list = psCustomInfoService.queryList(bo);
|
||||||
}
|
// ExcelUtil.exportExcel(list, "客户基本信息", PsCustomInfoVo.class, response);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.pusong.business.domain;
|
||||||
|
|
||||||
|
import com.pusong.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息对象 ps_company_info
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ps_company_info")
|
||||||
|
public class PsCompanyInfo extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 创建的合同id
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
private Long customId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司地址
|
||||||
|
*/
|
||||||
|
private String companyAdress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司开户行
|
||||||
|
*/
|
||||||
|
private String companyAccountBank;
|
||||||
|
/**
|
||||||
|
* 公司开户行地址
|
||||||
|
*/
|
||||||
|
private String companyAccountBankAdress;
|
||||||
|
/**
|
||||||
|
* 法人姓名
|
||||||
|
*/
|
||||||
|
private String legalPersonName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人证件号
|
||||||
|
*/
|
||||||
|
private String legalPersonIdcard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人电话号
|
||||||
|
*/
|
||||||
|
private String legalPersonPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2逻辑删除 0 默认有效
|
||||||
|
*/
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.pusong.business.domain;
|
||||||
|
|
||||||
|
import com.pusong.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务类别对象 ps_contract_business
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ps_contract_business")
|
||||||
|
public class PsContractBusiness extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编号
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型
|
||||||
|
*/
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal businessAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否老账新接
|
||||||
|
*/
|
||||||
|
private String isOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否续费
|
||||||
|
*/
|
||||||
|
private String isDue;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endDate;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startDate;
|
||||||
|
/**
|
||||||
|
* 2逻辑删除 0 默认有效
|
||||||
|
*/
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.pusong.business.domain;
|
||||||
|
|
||||||
|
import com.pusong.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务明细对象 ps_contract_business_detail
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ps_contract_business_detail")
|
||||||
|
public class PsContractBusinessDetail extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编号
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型表id
|
||||||
|
*/
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务项目
|
||||||
|
*/
|
||||||
|
private String businessProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务项目描述
|
||||||
|
*/
|
||||||
|
private String businessProjectLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String amountDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段(目前只有服务项目是刻章的时候有用)
|
||||||
|
*/
|
||||||
|
private String extentInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2逻辑删除 0 默认有效
|
||||||
|
*/
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
package com.pusong.business.domain;
|
||||||
|
|
||||||
|
import com.pusong.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同基本信息对象 ps_contract_info
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ps_contract_info")
|
||||||
|
public class PsContractInfo extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编码
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
private String contractName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
private Long customId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司id
|
||||||
|
*/
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同主体
|
||||||
|
*/
|
||||||
|
private String contractMain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同所属销售经理
|
||||||
|
*/
|
||||||
|
private Long customManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal contractAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同状态
|
||||||
|
*/
|
||||||
|
private String contractStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签约日期
|
||||||
|
*/
|
||||||
|
private Date applyDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理期限
|
||||||
|
*/
|
||||||
|
private Long timeLimit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户是否到达现场
|
||||||
|
*/
|
||||||
|
private String customScene;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否代账
|
||||||
|
*/
|
||||||
|
private String isProxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签约备注
|
||||||
|
*/
|
||||||
|
private String signDesc;
|
||||||
|
/**
|
||||||
|
* 付款方式描述
|
||||||
|
*/
|
||||||
|
private String payModeDesc;
|
||||||
|
/**
|
||||||
|
* 文件系统ossId
|
||||||
|
*/
|
||||||
|
private Long pdfId;
|
||||||
|
/**
|
||||||
|
* 2逻辑删除 0 默认有效
|
||||||
|
*/
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -71,8 +71,14 @@ public class PsCustomInfo extends TenantEntity {
|
|||||||
* 拉黑标识 1是0否
|
* 拉黑标识 1是0否
|
||||||
*/
|
*/
|
||||||
private String black;
|
private String black;
|
||||||
|
/**
|
||||||
|
* 拉黑备注
|
||||||
|
*/
|
||||||
|
private String blackDesc;
|
||||||
|
/**
|
||||||
|
* 颜色
|
||||||
|
*/
|
||||||
|
private String color;
|
||||||
/**
|
/**
|
||||||
* 2逻辑删除 0 默认有效
|
* 2逻辑删除 0 默认有效
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.pusong.business.domain.bo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.pusong.business.domain.PsCompanyInfo;
|
||||||
|
import com.pusong.common.core.validate.QueryGroup;
|
||||||
|
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.pusong.common.core.validate.AddGroup;
|
||||||
|
import com.pusong.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息业务对象 ps_company_info
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode
|
||||||
|
@AutoMapper(target = PsCompanyInfo.class, reverseConvertGenerate = false)
|
||||||
|
public class PsCompanyInfoBo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "公司ID不能为空",groups = {EditGroup.class})
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "客户id不能为空",groups = {EditGroup.class, AddGroup.class, QueryGroup.class})
|
||||||
|
private Long customId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "公司名称不能为空",groups = {EditGroup.class, AddGroup.class})
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司地址
|
||||||
|
*/
|
||||||
|
private String companyAdress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司开户行
|
||||||
|
*/
|
||||||
|
private String companyAccountBank;
|
||||||
|
/**
|
||||||
|
* 公司开户行地址
|
||||||
|
*/
|
||||||
|
private String companyAccountBankAdress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人姓名
|
||||||
|
*/
|
||||||
|
private String legalPersonName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人证件号
|
||||||
|
*/
|
||||||
|
private String legalPersonIdcard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人电话号
|
||||||
|
*/
|
||||||
|
private String legalPersonPhone;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package com.pusong.business.domain.bo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.pusong.business.domain.PsContractBusiness;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务类别业务对象 ps_contract_business
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode
|
||||||
|
@AutoMapper(target = PsContractBusiness.class, reverseConvertGenerate = false)
|
||||||
|
public class PsContractBusinessBo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 合同编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "合同编号不能为空")
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "服务类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务总金额
|
||||||
|
*/
|
||||||
|
@NotNull(message = "服务总金额不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private BigDecimal businessAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否老账新接
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "是否老账新接不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String isOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否续费
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "是否续费不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String isDue;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern ="yyyy-MM-dd")
|
||||||
|
private Date endDate;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern ="yyyy-MM-dd")
|
||||||
|
private Date startDate;
|
||||||
|
/**
|
||||||
|
* 合同服务项目
|
||||||
|
*/
|
||||||
|
private List<PsContractBusinessDetailBo> detailBos;
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.pusong.business.domain.bo;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.PsContractBusinessDetail;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务明细业务对象 ps_contract_business_detail
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = PsContractBusinessDetail.class, reverseConvertGenerate = false)
|
||||||
|
public class PsContractBusinessDetailBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键id不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "合同编号不能为空")
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "服务类型不能为空")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务项目
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "服务项目不能为空")
|
||||||
|
private String businessProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务项目描述
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "服务项目描述不能为空")
|
||||||
|
private String businessProjectLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额
|
||||||
|
*/
|
||||||
|
@NotNull(message = "金额不能为空")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "备注不能为空")
|
||||||
|
private String amountDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段(目前只有服务项目是刻章的时候有用)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "扩展字段(目前只有服务项目是刻章的时候有用)不能为空")
|
||||||
|
private String extentInfo;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package com.pusong.business.domain.bo;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.PsContractInfo;
|
||||||
|
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.mybatis.core.domain.BaseEntity;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同基本信息业务对象 ps_contract_info
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode
|
||||||
|
@AutoMapper(target = PsContractInfo.class, reverseConvertGenerate = false)
|
||||||
|
public class PsContractInfoBo {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "合同编码不能为空", groups = { EditGroup.class })
|
||||||
|
private String contractCode;
|
||||||
|
/**
|
||||||
|
* 合同主体
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "合同主体不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String contractMain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "客户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long customId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签约日期
|
||||||
|
*/
|
||||||
|
@NotNull(message = "签约日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date applyDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理期限
|
||||||
|
*/
|
||||||
|
@NotNull(message = "办理期限不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Integer timeLimit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户是否到达现场
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "客户是否到达现场不能为空")
|
||||||
|
private String customScene;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否代账
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "是否代账不能为空")
|
||||||
|
private String isProxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签约备注
|
||||||
|
*/
|
||||||
|
private String signDesc;
|
||||||
|
/**
|
||||||
|
* 付款方式描述
|
||||||
|
*/
|
||||||
|
private String payModeDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务类别
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "合同服务类别不能为空")
|
||||||
|
private List<PsContractBusinessBo> businessList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "公司信息不能为空")
|
||||||
|
private PsCompanyInfoBo companyInfoBo;
|
||||||
|
|
||||||
|
}
|
@ -10,6 +10,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户基本信息业务对象 ps_custom_info
|
* 客户基本信息业务对象 ps_custom_info
|
||||||
*
|
*
|
||||||
@ -17,9 +19,9 @@ import org.hibernate.validator.constraints.Length;
|
|||||||
* @date 2024-07-25
|
* @date 2024-07-25
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode
|
||||||
@AutoMapper(target = PsCustomInfo.class, reverseConvertGenerate = false)
|
@AutoMapper(target = PsCustomInfo.class, reverseConvertGenerate = false)
|
||||||
public class PsCustomInfoBo extends BaseEntity {
|
public class PsCustomInfoBo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -39,6 +41,7 @@ public class PsCustomInfoBo extends BaseEntity {
|
|||||||
@NotBlank(message = "客户电话客户电话",groups = { EditGroup.class, AddGroup.class })
|
@NotBlank(message = "客户电话客户电话",groups = { EditGroup.class, AddGroup.class })
|
||||||
@Length(max = 500)
|
@Length(max = 500)
|
||||||
private String customMobile;
|
private String customMobile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户来源
|
* 客户来源
|
||||||
*/
|
*/
|
||||||
@ -66,8 +69,14 @@ public class PsCustomInfoBo extends BaseEntity {
|
|||||||
private String customIntroducerName;
|
private String customIntroducerName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报价信息
|
||||||
|
*/
|
||||||
|
private List<PsCustomPriceBo> priceBos;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回访信息
|
||||||
|
*/
|
||||||
|
private List<PsCustomCallbackBo> callbackBos;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.pusong.business.domain.bo;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.pusong.business.domain.PsCustomInfo;
|
import com.pusong.business.domain.PsCustomInfo;
|
||||||
|
import com.pusong.business.domain.PsCustomPrice;
|
||||||
import com.pusong.common.core.validate.AddGroup;
|
import com.pusong.common.core.validate.AddGroup;
|
||||||
import com.pusong.common.core.validate.EditGroup;
|
import com.pusong.common.core.validate.EditGroup;
|
||||||
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||||
@ -22,7 +23,7 @@ import java.math.BigDecimal;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@AutoMapper(target = PsCustomInfo.class, reverseConvertGenerate = false)
|
@AutoMapper(target = PsCustomPrice.class, reverseConvertGenerate = false)
|
||||||
public class PsCustomPriceBo extends BaseEntity {
|
public class PsCustomPriceBo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.pusong.business.domain.PsCompanyInfo;
|
||||||
|
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 lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息视图对象 ps_company_info
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = PsCompanyInfo.class)
|
||||||
|
public class PsCompanyInfoVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
private Long customId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司地址
|
||||||
|
*/
|
||||||
|
private String companyAdress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司开户行
|
||||||
|
*/
|
||||||
|
private String companyAccountBank;
|
||||||
|
/**
|
||||||
|
* 公司开户行地址
|
||||||
|
*/
|
||||||
|
private String companyAccountBankAdress;
|
||||||
|
/**
|
||||||
|
* 法人姓名
|
||||||
|
*/
|
||||||
|
private String legalPersonName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人证件号
|
||||||
|
*/
|
||||||
|
private String legalPersonIdcard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人电话号
|
||||||
|
*/
|
||||||
|
private String legalPersonPhone;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.pusong.business.domain.PsContractBusinessDetail;
|
||||||
|
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 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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务明细视图对象 ps_contract_business_detail
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = PsContractBusinessDetail.class)
|
||||||
|
public class PsContractBusinessDetailVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编号
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型表id
|
||||||
|
*/
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务项目
|
||||||
|
*/
|
||||||
|
private String businessProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务项目描述
|
||||||
|
*/
|
||||||
|
private String businessProjectLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String amountDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段(目前只有服务项目是刻章的时候有用)
|
||||||
|
*/
|
||||||
|
private String extentInfo;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.pusong.business.domain.PsContractBusiness;
|
||||||
|
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 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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务类别视图对象 ps_contract_business
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = PsContractBusiness.class)
|
||||||
|
public class PsContractBusinessVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编号
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型
|
||||||
|
*/
|
||||||
|
private String businessType;
|
||||||
|
/**
|
||||||
|
* 服务类型名称
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL,other = "contract_type",mapper="businessType")
|
||||||
|
private String businessTypeName;
|
||||||
|
/**
|
||||||
|
* 服务总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal businessAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否老账新接
|
||||||
|
*/
|
||||||
|
private String isOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否续费
|
||||||
|
*/
|
||||||
|
private String isDue;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern ="yyyy-MM-dd")
|
||||||
|
private Date endDate;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern ="yyyy-MM-dd")
|
||||||
|
private Date startDate;
|
||||||
|
/**
|
||||||
|
* 服务项目
|
||||||
|
*/
|
||||||
|
private List<PsContractBusinessDetailVo> detailVoList;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,121 @@
|
|||||||
|
package com.pusong.business.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.pusong.business.domain.PsContractInfo;
|
||||||
|
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 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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同基本信息视图对象 ps_contract_info
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = PsContractInfo.class)
|
||||||
|
public class PsContractInfoVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编码
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
private String contractName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
private Long customId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司id
|
||||||
|
*/
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同主体
|
||||||
|
*/
|
||||||
|
private String contractMain;
|
||||||
|
/**
|
||||||
|
* 合同主体
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL,other = "contract_main",mapper="contractMain")
|
||||||
|
private String contractMainName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal contractAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同状态
|
||||||
|
*/
|
||||||
|
private String contractStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签约日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date applyDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理期限
|
||||||
|
*/
|
||||||
|
private Long timeLimit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户是否到达现场
|
||||||
|
*/
|
||||||
|
private String customScene;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否代账
|
||||||
|
*/
|
||||||
|
private String isProxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签约备注
|
||||||
|
*/
|
||||||
|
private String signDesc;
|
||||||
|
/**
|
||||||
|
* 付款方式描述
|
||||||
|
*/
|
||||||
|
private String payModeDesc;
|
||||||
|
/**
|
||||||
|
* 文件系统ossId
|
||||||
|
*/
|
||||||
|
private Long pdfId;
|
||||||
|
/**
|
||||||
|
* 公司信息
|
||||||
|
*/
|
||||||
|
private PsCompanyInfoVo psCompanyInfoVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类别信息
|
||||||
|
*/
|
||||||
|
private List<PsContractBusinessVo> businessVoList;
|
||||||
|
|
||||||
|
}
|
@ -40,13 +40,11 @@ public class PsCustomInfoVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 客户名称
|
* 客户名称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "客户名称")
|
|
||||||
private String customName;
|
private String customName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户电话客户电话(多个用英文逗号分割)
|
* 客户电话客户电话(多个用英文逗号分割)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "客户电话(多个用英文逗号分割)")
|
|
||||||
private String customMobile;
|
private String customMobile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,18 +57,15 @@ public class PsCustomInfoVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 客户联系地址
|
* 客户联系地址
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "客户联系地址")
|
|
||||||
private String customAdressDetail;
|
private String customAdressDetail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属客户经理
|
* 所属客户经理
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "所属客户经理id")
|
|
||||||
private String customManager;
|
private String customManager;
|
||||||
/**
|
/**
|
||||||
* 所属客户经理
|
* 所属客户经理
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "所属客户经理姓名")
|
|
||||||
private String customManagerName;
|
private String customManagerName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,21 +85,25 @@ public class PsCustomInfoVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 介绍人-仅支持本司内客户
|
* 介绍人-仅支持本司内客户
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "介绍人-仅支持本司内客户")
|
|
||||||
private Long customIntroducer;
|
private Long customIntroducer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 介绍人姓名-仅支持本司内客户
|
* 介绍人姓名-仅支持本司内客户
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "介绍人姓名-仅支持本司内客户")
|
|
||||||
private String customIntroducerName;
|
private String customIntroducerName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉黑标识
|
* 拉黑标识
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "拉黑标识")
|
|
||||||
private String black;
|
private String black;
|
||||||
|
/**
|
||||||
|
* 拉黑备注
|
||||||
|
*/
|
||||||
|
private String blackDesc;
|
||||||
|
/**
|
||||||
|
* 颜色
|
||||||
|
*/
|
||||||
|
private String color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
@ -123,9 +122,27 @@ public class PsCustomInfoVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 总报价金额
|
* 总报价金额
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "总报价金额")
|
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最新的回访记录
|
||||||
|
*/
|
||||||
|
private String callBack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最早的公司名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司数量
|
||||||
|
*/
|
||||||
|
private Integer companyNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已生成合同(1是0否)
|
||||||
|
*/
|
||||||
|
private Integer haveContract;
|
||||||
/**
|
/**
|
||||||
* 报价金额DTO
|
* 报价金额DTO
|
||||||
*/
|
*/
|
||||||
@ -135,4 +152,9 @@ public class PsCustomInfoVo implements Serializable {
|
|||||||
* 回访记录DTO
|
* 回访记录DTO
|
||||||
*/
|
*/
|
||||||
private List<PsCustomCallbackVo> psCustomCallbackVo;
|
private List<PsCustomCallbackVo> psCustomCallbackVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息DTO
|
||||||
|
*/
|
||||||
|
private List<PsCompanyInfoVo> psCompanyInfoVos;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.pusong.business.domain.PsCustomInfo;
|
import com.pusong.business.domain.PsCustomInfo;
|
||||||
import com.pusong.business.domain.PsCustomPrice;
|
import com.pusong.business.domain.PsCustomPrice;
|
||||||
import com.pusong.common.tenant.core.TenantEntity;
|
import com.pusong.common.tenant.core.TenantEntity;
|
||||||
@ -17,6 +18,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户基本信息对象 ps_custom_info
|
* 客户基本信息对象 ps_custom_info
|
||||||
@ -49,13 +51,16 @@ public class PsCustomPriceVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 服务项目
|
* 服务项目
|
||||||
*/
|
*/
|
||||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL,other = "service_project")
|
// @Translation(type = TransConstant.DICT_TYPE_TO_LABEL,other = "service_project")
|
||||||
private String serviceProject;
|
private String serviceProject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务金额
|
* 服务金额
|
||||||
*/
|
*/
|
||||||
private BigDecimal servicePrice;
|
private BigDecimal servicePrice;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern ="yyyy-MM-dd HH:mm")
|
||||||
|
private Date createTime;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.pusong.business.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ContractStatusEnum {
|
||||||
|
INIT("10","暂存"),
|
||||||
|
CREATE("20","生成成功");
|
||||||
|
private String code;
|
||||||
|
private String text;
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.pusong.business.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum TenplateEnum {
|
||||||
|
CONTRACT("report.ftl","合同模板");
|
||||||
|
private String name;
|
||||||
|
private String label;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.pusong.business.mapper;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.PsCompanyInfo;
|
||||||
|
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||||
|
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
public interface PsCompanyInfoMapper extends BaseMapperPlus<PsCompanyInfo, PsCompanyInfoVo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.pusong.business.mapper;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.PsContractBusinessDetail;
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessDetailVo;
|
||||||
|
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务明细Mapper接口
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
public interface PsContractBusinessDetailMapper extends BaseMapperPlus<PsContractBusinessDetail, PsContractBusinessDetailVo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.pusong.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.pusong.business.domain.PsContractBusiness;
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
||||||
|
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务类别Mapper接口
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
public interface PsContractBusinessMapper extends BaseMapperPlus<PsContractBusiness, PsContractBusinessVo> {
|
||||||
|
|
||||||
|
|
||||||
|
List<PsContractBusinessVo> selectBusinessList(@Param("contractCode") String contractCode);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.pusong.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.pusong.business.domain.PsContractInfo;
|
||||||
|
import com.pusong.business.domain.PsCustomInfo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractInfoVo;
|
||||||
|
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||||
|
import com.pusong.common.mybatis.annotation.DataColumn;
|
||||||
|
import com.pusong.common.mybatis.annotation.DataPermission;
|
||||||
|
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同基本信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
public interface PsContractInfoMapper extends BaseMapperPlus<PsContractInfo, PsContractInfoVo> {
|
||||||
|
|
||||||
|
|
||||||
|
@DataPermission({
|
||||||
|
@DataColumn(key = "deptName", value = "create_dept"),
|
||||||
|
@DataColumn(key = "userName", value = "create_by")
|
||||||
|
})
|
||||||
|
Page<PsContractInfoVo> selectPageContractList(@Param("page") Page<PsContractInfo> page, @Param(Constants.WRAPPER) Wrapper<PsContractInfo> queryWrapper);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.pusong.business.service;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||||
|
import com.pusong.business.domain.bo.PsCompanyInfoBo;
|
||||||
|
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-07-29
|
||||||
|
*/
|
||||||
|
public interface IPsCompanyInfoService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同基本信息
|
||||||
|
*/
|
||||||
|
PsCompanyInfoVo queryById(Long id);
|
||||||
|
/**
|
||||||
|
* 查询符合条件的公司信息列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 公司信息列表
|
||||||
|
*/
|
||||||
|
List<PsCompanyInfoVo> queryList(PsCompanyInfoBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公司信息
|
||||||
|
*
|
||||||
|
* @param bo 公司信息
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean saveBo(PsCompanyInfoBo bo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除公司信息信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.pusong.business.service;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessDetailVo;
|
||||||
|
import com.pusong.business.domain.bo.PsContractBusinessDetailBo;
|
||||||
|
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-07-29
|
||||||
|
*/
|
||||||
|
public interface IPsContractBusinessDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同服务明细
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同服务明细
|
||||||
|
*/
|
||||||
|
PsContractBusinessDetailVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询合同服务明细列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 合同服务明细分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<PsContractBusinessDetailVo> queryPageList(PsContractBusinessDetailBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的合同服务明细列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 合同服务明细列表
|
||||||
|
*/
|
||||||
|
List<PsContractBusinessDetailVo> queryList(PsContractBusinessDetailBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增合同服务明细
|
||||||
|
*
|
||||||
|
* @param bo 合同服务明细
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(PsContractBusinessDetailBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改合同服务明细
|
||||||
|
*
|
||||||
|
* @param bo 合同服务明细
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(PsContractBusinessDetailBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除合同服务明细信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.pusong.business.service;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
||||||
|
import com.pusong.business.domain.bo.PsContractBusinessBo;
|
||||||
|
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-07-29
|
||||||
|
*/
|
||||||
|
public interface IPsContractBusinessService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同服务类别
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同服务类别
|
||||||
|
*/
|
||||||
|
PsContractBusinessVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询合同服务类别列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 合同服务类别分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<PsContractBusinessVo> queryPageList(PsContractBusinessBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的合同服务类别列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 合同服务类别列表
|
||||||
|
*/
|
||||||
|
List<PsContractBusinessVo> queryList(PsContractBusinessBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增合同服务类别
|
||||||
|
*
|
||||||
|
* @param bo 合同服务类别
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(PsContractBusinessBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改合同服务类别
|
||||||
|
*
|
||||||
|
* @param bo 合同服务类别
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(PsContractBusinessBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除合同服务类别信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package com.pusong.business.service;
|
||||||
|
|
||||||
|
import com.pusong.business.domain.PsContractInfo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractInfoVo;
|
||||||
|
import com.pusong.business.domain.bo.PsContractInfoBo;
|
||||||
|
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-07-29
|
||||||
|
*/
|
||||||
|
public interface IPsContractInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成合同
|
||||||
|
*
|
||||||
|
* @param bo 合同信息
|
||||||
|
* @param type 操作类型 1保存2暂存
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean createContract(PsContractInfoBo bo,Integer type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户id查询暂存的合同详情信息
|
||||||
|
*
|
||||||
|
* @param customerId 客户id
|
||||||
|
* @return 合同基本信息
|
||||||
|
*/
|
||||||
|
PsContractInfoVo queryInfoByCustomId(Long customerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同基本信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同基本信息
|
||||||
|
*/
|
||||||
|
// PsContractInfoVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询合同基本信息列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 合同基本信息分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<PsContractInfoVo> queryPageList(PsContractInfoBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的合同基本信息列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 合同基本信息列表
|
||||||
|
*//*
|
||||||
|
List<PsContractInfoVo> queryList(PsContractInfoBo bo);
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 新增合同基本信息
|
||||||
|
*
|
||||||
|
* @param bo 合同基本信息
|
||||||
|
* @return 是否新增成功
|
||||||
|
*//*
|
||||||
|
Boolean insertByBo(PsContractInfoBo bo);
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 修改合同基本信息
|
||||||
|
*
|
||||||
|
* @param bo 合同基本信息
|
||||||
|
* @return 是否修改成功
|
||||||
|
*//*
|
||||||
|
Boolean updateByBo(PsContractInfoBo bo);
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 校验并批量删除合同基本信息信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*//*
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);*/
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package com.pusong.business.service;
|
package com.pusong.business.service;
|
||||||
|
|
||||||
import com.pusong.business.domain.PsCustomCallback;
|
import com.pusong.business.domain.PsCustomCallback;
|
||||||
|
import com.pusong.business.domain.PsCustomInfo;
|
||||||
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
||||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||||
@ -18,7 +19,11 @@ import java.util.List;
|
|||||||
* @date 2024-07-25
|
* @date 2024-07-25
|
||||||
*/
|
*/
|
||||||
public interface IPsCustomInfoService {
|
public interface IPsCustomInfoService {
|
||||||
|
/**
|
||||||
|
* 根据id查询客户
|
||||||
|
* @return 客户id和姓名
|
||||||
|
*/
|
||||||
|
PsCustomInfo listById(Long id);
|
||||||
/**
|
/**
|
||||||
* 查询登陆人下所有的客户名称和id
|
* 查询登陆人下所有的客户名称和id
|
||||||
* @return 客户id和姓名
|
* @return 客户id和姓名
|
||||||
@ -62,9 +67,10 @@ public interface IPsCustomInfoService {
|
|||||||
*
|
*
|
||||||
* @param id 主键id
|
* @param id 主键id
|
||||||
* @param type 操作类型
|
* @param type 操作类型
|
||||||
|
* @param desc 备注
|
||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean updateCustomerStatus(Long id, Integer type);
|
Boolean updateCustomerStatus(Long id, Integer type,String desc);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,108 @@
|
|||||||
|
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.PsCompanyInfoBo;
|
||||||
|
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||||
|
import com.pusong.business.domain.PsCompanyInfo;
|
||||||
|
import com.pusong.business.mapper.PsCompanyInfoMapper;
|
||||||
|
import com.pusong.business.service.IPsCompanyInfoService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
||||||
|
|
||||||
|
private final PsCompanyInfoMapper baseMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同基本信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PsCompanyInfoVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询符合条件的公司信息列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 公司信息列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PsCompanyInfoVo> queryList(PsCompanyInfoBo bo) {
|
||||||
|
LambdaQueryWrapper<PsCompanyInfo> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<PsCompanyInfo> buildQueryWrapper(PsCompanyInfoBo bo) {
|
||||||
|
LambdaQueryWrapper<PsCompanyInfo> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getId() != null, PsCompanyInfo::getId, bo.getId());
|
||||||
|
lqw.eq(bo.getCustomId() != null, PsCompanyInfo::getCustomId, bo.getCustomId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), PsCompanyInfo::getCompanyName, bo.getCompanyName());
|
||||||
|
lqw.eq( PsCompanyInfo::getDelFlag, "0");
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公司信息
|
||||||
|
*
|
||||||
|
* @param bo 公司信息
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean saveBo(PsCompanyInfoBo bo) {
|
||||||
|
PsCompanyInfo add = MapstructUtils.convert(bo, PsCompanyInfo.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insertOrUpdate(add);
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(PsCompanyInfo entity){
|
||||||
|
if(entity.getId() != null){
|
||||||
|
//修改
|
||||||
|
}
|
||||||
|
//TODO 修改公司时需要校验公司下是否有合同状态
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除公司信息信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 删除公司时需要校验公司下是否有合同状态
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
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.PsContractBusinessDetailBo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessDetailVo;
|
||||||
|
import com.pusong.business.domain.PsContractBusinessDetail;
|
||||||
|
import com.pusong.business.mapper.PsContractBusinessDetailMapper;
|
||||||
|
import com.pusong.business.service.IPsContractBusinessDetailService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务明细Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class PsContractBusinessDetailServiceImpl implements IPsContractBusinessDetailService {
|
||||||
|
|
||||||
|
private final PsContractBusinessDetailMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同服务明细
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同服务明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PsContractBusinessDetailVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询合同服务明细列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 合同服务明细分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<PsContractBusinessDetailVo> queryPageList(PsContractBusinessDetailBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<PsContractBusinessDetail> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<PsContractBusinessDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的合同服务明细列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 合同服务明细列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PsContractBusinessDetailVo> queryList(PsContractBusinessDetailBo bo) {
|
||||||
|
LambdaQueryWrapper<PsContractBusinessDetail> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<PsContractBusinessDetail> buildQueryWrapper(PsContractBusinessDetailBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
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.getBusinessProjectLabel()), PsContractBusinessDetail::getBusinessProjectLabel, bo.getBusinessProjectLabel());
|
||||||
|
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");
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增合同服务明细
|
||||||
|
*
|
||||||
|
* @param bo 合同服务明细
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(PsContractBusinessDetailBo bo) {
|
||||||
|
PsContractBusinessDetail add = MapstructUtils.convert(bo, PsContractBusinessDetail.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改合同服务明细
|
||||||
|
*
|
||||||
|
* @param bo 合同服务明细
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(PsContractBusinessDetailBo bo) {
|
||||||
|
PsContractBusinessDetail update = MapstructUtils.convert(bo, PsContractBusinessDetail.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(PsContractBusinessDetail entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除合同服务明细信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
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.PsContractBusinessBo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
||||||
|
import com.pusong.business.domain.PsContractBusiness;
|
||||||
|
import com.pusong.business.mapper.PsContractBusinessMapper;
|
||||||
|
import com.pusong.business.service.IPsContractBusinessService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同服务类别Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class PsContractBusinessServiceImpl implements IPsContractBusinessService {
|
||||||
|
|
||||||
|
private final PsContractBusinessMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同服务类别
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同服务类别
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PsContractBusinessVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询合同服务类别列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 合同服务类别分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<PsContractBusinessVo> queryPageList(PsContractBusinessBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<PsContractBusiness> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<PsContractBusinessVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的合同服务类别列表
|
||||||
|
*
|
||||||
|
* @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(bo.getContractCode() != null, PsContractBusiness::getContractCode, bo.getContractCode());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getBusinessType()), PsContractBusiness::getBusinessType, bo.getBusinessType());
|
||||||
|
lqw.eq(bo.getBusinessAmount() != null, PsContractBusiness::getBusinessAmount, bo.getBusinessAmount());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getIsOld()), PsContractBusiness::getIsOld, bo.getIsOld());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getIsDue()), PsContractBusiness::getIsDue, bo.getIsDue());
|
||||||
|
lqw.eq( PsContractBusiness::getDelFlag, "0");
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增合同服务类别
|
||||||
|
*
|
||||||
|
* @param bo 合同服务类别
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(PsContractBusinessBo bo) {
|
||||||
|
PsContractBusiness add = MapstructUtils.convert(bo, PsContractBusiness.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改合同服务类别
|
||||||
|
*
|
||||||
|
* @param bo 合同服务类别
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(PsContractBusinessBo bo) {
|
||||||
|
PsContractBusiness update = MapstructUtils.convert(bo, PsContractBusiness.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(PsContractBusiness entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除合同服务类别信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,389 @@
|
|||||||
|
package com.pusong.business.service.impl;
|
||||||
|
|
||||||
|
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.toolkit.CollectionUtils;
|
||||||
|
import com.pusong.business.domain.*;
|
||||||
|
import com.pusong.business.domain.bo.*;
|
||||||
|
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||||
|
import com.pusong.business.domain.vo.PsContractBusinessVo;
|
||||||
|
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||||
|
import com.pusong.business.enums.ContractStatusEnum;
|
||||||
|
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.service.*;
|
||||||
|
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.doc.util.PdfGenerator;
|
||||||
|
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 com.pusong.common.satoken.utils.LoginHelper;
|
||||||
|
import com.pusong.common.translation.annotation.Translation;
|
||||||
|
import com.pusong.system.domain.vo.SysOssVo;
|
||||||
|
import com.pusong.system.service.ISysOssService;
|
||||||
|
import io.swagger.v3.core.util.Json;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.task.VirtualThreadTaskExecutor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.pusong.business.domain.vo.PsContractInfoVo;
|
||||||
|
import com.pusong.business.mapper.PsContractInfoMapper;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同基本信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wls
|
||||||
|
* @date 2024-07-29
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||||
|
|
||||||
|
private final PsContractInfoMapper baseMapper;
|
||||||
|
private final PsContractBusinessMapper businessMapper;
|
||||||
|
private final PsContractBusinessDetailMapper businessDetailMapper;
|
||||||
|
private final IPsContractBusinessService businessService;
|
||||||
|
private final IPsContractBusinessDetailService businessDetailService;
|
||||||
|
@Autowired
|
||||||
|
private final IPsCompanyInfoService companyInfoService;
|
||||||
|
@Autowired
|
||||||
|
private final IPsCustomInfoService customInfoService;
|
||||||
|
@Autowired
|
||||||
|
private final ISysOssService ossService;
|
||||||
|
/**
|
||||||
|
* 生成合同
|
||||||
|
*
|
||||||
|
* @param bo 合同信息
|
||||||
|
* @param type 操作类型 1暂存2保存
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional//开启事务
|
||||||
|
public Boolean createContract(PsContractInfoBo bo,Integer type) {
|
||||||
|
|
||||||
|
//1.插入公司信息
|
||||||
|
companyInfoService.saveBo(bo.getCompanyInfoBo());
|
||||||
|
//2校验
|
||||||
|
PsContractInfo add = validEntity(bo);
|
||||||
|
|
||||||
|
//3.如果已存在合同,则进行修改,否则新增
|
||||||
|
if(add == null){
|
||||||
|
add = new PsContractInfo();
|
||||||
|
add.setContractCode(UUID.randomUUID().toString().replaceAll("-", ""));//合同编码
|
||||||
|
add.setContractName("合同名称");//todo 合同名称
|
||||||
|
add.setCompanyId(bo.getCompanyInfoBo().getId());//公司id
|
||||||
|
add.setCustomManager(LoginHelper.getUserId());//所属销售经理id
|
||||||
|
}
|
||||||
|
MapstructUtils.convert(bo, add);
|
||||||
|
|
||||||
|
BigDecimal sum = bo.getBusinessList().stream().map(PsContractBusinessBo::getBusinessAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
add.setContractAmount(sum);//合同总金额
|
||||||
|
add.setContractStatus(type == 1?ContractStatusEnum.INIT.getCode():ContractStatusEnum.CREATE.getCode());//合同状态
|
||||||
|
baseMapper.insertOrUpdate(add);
|
||||||
|
|
||||||
|
//4.删除所有服务类型和服务项目
|
||||||
|
businessMapper.delete(Wrappers.<PsContractBusiness>lambdaQuery()
|
||||||
|
.eq(PsContractBusiness::getContractCode,add.getContractCode()));
|
||||||
|
businessDetailMapper.delete(Wrappers.<PsContractBusinessDetail>lambdaQuery()
|
||||||
|
.eq(PsContractBusinessDetail::getContractCode,add.getContractCode()));
|
||||||
|
|
||||||
|
//5.插入服务类型
|
||||||
|
for (PsContractBusinessBo businessBo : bo.getBusinessList()) {
|
||||||
|
PsContractBusiness businessAdd = MapstructUtils.convert(businessBo, PsContractBusiness.class);
|
||||||
|
businessAdd.setContractCode(add.getContractCode());
|
||||||
|
businessMapper.insert(businessAdd);
|
||||||
|
if (CollectionUtils.isEmpty(businessBo.getDetailBos())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//6.插入服务项目
|
||||||
|
List<PsContractBusinessDetail> details = MapstructUtils.convert(businessBo.getDetailBos(), PsContractBusinessDetail.class);
|
||||||
|
String code = add.getContractCode();
|
||||||
|
details.forEach(item -> {
|
||||||
|
item.setContractCode(code);
|
||||||
|
item.setBusinessId(businessAdd.getId());
|
||||||
|
});
|
||||||
|
businessDetailMapper.insertBatch(details);
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
//生成合同pdf
|
||||||
|
PsCustomInfo customer = customInfoService.listById(add.getCustomId());
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("contract",add);
|
||||||
|
map.put("business",bo.getBusinessList());
|
||||||
|
map.put("company",bo.getCompanyInfoBo());
|
||||||
|
map.put("customer",customer);
|
||||||
|
map.put("customer",customer);
|
||||||
|
String path = System.getProperty("user.dir")+"test.pdf";
|
||||||
|
// path = "D:/王立帅/临时/output.pdf";
|
||||||
|
PdfGenerator.makePdf(map, path,TenplateEnum.CONTRACT.getName());
|
||||||
|
File file = new File(path);
|
||||||
|
//上传到oss服务
|
||||||
|
SysOssVo sysOssVo = ossService.upload(new File(path));
|
||||||
|
//删除临时的合同文件
|
||||||
|
if(file.exists())file.delete();
|
||||||
|
//更新合同id
|
||||||
|
PsContractInfo psContractInfo = new PsContractInfo();
|
||||||
|
psContractInfo.setId(add.getId());
|
||||||
|
psContractInfo.setPdfId(sysOssVo.getOssId());
|
||||||
|
baseMapper.updateById(psContractInfo);
|
||||||
|
//删除原合同
|
||||||
|
if(add.getPdfId() != null)ossService.deleteWithValidByIds(Arrays.asList(add.getPdfId()),false);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("生成pdf失败",e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户id查询暂存的合同详情信息
|
||||||
|
*
|
||||||
|
* @param customerId 客户id
|
||||||
|
* @return 合同基本信息
|
||||||
|
*/
|
||||||
|
public PsContractInfoVo queryInfoByCustomId(Long customerId){
|
||||||
|
PsContractInfoBo bo = new PsContractInfoBo();
|
||||||
|
bo.setCustomId(customerId);
|
||||||
|
//校验信息并返回
|
||||||
|
PsContractInfo info = validEntity(bo);
|
||||||
|
if(info == null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
PsContractInfoVo vo = MapstructUtils.convert(info, PsContractInfoVo.class);
|
||||||
|
//装填公司信息
|
||||||
|
if(vo.getCompanyId() != null){
|
||||||
|
vo.setPsCompanyInfoVo(companyInfoService.queryById(vo.getCompanyId()));
|
||||||
|
}
|
||||||
|
//装填服务类型和服务项目信息
|
||||||
|
List<PsContractBusinessVo> list = businessMapper.selectBusinessList(vo.getContractCode());
|
||||||
|
vo.setBusinessVoList(list);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户id,合同编码询和合同状态查询合同信息
|
||||||
|
*
|
||||||
|
* @param code 合同编码
|
||||||
|
* @return 合同基本信息
|
||||||
|
*/
|
||||||
|
public List<PsContractInfo> queryByCode(Long customId,String code,ContractStatusEnum enu){
|
||||||
|
if(customId == null || StringUtils.isBlank(code)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return baseMapper.selectList(Wrappers.<PsContractInfo>lambdaQuery().eq(PsContractInfo::getDelFlag,"0")
|
||||||
|
.eq(StringUtils.isNotBlank(code),PsContractInfo::getContractCode,code)
|
||||||
|
.eq(customId != null,PsContractInfo::getCustomId,customId)
|
||||||
|
.eq(enu != null ,PsContractInfo::getContractStatus,enu.getCode()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据校验并返回
|
||||||
|
* 校验:暂存的合同不止一个,暂存的合同并且不是传入的合同-》报错(暂存的合同只能有一个)
|
||||||
|
*/
|
||||||
|
private PsContractInfo validEntity( PsContractInfoBo bo){
|
||||||
|
PsContractInfo add =null;
|
||||||
|
//插入或修改合同
|
||||||
|
log.info("校验合同查询入参:{}",bo.getCustomId());
|
||||||
|
List<PsContractInfo> infos = this.queryByCode(bo.getCustomId(),null,ContractStatusEnum.INIT);//todo 状态查询
|
||||||
|
log.info("校验合同查询结果:{}",infos == null?null: infos.size() );
|
||||||
|
//校验:暂存的合同不止一个,暂存的合同并且不是传入的合同-》报错(暂存的合同只能有一个)
|
||||||
|
if (CollectionUtils.isNotEmpty(infos) ) {
|
||||||
|
if(infos.size()>1){
|
||||||
|
log.error("暂存的合同过多,customerid:"+bo.getCustomId());
|
||||||
|
throw new ServiceException("系统异常,请联系管理员");
|
||||||
|
}
|
||||||
|
add = infos.get(0);
|
||||||
|
if(!StringUtils.equals(add.getContractCode(), bo.getContractCode())){
|
||||||
|
log.error("此合已有暂存的合同,customerid:"+bo.getCustomId());
|
||||||
|
throw new ServiceException("此合同状态已变更,请刷新页面重新操作");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return add;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// private LambdaQueryWrapper<PsContractInfo> buildQueryWrapper(PsContractInfoBo bo) {
|
||||||
|
// LambdaQueryWrapper<PsContractInfo> lqw = Wrappers.lambdaQuery();
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), PsContractInfo::getContractCode, bo.getContractCode());
|
||||||
|
// lqw.like(StringUtils.isNotBlank(bo.getContractName()), PsContractInfo::getContractName, bo.getContractName());
|
||||||
|
// lqw.eq(bo.getCustomId() != null, PsContractInfo::getCustomId, bo.getCustomId());
|
||||||
|
// lqw.eq(bo.getCompanyId() != null, PsContractInfo::getCompanyId, bo.getCompanyId());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getContractMain()), PsContractInfo::getContractMain, bo.getContractMain());
|
||||||
|
// lqw.eq(bo.getCustomManager() != null, PsContractInfo::getCustomManager, bo.getCustomManager());
|
||||||
|
// lqw.eq(bo.getContractAmount() != null, PsContractInfo::getContractAmount, bo.getContractAmount());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getContractStatus()), PsContractInfo::getContractStatus, bo.getContractStatus());
|
||||||
|
// lqw.between(params.get("beginApplyDate") != null && params.get("endApplyDate") != null,
|
||||||
|
// PsContractInfo::getApplyDate ,params.get("beginApplyDate"), params.get("endApplyDate"));
|
||||||
|
// lqw.eq(bo.getTimeLimit() != null, PsContractInfo::getTimeLimit, bo.getTimeLimit());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getCustomScene()), PsContractInfo::getCustomScene, bo.getCustomScene());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getIsProxy()), PsContractInfo::getIsProxy, bo.getIsProxy());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getSignDesc()), PsContractInfo::getSignDesc, bo.getSignDesc());
|
||||||
|
// lqw.eq(bo.getDelFlage() != null, PsContractInfo::getDelFlage, bo.getDelFlage());
|
||||||
|
// return lqw;
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询合同基本信息列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 合同基本信息分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<PsContractInfoVo> queryPageList(PsContractInfoBo bo, PageQuery pageQuery) {
|
||||||
|
Wrapper<PsCustomInfo> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<PsContractInfoVo> result = baseMapper.selectPageContractList(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private QueryWrapper<PsContractInfo> buildQueryWrapper(PsContractInfoBo bo) {
|
||||||
|
QueryWrapper<PsContractInfo> qw = Wrappers.query();
|
||||||
|
//合同表条件
|
||||||
|
qw.eq( "info.del_flag", 0);//删除标志
|
||||||
|
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), PsContractInfo::getContractCode, bo.getContractCode());
|
||||||
|
// lqw.like(StringUtils.isNotBlank(bo.getContractName()), PsContractInfo::getContractName, bo.getContractName());
|
||||||
|
// lqw.eq(bo.getCustomId() != null, PsContractInfo::getCustomId, bo.getCustomId());
|
||||||
|
// lqw.eq(bo.getCompanyId() != null, PsContractInfo::getCompanyId, bo.getCompanyId());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getContractMain()), PsContractInfo::getContractMain, bo.getContractMain());
|
||||||
|
// lqw.eq(bo.getCustomManager() != null, PsContractInfo::getCustomManager, bo.getCustomManager());
|
||||||
|
// lqw.eq(bo.getContractAmount() != null, PsContractInfo::getContractAmount, bo.getContractAmount());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getContractStatus()), PsContractInfo::getContractStatus, bo.getContractStatus());
|
||||||
|
// lqw.between(params.get("beginApplyDate") != null && params.get("endApplyDate") != null,
|
||||||
|
// PsContractInfo::getApplyDate ,params.get("beginApplyDate"), params.get("endApplyDate"));
|
||||||
|
// lqw.eq(bo.getTimeLimit() != null, PsContractInfo::getTimeLimit, bo.getTimeLimit());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getCustomScene()), PsContractInfo::getCustomScene, bo.getCustomScene());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getIsProxy()), PsContractInfo::getIsProxy, bo.getIsProxy());
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getSignDesc()), PsContractInfo::getSignDesc, bo.getSignDesc());
|
||||||
|
// lqw.eq(bo.getDelFlage() != null, PsContractInfo::getDelFlage, bo.getDelFlage());
|
||||||
|
return qw;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同基本信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 合同基本信息
|
||||||
|
*//*
|
||||||
|
@Override
|
||||||
|
public PsContractInfoVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 分页查询合同基本信息列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 合同基本信息分页列表
|
||||||
|
*//*
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<PsContractInfoVo> queryPageList(PsContractInfoBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<PsContractInfo> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<PsContractInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 查询符合条件的合同基本信息列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 合同基本信息列表
|
||||||
|
*//*
|
||||||
|
@Override
|
||||||
|
public List<PsContractInfoVo> queryList(PsContractInfoBo bo) {
|
||||||
|
LambdaQueryWrapper<PsContractInfo> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<PsContractInfo> buildQueryWrapper(PsContractInfoBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<PsContractInfo> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), PsContractInfo::getContractCode, bo.getContractCode());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getContractName()), PsContractInfo::getContractName, bo.getContractName());
|
||||||
|
lqw.eq(bo.getCustomId() != null, PsContractInfo::getCustomId, bo.getCustomId());
|
||||||
|
lqw.eq(bo.getCompanyId() != null, PsContractInfo::getCompanyId, bo.getCompanyId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getContractMain()), PsContractInfo::getContractMain, bo.getContractMain());
|
||||||
|
lqw.eq(bo.getCustomManager() != null, PsContractInfo::getCustomManager, bo.getCustomManager());
|
||||||
|
lqw.eq(bo.getContractAmount() != null, PsContractInfo::getContractAmount, bo.getContractAmount());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getContractStatus()), PsContractInfo::getContractStatus, bo.getContractStatus());
|
||||||
|
lqw.between(params.get("beginApplyDate") != null && params.get("endApplyDate") != null,
|
||||||
|
PsContractInfo::getApplyDate ,params.get("beginApplyDate"), params.get("endApplyDate"));
|
||||||
|
lqw.eq(bo.getTimeLimit() != null, PsContractInfo::getTimeLimit, bo.getTimeLimit());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCustomScene()), PsContractInfo::getCustomScene, bo.getCustomScene());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getIsProxy()), PsContractInfo::getIsProxy, bo.getIsProxy());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSignDesc()), PsContractInfo::getSignDesc, bo.getSignDesc());
|
||||||
|
lqw.eq(bo.getDelFlage() != null, PsContractInfo::getDelFlage, bo.getDelFlage());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 新增合同基本信息
|
||||||
|
*
|
||||||
|
* @param bo 合同基本信息
|
||||||
|
* @return 是否新增成功
|
||||||
|
*//*
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(PsContractInfoBo bo) {
|
||||||
|
PsContractInfo add = MapstructUtils.convert(bo, PsContractInfo.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 修改合同基本信息
|
||||||
|
*
|
||||||
|
* @param bo 合同基本信息
|
||||||
|
* @return 是否修改成功
|
||||||
|
*//*
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(PsContractInfoBo bo) {
|
||||||
|
PsContractInfo update = MapstructUtils.convert(bo, PsContractInfo.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*//*
|
||||||
|
private void validEntityBeforeSave(PsContractInfo entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
*//**
|
||||||
|
* 校验并批量删除合同基本信息信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*//*
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}*/
|
||||||
|
}
|
@ -3,13 +3,17 @@ package com.pusong.business.service.impl;
|
|||||||
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.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.PsCustomCallbackBo;
|
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
||||||
|
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.CustomerStatusEnum;
|
import com.pusong.business.enums.CustomerStatusEnum;
|
||||||
|
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.common.core.utils.MapstructUtils;
|
import com.pusong.common.core.utils.MapstructUtils;
|
||||||
@ -27,7 +31,9 @@ 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;
|
||||||
import com.pusong.business.service.IPsCustomInfoService;
|
import com.pusong.business.service.IPsCustomInfoService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -44,6 +50,17 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
private final PsCustomInfoMapper baseMapper;
|
private final PsCustomInfoMapper baseMapper;
|
||||||
private final PsCustomPriceMapper priceMapper;
|
private final PsCustomPriceMapper priceMapper;
|
||||||
private final PsCustomCallbackMapper callbackMapper;
|
private final PsCustomCallbackMapper callbackMapper;
|
||||||
|
private final PsCompanyInfoMapper companyInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询客户
|
||||||
|
* @return 客户id和姓名
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PsCustomInfo listById(Long id) {
|
||||||
|
return baseMapper.selectById(id);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询登陆人下所有的客户名称和id
|
* 查询登陆人下所有的客户名称和id
|
||||||
@ -90,18 +107,53 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
//查询回访记录详细
|
//查询回访记录详细
|
||||||
List<PsCustomCallbackVo> callbacks = callbackMapper.selectVoList(Wrappers.<PsCustomCallback>lambdaQuery()
|
List<PsCustomCallbackVo> callbacks = callbackMapper.selectVoList(Wrappers.<PsCustomCallback>lambdaQuery()
|
||||||
.in(PsCustomCallback::getCustomId, ids)
|
.in(PsCustomCallback::getCustomId, ids)
|
||||||
.eq(PsCustomCallback::getDelFlag, 0)
|
.eq(PsCustomCallback::getDelFlag, 0));
|
||||||
.orderByDesc(PsCustomCallback::getCreateTime));
|
|
||||||
Map<Long, List<PsCustomCallbackVo>> id_callbackMap = new HashMap<>();
|
Map<Long, List<PsCustomCallbackVo>> id_callbackMap = new HashMap<>();
|
||||||
if(CollectionUtils.isNotEmpty(callbacks)){
|
if(CollectionUtils.isNotEmpty(callbacks)){
|
||||||
//分组
|
//分组
|
||||||
id_callbackMap = callbacks.stream().collect((Collectors.groupingBy(PsCustomCallbackVo::getCustomId)));
|
id_callbackMap = callbacks.stream().collect((Collectors.groupingBy(PsCustomCallbackVo::getCustomId)));
|
||||||
|
//排序
|
||||||
|
id_callbackMap.forEach((k,v)->{
|
||||||
|
v = v.stream().sorted(Comparator.comparingLong(PsCustomCallbackVo::getId).reversed()).collect(Collectors.toList());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查询公司信息
|
||||||
|
List<PsCompanyInfoVo> companyInfoVos = companyInfoMapper.selectVoList(Wrappers.<PsCompanyInfo>lambdaQuery()
|
||||||
|
.in(PsCompanyInfo::getCustomId, ids)
|
||||||
|
.eq(PsCompanyInfo::getDelFlag, 0));
|
||||||
|
Map<Long, List<PsCompanyInfoVo>> id_companyMap = new HashMap<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(companyInfoVos)){
|
||||||
|
//分组
|
||||||
|
id_companyMap = companyInfoVos.stream().collect((Collectors.groupingBy(PsCompanyInfoVo::getCustomId)));
|
||||||
|
//排序
|
||||||
|
id_companyMap.forEach((k,v)->{
|
||||||
|
v = v.stream().sorted(Comparator.comparingLong(PsCompanyInfoVo::getId)).collect(Collectors.toList());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
for (PsCustomInfoVo info : result.getRecords()) {
|
for (PsCustomInfoVo info : result.getRecords()) {
|
||||||
//装填回访记录vo
|
//装填回访记录vo
|
||||||
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
|
||||||
|
info.setPsCompanyInfoVos(id_companyMap.get(info.getId()));
|
||||||
|
//报价金额
|
||||||
|
if(CollectionUtils.isNotEmpty(info.getPsCustomPriceVo())){
|
||||||
|
info.setPrice(info.getPsCustomPriceVo().stream().map(PsCustomPriceVo::getServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
}
|
||||||
|
//最新的回访信息
|
||||||
|
if(CollectionUtils.isNotEmpty(info.getPsCustomCallbackVo())){
|
||||||
|
info.setCallBack(info.getPsCustomCallbackVo().get(0).getCallbackContent());
|
||||||
|
}
|
||||||
|
//最早的公司名称
|
||||||
|
if(CollectionUtils.isNotEmpty(info.getPsCompanyInfoVos())){
|
||||||
|
info.setCompanyName(info.getPsCompanyInfoVos().get(0).getCompanyName());
|
||||||
|
info.setCompanyNum(info.getPsCompanyInfoVos().size());
|
||||||
|
}else{
|
||||||
|
info.setCompanyNum(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
@ -119,14 +171,15 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Wrapper<PsCustomInfo> buildQueryWrapper(PsCustomInfoBo bo) {
|
private Wrapper<PsCustomInfo> buildQueryWrapper(PsCustomInfoBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
|
||||||
QueryWrapper<PsCustomInfo> qw = Wrappers.query();
|
QueryWrapper<PsCustomInfo> qw = Wrappers.query();
|
||||||
//客户信息表条件
|
//客户信息表条件
|
||||||
qw.like( "info.del_flag", 0);//删除标志
|
qw.eq( "info.del_flag", 0);//删除标志
|
||||||
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.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "use.custom_manager", bo.getCustomManagerName());//销售经理名称
|
qw.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "use.custom_manager", bo.getCustomManagerName());//销售经理名称
|
||||||
//关联客户信息表条件
|
//关联客户信息表条件
|
||||||
@ -142,15 +195,23 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Boolean insertByBo(PsCustomInfoBo bo) {
|
public Boolean insertByBo(PsCustomInfoBo bo) {
|
||||||
PsCustomInfo add = MapstructUtils.convert(bo, PsCustomInfo.class);
|
PsCustomInfo add = MapstructUtils.convert(bo, PsCustomInfo.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
//客户经理就是登录用户
|
//客户经理就是登录用户
|
||||||
add.setCustomManager(LoginHelper.getUserId());
|
add.setCustomManager(LoginHelper.getUserId());
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if(CollectionUtils.isNotEmpty(bo.getPriceBos())){
|
||||||
bo.setId(add.getId());
|
bo.getPriceBos().forEach(item->item.setCustomId(add.getId()));
|
||||||
|
this.insertPiceByBo(bo.getPriceBos());
|
||||||
}
|
}
|
||||||
|
if(CollectionUtils.isNotEmpty(bo.getCallbackBos())){
|
||||||
|
bo.getCallbackBos().forEach(item->item.setCustomId(add.getId()));
|
||||||
|
this.insertCallbackByBo(bo.getCallbackBos());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +243,7 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateCustomerStatus(Long id, Integer type) {
|
public Boolean updateCustomerStatus(Long id, Integer type,String desc) {
|
||||||
PsCustomInfo psCustomInfo = baseMapper.selectById(id);
|
PsCustomInfo psCustomInfo = baseMapper.selectById(id);
|
||||||
if(true){
|
if(true){
|
||||||
//todo 校验原数据状态是否可以更改
|
//todo 校验原数据状态是否可以更改
|
||||||
@ -193,6 +254,7 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
break;
|
break;
|
||||||
case 2://拉黑
|
case 2://拉黑
|
||||||
psCustomInfo.setBlack("1");
|
psCustomInfo.setBlack("1");
|
||||||
|
psCustomInfo.setBlackDesc(desc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +270,7 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
|||||||
@Override
|
@Override
|
||||||
public Boolean insertPiceByBo(List<PsCustomPriceBo> bos) {
|
public Boolean insertPiceByBo(List<PsCustomPriceBo> bos) {
|
||||||
List<PsCustomPrice> adds = MapstructUtils.convert(bos, PsCustomPrice.class);
|
List<PsCustomPrice> adds = MapstructUtils.convert(bos, PsCustomPrice.class);
|
||||||
PsCustomPrice price = priceMapper.selectById(new QueryWrapper<PsCustomPrice>().select("max(price_batch)")
|
PsCustomPrice price = priceMapper.selectOne(new QueryWrapper<PsCustomPrice>().select("max(price_batch) price_batch")
|
||||||
.lambda().eq(PsCustomPrice::getDelFlag, 0).eq(PsCustomPrice::getCustomId, bos.get(0).getCustomId()));
|
.lambda().eq(PsCustomPrice::getDelFlag, 0).eq(PsCustomPrice::getCustomId, bos.get(0).getCustomId()));
|
||||||
adds.forEach(add->{
|
adds.forEach(add->{
|
||||||
add.setPriceBatch((price != null && price.getPriceBatch() != null) ? price.getPriceBatch() + 1 : 1);
|
add.setPriceBatch((price != null && price.getPriceBatch() != null) ? price.getPriceBatch() + 1 : 1);
|
||||||
|
@ -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.PsCompanyInfoMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -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.PsContractBusinessDetailMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,30 @@
|
|||||||
|
<?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.PsContractBusinessMapper">
|
||||||
|
|
||||||
|
<resultMap id="businessResult" type="com.pusong.business.domain.vo.PsContractBusinessVo">
|
||||||
|
<collection columnPrefix="DETAIL_" property="detailVoList" ofType="com.pusong.business.domain.vo.PsContractBusinessDetailVo" >
|
||||||
|
<!--<id column="ID" property="id"></id>
|
||||||
|
<result column="CUSTOMER_NAME" property="customerName" />
|
||||||
|
<result column="CUSTOMER_ID_NO" property="customerIdNo" />-->
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectBusinessList" resultMap="businessResult">
|
||||||
|
select bus.*,
|
||||||
|
detail.contract_code detail_contract_code,
|
||||||
|
detail.business_project detail_business_project,
|
||||||
|
detail.business_project_label detail_business_project_label,
|
||||||
|
detail.amount detail_amount,
|
||||||
|
detail.amount_desc detail_amount_desc,
|
||||||
|
detail.extent_info detail_extent_info,
|
||||||
|
from ps_contract_business bus
|
||||||
|
left join ps_contract_business_detail detail on bus.id = detail.business_id
|
||||||
|
where bus.del_flag = 0
|
||||||
|
and detail.del_flag = 0
|
||||||
|
and bus.contract_code = #{contractCode}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -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.PsContractInfoMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -8,7 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectPageCustomerList" resultType="com.pusong.business.domain.vo.PsCustomInfoVo">
|
<select id="selectPageCustomerList" resultType="com.pusong.business.domain.vo.PsCustomInfoVo">
|
||||||
SELECT info.*
|
SELECT info.*
|
||||||
, usr.nick_name as custom_manager_name
|
, usr.nick_name as custom_manager_name
|
||||||
,psinfo.custom_introducer as custom_introducer_name
|
,psinfo.custom_introducer as custom_introducer_name,
|
||||||
|
EXISTS(SELECT * FROM ps_contract_info coninfo WHERE coninfo.custom_id = info.id and coninfo.contract_status != '10') have_contract
|
||||||
FROM ps_custom_info info
|
FROM ps_custom_info info
|
||||||
left join sys_user usr on info.custom_manager = usr.user_id and usr.del_flag = 0
|
left join sys_user usr on info.custom_manager = usr.user_id and usr.del_flag = 0
|
||||||
left join ps_custom_info psinfo on info.custom_introducer = psinfo.id and psinfo.del_flag = 0
|
left join ps_custom_info psinfo on info.custom_introducer = psinfo.id and psinfo.del_flag = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user