This commit is contained in:
baozhipeng
2021-09-14 23:57:32 +08:00
parent d9049e81ce
commit 521e90b125
6 changed files with 61 additions and 34 deletions
@@ -159,6 +159,10 @@ public class TbMemberProjectSubitem implements Serializable {
@ApiModelProperty(value = "来款用途(字典表)")
private String chargeUse;
/**标协缴费表id*/
@ApiModelProperty(value = "标协缴费表id")
private String tbPaymentId;
public String convertisEmail(){
return PasswordUtil.decrypt(email);
}
@@ -49,9 +49,10 @@ public class PayPaymentRecordController extends JeroController<PayPaymentRecord,
@GetMapping(value = "/mainList")
public Result<?> mainList(PayCommonProject payCommonProject,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize
,String paymentDate) {
Page<PayCommonProject> page = new Page<PayCommonProject>(pageNo, pageSize);
List<PayCommonProject> pageList = payPaymentRecordService.mainList(page, payCommonProject);
List<PayCommonProject> pageList = payPaymentRecordService.mainList(page, payCommonProject,paymentDate);
page.setRecords(pageList);
return Result.OK(page);
}
@@ -22,7 +22,9 @@ public interface PayPaymentRecordMapper extends BaseMapper<PayPaymentRecord> {
* @param payCommonProject
* @return
*/
List<PayCommonProject> mainList(Page page, @Param("payCommonProject")PayCommonProject payCommonProject);
List<PayCommonProject> mainList(Page page,
@Param("payCommonProject")PayCommonProject payCommonProject,
@Param("paymentDate") String paymentDate);
/**
* 到账开票导出
@@ -4,12 +4,14 @@
<!-- 到账开票主列表-->
<select id="mainList" resultType="com.jero.project.entity.PayCommonProject">
<!-- 普通项目-->
select p.id,p.charge_project, p.charge_use, p.principal_id,p.principal_name,p.charge_company_temporary_name,p.receivable_amount,p.paid_amount,p.need_invoice,p.pack,p.in_account,p.make_invoice,p.mail,p.create_time,1 as projectType
from
(<!-- 普通项目-->
select c.id,c.charge_project, c.charge_use, c.principal_id,c.principal_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType
from pay_common_project c
where
(c.receivable_amount <![CDATA[>]]> c.paid_amount
or (c.receivable_amount is not null and c.paid_amount is null))
c.receivable_amount <![CDATA[<>]]> 0
and c.receivable_amount is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND c.principal_id = #{payCommonProject.principalId}
</if>
@@ -25,8 +27,8 @@
from pay_working_group g
inner join pay_working_group_subitem gsub on g.id = gsub.charge_company_id
where
(gsub.receivable_amount <![CDATA[>]]> gsub.paid_amount
or (gsub.receivable_amount is not null and gsub.paid_amount is null))
gsub.receivable_amount <![CDATA[<>]]> 0
and gsub.receivable_amount is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND g.principal_id_a = #{payCommonProject.principalId}
</if>
@@ -42,8 +44,8 @@
from pay_meeting meeting
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
where
(sit.amount_receivable <![CDATA[>]]> sit.paid_amount
or (sit.amount_receivable is not null and sit.paid_amount is null))
sit.amount_receivable <![CDATA[<>]]> 0
and sit.amount_receivable is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND meeting.director_id = #{payCommonProject.principalId}
</if>
@@ -59,8 +61,8 @@
from pay_member_project member
inner join pay_member_project_subitem msub on member.id=msub.project_id
where
(msub.amount_receivable <![CDATA[>]]> msub.paid_amount
or (msub.amount_receivable is not null and msub.paid_amount is null))
msub.amount_receivable <![CDATA[<>]]> 0
and msub.amount_receivable is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND member.director_id = #{payCommonProject.principalId}
</if>
@@ -72,20 +74,26 @@
</if>
<!-- 标协会员项目-->
UNION ALL
select tmsub.id,tmember.project_name,tmsub.charge_use,'','',tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5
select tmsub.id,tmember.project_name,tmsub.charge_use,'null','null',tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5
from tb_member_project tmember
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
where
(tmsub.amount_receivable <![CDATA[>]]> tmsub.paid_amount
or (tmsub.amount_receivable is not null and tmsub.paid_amount))
tmsub.amount_receivable <![CDATA[<>]]> 0
and tmsub.amount_receivable is not null
<if test="payCommonProject.chargeProject != null and payCommonProject.chargeProject != ''">
AND tmember.project_name = #{payCommonProject.chargeProject}
</if>
<if test="payCommonProject.chargeCompanyTemporaryName != null and payCommonProject.chargeCompanyTemporaryName != ''">
AND tmsub.company_name = #{payCommonProject.chargeCompanyTemporaryName}
</if>
order by create_time DESC
)p
LEFT JOIN pay_payment_record ppr ON ppr.project_id = p.id
where
1=1
<if test="paymentDate != null and paymentDate != ''">
AND DATE_FORMAT(ppr.payment_date,'%Y') = #{paymentDate}
</if>
GROUP BY p.id ORDER BY p.create_time
</select>
<!-- 到账开票导出-->
@@ -94,8 +102,8 @@
select c.id,c.charge_project, c.charge_use, c.principal_id,c.principal_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType
from pay_common_project c
where
(c.receivable_amount <![CDATA[>]]> c.paid_amount
or (c.receivable_amount is not null and c.paid_amount is null))
c.receivable_amount <![CDATA[<>]]> 0
and c.receivable_amount is not null
<if test="principalId != null and principalId != ''">
AND c.principal_id = #{principalId}
</if>
@@ -111,8 +119,8 @@
from pay_working_group g
inner join pay_working_group_subitem gsub on g.id = gsub.charge_company_id
where
(gsub.receivable_amount <![CDATA[>]]> gsub.paid_amount
or (gsub.receivable_amount is not null and gsub.paid_amount is null))
gsub.receivable_amount <![CDATA[<>]]> 0
and gsub.receivable_amount is not null
<if test="principalId != null and principalId != ''">
AND g.principal_id_a = #{principalId}
</if>
@@ -128,8 +136,8 @@
from pay_meeting meeting
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
where
(sit.amount_receivable <![CDATA[>]]> sit.paid_amount
or (sit.amount_receivable is not null and sit.paid_amount is null))
sit.amount_receivable <![CDATA[<>]]> 0
and sit.amount_receivable is not null
<if test="principalId != null and principalId != ''">
AND meeting.director_id = #{principalId}
</if>
@@ -145,8 +153,8 @@
from pay_member_project member
inner join pay_member_project_subitem msub on member.id=msub.project_id
where
(msub.amount_receivable <![CDATA[>]]> msub.paid_amount
or (msub.amount_receivable is not null and msub.paid_amount is null))
msub.amount_receivable <![CDATA[<>]]> 0
and msub.amount_receivable is not null
<if test="principalId != null and principalId != ''">
AND member.director_id = #{principalId}
</if>
@@ -158,12 +166,12 @@
</if>
<!-- 标协会员项目-->
UNION ALL
select tmsub.id,tmember.project_name,tmsub.charge_use,'','',tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5
select tmsub.id,tmember.project_name,tmsub.charge_use,'null','null',tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5
from tb_member_project tmember
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
where
(tmsub.amount_receivable <![CDATA[>]]> tmsub.paid_amount
or (tmsub.amount_receivable is not null and tmsub.paid_amount))
tmsub.amount_receivable <![CDATA[<>]]> 0
and tmsub.amount_receivable is not null
<if test="chargeProject != null and chargeProject != ''">
AND tmember.project_name = #{chargeProject}
</if>
@@ -24,7 +24,7 @@ public interface IPayPaymentRecordService extends IService<PayPaymentRecord> {
* @param payCommonProject
* @return
*/
List<PayCommonProject> mainList(Page page, PayCommonProject payCommonProject);
List<PayCommonProject> mainList(Page page, PayCommonProject payCommonProject,String paymentDate);
/**
* 添加阶段
@@ -87,8 +87,8 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
* @param payCommonProject
* @return
*/
public List<PayCommonProject> mainList(Page page, PayCommonProject payCommonProject){
return payPaymentRecordMapper.mainList(page, payCommonProject);
public List<PayCommonProject> mainList(Page page, PayCommonProject payCommonProject,String paymentDate){
return payPaymentRecordMapper.mainList(page, payCommonProject, paymentDate);
}
@@ -210,7 +210,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
tbMember.setInAccount(inAccount);
tbMemberProjectSubitemMapper.updateById(tbMember);
sendToStandards();
sendToStandards(tbMember,payPaymentRecord);
}else{
return Result.error("到账金额大于当前欠款金额,不可提交!");
}
@@ -238,7 +238,17 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
BigDecimal rAInsert = tbMemberInsert.getAmountReceivable();//应收
BigDecimal pAInsert = tbMemberInsert.getPaidAmount();//实收
BigDecimal aRInsert =payPaymentRecord.getAmountReceived();//到账
BigDecimal aRInsert =payPaymentRecord.getAmountReceived().setScale(2,BigDecimal.ROUND_HALF_UP);;//到账
if(rAInsert == null){
rAInsert = new BigDecimal("0");
}
if(pAInsert == null){
pAInsert = new BigDecimal("0");
}
if(aRInsert == null){
aRInsert = new BigDecimal("0");
}
//欠款
BigDecimal debtInsert = rAInsert.subtract(pAInsert);
if(aRInsert.compareTo(debtInsert) != 0){
@@ -325,7 +335,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
/**
* 标协会员来款推送到标协项目
*/
private void sendToStandards(){
private void sendToStandards(TbMemberProjectSubitem tbMember,PayPaymentRecord payPaymentRecord){
//获取公钥并使用公钥加密token
Map<String, String> map = authenticationUtils.encryptByRsaPriKey();
@@ -333,6 +343,8 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
paramMap.put("token", map.get("token"));
paramMap.put("publicKey", map.get("publicKey"));
paramMap.put("id",tbMember.getTbPaymentId());
paramMap.put("checkMark",payPaymentRecord.getRemark());
String result3= HttpUtil.get(url+"/paymentInfo/incomingPaymentCheck", paramMap);
}