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 = "来款用途(字典表)") @ApiModelProperty(value = "来款用途(字典表)")
private String chargeUse; private String chargeUse;
/**标协缴费表id*/
@ApiModelProperty(value = "标协缴费表id")
private String tbPaymentId;
public String convertisEmail(){ public String convertisEmail(){
return PasswordUtil.decrypt(email); return PasswordUtil.decrypt(email);
} }
@@ -49,9 +49,10 @@ public class PayPaymentRecordController extends JeroController<PayPaymentRecord,
@GetMapping(value = "/mainList") @GetMapping(value = "/mainList")
public Result<?> mainList(PayCommonProject payCommonProject, public Result<?> mainList(PayCommonProject payCommonProject,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @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); 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); page.setRecords(pageList);
return Result.OK(page); return Result.OK(page);
} }
@@ -22,7 +22,9 @@ public interface PayPaymentRecordMapper extends BaseMapper<PayPaymentRecord> {
* @param payCommonProject * @param payCommonProject
* @return * @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 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 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 from pay_common_project c
where where
(c.receivable_amount <![CDATA[>]]> c.paid_amount c.receivable_amount <![CDATA[<>]]> 0
or (c.receivable_amount is not null and c.paid_amount is null)) and c.receivable_amount is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''"> <if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND c.principal_id = #{payCommonProject.principalId} AND c.principal_id = #{payCommonProject.principalId}
</if> </if>
@@ -25,8 +27,8 @@
from pay_working_group g from pay_working_group g
inner join pay_working_group_subitem gsub on g.id = gsub.charge_company_id inner join pay_working_group_subitem gsub on g.id = gsub.charge_company_id
where where
(gsub.receivable_amount <![CDATA[>]]> gsub.paid_amount gsub.receivable_amount <![CDATA[<>]]> 0
or (gsub.receivable_amount is not null and gsub.paid_amount is null)) and gsub.receivable_amount is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''"> <if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND g.principal_id_a = #{payCommonProject.principalId} AND g.principal_id_a = #{payCommonProject.principalId}
</if> </if>
@@ -42,8 +44,8 @@
from pay_meeting meeting from pay_meeting meeting
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
where where
(sit.amount_receivable <![CDATA[>]]> sit.paid_amount sit.amount_receivable <![CDATA[<>]]> 0
or (sit.amount_receivable is not null and sit.paid_amount is null)) and sit.amount_receivable is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''"> <if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND meeting.director_id = #{payCommonProject.principalId} AND meeting.director_id = #{payCommonProject.principalId}
</if> </if>
@@ -59,8 +61,8 @@
from pay_member_project member from pay_member_project member
inner join pay_member_project_subitem msub on member.id=msub.project_id inner join pay_member_project_subitem msub on member.id=msub.project_id
where where
(msub.amount_receivable <![CDATA[>]]> msub.paid_amount msub.amount_receivable <![CDATA[<>]]> 0
or (msub.amount_receivable is not null and msub.paid_amount is null)) and msub.amount_receivable is not null
<if test="payCommonProject.principalId != null and payCommonProject.principalId != ''"> <if test="payCommonProject.principalId != null and payCommonProject.principalId != ''">
AND member.director_id = #{payCommonProject.principalId} AND member.director_id = #{payCommonProject.principalId}
</if> </if>
@@ -72,20 +74,26 @@
</if> </if>
<!-- 标协会员项目--> <!-- 标协会员项目-->
UNION ALL 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 from tb_member_project tmember
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
where where
(tmsub.amount_receivable <![CDATA[>]]> tmsub.paid_amount tmsub.amount_receivable <![CDATA[<>]]> 0
or (tmsub.amount_receivable is not null and tmsub.paid_amount)) and tmsub.amount_receivable is not null
<if test="payCommonProject.chargeProject != null and payCommonProject.chargeProject != ''"> <if test="payCommonProject.chargeProject != null and payCommonProject.chargeProject != ''">
AND tmember.project_name = #{payCommonProject.chargeProject} AND tmember.project_name = #{payCommonProject.chargeProject}
</if> </if>
<if test="payCommonProject.chargeCompanyTemporaryName != null and payCommonProject.chargeCompanyTemporaryName != ''"> <if test="payCommonProject.chargeCompanyTemporaryName != null and payCommonProject.chargeCompanyTemporaryName != ''">
AND tmsub.company_name = #{payCommonProject.chargeCompanyTemporaryName} AND tmsub.company_name = #{payCommonProject.chargeCompanyTemporaryName}
</if> </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> </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 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 from pay_common_project c
where where
(c.receivable_amount <![CDATA[>]]> c.paid_amount c.receivable_amount <![CDATA[<>]]> 0
or (c.receivable_amount is not null and c.paid_amount is null)) and c.receivable_amount is not null
<if test="principalId != null and principalId != ''"> <if test="principalId != null and principalId != ''">
AND c.principal_id = #{principalId} AND c.principal_id = #{principalId}
</if> </if>
@@ -111,8 +119,8 @@
from pay_working_group g from pay_working_group g
inner join pay_working_group_subitem gsub on g.id = gsub.charge_company_id inner join pay_working_group_subitem gsub on g.id = gsub.charge_company_id
where where
(gsub.receivable_amount <![CDATA[>]]> gsub.paid_amount gsub.receivable_amount <![CDATA[<>]]> 0
or (gsub.receivable_amount is not null and gsub.paid_amount is null)) and gsub.receivable_amount is not null
<if test="principalId != null and principalId != ''"> <if test="principalId != null and principalId != ''">
AND g.principal_id_a = #{principalId} AND g.principal_id_a = #{principalId}
</if> </if>
@@ -128,8 +136,8 @@
from pay_meeting meeting from pay_meeting meeting
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
where where
(sit.amount_receivable <![CDATA[>]]> sit.paid_amount sit.amount_receivable <![CDATA[<>]]> 0
or (sit.amount_receivable is not null and sit.paid_amount is null)) and sit.amount_receivable is not null
<if test="principalId != null and principalId != ''"> <if test="principalId != null and principalId != ''">
AND meeting.director_id = #{principalId} AND meeting.director_id = #{principalId}
</if> </if>
@@ -145,8 +153,8 @@
from pay_member_project member from pay_member_project member
inner join pay_member_project_subitem msub on member.id=msub.project_id inner join pay_member_project_subitem msub on member.id=msub.project_id
where where
(msub.amount_receivable <![CDATA[>]]> msub.paid_amount msub.amount_receivable <![CDATA[<>]]> 0
or (msub.amount_receivable is not null and msub.paid_amount is null)) and msub.amount_receivable is not null
<if test="principalId != null and principalId != ''"> <if test="principalId != null and principalId != ''">
AND member.director_id = #{principalId} AND member.director_id = #{principalId}
</if> </if>
@@ -158,12 +166,12 @@
</if> </if>
<!-- 标协会员项目--> <!-- 标协会员项目-->
UNION ALL 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 from tb_member_project tmember
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
where where
(tmsub.amount_receivable <![CDATA[>]]> tmsub.paid_amount tmsub.amount_receivable <![CDATA[<>]]> 0
or (tmsub.amount_receivable is not null and tmsub.paid_amount)) and tmsub.amount_receivable is not null
<if test="chargeProject != null and chargeProject != ''"> <if test="chargeProject != null and chargeProject != ''">
AND tmember.project_name = #{chargeProject} AND tmember.project_name = #{chargeProject}
</if> </if>
@@ -24,7 +24,7 @@ public interface IPayPaymentRecordService extends IService<PayPaymentRecord> {
* @param payCommonProject * @param payCommonProject
* @return * @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 * @param payCommonProject
* @return * @return
*/ */
public List<PayCommonProject> mainList(Page page, PayCommonProject payCommonProject){ public List<PayCommonProject> mainList(Page page, PayCommonProject payCommonProject,String paymentDate){
return payPaymentRecordMapper.mainList(page, payCommonProject); return payPaymentRecordMapper.mainList(page, payCommonProject, paymentDate);
} }
@@ -210,7 +210,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
tbMember.setInAccount(inAccount); tbMember.setInAccount(inAccount);
tbMemberProjectSubitemMapper.updateById(tbMember); tbMemberProjectSubitemMapper.updateById(tbMember);
sendToStandards(); sendToStandards(tbMember,payPaymentRecord);
}else{ }else{
return Result.error("到账金额大于当前欠款金额,不可提交!"); return Result.error("到账金额大于当前欠款金额,不可提交!");
} }
@@ -238,7 +238,17 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
BigDecimal rAInsert = tbMemberInsert.getAmountReceivable();//应收 BigDecimal rAInsert = tbMemberInsert.getAmountReceivable();//应收
BigDecimal pAInsert = tbMemberInsert.getPaidAmount();//实收 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); BigDecimal debtInsert = rAInsert.subtract(pAInsert);
if(aRInsert.compareTo(debtInsert) != 0){ 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 //获取公钥并使用公钥加密token
Map<String, String> map = authenticationUtils.encryptByRsaPriKey(); Map<String, String> map = authenticationUtils.encryptByRsaPriKey();
@@ -333,6 +343,8 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
paramMap.put("token", map.get("token")); paramMap.put("token", map.get("token"));
paramMap.put("publicKey", map.get("publicKey")); paramMap.put("publicKey", map.get("publicKey"));
paramMap.put("id",tbMember.getTbPaymentId());
paramMap.put("checkMark",payPaymentRecord.getRemark());
String result3= HttpUtil.get(url+"/paymentInfo/incomingPaymentCheck", paramMap); String result3= HttpUtil.get(url+"/paymentInfo/incomingPaymentCheck", paramMap);
} }