Merge remote-tracking branch 'origin/master' into 22年七月工作

# Conflicts:
#	jero-boot-incoming-payment/src/main/java/com/jero/member/entity/TbCertificatePayment.java
#	jero-boot-incoming-payment/src/main/java/com/jero/member/entity/TbMemberProjectSubitem.java
This commit is contained in:
lijiarao
2022-08-08 09:48:50 +08:00
45 changed files with 1535 additions and 197 deletions
+5
View File
@@ -257,4 +257,9 @@ INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `com
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1535559127371321346', '1535558715796852737', '查询', '', NULL, NULL, NULL, 2, 'departmentAllStatistics:search', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-06-11 17:46:40', NULL, NULL, 0, 0, '1', 0); INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1535559127371321346', '1535558715796852737', '查询', '', NULL, NULL, NULL, 2, 'departmentAllStatistics:search', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-06-11 17:46:40', NULL, NULL, 0, 0, '1', 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1535559323643777026', '1535558715796852737', '导出', '', NULL, NULL, NULL, 2, 'departmentAllStatistics:export', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-06-11 17:47:27', NULL, NULL, 0, 0, '1', 0); INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1535559323643777026', '1535558715796852737', '导出', '', NULL, NULL, NULL, 2, 'departmentAllStatistics:export', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-06-11 17:47:27', NULL, NULL, 0, 0, '1', 0);
-- 2022年8月1日 增加全所收入统计模块的sql;增加打包管理模块确认收入按钮的sql
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1553998336251633666', '1553997970898395138', '导出', NULL, NULL, NULL, NULL, 2, 'wholePaymentsStatistics:export', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-08-01 14:57:30', NULL, NULL, 0, 0, '1', 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1553998246489333762', '1553997970898395138', '查询', NULL, NULL, NULL, NULL, 2, 'wholePaymentsStatistics:search', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-08-01 14:57:09', NULL, NULL, 0, 0, '1', 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1553997970898395138', '1437320526513905666', '全所收入统计', '/statisticalReport/WholePaymentsStatistics', 'statisticalReport/WholePaymentsStatistics', NULL, NULL, 1, NULL, '1', 10.00, 0, NULL, 1, 0, 0, 0, NULL, 'LKGLZ', '2022-08-01 14:56:03', NULL, NULL, 0, 0, '1', 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1553987184549404674', '1435493270476906497', '确认收入', NULL, NULL, NULL, NULL, 2, 'packProject:confirmPayment', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-08-01 14:13:11', NULL, NULL, 0, 0, '1', 0);
+198 -21
View File
@@ -20,30 +20,36 @@ select pp.id as projectId,
type, type,
if(billMoney is null, 0, billMoney) as billMoney, if(billMoney is null, 0, billMoney) as billMoney,
confirmAmount, confirmAmount,
invoiceNoTaxAmount,
paidNoTaxAmount,
confirmNoTaxAmount,
contactsName, contactsName,
pp.pack pp.pack
from (SELECT pwgs.id, from (SELECT pwgs.id,
pwg.id as superId, pwg.id as superId,
pwg.working_group_project AS projectName, pwg.working_group_project AS projectName,
pwg.principal_name_a as principalName, pwg.principal_name_a as principalName,
pwgs.charge_company_id AS chargeCompanyId, pwgs.charge_company_id AS chargeCompanyId,
pwgs.charge_company_temporary_id as chargeCompanyTemporaryId, pwgs.charge_company_temporary_id as chargeCompanyTemporaryId,
pwgs.charge_company_temporary_name AS chargeCompanyTemporaryName, pwgs.charge_company_temporary_name AS chargeCompanyTemporaryName,
pwgs.receivable_amount as allMoney, pwgs.receivable_amount as allMoney,
pwgs.paid_amount as comeAllMoney, pwgs.paid_amount as comeAllMoney,
pwgs.charge_use as chargeUse, pwgs.charge_use as chargeUse,
sd.depart_name as depart, sd.depart_name as depart,
pwgs.pack as pack, pwgs.pack as pack,
pwg.year as year, pwg.year as year,
pwgs.in_account as payStatue, pwgs.in_account as payStatue,
su.org_code as departCode, su.org_code as departCode,
sd.id as departId, sd.id as departId,
pwg.principal_id_a as principalNameId, pwg.principal_id_a as principalNameId,
2 as type, 2 as type,
pwgs.invoice_amount AS billMoney, pwgs.invoice_amount AS billMoney,
confirm_amount as confirmAmount, confirm_amount as confirmAmount,
GROUP_CONCAT(pwgsc.contacts_temporary_name) as contactsName, invoice_no_tax_amount as invoiceNoTaxAmount,
pwgs.create_time as createTime paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount,
GROUP_CONCAT(pwgsc.contacts_temporary_name order by pwgsc.contacts_temporary_name) as contactsName,
pwgs.create_time as createTime
FROM pay_working_group pwg FROM pay_working_group pwg
right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id) right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id)
left JOIN sys_user su on (pwg.principal_id_a = su.id) left JOIN sys_user su on (pwg.principal_id_a = su.id)
@@ -71,6 +77,9 @@ from (SELECT pwgs.id,
1 as type, 1 as type,
pcp.invoice_amount AS billMoney, pcp.invoice_amount AS billMoney,
confirm_amount as confirmAmount, confirm_amount as confirmAmount,
invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount,
contacts_temporary_name as contactsName, contacts_temporary_name as contactsName,
pcp.create_time as createTime pcp.create_time as createTime
FROM pay_common_project pcp FROM pay_common_project pcp
@@ -97,6 +106,9 @@ from (SELECT pwgs.id,
4 as type, 4 as type,
pmps.invoice_amount AS billMoney, pmps.invoice_amount AS billMoney,
confirm_amount as confirmAmount, confirm_amount as confirmAmount,
invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount,
company_contact_name as contactsName, company_contact_name as contactsName,
pmps.create_time as createTime pmps.create_time as createTime
FROM pay_member_project pmp FROM pay_member_project pmp
@@ -124,6 +136,9 @@ from (SELECT pwgs.id,
3 as type, 3 as type,
pms.invoice_amount AS billMoney, pms.invoice_amount AS billMoney,
confirm_amount as confirmAmount, confirm_amount as confirmAmount,
invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount,
company_contact_name as contactsName, company_contact_name as contactsName,
pms.create_time as createTime pms.create_time as createTime
FROM pay_meeting pm FROM pay_meeting pm
@@ -151,6 +166,9 @@ from (SELECT pwgs.id,
5 as type, 5 as type,
tmps.invoice_amount AS billMoney, tmps.invoice_amount AS billMoney,
confirm_amount as confirmAmount, confirm_amount as confirmAmount,
invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount,
liaison_man as contactsName, liaison_man as contactsName,
tmps.create_time as createTime tmps.create_time as createTime
FROM tb_member_project tmp FROM tb_member_project tmp
@@ -178,6 +196,9 @@ from (SELECT pwgs.id,
6 as type, 6 as type,
tcp.invoice_amount AS billMoney, tcp.invoice_amount AS billMoney,
confirm_amount as confirmAmount, confirm_amount as confirmAmount,
invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount,
liaison_man as contactsName, liaison_man as contactsName,
tcp.create_time as createTime tcp.create_time as createTime
FROM tb_member_project tmp FROM tb_member_project tmp
@@ -215,3 +236,159 @@ alter table tb_member_project_subitem
add column confirm_amount decimal(12, 2) default 0 null comment '确认金额'; add column confirm_amount decimal(12, 2) default 0 null comment '确认金额';
alter table tb_certificate_payment alter table tb_certificate_payment
add column confirm_amount decimal(12, 2) default 0 null comment '确认金额'; add column confirm_amount decimal(12, 2) default 0 null comment '确认金额';
-- 新增税额和未税金额
alter table pay_payment_record
add column tax decimal(12, 2) default 0 comment '税额',
add column no_tax_amount decimal(12, 2) default 0 comment '未税金额';
alter table pay_mail_bill_project
add column tax decimal(12, 2) default 0 comment '税额',
add column no_tax_amount decimal(12, 2) default 0 comment '未税金额';
alter table pay_confirm_payment_record
add column tax decimal(12, 2) default 0 comment '税额',
add column no_tax_amount decimal(12, 2) default 0 comment '未税金额';
-- 项目增加确认收入状态,税额,未税金额
alter table pay_common_project
add column affirm_income tinyint(1) default 0 comment '确认收入',
add column confirm_no_tax_amount decimal(12, 2) default 0 comment '确认金额未税',
add column confirm_tax decimal(12, 2) default 0 comment '确认金额税额',
add column paid_no_tax_amount decimal(12, 2) default 0 comment '到账金额未税',
add column paid_tax decimal(12, 2) default 0 comment '到账金额税额',
add column invoice_no_tax_amount decimal(12, 2) default 0 comment '开票金额未税',
add column invoice_tax decimal(12, 2) default 0 comment '开票金额税额';
alter table pay_working_group_subitem
add column affirm_income tinyint(1) default 0 comment '确认收入',
add column confirm_no_tax_amount decimal(12, 2) default 0 comment '确认金额未税',
add column confirm_tax decimal(12, 2) default 0 comment '确认金额税额',
add column paid_no_tax_amount decimal(12, 2) default 0 comment '到账金额未税',
add column paid_tax decimal(12, 2) default 0 comment '到账金额税额',
add column invoice_no_tax_amount decimal(12, 2) default 0 comment '开票金额未税',
add column invoice_tax decimal(12, 2) default 0 comment '开票金额税额';
alter table pay_member_project_subitem
add column affirm_income tinyint(1) default 0 comment '确认收入',
add column confirm_no_tax_amount decimal(12, 2) default 0 comment '确认金额未税',
add column confirm_tax decimal(12, 2) default 0 comment '确认金额税额',
add column paid_no_tax_amount decimal(12, 2) default 0 comment '到账金额未税',
add column paid_tax decimal(12, 2) default 0 comment '到账金额税额',
add column invoice_no_tax_amount decimal(12, 2) default 0 comment '开票金额未税',
add column invoice_tax decimal(12, 2) default 0 comment '开票金额税额';
alter table pay_meeting_situation
add column affirm_income tinyint(1) default 0 comment '确认收入',
add column confirm_no_tax_amount decimal(12, 2) default 0 comment '确认金额未税',
add column confirm_tax decimal(12, 2) default 0 comment '确认金额税额',
add column paid_no_tax_amount decimal(12, 2) default 0 comment '到账金额未税',
add column paid_tax decimal(12, 2) default 0 comment '到账金额税额',
add column invoice_no_tax_amount decimal(12, 2) default 0 comment '开票金额未税',
add column invoice_tax decimal(12, 2) default 0 comment '开票金额税额';
alter table tb_member_project_subitem
add column affirm_income tinyint(1) default 0 comment '确认收入',
add column confirm_no_tax_amount decimal(12, 2) default 0 comment '确认金额未税',
add column confirm_tax decimal(12, 2) default 0 comment '确认金额税额',
add column paid_no_tax_amount decimal(12, 2) default 0 comment '到账金额未税',
add column paid_tax decimal(12, 2) default 0 comment '到账金额税额',
add column invoice_no_tax_amount decimal(12, 2) default 0 comment '开票金额未税',
add column invoice_tax decimal(12, 2) default 0 comment '开票金额税额';
alter table tb_certificate_payment
add column affirm_income tinyint(1) default 0 comment '确认收入',
add column confirm_no_tax_amount decimal(12, 2) default 0 comment '确认金额未税',
add column confirm_tax decimal(12, 2) default 0 comment '确认金额税额',
add column paid_no_tax_amount decimal(12, 2) default 0 comment '到账金额未税',
add column paid_tax decimal(12, 2) default 0 comment '到账金额税额',
add column invoice_no_tax_amount decimal(12, 2) default 0 comment '开票金额未税',
add column invoice_tax decimal(12, 2) default 0 comment '开票金额税额';
-- 处理历史数据
update pay_payment_record
set no_tax_amount = amount_received / 1.06,
tax = amount_received - no_tax_amount
where amount_received is not null;
update pay_mail_bill_project
set no_tax_amount = invoice_amount / 1.06,
tax = invoice_amount - no_tax_amount
where invoice_amount is not null;
update pay_confirm_payment_record
set no_tax_amount = amount_received / 1.06,
tax = amount_received - no_tax_amount
where amount_received is not null;
-- 六个项目处理历史数据
update pay_common_project
set confirm_no_tax_amount = confirm_amount / 1.06,
paid_no_tax_amount = paid_amount / 1.06,
invoice_no_tax_amount = invoice_amount / 1.06,
confirm_tax = confirm_amount - confirm_no_tax_amount,
paid_tax = paid_amount - paid_no_tax_amount,
invoice_tax = invoice_amount - invoice_no_tax_amount
where need_invoice != 0;
update pay_working_group_subitem
set confirm_no_tax_amount = confirm_amount / 1.06,
paid_no_tax_amount = paid_amount / 1.06,
invoice_no_tax_amount = invoice_amount / 1.06,
confirm_tax = confirm_amount - confirm_no_tax_amount,
paid_tax = paid_amount - paid_no_tax_amount,
invoice_tax = invoice_amount - invoice_no_tax_amount
where need_invoice != 0;
update pay_member_project_subitem
set confirm_no_tax_amount = confirm_amount / 1.06,
paid_no_tax_amount = paid_amount / 1.06,
invoice_no_tax_amount = invoice_amount / 1.06,
confirm_tax = confirm_amount - confirm_no_tax_amount,
paid_tax = paid_amount - paid_no_tax_amount,
invoice_tax = invoice_amount - invoice_no_tax_amount
where need_invoice != 0;
update pay_meeting_situation
set confirm_no_tax_amount = confirm_amount / 1.06,
paid_no_tax_amount = paid_amount / 1.06,
invoice_no_tax_amount = invoice_amount / 1.06,
confirm_tax = confirm_amount - confirm_no_tax_amount,
paid_tax = paid_amount - paid_no_tax_amount,
invoice_tax = invoice_amount - invoice_no_tax_amount
where need_invoice != 0;
update tb_member_project_subitem
set confirm_no_tax_amount = confirm_amount / 1.06,
paid_no_tax_amount = paid_amount / 1.06,
invoice_no_tax_amount = invoice_amount / 1.06,
confirm_tax = confirm_amount - confirm_no_tax_amount,
paid_tax = paid_amount - paid_no_tax_amount,
invoice_tax = invoice_amount - invoice_no_tax_amount
where invoice_requirements != 0;
update tb_certificate_payment
set confirm_no_tax_amount = confirm_amount / 1.06,
paid_no_tax_amount = paid_amount / 1.06,
invoice_no_tax_amount = invoice_amount / 1.06,
confirm_tax = confirm_amount - confirm_no_tax_amount,
paid_tax = paid_amount - paid_no_tax_amount,
invoice_tax = invoice_amount - invoice_no_tax_amount
where invoice_requirements != 0;
update pay_common_project
set confirm_no_tax_amount = confirm_amount ,
paid_no_tax_amount = paid_amount ,
invoice_no_tax_amount = invoice_amount
where need_invoice = 0;
update pay_working_group_subitem
set confirm_no_tax_amount = confirm_amount,
paid_no_tax_amount = paid_amount,
invoice_no_tax_amount = invoice_amount
where need_invoice = 0;
update pay_member_project_subitem
set confirm_no_tax_amount = confirm_amount ,
paid_no_tax_amount = paid_amount ,
invoice_no_tax_amount = invoice_amount
where need_invoice = 0;
update pay_meeting_situation
set confirm_no_tax_amount = confirm_amount ,
paid_no_tax_amount = paid_amount ,
invoice_no_tax_amount = invoice_amount
where need_invoice = 0;
update tb_member_project_subitem
set confirm_no_tax_amount = confirm_amount ,
paid_no_tax_amount = paid_amount ,
invoice_no_tax_amount = invoice_amount
where invoice_requirements = 0;
update tb_certificate_payment
set confirm_no_tax_amount = confirm_amount ,
paid_no_tax_amount = paid_amount ,
invoice_no_tax_amount = invoice_amount
where invoice_requirements = 0;
select *
from v_statistical;
@@ -3,10 +3,12 @@ package com.jero.mail;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.mail.entity.PayMailBill; import com.jero.mail.entity.PayMailBill;
import com.jero.mail.entity.PayMailBillProject; import com.jero.mail.entity.PayMailBillProject;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import javax.validation.constraints.DecimalMax; import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@@ -28,4 +30,18 @@ public class PayMailBillVO extends PayMailBill {
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "bmpId") @ApiModelProperty(value = "bmpId")
private java.lang.String bmpId; private java.lang.String bmpId;
/**税额*/
@Excel(name = "税额", width = 15)
@ApiModelProperty(value = "税额")
@DecimalMax(value = "9999999999.99",message = "税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal tax;
/**未税金额*/
@Excel(name = "未税金额", width = 15)
@ApiModelProperty(value = "未税金额")
@DecimalMax(value = "9999999999.99",message = "未税金额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal noTaxAmount;
} }
@@ -52,6 +52,20 @@ public class PayMailBillProject implements Serializable {
@DecimalMax(value = "9999999999.99",message = "开票金额格式错误") @DecimalMax(value = "9999999999.99",message = "开票金额格式错误")
@JsonFormat(shape = JsonFormat.Shape.STRING) @JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceAmount; private BigDecimal invoiceAmount;
/**税额*/
@Excel(name = "税额", width = 15)
@ApiModelProperty(value = "税额")
@DecimalMax(value = "9999999999.99",message = "税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal tax;
/**未税金额*/
@Excel(name = "未税金额", width = 15)
@ApiModelProperty(value = "未税金额")
@DecimalMax(value = "9999999999.99",message = "未税金额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal noTaxAmount;
/**备注*/ /**备注*/
@Excel(name = "备注", width = 15) @Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
@@ -45,7 +45,7 @@
</select> </select>
<select id="selectInvoicingStage" resultType="com.jero.mail.PayMailBillVO"> <select id="selectInvoicingStage" resultType="com.jero.mail.PayMailBillVO">
select pmb.id as id,pmbp.id as bmpId,pmb.project_name,pmbp.invoice_amount,pmb.bill_no,pmb.bill_date,pmbp.remark select pmb.id as id,pmbp.id as bmpId,pmb.project_name,pmbp.invoice_amount,pmb.bill_no,pmb.bill_date,pmbp.remark,pmbp.no_tax_amount,pmbp.tax
from pay_mail_bill pmb from pay_mail_bill pmb
inner JOIN pay_mail_bill_project pmbp on pmb.id = pmbp.bill_id inner JOIN pay_mail_bill_project pmbp on pmb.id = pmbp.bill_id
where pmbp.project_id=#{projectId} where pmbp.project_id=#{projectId}
@@ -45,6 +45,7 @@ import com.jero.member.service.ITbCertificatePaymentService;
import com.jero.member.service.ITbMemberProjectService; import com.jero.member.service.ITbMemberProjectService;
import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.service.ISysUserService;
import com.jero.payment.service.IPayPaymentRecordService;
import com.jero.project.entity.PayCommonProject; import com.jero.project.entity.PayCommonProject;
import com.jero.project.entity.PayWorkingGroup; import com.jero.project.entity.PayWorkingGroup;
import com.jero.project.entity.PayWorkingGroupSubItem; import com.jero.project.entity.PayWorkingGroupSubItem;
@@ -62,11 +63,13 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@@ -136,7 +139,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
private ITbCertificatePaymentService certificatePaymentService; private ITbCertificatePaymentService certificatePaymentService;
@Resource @Resource
private IPayWorkingGroupSubItemContactsService payWorkingGroupSubItemContactsService; private IPayWorkingGroupSubItemContactsService payWorkingGroupSubItemContactsService;
@Autowired
private IPayPaymentRecordService payPaymentRecordService;
@Override @Override
public List<PayMailBill> selectMailBillVO(String projectId) { public List<PayMailBill> selectMailBillVO(String projectId) {
@@ -776,6 +780,13 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
invoiceAmount=new BigDecimal("0"); invoiceAmount=new BigDecimal("0");
} }
BigDecimal oldInvoiceAmount;//开票金额 BigDecimal oldInvoiceAmount;//开票金额
BigDecimal noTaxAmount = payMailBillProject.getNoTaxAmount();
BigDecimal tax = payMailBillProject.getTax();
if (noTaxAmount == null || tax == null){
noTaxAmount = invoiceAmount.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
tax = invoiceAmount.subtract(noTaxAmount);
}
payPaymentRecordService.isTax(noTaxAmount,tax,invoiceAmount);
switch (payMailBillProject.getProjectType().toString()) { switch (payMailBillProject.getProjectType().toString()) {
// 普通项目 // 普通项目
@@ -789,6 +800,9 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
} }
//之前开票总额+本次开票金额 //之前开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,payCommonProject.getInvoiceNoTaxAmount());
tax = payPaymentRecordService.addPaidAmount(tax,payCommonProject.getInvoiceTax());
//逗号拼接邮寄信息 //逗号拼接邮寄信息
if(i==0){ if(i==0){
projectName.append(payCommonProject.getChargeProject()); projectName.append(payCommonProject.getChargeProject());
@@ -813,7 +827,9 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
} }
//之前开票总额+本次开票金额 //之前开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,workingGroup.getInvoiceNoTaxAmount());
tax = payPaymentRecordService.addPaidAmount(tax,workingGroup.getInvoiceTax());
//查父表 //查父表
PayWorkingGroup payWorkingGroup = payWorkingGroupMapper.selectById(workingGroup.getWorkingGroupId()); PayWorkingGroup payWorkingGroup = payWorkingGroupMapper.selectById(workingGroup.getWorkingGroupId());
//逗号拼接邮寄信息 //逗号拼接邮寄信息
@@ -840,7 +856,9 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
} }
//之前开票总额+本次开票金额 //之前开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,meeting.getInvoiceNoTaxAmount());
tax = payPaymentRecordService.addPaidAmount(tax,meeting.getInvoiceTax());
//查父表 //查父表
PayMeeting payMeeting = payMeetingMapper.selectById(meeting.getMeetingId()); PayMeeting payMeeting = payMeetingMapper.selectById(meeting.getMeetingId());
LambdaQueryWrapper<SysUser> queryPayMeetingSysUser = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysUser> queryPayMeetingSysUser = new LambdaQueryWrapper<>();
@@ -874,7 +892,9 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
} }
//之前开票总额+本次开票金额 //之前开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,memberProject.getInvoiceNoTaxAmount());
tax = payPaymentRecordService.addPaidAmount(tax,memberProject.getInvoiceTax());
//查父表 //查父表
PayMemberProject payMemberProject = payMemberProjectMapper.selectById(memberProject.getProjectId()); PayMemberProject payMemberProject = payMemberProjectMapper.selectById(memberProject.getProjectId());
LambdaQueryWrapper<SysUser> queryPayMemberProjectSysUser = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysUser> queryPayMemberProjectSysUser = new LambdaQueryWrapper<>();
@@ -908,7 +928,9 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
} }
//之前开票总额+本次开票金额 //之前开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,tbMemberProject.getInvoiceNoTaxAmount());
tax = payPaymentRecordService.addPaidAmount(tax,tbMemberProject.getInvoiceTax());
//查父表 //查父表
TbMemberProject tbProject = tbMemberProjectMapper.selectById(tbMemberProject.getProjectId()); TbMemberProject tbProject = tbMemberProjectMapper.selectById(tbMemberProject.getProjectId());
SysUser queryTbMemberProjectSysUser = sysUserService.getById(tbProject.getDirectorId()); SysUser queryTbMemberProjectSysUser = sysUserService.getById(tbProject.getDirectorId());
@@ -936,7 +958,9 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
} }
//之前开票总额+本次开票金额 //之前开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(invoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,tbMemberCertificate.getInvoiceNoTaxAmount());
tax = payPaymentRecordService.addPaidAmount(tax,tbMemberCertificate.getInvoiceTax());
//查父表 //查父表
TbMemberProject tbProjectCer = tbMemberProjectMapper.selectById(tbMemberCertificate.getProjectId()); TbMemberProject tbProjectCer = tbMemberProjectMapper.selectById(tbMemberCertificate.getProjectId());
SysUser queryTbMemberProjectSysUserCer = sysUserService.getById(tbProjectCer.getDirectorId()); SysUser queryTbMemberProjectSysUserCer = sysUserService.getById(tbProjectCer.getDirectorId());
@@ -988,6 +1012,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newCommon.setId(payMailBillProject.getProjectId()); newCommon.setId(payMailBillProject.getProjectId());
newCommon.setMakeInvoice(makeInvoice); newCommon.setMakeInvoice(makeInvoice);
newCommon.setInvoiceAmount(invoiceAmount); newCommon.setInvoiceAmount(invoiceAmount);
newCommon.setInvoiceNoTaxAmount(noTaxAmount);
newCommon.setInvoiceTax(tax);
payCommonProjectMapper.updateById(newCommon); payCommonProjectMapper.updateById(newCommon);
break; break;
// 工作组项目 // 工作组项目
@@ -996,6 +1022,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newWorkingGroup.setId(payMailBillProject.getProjectId()); newWorkingGroup.setId(payMailBillProject.getProjectId());
newWorkingGroup.setMakeInvoice(makeInvoice); newWorkingGroup.setMakeInvoice(makeInvoice);
newWorkingGroup.setInvoiceAmount(invoiceAmount); newWorkingGroup.setInvoiceAmount(invoiceAmount);
newWorkingGroup.setInvoiceNoTaxAmount(noTaxAmount);
newWorkingGroup.setInvoiceTax(tax);
payWorkingGroupSubItemMapper.updateById(newWorkingGroup); payWorkingGroupSubItemMapper.updateById(newWorkingGroup);
break; break;
//会议项目 //会议项目
@@ -1004,6 +1032,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newMeeting.setId(payMailBillProject.getProjectId()); newMeeting.setId(payMailBillProject.getProjectId());
newMeeting.setMakeInvoice(makeInvoice); newMeeting.setMakeInvoice(makeInvoice);
newMeeting.setInvoiceAmount(invoiceAmount); newMeeting.setInvoiceAmount(invoiceAmount);
newMeeting.setInvoiceNoTaxAmount(noTaxAmount);
newMeeting.setInvoiceTax(tax);
payMeetingSituationMapper.updateById(newMeeting); payMeetingSituationMapper.updateById(newMeeting);
break; break;
//会员项目 //会员项目
@@ -1012,6 +1042,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newMemberProject.setId(payMailBillProject.getProjectId()); newMemberProject.setId(payMailBillProject.getProjectId());
newMemberProject.setMakeInvoice(makeInvoice); newMemberProject.setMakeInvoice(makeInvoice);
newMemberProject.setInvoiceAmount(invoiceAmount); newMemberProject.setInvoiceAmount(invoiceAmount);
newMemberProject.setInvoiceNoTaxAmount(noTaxAmount);
newMemberProject.setInvoiceTax(tax);
payMemberProjectSubitemMapper.updateById(newMemberProject); payMemberProjectSubitemMapper.updateById(newMemberProject);
break; break;
//标协会员 //标协会员
@@ -1020,6 +1052,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newTbMemberProject.setId(payMailBillProject.getProjectId()); newTbMemberProject.setId(payMailBillProject.getProjectId());
newTbMemberProject.setMakeInvoice(makeInvoice); newTbMemberProject.setMakeInvoice(makeInvoice);
newTbMemberProject.setInvoiceAmount(invoiceAmount); newTbMemberProject.setInvoiceAmount(invoiceAmount);
newTbMemberProject.setInvoiceNoTaxAmount(noTaxAmount);
newTbMemberProject.setInvoiceTax(tax);
tbMemberProjectSubitemMapper.updateById(newTbMemberProject); tbMemberProjectSubitemMapper.updateById(newTbMemberProject);
break; break;
//标协证书 //标协证书
@@ -1028,6 +1062,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newCertificate.setId(payMailBillProject.getProjectId()); newCertificate.setId(payMailBillProject.getProjectId());
newCertificate.setMakeInvoice(makeInvoice); newCertificate.setMakeInvoice(makeInvoice);
newCertificate.setInvoiceAmount(invoiceAmount); newCertificate.setInvoiceAmount(invoiceAmount);
newCertificate.setInvoiceNoTaxAmount(noTaxAmount);
newCertificate.setInvoiceTax(tax);
certificatePaymentMapper.updateById(newCertificate); certificatePaymentMapper.updateById(newCertificate);
break; break;
default: default:
@@ -1058,6 +1094,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
payMailBillProject.setId(payMailBillVo.getBmpId()); payMailBillProject.setId(payMailBillVo.getBmpId());
payMailBillProject.setInvoiceAmount(payMailBillVo.getInvoiceAmount()); payMailBillProject.setInvoiceAmount(payMailBillVo.getInvoiceAmount());
payMailBillProject.setRemark(payMailBillVo.getRemark()); payMailBillProject.setRemark(payMailBillVo.getRemark());
payMailBillProject.setNoTaxAmount(payMailBillVo.getNoTaxAmount());
payMailBillProject.setTax(payMailBillVo.getTax());
payMailBillProjectService.updateById(payMailBillProject); payMailBillProjectService.updateById(payMailBillProject);
} }
@@ -1073,6 +1111,18 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
//原始开票总额+本次开票金额 //原始开票总额+本次开票金额
BigDecimal invoiceAmount=new BigDecimal("0"); BigDecimal invoiceAmount=new BigDecimal("0");
BigDecimal thisInvoiceAmount = bm.getInvoiceAmount();
BigDecimal oldNoTaxAmount;
BigDecimal oldTax;
BigDecimal noTaxAmount = bm.getNoTaxAmount();
BigDecimal tax = bm.getTax();
if (noTaxAmount == null || tax == null){
noTaxAmount = thisInvoiceAmount.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
tax = thisInvoiceAmount.subtract(noTaxAmount);
bm.setNoTaxAmount(noTaxAmount);
bm.setTax(tax);
}
payPaymentRecordService.isTax(noTaxAmount,tax,thisInvoiceAmount);
switch (oldBmp.getProjectType().toString()) { switch (oldBmp.getProjectType().toString()) {
// 普通项目 // 普通项目
case PayIncomeContractCommon.PROJECT_TYPE1: case PayIncomeContractCommon.PROJECT_TYPE1:
@@ -1086,7 +1136,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
oldInvoiceAmount= new BigDecimal("0"); oldInvoiceAmount= new BigDecimal("0");
} }
//原始开票总额+本次开票金额 //原始开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(bm.getInvoiceAmount()).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(thisInvoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//开票总额>应收 //开票总额>应收
if(invoiceAmount.compareTo(payCommonProject.getReceivableAmount()) == 1){ if(invoiceAmount.compareTo(payCommonProject.getReceivableAmount()) == 1){
return "开票金额大于当前未开票金额,输入有误!"; return "开票金额大于当前未开票金额,输入有误!";
@@ -1095,6 +1145,12 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
if(!Objects.isNull(payCompanyManagement) && "2".equals(payCompanyManagement.getStatus()) ){ if(!Objects.isNull(payCompanyManagement) && "2".equals(payCompanyManagement.getStatus()) ){
return "企业未审核,需要审核后开票"; return "企业未审核,需要审核后开票";
} }
//之前的税额
oldNoTaxAmount = payCommonProject.getInvoiceNoTaxAmount().subtract(oldBmp.getNoTaxAmount());
oldTax = payCommonProject.getInvoiceTax().subtract(oldBmp.getTax());
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,oldNoTaxAmount);
tax = payPaymentRecordService.addPaidAmount(tax,oldTax);
break; break;
// 工作组项目 // 工作组项目
case PayIncomeContractCommon.PROJECT_TYPE2: case PayIncomeContractCommon.PROJECT_TYPE2:
@@ -1108,7 +1164,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
oldInvoiceAmount= new BigDecimal("0"); oldInvoiceAmount= new BigDecimal("0");
} }
//原始开票总额+本次开票金额 //原始开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(bm.getInvoiceAmount()).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(thisInvoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//开票总额>应收 //开票总额>应收
if(invoiceAmount.compareTo(workingGroup.getReceivableAmount()) == 1){ if(invoiceAmount.compareTo(workingGroup.getReceivableAmount()) == 1){
return "开票金额大于当前未开票金额,输入有误!"; return "开票金额大于当前未开票金额,输入有误!";
@@ -1117,6 +1173,12 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
if(!Objects.isNull(payCompanyManagementWorkingGroup) && "2".equals(payCompanyManagementWorkingGroup.getStatus()) ){ if(!Objects.isNull(payCompanyManagementWorkingGroup) && "2".equals(payCompanyManagementWorkingGroup.getStatus()) ){
return "企业未审核,需要审核后开票"; return "企业未审核,需要审核后开票";
} }
//之前的税额
oldNoTaxAmount = workingGroup.getInvoiceNoTaxAmount().subtract(oldBmp.getNoTaxAmount());
oldTax = workingGroup.getInvoiceTax().subtract(oldBmp.getTax());
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,oldNoTaxAmount);
tax = payPaymentRecordService.addPaidAmount(tax,oldTax);
break; break;
//会议项目 //会议项目
case PayIncomeContractCommon.PROJECT_TYPE3: case PayIncomeContractCommon.PROJECT_TYPE3:
@@ -1130,7 +1192,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
oldInvoiceAmount= new BigDecimal("0"); oldInvoiceAmount= new BigDecimal("0");
} }
//原始开票总额+本次开票金额 //原始开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(bm.getInvoiceAmount()).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(thisInvoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//开票总额>应收 //开票总额>应收
if(invoiceAmount.compareTo(meeting.getAmountReceivable()) == 1){ if(invoiceAmount.compareTo(meeting.getAmountReceivable()) == 1){
return "开票金额大于当前未开票金额,输入有误!"; return "开票金额大于当前未开票金额,输入有误!";
@@ -1139,6 +1201,12 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
if(!Objects.isNull(payCompanyManagementMeeting) && payCompanyManagementMeeting.getStatus()==2 ){ if(!Objects.isNull(payCompanyManagementMeeting) && payCompanyManagementMeeting.getStatus()==2 ){
return "企业未审核,需要审核后开票"; return "企业未审核,需要审核后开票";
} }
//之前的税额
oldNoTaxAmount = meeting.getInvoiceNoTaxAmount().subtract(oldBmp.getNoTaxAmount());
oldTax = meeting.getInvoiceTax().subtract(oldBmp.getTax());
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,oldNoTaxAmount);
tax = payPaymentRecordService.addPaidAmount(tax,oldTax);
break; break;
//会员项目 //会员项目
case PayIncomeContractCommon.PROJECT_TYPE4: case PayIncomeContractCommon.PROJECT_TYPE4:
@@ -1152,7 +1220,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
oldInvoiceAmount= new BigDecimal("0"); oldInvoiceAmount= new BigDecimal("0");
} }
//原始开票总额+本次开票金额 //原始开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(bm.getInvoiceAmount()).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(thisInvoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//开票总额>应收 //开票总额>应收
if(invoiceAmount.compareTo(memberProject.getAmountReceivable()) == 1){ if(invoiceAmount.compareTo(memberProject.getAmountReceivable()) == 1){
return "开票金额大于当前未开票金额,输入有误!"; return "开票金额大于当前未开票金额,输入有误!";
@@ -1161,6 +1229,12 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
if(!Objects.isNull(payCompanyManagementMember) && "2".equals(payCompanyManagementMember.getStatus()) ){ if(!Objects.isNull(payCompanyManagementMember) && "2".equals(payCompanyManagementMember.getStatus()) ){
return "企业未审核,需要审核后开票"; return "企业未审核,需要审核后开票";
} }
//之前的税额
oldNoTaxAmount = memberProject.getInvoiceNoTaxAmount().subtract(oldBmp.getNoTaxAmount());
oldTax = memberProject.getInvoiceTax().subtract(oldBmp.getTax());
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,oldNoTaxAmount);
tax = payPaymentRecordService.addPaidAmount(tax,oldTax);
break; break;
//标协会员 //标协会员
case PayIncomeContractCommon.PROJECT_TYPE5: case PayIncomeContractCommon.PROJECT_TYPE5:
@@ -1174,7 +1248,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
oldInvoiceAmount= new BigDecimal("0"); oldInvoiceAmount= new BigDecimal("0");
} }
//原始开票总额+本次开票金额 //原始开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(bm.getInvoiceAmount()).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(thisInvoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//开票总额!=应收 //开票总额!=应收
if(invoiceAmount.compareTo(tbMemberProject.getAmountReceivable()) != 0){ if(invoiceAmount.compareTo(tbMemberProject.getAmountReceivable()) != 0){
return "开票金额应等于当前未开票金额,输入有误!"; return "开票金额应等于当前未开票金额,输入有误!";
@@ -1183,6 +1257,12 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
if(!Objects.isNull(payCompanyManagementTbMember) && payCompanyManagementTbMember.getStatus()==2 ){ if(!Objects.isNull(payCompanyManagementTbMember) && payCompanyManagementTbMember.getStatus()==2 ){
return "企业未审核,需要审核后开票"; return "企业未审核,需要审核后开票";
} }
//之前的税额
oldNoTaxAmount = tbMemberProject.getInvoiceNoTaxAmount().subtract(oldBmp.getNoTaxAmount());
oldTax = tbMemberProject.getInvoiceTax().subtract(oldBmp.getTax());
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,oldNoTaxAmount);
tax = payPaymentRecordService.addPaidAmount(tax,oldTax);
break; break;
//标协证书 //标协证书
case PayIncomeContractCommon.PROJECT_TYPE6: case PayIncomeContractCommon.PROJECT_TYPE6:
@@ -1196,7 +1276,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
oldInvoiceAmount= new BigDecimal("0"); oldInvoiceAmount= new BigDecimal("0");
} }
//原始开票总额+本次开票金额 //原始开票总额+本次开票金额
invoiceAmount = oldInvoiceAmount.add(bm.getInvoiceAmount()).setScale(2, BigDecimal.ROUND_HALF_UP); invoiceAmount = oldInvoiceAmount.add(thisInvoiceAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
//开票总额!=应收 //开票总额!=应收
if(invoiceAmount.compareTo(tbMemberCertificate.getAmountReceivable()) != 0){ if(invoiceAmount.compareTo(tbMemberCertificate.getAmountReceivable()) != 0){
return "开票金额应等于当前未开票金额,输入有误!"; return "开票金额应等于当前未开票金额,输入有误!";
@@ -1205,6 +1285,12 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
if(!Objects.isNull(payCompanyManagementTbMemberCer) && payCompanyManagementTbMemberCer.getStatus()==2 ){ if(!Objects.isNull(payCompanyManagementTbMemberCer) && payCompanyManagementTbMemberCer.getStatus()==2 ){
return "企业未审核,需要审核后开票"; return "企业未审核,需要审核后开票";
} }
//之前的税额
oldNoTaxAmount = tbMemberCertificate.getInvoiceNoTaxAmount().subtract(oldBmp.getNoTaxAmount());
oldTax = tbMemberCertificate.getInvoiceTax().subtract(oldBmp.getTax());
//税额
noTaxAmount = payPaymentRecordService.addPaidAmount(noTaxAmount,oldNoTaxAmount);
tax = payPaymentRecordService.addPaidAmount(tax,oldTax);
break; break;
default: default:
break; break;
@@ -1240,6 +1326,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newCommon.setId(oldBmp.getProjectId()); newCommon.setId(oldBmp.getProjectId());
newCommon.setMakeInvoice(makeInvoice); newCommon.setMakeInvoice(makeInvoice);
newCommon.setInvoiceAmount(invoiceAmount); newCommon.setInvoiceAmount(invoiceAmount);
newCommon.setInvoiceNoTaxAmount(noTaxAmount);
newCommon.setInvoiceTax(tax);
payCommonProjectMapper.updateById(newCommon); payCommonProjectMapper.updateById(newCommon);
break; break;
// 工作组项目 // 工作组项目
@@ -1248,6 +1336,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newWorkingGroup.setId(oldBmp.getProjectId()); newWorkingGroup.setId(oldBmp.getProjectId());
newWorkingGroup.setMakeInvoice(makeInvoice); newWorkingGroup.setMakeInvoice(makeInvoice);
newWorkingGroup.setInvoiceAmount(invoiceAmount); newWorkingGroup.setInvoiceAmount(invoiceAmount);
newWorkingGroup.setInvoiceNoTaxAmount(noTaxAmount);
newWorkingGroup.setInvoiceTax(tax);
payWorkingGroupSubItemMapper.updateById(newWorkingGroup); payWorkingGroupSubItemMapper.updateById(newWorkingGroup);
break; break;
//会议项目 //会议项目
@@ -1256,6 +1346,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newMeeting.setId(oldBmp.getProjectId()); newMeeting.setId(oldBmp.getProjectId());
newMeeting.setMakeInvoice(makeInvoice); newMeeting.setMakeInvoice(makeInvoice);
newMeeting.setInvoiceAmount(invoiceAmount); newMeeting.setInvoiceAmount(invoiceAmount);
newMeeting.setInvoiceNoTaxAmount(noTaxAmount);
newMeeting.setInvoiceTax(tax);
payMeetingSituationMapper.updateById(newMeeting); payMeetingSituationMapper.updateById(newMeeting);
break; break;
//会员项目 //会员项目
@@ -1264,8 +1356,30 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
newMemberProject.setId(oldBmp.getProjectId()); newMemberProject.setId(oldBmp.getProjectId());
newMemberProject.setMakeInvoice(makeInvoice); newMemberProject.setMakeInvoice(makeInvoice);
newMemberProject.setInvoiceAmount(invoiceAmount); newMemberProject.setInvoiceAmount(invoiceAmount);
newMemberProject.setInvoiceNoTaxAmount(noTaxAmount);
newMemberProject.setInvoiceTax(tax);
payMemberProjectSubitemMapper.updateById(newMemberProject); payMemberProjectSubitemMapper.updateById(newMemberProject);
break; break;
//标协会员
case PayIncomeContractCommon.PROJECT_TYPE5:
TbMemberProjectSubitem newTbMemberProject = new TbMemberProjectSubitem();
newTbMemberProject.setId(oldBmp.getProjectId());
newTbMemberProject.setMakeInvoice(makeInvoice);
newTbMemberProject.setInvoiceAmount(invoiceAmount);
newTbMemberProject.setInvoiceNoTaxAmount(noTaxAmount);
newTbMemberProject.setInvoiceTax(tax);
tbMemberProjectSubitemMapper.updateById(newTbMemberProject);
break;
//标协证书
case PayIncomeContractCommon.PROJECT_TYPE6:
TbCertificatePayment newCertificate = new TbCertificatePayment();
newCertificate.setId(oldBmp.getProjectId());
newCertificate.setMakeInvoice(makeInvoice);
newCertificate.setInvoiceAmount(invoiceAmount);
newCertificate.setInvoiceNoTaxAmount(noTaxAmount);
newCertificate.setInvoiceTax(tax);
certificatePaymentMapper.updateById(newCertificate);
break;
default: default:
break; break;
} }
@@ -460,4 +460,44 @@ public class PayMeetingSituation implements Serializable {
@TableField(exist = false) @TableField(exist = false)
@Dict(dicCode = "sign_up_status") @Dict(dicCode = "sign_up_status")
private Integer signUpStatus; private Integer signUpStatus;
@ApiModelProperty(value = "确认收入((1:全额(对勾),0:0(X),2:>0 && <总金额(半满标志)))")
private Integer affirmIncome;
/**确认金额税额*/
@ApiModelProperty(value = "确认金额税额")
@DecimalMax(value = "9999999999.99",message = "确认金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmTax;
/**确认金额未税*/
@ApiModelProperty(value = "确认金额未税")
@DecimalMax(value = "9999999999.99",message = "确认金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmNoTaxAmount;
/**到账金额税额*/
@ApiModelProperty(value = "到账金额税额")
@DecimalMax(value = "9999999999.99",message = "到账金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidTax;
/**到账金额未税*/
@ApiModelProperty(value = "到账金额未税")
@DecimalMax(value = "9999999999.99",message = "到账金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidNoTaxAmount;
/**开票金额税额*/
@ApiModelProperty(value = "开票金额税额")
@DecimalMax(value = "9999999999.99",message = "开票金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceTax;
/**开票金额未税*/
@ApiModelProperty(value = "开票金额未税")
@DecimalMax(value = "9999999999.99",message = "开票金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceNoTaxAmount;
} }
@@ -482,10 +482,10 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
if (!registerCheckResult.equals(MeetingSubitemCommon.SIGNUP_STATUS_1)) { if (!registerCheckResult.equals(MeetingSubitemCommon.SIGNUP_STATUS_1)) {
throw new JeroBootException("报名信息未审核通过"); throw new JeroBootException("报名信息未审核通过");
} }
String paymentRecord = payMeetingSituation.getPaymentRecord(); //String paymentRecord = payMeetingSituation.getPaymentRecord();
if (StrUtil.isBlank(paymentRecord)) { //if (StrUtil.isBlank(paymentRecord)) {
throw new JeroBootException("缴费凭证为空不能审核"); // throw new JeroBootException("缴费凭证为空不能审核");
} //}
Integer oldCheckResult = payMeetingSituation.getCheckResult(); Integer oldCheckResult = payMeetingSituation.getCheckResult();
if (oldCheckResult.equals(MeetingSubitemCommon.SIGNUP_STATUS_1)) { if (oldCheckResult.equals(MeetingSubitemCommon.SIGNUP_STATUS_1)) {
throw new JeroBootException("审核通过之后就无法在审核"); throw new JeroBootException("审核通过之后就无法在审核");
@@ -496,6 +496,10 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
Integer registerProcess = payMeetingSituation.getRegisterProcess(); Integer registerProcess = payMeetingSituation.getRegisterProcess();
if (checkResult.equals(MeetingSubitemCommon.SIGNUP_STATUS_2)) { if (checkResult.equals(MeetingSubitemCommon.SIGNUP_STATUS_2)) {
payMeetingSituation.setCheckRemark(checkRemark); payMeetingSituation.setCheckRemark(checkRemark);
if (Objects.equals(registerProcess,3)||Objects.equals(registerProcess,8)){
throw new JeroBootException("提前审核无法驳回");
}
if (Objects.equals(registerProcess,4)){ if (Objects.equals(registerProcess,4)){
payMeetingSituation.setRegisterProcess(MeetingSubitemCommon.REGISTER_PROCESS_5); payMeetingSituation.setRegisterProcess(MeetingSubitemCommon.REGISTER_PROCESS_5);
}else if (Objects.equals(registerProcess,9)){ }else if (Objects.equals(registerProcess,9)){
@@ -510,9 +514,9 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
//payMeetingSituation.setInAccount(PayProjectCommon.YES); //payMeetingSituation.setInAccount(PayProjectCommon.YES);
//设置实收金额 //设置实收金额
//payMeetingSituation.setPaidAmount(payMeetingSituation.getAmountReceivable()); //payMeetingSituation.setPaidAmount(payMeetingSituation.getAmountReceivable());
if (Objects.equals(registerProcess,4)||Objects.equals(registerProcess,5)){ if (Objects.equals(registerProcess,3)||Objects.equals(registerProcess,4)||Objects.equals(registerProcess,5)){
payMeetingSituation.setRegisterProcess(MeetingSubitemCommon.REGISTER_PROCESS_6); payMeetingSituation.setRegisterProcess(MeetingSubitemCommon.REGISTER_PROCESS_6);
}else if (Objects.equals(registerProcess,9)||Objects.equals(registerProcess,10)){ }else if (Objects.equals(registerProcess,8)||Objects.equals(registerProcess,9)||Objects.equals(registerProcess,10)){
payMeetingSituation.setRegisterProcess(MeetingSubitemCommon.REGISTER_PROCESS_11); payMeetingSituation.setRegisterProcess(MeetingSubitemCommon.REGISTER_PROCESS_11);
} }
payMeetingSituation.setPaymentStatus(PaymentStatusEnum.COMPLETED.getCode()); payMeetingSituation.setPaymentStatus(PaymentStatusEnum.COMPLETED.getCode());
@@ -1,9 +1,13 @@
package com.jero.meeting.vo.excel; package com.jero.meeting.vo.excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import java.math.BigDecimal;
/** /**
* @author liJiaRao * @author liJiaRao
* @date 2021-09-22 15:40 * @date 2021-09-22 15:40
@@ -64,6 +68,12 @@ public class StandardsSituationExcel extends SituationBaseExcel {
@Excel(name = "邮编", width = 15) @Excel(name = "邮编", width = 15)
private String postCode; private String postCode;
/**
* 应收金额
*/
@Excel(name = "应收金额", width = 15)
private BigDecimal amountReceivable;
/**缴费方式*/ /**缴费方式*/
@Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type") @Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type")
private Integer payMode; private Integer payMode;
@@ -297,4 +297,42 @@ public class PayMemberProjectSubitem implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String email; private String email;
@ApiModelProperty(value = "确认收入((1:全额(对勾),0:0(X),2:>0 && <总金额(半满标志)))")
private Integer affirmIncome;
/**确认金额税额*/
@ApiModelProperty(value = "确认金额税额")
@DecimalMax(value = "9999999999.99",message = "确认金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmTax;
/**确认金额未税*/
@ApiModelProperty(value = "确认金额未税")
@DecimalMax(value = "9999999999.99",message = "确认金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmNoTaxAmount;
/**到账金额税额*/
@ApiModelProperty(value = "到账金额税额")
@DecimalMax(value = "9999999999.99",message = "到账金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidTax;
/**到账金额未税*/
@ApiModelProperty(value = "到账金额未税")
@DecimalMax(value = "9999999999.99",message = "到账金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidNoTaxAmount;
/**开票金额税额*/
@ApiModelProperty(value = "开票金额税额")
@DecimalMax(value = "9999999999.99",message = "开票金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceTax;
/**开票金额未税*/
@ApiModelProperty(value = "开票金额未税")
@DecimalMax(value = "9999999999.99",message = "开票金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceNoTaxAmount;
} }
@@ -286,6 +286,45 @@ public class TbCertificatePayment implements Serializable {
@ApiModelProperty(value = "银行账户") @ApiModelProperty(value = "银行账户")
private String bankAccount; private String bankAccount;
@ApiModelProperty(value = "确认收入((1:全额(对勾),0:0(X),2:>0 && <总金额(半满标志)))")
private Integer affirmIncome;
/**确认金额税额*/
@ApiModelProperty(value = "确认金额税额")
@DecimalMax(value = "9999999999.99",message = "确认金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmTax;
/**确认金额未税*/
@ApiModelProperty(value = "确认金额未税")
@DecimalMax(value = "9999999999.99",message = "确认金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmNoTaxAmount;
/**到账金额税额*/
@ApiModelProperty(value = "到账金额税额")
@DecimalMax(value = "9999999999.99",message = "到账金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidTax;
/**到账金额未税*/
@ApiModelProperty(value = "到账金额未税")
@DecimalMax(value = "9999999999.99",message = "到账金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidNoTaxAmount;
/**开票金额税额*/
@ApiModelProperty(value = "开票金额税额")
@DecimalMax(value = "9999999999.99",message = "开票金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceTax;
/**开票金额未税*/
@ApiModelProperty(value = "开票金额未税")
@DecimalMax(value = "9999999999.99",message = "开票金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceNoTaxAmount;
/**会员缴费金额*/ /**会员缴费金额*/
@ApiModelProperty(value = "会员缴费金额") @ApiModelProperty(value = "会员缴费金额")
private BigDecimal memberPaymentAmount; private BigDecimal memberPaymentAmount;
@@ -295,5 +334,4 @@ public class TbCertificatePayment implements Serializable {
/**其他缴费金额*/ /**其他缴费金额*/
@ApiModelProperty(value = "其他缴费金额") @ApiModelProperty(value = "其他缴费金额")
private BigDecimal otherPaymentAmount; private BigDecimal otherPaymentAmount;
} }
@@ -258,6 +258,47 @@ public class TbMemberProjectSubitem implements Serializable {
/**入会申请表文件id*/ /**入会申请表文件id*/
@ApiModelProperty(value = "银行账户") @ApiModelProperty(value = "银行账户")
private String bankAccount; private String bankAccount;
@ApiModelProperty(value = "确认收入((1:全额(对勾),0:0(X),2:>0 && <总金额(半满标志)))")
private Integer affirmIncome;
/**确认金额税额*/
@ApiModelProperty(value = "确认金额税额")
@DecimalMax(value = "9999999999.99",message = "确认金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmTax;
/**确认金额未税*/
@ApiModelProperty(value = "确认金额未税")
@DecimalMax(value = "9999999999.99",message = "确认金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmNoTaxAmount;
/**到账金额税额*/
@ApiModelProperty(value = "到账金额税额")
@DecimalMax(value = "9999999999.99",message = "到账金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidTax;
/**到账金额未税*/
@ApiModelProperty(value = "到账金额未税")
@DecimalMax(value = "9999999999.99",message = "到账金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidNoTaxAmount;
/**开票金额税额*/
@ApiModelProperty(value = "开票金额税额")
@DecimalMax(value = "9999999999.99",message = "开票金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceTax;
/**开票金额未税*/
@ApiModelProperty(value = "开票金额未税")
@DecimalMax(value = "9999999999.99",message = "开票金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceNoTaxAmount;
/**会员缴费金额*/ /**会员缴费金额*/
@ApiModelProperty(value = "会员缴费金额") @ApiModelProperty(value = "会员缴费金额")
private BigDecimal memberPaymentAmount; private BigDecimal memberPaymentAmount;
@@ -124,6 +124,16 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
return Result.OK(); return Result.OK();
} }
/**
* 更新所有确认收入状态
*/
@ApiOperation(value="-更新所有确认收入状态")
@GetMapping(value = "/updateAffirmIncome")
public Result<?> updateAffirmIncome() {
payConfirmPaymentRecordService.updateAffirmIncome();
return Result.OK();
}
/** /**
* 导出excel * 导出excel
*/ */
@@ -102,12 +102,7 @@ public class PayPaymentCheckController extends JeroController<PayPaymentRecordSu
@PostMapping(value = "/check") @PostMapping(value = "/check")
@RequiresPermissions("incomePaymentAndInvoiving:audit") @RequiresPermissions("incomePaymentAndInvoiving:audit")
public Result<?> check(@RequestBody PayPaymentRecord payPaymentRecord) { public Result<?> check(@RequestBody PayPaymentRecord payPaymentRecord) {
try{ payPaymentCheckService.check(payPaymentRecord);
payPaymentCheckService.check(payPaymentRecord);
}catch (Exception e){
log.error("审核异常",e);
return Result.error(e.getMessage());
}
return Result.OK("操作成功"); return Result.OK("操作成功");
} }
@@ -18,13 +18,10 @@ import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
* *确认来款记录表
*@author liJiaRao *@author liJiaRao
*@date 2022-06-08 17:22 *@date 2022-06-08 17:22
*/ */
/**
* 确认来款记录表
*/
@ApiModel(value="确认来款记录表") @ApiModel(value="确认来款记录表")
@Data @Data
@TableName(value = "pay_confirm_payment_record") @TableName(value = "pay_confirm_payment_record")
@@ -108,6 +105,19 @@ public class PayConfirmPaymentRecord implements Serializable {
@ApiModelProperty(value="备注") @ApiModelProperty(value="备注")
private String remark; private String remark;
/**税额*/
@ApiModelProperty(value = "税额")
@DecimalMax(value = "9999999999.99",message = "税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal tax;
/**未税金额*/
@ApiModelProperty(value = "未税金额")
@DecimalMax(value = "9999999999.99",message = "未税金额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal noTaxAmount;
public static final String COL_ID = "id"; public static final String COL_ID = "id";
public static final String COL_CREATE_BY = "create_by"; public static final String COL_CREATE_BY = "create_by";
@@ -115,4 +115,16 @@ public class PayPaymentRecord implements Serializable {
@Dict(dicCode = "meeting_pay_type") @Dict(dicCode = "meeting_pay_type")
@TableField(exist = false) @TableField(exist = false)
private Integer paymentMethod; private Integer paymentMethod;
/**税额*/
@ApiModelProperty(value = "税额")
@DecimalMax(value = "9999999999.99",message = "税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal tax;
/**未税金额*/
@ApiModelProperty(value = "未税金额")
@DecimalMax(value = "9999999999.99",message = "未税金额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal noTaxAmount;
} }
@@ -1,11 +1,21 @@
package com.jero.payment.mapper; package com.jero.payment.mapper;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.member.entity.TbCertificatePayment;
import com.jero.payment.entity.PayConfirmPaymentRecord; import com.jero.payment.entity.PayConfirmPaymentRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author liJiaRao * @author liJiaRao
* @date 2022-06-08 17:24 * @date 2022-06-08 17:24
*/ */
public interface PayConfirmPaymentRecordMapper extends BaseMapper<PayConfirmPaymentRecord> { public interface PayConfirmPaymentRecordMapper extends BaseMapper<PayConfirmPaymentRecord> {
List<PayConfirmPaymentRecord> selectByProjectId(@Param("projectId")String projectId);
PayConfirmPaymentRecord selectOneByProjectIdAndProjectType(@Param("projectId")String projectId,@Param("projectType")String projectType);
int updateZeroTaxByProjectId(@Param("projectId")String projectId);
} }
@@ -1,11 +1,11 @@
package com.jero.payment.mapper; package com.jero.payment.mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.payment.entity.PayPaymentRecord; import com.jero.payment.entity.PayPaymentRecord;
import com.jero.project.entity.PayCommonProject; import com.jero.project.entity.PayCommonProject;
import com.jero.project.vo.PayCommonProjectOutput; import com.jero.project.vo.PayCommonProjectOutput;
import io.lettuce.core.dynamic.annotation.Param;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
@@ -61,4 +61,8 @@ public interface PayPaymentRecordMapper extends BaseMapper<PayPaymentRecord> {
* @Exception * @Exception
*/ */
Integer getMonthProjectCount(String time); Integer getMonthProjectCount(String time);
int updateZeroTaxByProjectId(@Param("projectId")String projectId);
} }
@@ -10,12 +10,42 @@
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" /> <result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="project_type" jdbcType="VARCHAR" property="projectType" />
<result column="amount_received" jdbcType="DECIMAL" property="amountReceived" /> <result column="amount_received" jdbcType="DECIMAL" property="amountReceived" />
<result column="payment_date" jdbcType="DATE" property="paymentDate" /> <result column="payment_date" jdbcType="DATE" property="paymentDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, create_by, create_time, update_by, update_time, project_id, amount_received, id, create_by, create_time, update_by, update_time, project_id, amount_received,project_type,
payment_date payment_date
</sql> </sql>
<!--auto generated by MybatisCodeHelper on 2022-08-02-->
<select id="selectByProjectId" resultMap="BaseResultMap">
select sum(amount_received) as amount_received,
sum(tax) as tax,
sum(no_tax_amount) as no_tax_amount
from pay_confirm_payment_record
where project_id = #{projectId,jdbcType=VARCHAR}
group by project_id
</select>
<!--auto generated by MybatisCodeHelper on 2022-08-02-->
<select id="selectOneByProjectIdAndProjectType" resultMap="BaseResultMap">
select sum(amount_received) as amount_received,
sum(tax) as tax,
sum(no_tax_amount) as no_tax_amount
from pay_confirm_payment_record
where project_id = #{projectId,jdbcType=VARCHAR}
and project_type = #{projectType}
group by project_id
</select>
<!--auto generated by MybatisCodeHelper on 2022-08-03-->
<update id="updateZeroTaxByProjectId">
update pay_confirm_payment_record
set no_tax_amount = amount_received,
tax = 0
where project_id = #{projectId,jdbcType=VARCHAR}
</update>
</mapper> </mapper>
@@ -3,13 +3,55 @@
<mapper namespace="com.jero.payment.mapper.PayPaymentRecordMapper"> <mapper namespace="com.jero.payment.mapper.PayPaymentRecordMapper">
<!-- 到账开票主列表--> <!-- 到账开票主列表-->
<sql id="Base_Column_List">
id,
project_id,
project_type,
amount_received,
payment_date,
proof,
remark,
create_by,
create_time,
update_by,
update_time,
applicant_name,
payment_status,
reviewer_id,
reviewer_name,
review_time,
review_instructions,
tax,
no_tax_amount
</sql>
<resultMap id="BaseResultMap" type="com.jero.payment.entity.PayPaymentRecord">
<result column="id" property="id"/>
<result column="project_id" property="projectId"/>
<result column="project_type" property="projectType"/>
<result column="amount_received" property="amountReceived"/>
<result column="payment_date" property="paymentDate"/>
<result column="proof" property="proof"/>
<result column="remark" property="remark"/>
<result column="create_by" property="createBy"/>
<result column="create_time" property="createTime"/>
<result column="update_by" property="updateBy"/>
<result column="update_time" property="updateTime"/>
<result column="applicant_name" property="applicantName"/>
<result column="payment_status" property="paymentStatus"/>
<result column="reviewer_id" property="reviewerId"/>
<result column="reviewer_name" property="reviewerName"/>
<result column="review_time" property="reviewTime"/>
<result column="review_instructions" property="reviewInstructions"/>
<result column="tax" property="tax"/>
<result column="no_tax_amount" property="noTaxAmount"/>
</resultMap>
<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_id,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,p.projectType, select p.id,p.charge_project, p.charge_use, p.principal_id,p.principal_name,p.charge_company_id,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,p.projectType,
p.invoice_amount,p.mail_contacts_id,p.register_check_result,p.contacts_temporary_name,p.payment_status,p.charge_company_temporary_id,p.confirm_amount p.invoice_amount,p.mail_contacts_id,p.register_check_result,p.contacts_temporary_name,p.payment_status,p.charge_company_temporary_id,p.confirm_amount,p.affirm_income
from from
(<!-- 普通项目--> (<!-- 普通项目-->
select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as principal_name,c.charge_company_id,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,su.realname as principal_name,c.charge_company_id,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,
c.invoice_amount,c.mail_contacts_id,'' as register_check_result,c.contacts_temporary_name,c.payment_status,c.charge_company_temporary_id,c.confirm_amount c.invoice_amount,c.mail_contacts_id,'' as register_check_result,c.contacts_temporary_name,c.payment_status,c.charge_company_temporary_id,c.confirm_amount,c.affirm_income
from pay_common_project c from pay_common_project c
left join sys_user su on c.principal_id = su.id left join sys_user su on c.principal_id = su.id
where where
@@ -40,7 +82,7 @@
<!--工作组项目--> <!--工作组项目-->
UNION ALL UNION ALL
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.charge_company_id,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2, select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.charge_company_id,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,
gsub.invoice_amount,gsub.mail_contacts_id,'' as register_check_result,gsubc.contacts_temporary_name as contacts_temporary_name_one,gsub.payment_status,gsub.charge_company_temporary_id,gsub.confirm_amount gsub.invoice_amount,gsub.mail_contacts_id,'' as register_check_result,gsubc.contacts_temporary_name as contacts_temporary_name_one,gsub.payment_status,gsub.charge_company_temporary_id,gsub.confirm_amount,gsub.affirm_income
from pay_working_group g from pay_working_group g
left join sys_user su on g.principal_id_a = su.id left join sys_user su on g.principal_id_a = su.id
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
@@ -73,7 +115,7 @@
<!-- 会议项目--> <!-- 会议项目-->
UNION ALL UNION ALL
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_id,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3, select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_id,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,
sit.invoice_amount,sit.post_contact_id,sit.register_check_result,sit.company_contact_name,sit.payment_status,sit.company_id,sit.confirm_amount sit.invoice_amount,sit.post_contact_id,sit.register_check_result,sit.company_contact_name,sit.payment_status,sit.company_id,sit.confirm_amount,sit.affirm_income
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
left join sys_user su on su.id = meeting.director_id left join sys_user su on su.id = meeting.director_id
@@ -105,7 +147,7 @@
<!-- 会员项目--> <!-- 会员项目-->
UNION ALL UNION ALL
select msub.id,pmp.project_name,msub.charge_use,pmp.director_id,su.realname,msub.company_id,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4, select msub.id,pmp.project_name,msub.charge_use,pmp.director_id,su.realname,msub.company_id,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,
msub.invoice_amount,msub.post_contact_id,'' as register_check_result,msub.company_contact_name,msub.payment_status,msub.company_temporary_id,msub.confirm_amount msub.invoice_amount,msub.post_contact_id,'' as register_check_result,msub.company_contact_name,msub.payment_status,msub.company_temporary_id,msub.confirm_amount,msub.affirm_income
from pay_member_project pmp from pay_member_project pmp
inner join pay_member_project_subitem msub on pmp.id=msub.project_id inner join pay_member_project_subitem msub on pmp.id=msub.project_id
left join sys_user su on su.id = pmp.director_id left join sys_user su on su.id = pmp.director_id
@@ -137,7 +179,7 @@
<!-- 标协会员项目--> <!-- 标协会员项目-->
UNION ALL UNION ALL
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,tmsub.company_id,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,tmember.director_id,su.realname,tmsub.company_id,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,
tmsub.invoice_amount,tmsub.liaison_man_id,'' as register_check_result,tmsub.liaison_man,tmsub.payment_status,tmsub.company_id,tmsub.confirm_amount tmsub.invoice_amount,tmsub.liaison_man_id,'' as register_check_result,tmsub.liaison_man,tmsub.payment_status,tmsub.company_id,tmsub.confirm_amount,tmsub.affirm_income
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
left join sys_user su on su.id = tmember.director_id left join sys_user su on su.id = tmember.director_id
@@ -169,7 +211,7 @@
<!-- 标协证书项目--> <!-- 标协证书项目-->
UNION ALL UNION ALL
select tcp.id,tmember.project_name,tcp.charge_use,tmember.director_id,su.realname,tcp.company_id,tcp.company_name,tcp.amount_receivable,tcp.paid_amount,tcp.invoice_requirements,tcp.pack,tcp.in_account,tcp.make_invoice,tcp.mail,tcp.create_time,6, select tcp.id,tmember.project_name,tcp.charge_use,tmember.director_id,su.realname,tcp.company_id,tcp.company_name,tcp.amount_receivable,tcp.paid_amount,tcp.invoice_requirements,tcp.pack,tcp.in_account,tcp.make_invoice,tcp.mail,tcp.create_time,6,
tcp.invoice_amount,tcp.liaison_man_id,'' as register_check_result,tcp.liaison_man,tcp.payment_status,tcp.company_id,tcp.confirm_amount tcp.invoice_amount,tcp.liaison_man_id,'' as register_check_result,tcp.liaison_man,tcp.payment_status,tcp.company_id,tcp.confirm_amount,tcp.affirm_income
from tb_member_project tmember from tb_member_project tmember
inner join tb_certificate_payment tcp on tmember.id=tcp.project_id inner join tb_certificate_payment tcp on tmember.id=tcp.project_id
left join sys_user su on su.id = tmember.director_id left join sys_user su on su.id = tmember.director_id
@@ -222,10 +264,12 @@
<!-- 到账开票导出--> <!-- 到账开票导出-->
<select id="mainListExportXls" resultType="com.jero.project.vo.PayCommonProjectOutput"> <select id="mainListExportXls" resultType="com.jero.project.vo.PayCommonProjectOutput">
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,p.projectType,p.charge_company_temporary_id 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,p.projectType,p.charge_company_temporary_id,
p.confirm_amount
from from
(<!-- 普通项目--> (<!-- 普通项目-->
select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as 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,c.charge_company_temporary_id select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as 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,c.charge_company_temporary_id
,c.confirm_amount
from pay_common_project c from pay_common_project c
left join sys_user su on c.principal_id = su.id left join sys_user su on c.principal_id = su.id
where where
@@ -255,7 +299,8 @@
</if> </if>
<!--工作组项目--> <!--工作组项目-->
UNION ALL UNION ALL
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,gsub.charge_company_temporary_id select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,gsub.charge_company_temporary_id,
gsub.confirm_amount
from pay_working_group g from pay_working_group g
left join sys_user su on g.principal_id_a = su.id left join sys_user su on g.principal_id_a = su.id
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
@@ -286,7 +331,8 @@
</if> </if>
<!-- 会议项目--> <!-- 会议项目-->
UNION ALL UNION ALL
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,sit.company_id select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,sit.company_id,
sit.confirm_amount
from pay_meeting meeting from pay_meeting meeting
left join sys_user su on meeting.director_id = su.id left join sys_user su on meeting.director_id = su.id
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
@@ -317,7 +363,8 @@
</if> </if>
<!-- 会员项目--> <!-- 会员项目-->
UNION ALL UNION ALL
select msub.id,member.project_name,msub.charge_use,member.director_id,su.realname,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,msub.company_temporary_id select msub.id,member.project_name,msub.charge_use,member.director_id,su.realname,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,msub.company_temporary_id,
msub.confirm_amount
from pay_member_project member from pay_member_project member
left join sys_user su on member.director_id = su.id left join sys_user su on member.director_id = su.id
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
@@ -348,7 +395,8 @@
</if> </if>
<!-- 标协会员项目--> <!-- 标协会员项目-->
UNION ALL UNION ALL
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,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,tmsub.company_id select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,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,tmsub.company_id,
tmsub.confirm_amount
from tb_member_project tmember from tb_member_project tmember
left join sys_user su on tmember.director_id = su.id left join sys_user su on tmember.director_id = su.id
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
@@ -379,7 +427,8 @@
</if> </if>
<!-- 标协证书项目--> <!-- 标协证书项目-->
UNION ALL UNION ALL
select tcp.id,tmember.project_name,tcp.charge_use,tmember.director_id,su.realname,tcp.company_name,tcp.amount_receivable,tcp.paid_amount,tcp.invoice_requirements,tcp.pack,tcp.in_account,tcp.make_invoice,tcp.mail,tcp.create_time,6,tcp.company_id select tcp.id,tmember.project_name,tcp.charge_use,tmember.director_id,su.realname,tcp.company_name,tcp.amount_receivable,tcp.paid_amount,tcp.invoice_requirements,tcp.pack,tcp.in_account,tcp.make_invoice,tcp.mail,tcp.create_time,6,tcp.company_id,
tcp.confirm_amount
from tb_member_project tmember from tb_member_project tmember
inner join tb_certificate_payment tcp on tmember.id=tcp.project_id inner join tb_certificate_payment tcp on tmember.id=tcp.project_id
left join sys_user su on su.id = tmember.director_id left join sys_user su on su.id = tmember.director_id
@@ -426,4 +475,12 @@
<select id="getMonthProjectCount" resultType="java.lang.Integer"> <select id="getMonthProjectCount" resultType="java.lang.Integer">
select count(*) from (select * from pay_payment_record WHERE DATE_FORMAT(payment_date,'%Y-%m') = #{time} group by project_id) aa select count(*) from (select * from pay_payment_record WHERE DATE_FORMAT(payment_date,'%Y-%m') = #{time} group by project_id) aa
</select> </select>
<!--auto generated by MybatisCodeHelper on 2022-08-03-->
<update id="updateZeroTaxByProjectId">
update pay_payment_record
set no_tax_amount=amount_received,
tax = 0
where project_id = #{projectId}
</update>
</mapper> </mapper>
@@ -68,6 +68,11 @@ public interface IPayPaymentRecordService extends IService<PayPaymentRecord> {
void updateStandards(String tbPaymentId, MemberInfo memberInfo); void updateStandards(String tbPaymentId, MemberInfo memberInfo);
/**
* 税额是否正确
*/
void isTax(BigDecimal tax, BigDecimal noTaxAmount, BigDecimal amountReceived);
/** /**
* 累加实收并四舍五入 * 累加实收并四舍五入
* @param paidAmount 实收 * @param paidAmount 实收
@@ -1,38 +1,29 @@
package com.jero.payment.service.impl; package com.jero.payment.service.impl;
import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.enums.PaymentStatusEnum;
import com.jero.company.entity.PayContactsManagement;
import com.jero.contract.common.PayIncomeContractCommon; import com.jero.contract.common.PayIncomeContractCommon;
import com.jero.meeting.entity.PayMeeting;
import com.jero.meeting.entity.PayMeetingSituation; import com.jero.meeting.entity.PayMeetingSituation;
import com.jero.meeting.mapper.PayMeetingSituationMapper; import com.jero.meeting.mapper.PayMeetingSituationMapper;
import com.jero.member.entity.*; import com.jero.member.entity.*;
import com.jero.member.mapper.PayMemberProjectSubitemMapper; import com.jero.member.mapper.PayMemberProjectSubitemMapper;
import com.jero.member.mapper.TbCertificatePaymentMapper; import com.jero.member.mapper.TbCertificatePaymentMapper;
import com.jero.member.mapper.TbMemberProjectSubitemMapper; import com.jero.member.mapper.TbMemberProjectSubitemMapper;
import com.jero.payment.vo.TbCheckVo; import com.jero.payment.mapper.PayPaymentRecordMapper;
import com.jero.project.common.PayProjectCommon; import com.jero.payment.service.IPayPaymentRecordService;
import com.jero.project.entity.PayCommonProject; import com.jero.project.entity.PayCommonProject;
import com.jero.project.entity.PayWorkingGroup;
import com.jero.project.entity.PayWorkingGroupSubItem; import com.jero.project.entity.PayWorkingGroupSubItem;
import com.jero.project.entity.PayWorkingGroupSubItemContacts;
import com.jero.project.mapper.PayCommonProjectMapper; import com.jero.project.mapper.PayCommonProjectMapper;
import com.jero.project.mapper.PayWorkingGroupSubItemMapper; import com.jero.project.mapper.PayWorkingGroupSubItemMapper;
import com.jero.temporary.entity.PayContactsManagementTemporary; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.payment.entity.PayConfirmPaymentRecord; import com.jero.payment.entity.PayConfirmPaymentRecord;
import com.jero.payment.mapper.PayConfirmPaymentRecordMapper; import com.jero.payment.mapper.PayConfirmPaymentRecordMapper;
import org.springframework.util.CollectionUtils;
/** /**
* @author liJiaRao * @author liJiaRao
@@ -52,17 +43,37 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
private TbMemberProjectSubitemMapper tbMemberProjectSubitemMapper; private TbMemberProjectSubitemMapper tbMemberProjectSubitemMapper;
@Resource @Resource
private TbCertificatePaymentMapper certificatePaymentMapper; private TbCertificatePaymentMapper certificatePaymentMapper;
@Autowired
private IPayPaymentRecordService payPaymentRecordService;
@Resource
private PayPaymentRecordMapper payPaymentRecordMapper;
public void add(PayConfirmPaymentRecord payConfirmPaymentRecord) { public void add(PayConfirmPaymentRecord payConfirmPaymentRecord) {
//如果没有填写税额就存入默认税额
BigDecimal noTaxAmount = payConfirmPaymentRecord.getNoTaxAmount();
BigDecimal tax = payConfirmPaymentRecord.getTax();
BigDecimal amountReceived = payConfirmPaymentRecord.getAmountReceived();
if (noTaxAmount == null || tax == null){
noTaxAmount = amountReceived.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
tax = amountReceived.subtract(noTaxAmount);
payConfirmPaymentRecord.setNoTaxAmount(noTaxAmount);
payConfirmPaymentRecord.setTax(tax);
}
payPaymentRecordService.isTax(noTaxAmount,tax,amountReceived);
save(payConfirmPaymentRecord); save(payConfirmPaymentRecord);
updateConfirmAmount(payConfirmPaymentRecord); updateConfirmAmount(payConfirmPaymentRecord);
} }
private void updateConfirmAmount(PayConfirmPaymentRecord payConfirmPaymentRecord) { private void updateConfirmAmount(PayConfirmPaymentRecord payConfirmPaymentRecord) {
String projectId = payConfirmPaymentRecord.getProjectId(); String projectId = payConfirmPaymentRecord.getProjectId();
String projectType = payConfirmPaymentRecord.getProjectType(); String projectType = payConfirmPaymentRecord.getProjectType();
BigDecimal confirmAmount = payConfirmPaymentRecord.getAmountReceived(); //获得金额的和
PayConfirmPaymentRecord confirmPaymentRecord = baseMapper.selectOneByProjectIdAndProjectType(projectId, projectType);
BigDecimal confirmAmount = confirmPaymentRecord.getAmountReceived();
BigDecimal noTaxAmount = confirmPaymentRecord.getNoTaxAmount();
BigDecimal tax = confirmPaymentRecord.getTax();
Integer affirmIncome;
switch (projectType){ switch (projectType){
// 普通项目 // 普通项目
@@ -74,6 +85,10 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
} }
//更新主列表 //更新主列表
payCommonProject.setConfirmAmount(confirmAmount); payCommonProject.setConfirmAmount(confirmAmount);
payCommonProject.setConfirmTax(tax);
payCommonProject.setConfirmNoTaxAmount(noTaxAmount);
affirmIncome = getAffirmIncome(payCommonProject.getReceivableAmount(), confirmAmount);
payCommonProject.setAffirmIncome(affirmIncome);
payCommonProjectMapper.updateById(payCommonProject); payCommonProjectMapper.updateById(payCommonProject);
break; break;
@@ -85,6 +100,10 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
} }
//更新主列表 //更新主列表
payWorking.setConfirmAmount(confirmAmount); payWorking.setConfirmAmount(confirmAmount);
payWorking.setConfirmTax(tax);
payWorking.setConfirmNoTaxAmount(noTaxAmount);
affirmIncome = getAffirmIncome(payWorking.getReceivableAmount(), confirmAmount);
payWorking.setAffirmIncome(affirmIncome);
payWorkingGroupSubItemMapper.updateById(payWorking); payWorkingGroupSubItemMapper.updateById(payWorking);
break; break;
@@ -97,6 +116,10 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
} }
//更新主列表 //更新主列表
meeting.setConfirmAmount(confirmAmount); meeting.setConfirmAmount(confirmAmount);
meeting.setConfirmTax(tax);
meeting.setConfirmNoTaxAmount(noTaxAmount);
affirmIncome = getAffirmIncome(meeting.getAmountReceivable(), confirmAmount);
meeting.setAffirmIncome(affirmIncome);
payMeetingSituationMapper.updateById(meeting); payMeetingSituationMapper.updateById(meeting);
break; break;
@@ -109,6 +132,10 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
} }
//更新主列表 //更新主列表
member.setConfirmAmount(confirmAmount); member.setConfirmAmount(confirmAmount);
member.setConfirmTax(tax);
member.setConfirmNoTaxAmount(noTaxAmount);
affirmIncome = getAffirmIncome(member.getAmountReceivable(), confirmAmount);
member.setAffirmIncome(affirmIncome);
payMemberProjectSubitemMapper.updateById(member); payMemberProjectSubitemMapper.updateById(member);
break; break;
@@ -121,6 +148,10 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
} }
//更新主列表 //更新主列表
tbMember.setConfirmAmount(confirmAmount); tbMember.setConfirmAmount(confirmAmount);
tbMember.setConfirmTax(tax);
tbMember.setConfirmNoTaxAmount(noTaxAmount);
affirmIncome = getAffirmIncome(tbMember.getAmountReceivable(), confirmAmount);
tbMember.setAffirmIncome(affirmIncome);
tbMemberProjectSubitemMapper.updateById(tbMember); tbMemberProjectSubitemMapper.updateById(tbMember);
break; break;
//标协证书 //标协证书
@@ -132,6 +163,10 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
} }
//更新主列表 //更新主列表
tbMemberCertificate.setConfirmAmount(confirmAmount); tbMemberCertificate.setConfirmAmount(confirmAmount);
tbMemberCertificate.setConfirmTax(tax);
tbMemberCertificate.setConfirmNoTaxAmount(noTaxAmount);
affirmIncome = getAffirmIncome(tbMemberCertificate.getAmountReceivable(), confirmAmount);
tbMemberCertificate.setAffirmIncome(affirmIncome);
certificatePaymentMapper.updateById(tbMemberCertificate); certificatePaymentMapper.updateById(tbMemberCertificate);
break; break;
@@ -159,6 +194,127 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
public void deleteByIds(List<String> ids) { public void deleteByIds(List<String> ids) {
removeByIds(ids); removeByIds(ids);
} }
public void updateAffirmIncome() {
payCommonProjectMapper.selectList(new QueryWrapper<>()).forEach(p -> {
BigDecimal confirmAmount = p.getConfirmAmount();
Integer affirmIncome = getAffirmIncome(p.getReceivableAmount(), confirmAmount);
PayCommonProject project = new PayCommonProject();
project.setId(p.getId());
project.setAffirmIncome(affirmIncome);
payCommonProjectMapper.updateById(project);
if (p.getNeedInvoice() == 0) {
baseMapper.updateZeroTaxByProjectId(p.getId());
payPaymentRecordMapper.updateZeroTaxByProjectId(p.getId());
}
});
payWorkingGroupSubItemMapper.selectList(new QueryWrapper<>()).forEach(p -> {
BigDecimal confirmAmount = p.getConfirmAmount();
Integer affirmIncome = getAffirmIncome(p.getReceivableAmount(), confirmAmount);
PayWorkingGroupSubItem project = new PayWorkingGroupSubItem();
project.setId(p.getId());
project.setAffirmIncome(affirmIncome);
payWorkingGroupSubItemMapper.updateById(project);
if (p.getNeedInvoice() == 0) {
baseMapper.updateZeroTaxByProjectId(p.getId());
payPaymentRecordMapper.updateZeroTaxByProjectId(p.getId());
}
});
payMeetingSituationMapper.selectList(new QueryWrapper<>()).forEach(p -> {
BigDecimal confirmAmount = p.getConfirmAmount();
Integer affirmIncome = getAffirmIncome(p.getAmountReceivable(), confirmAmount);
PayMeetingSituation project = new PayMeetingSituation();
project.setId(p.getId());
project.setAffirmIncome(affirmIncome);
payMeetingSituationMapper.updateById(project);
if (p.getNeedInvoice() == 0) {
baseMapper.updateZeroTaxByProjectId(p.getId());
payPaymentRecordMapper.updateZeroTaxByProjectId(p.getId());
}
});
payMemberProjectSubitemMapper.selectList(new QueryWrapper<>()).forEach(p -> {
BigDecimal confirmAmount = p.getConfirmAmount();
Integer affirmIncome = getAffirmIncome(p.getAmountReceivable(), confirmAmount);
PayMemberProjectSubitem project = new PayMemberProjectSubitem();
project.setId(p.getId());
project.setAffirmIncome(affirmIncome);
payMemberProjectSubitemMapper.updateById(project);
if (p.getNeedInvoice() == 0) {
baseMapper.updateZeroTaxByProjectId(p.getId());
payPaymentRecordMapper.updateZeroTaxByProjectId(p.getId());
}
});
tbMemberProjectSubitemMapper.selectList(new QueryWrapper<>()).forEach(p -> {
BigDecimal confirmAmount = p.getConfirmAmount();
Integer affirmIncome = getAffirmIncome(p.getAmountReceivable(), confirmAmount);
TbMemberProjectSubitem project = new TbMemberProjectSubitem();
project.setId(p.getId());
project.setAffirmIncome(affirmIncome);
tbMemberProjectSubitemMapper.updateById(project);
if (p.getInvoiceRequirements() == 0) {
baseMapper.updateZeroTaxByProjectId(p.getId());
payPaymentRecordMapper.updateZeroTaxByProjectId(p.getId());
}
});
certificatePaymentMapper.selectList(new QueryWrapper<>()).forEach(p -> {
BigDecimal confirmAmount = p.getConfirmAmount();
Integer affirmIncome = getAffirmIncome(p.getAmountReceivable(), confirmAmount);
TbCertificatePayment project = new TbCertificatePayment();
project.setId(p.getId());
project.setAffirmIncome(affirmIncome);
certificatePaymentMapper.updateById(project);
if (p.getInvoiceRequirements() == 0) {
baseMapper.updateZeroTaxByProjectId(p.getId());
payPaymentRecordMapper.updateZeroTaxByProjectId(p.getId());
}
});
}
/**
* 得到确认收入状态
* @param receivableAmount 应收
* @param paidAmount 实收
* @return
*/
public Integer getAffirmIncome (BigDecimal receivableAmount, BigDecimal paidAmount){
BigDecimal zero = BigDecimal.ZERO;
if(receivableAmount == null){
receivableAmount = BigDecimal.ZERO;
}
if(paidAmount == null){
paidAmount = BigDecimal.ZERO;
}
//应收=0
if(receivableAmount.compareTo(zero)==0){
return 3;
}
//应收>实收>0
if(receivableAmount.compareTo(paidAmount) > 0 && paidAmount.compareTo(zero) > 0){
return 2;
}
//应收=实收
if(receivableAmount.compareTo(paidAmount) == 0){
return 1;
}
//实收 > 应收
if(paidAmount.compareTo(receivableAmount) > 0){
return 1;
}
//实收=0
if(paidAmount.compareTo(zero)==0){
return 0;
}else{
//无意义
return 2;
}
}
} }
@@ -55,6 +55,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*; import java.util.*;
/** /**
@@ -553,6 +554,19 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) { if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) {
//已同意 //已同意
//如果没有发票就存入0
BigDecimal noTaxAmount;
BigDecimal tax;
BigDecimal amountReceived = payPaymentRecord.getAmountReceived();
if (tbMember.getInvoiceRequirements() == 0) {
noTaxAmount = amountReceived;
tax = BigDecimal.ZERO;
}else {
noTaxAmount = amountReceived.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
tax = amountReceived.subtract(noTaxAmount);
}
payPaymentRecord.setTax(tax);
payPaymentRecord.setNoTaxAmount(noTaxAmount);
//来款条件校验 //来款条件校验
payPaymentRecordService.amountReceivedVerification( payPaymentRecord, ProjectCommon.PAYMENT_FLAG2); payPaymentRecordService.amountReceivedVerification( payPaymentRecord, ProjectCommon.PAYMENT_FLAG2);
@@ -565,7 +579,12 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
//插入来款记录表 //插入来款记录表
payPaymentRecord.setId(null); payPaymentRecord.setId(null);
payPaymentRecord.setPaymentStatus(paymentStatus); payPaymentRecord.setPaymentStatus(paymentStatus);
payPaymentRecord.setNoTaxAmount(noTaxAmount);
payPaymentRecord.setTax(tax);
payPaymentRecordMapper.insert(payPaymentRecord); payPaymentRecordMapper.insert(payPaymentRecord);
//保存税额
tbMember.setConfirmTax(tax);
tbMember.setConfirmNoTaxAmount(noTaxAmount);
tbCheckVo.setCheckResult(PayProjectCommon.YES); tbCheckVo.setCheckResult(PayProjectCommon.YES);
//发消息 //发消息
@@ -611,6 +630,19 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) { if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) {
//已同意 //已同意
//如果没有发票就存入0
BigDecimal noTaxAmount;
BigDecimal tax;
BigDecimal amountReceived = payPaymentRecord.getAmountReceived();
if (tbMemberCertificate.getInvoiceRequirements() == 0) {
noTaxAmount = amountReceived;
tax = BigDecimal.ZERO;
}else {
noTaxAmount = amountReceived.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
tax = amountReceived.subtract(noTaxAmount);
}
payPaymentRecord.setTax(tax);
payPaymentRecord.setNoTaxAmount(noTaxAmount);
//来款条件校验 //来款条件校验
payPaymentRecordService.amountReceivedVerification( payPaymentRecord, ProjectCommon.PAYMENT_FLAG2); payPaymentRecordService.amountReceivedVerification( payPaymentRecord, ProjectCommon.PAYMENT_FLAG2);
@@ -622,9 +654,15 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
tbMemberCertificate.setPaymentStatus(paymentStatus); tbMemberCertificate.setPaymentStatus(paymentStatus);
//插入来款记录表 //插入来款记录表
payPaymentRecord.setId(null); payPaymentRecord.setId(null);
payPaymentRecord.setNoTaxAmount(noTaxAmount);
payPaymentRecord.setTax(tax);
payPaymentRecord.setPaymentStatus(paymentStatus); payPaymentRecord.setPaymentStatus(paymentStatus);
payPaymentRecordMapper.insert(payPaymentRecord); payPaymentRecordMapper.insert(payPaymentRecord);
//保存税额
tbMemberCertificate.setConfirmTax(tax);
tbMemberCertificate.setConfirmNoTaxAmount(noTaxAmount);
tbCheckCerVo.setCheckResult(PayProjectCommon.YES); tbCheckCerVo.setCheckResult(PayProjectCommon.YES);
//发消息 //发消息
@@ -1,5 +1,6 @@
package com.jero.payment.service.impl; package com.jero.payment.service.impl;
import com.alibaba.druid.sql.visitor.functions.If;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -74,7 +75,9 @@ import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.DecimalMax;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -203,6 +206,18 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
public void addAmountReceived(List<PayPaymentRecord> list,Integer flag,String checkOrRecord){ public void addAmountReceived(List<PayPaymentRecord> list,Integer flag,String checkOrRecord){
List<TbCheckVo> typr5List = new ArrayList<>(); List<TbCheckVo> typr5List = new ArrayList<>();
List<TbCheckVo> typr6List = new ArrayList<>(); List<TbCheckVo> typr6List = new ArrayList<>();
//如果没有填写税额就存入默认税额
list.forEach(payPaymentRecord ->{
BigDecimal noTaxAmount1 = payPaymentRecord.getNoTaxAmount();
BigDecimal tax1 = payPaymentRecord.getTax();
if (noTaxAmount1 == null || tax1 == null){
BigDecimal amountReceived = payPaymentRecord.getAmountReceived();
BigDecimal noTaxAmount = amountReceived.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
BigDecimal tax = amountReceived.subtract(noTaxAmount);
payPaymentRecord.setNoTaxAmount(noTaxAmount);
payPaymentRecord.setTax(tax);
}
});
for(PayPaymentRecord payPaymentRecord : list){ for(PayPaymentRecord payPaymentRecord : list){
addOneAmountReceived(payPaymentRecord,typr5List,typr6List,flag,checkOrRecord); addOneAmountReceived(payPaymentRecord,typr5List,typr6List,flag,checkOrRecord);
@@ -329,6 +344,8 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
break; break;
default:break; default:break;
} }
//税额是否正确
isTax(payPaymentRecord.getTax(),payPaymentRecord.getNoTaxAmount(),payPaymentRecord.getAmountReceived());
} }
/** /**
@@ -345,8 +362,11 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
String paymentStatus; String paymentStatus;
String principalId = ""; String principalId = "";
String project = ""; String project = "";
BigDecimal tax;
BigDecimal noTaxAmount;
List<PayContactsManagementTemporary> listId = new ArrayList<>(); List<PayContactsManagementTemporary> listId = new ArrayList<>();
BigDecimal divide = payPaymentRecord.getAmountReceived().divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
//累加主列表实收金额 //累加主列表实收金额
//来款条件校验 //来款条件校验
amountReceivedVerification( payPaymentRecord, flag); amountReceivedVerification( payPaymentRecord, flag);
@@ -367,7 +387,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(payCommonProject.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(payCommonProject.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(payCommonProject.getReceivableAmount(), newPaidAmount);//到账状态 inAccount = getInAccount(payCommonProject.getReceivableAmount(), newPaidAmount);//到账状态
paymentStatus = payPaymentCheckService.getPaymentStatus(payCommonProject.getReceivableAmount(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态 paymentStatus = payPaymentCheckService.getPaymentStatus(payCommonProject.getReceivableAmount(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
tax = addPaidAmount(payCommonProject.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(payCommonProject.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
payCommonProject.setPaidTax(tax);
payCommonProject.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
payCommonProject.setPaidAmount(newPaidAmount); payCommonProject.setPaidAmount(newPaidAmount);
payCommonProject.setInAccount(inAccount); payCommonProject.setInAccount(inAccount);
@@ -395,7 +418,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(payWorking.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(payWorking.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(payWorking.getReceivableAmount(), newPaidAmount);//到账状态 inAccount = getInAccount(payWorking.getReceivableAmount(), newPaidAmount);//到账状态
paymentStatus = payPaymentCheckService.getPaymentStatus(payWorking.getReceivableAmount(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态 paymentStatus = payPaymentCheckService.getPaymentStatus(payWorking.getReceivableAmount(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
tax = addPaidAmount(payWorking.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(payWorking.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
payWorking.setPaidTax(tax);
payWorking.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
payWorking.setPaidAmount(newPaidAmount); payWorking.setPaidAmount(newPaidAmount);
payWorking.setInAccount(inAccount); payWorking.setInAccount(inAccount);
@@ -421,7 +447,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(meeting.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(meeting.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(meeting.getAmountReceivable(), newPaidAmount);//到账状态 inAccount = getInAccount(meeting.getAmountReceivable(), newPaidAmount);//到账状态
paymentStatus = payPaymentCheckService.getPaymentStatus(meeting.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态 paymentStatus = payPaymentCheckService.getPaymentStatus(meeting.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
tax = addPaidAmount(meeting.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(meeting.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
meeting.setPaidTax(tax);
meeting.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
meeting.setPaidAmount(newPaidAmount); meeting.setPaidAmount(newPaidAmount);
meeting.setInAccount(inAccount); meeting.setInAccount(inAccount);
@@ -445,7 +474,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(member.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(member.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(member.getAmountReceivable(), newPaidAmount);//到账状态 inAccount = getInAccount(member.getAmountReceivable(), newPaidAmount);//到账状态
paymentStatus = payPaymentCheckService.getPaymentStatus(member.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态 paymentStatus = payPaymentCheckService.getPaymentStatus(member.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
tax = addPaidAmount(member.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(member.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
member.setPaidTax(tax);
member.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
member.setPaidAmount(newPaidAmount); member.setPaidAmount(newPaidAmount);
@@ -472,7 +504,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(tbMember.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(tbMember.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(tbMember.getAmountReceivable(), newPaidAmount);//到账状态 inAccount = getInAccount(tbMember.getAmountReceivable(), newPaidAmount);//到账状态
paymentStatus = payPaymentCheckService.getPaymentStatus(tbMember.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态 paymentStatus = payPaymentCheckService.getPaymentStatus(tbMember.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
tax = addPaidAmount(tbMember.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(tbMember.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
tbMember.setPaidTax(tax);
tbMember.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
tbMember.setPaidAmount(newPaidAmount); tbMember.setPaidAmount(newPaidAmount);
tbMember.setInAccount(inAccount); tbMember.setInAccount(inAccount);
@@ -505,7 +540,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(tbMemberCertificate.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(tbMemberCertificate.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(tbMemberCertificate.getAmountReceivable(), newPaidAmount);//到账状态 inAccount = getInAccount(tbMemberCertificate.getAmountReceivable(), newPaidAmount);//到账状态
paymentStatus = payPaymentCheckService.getPaymentStatus(tbMemberCertificate.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态 paymentStatus = payPaymentCheckService.getPaymentStatus(tbMemberCertificate.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
tax = addPaidAmount(tbMemberCertificate.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(tbMemberCertificate.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
tbMemberCertificate.setPaidTax(tax);
tbMemberCertificate.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
tbMemberCertificate.setPaidAmount(newPaidAmount); tbMemberCertificate.setPaidAmount(newPaidAmount);
tbMemberCertificate.setInAccount(inAccount); tbMemberCertificate.setInAccount(inAccount);
@@ -594,7 +632,25 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
payPaymentRecord.setReviewTime(new Date()); payPaymentRecord.setReviewTime(new Date());
payPaymentRecord.setProjectId(tbMember.getId()); payPaymentRecord.setProjectId(tbMember.getId());
payPaymentRecord.setProjectType(Integer.valueOf(PayIncomeContractCommon.PROJECT_TYPE5)); payPaymentRecord.setProjectType(Integer.valueOf(PayIncomeContractCommon.PROJECT_TYPE5));
//税额
BigDecimal noTaxAmount;
BigDecimal tax;
//税额赋值
BigDecimal amountReceived = payPaymentRecord.getAmountReceived();
if (tbMember.getInvoiceRequirements() == 0) {
noTaxAmount = amountReceived;
tax = BigDecimal.ZERO;
}else {
noTaxAmount = amountReceived.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
tax = amountReceived.subtract(noTaxAmount);
}
//保存税额
payPaymentRecord.setTax(tax);
payPaymentRecord.setNoTaxAmount(noTaxAmount);
payPaymentRecordMapper.insert(payPaymentRecord); payPaymentRecordMapper.insert(payPaymentRecord);
tbMember.setConfirmTax(tax);
tbMember.setConfirmNoTaxAmount(noTaxAmount);
}else { }else {
tbMember.setPaymentStatus(PaymentStatusEnum.REJECTED.getCode()); tbMember.setPaymentStatus(PaymentStatusEnum.REJECTED.getCode());
} }
@@ -630,6 +686,21 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
certificatePayment.setPaymentStatus(PaymentStatusEnum.REJECTED.getCode()); certificatePayment.setPaymentStatus(PaymentStatusEnum.REJECTED.getCode());
payPaymentRecord.setPaymentStatus(PaymentStatusEnum.REJECTED.getCode()); payPaymentRecord.setPaymentStatus(PaymentStatusEnum.REJECTED.getCode());
} }
//税额
BigDecimal noTaxAmount;
BigDecimal tax;
//税额赋值
BigDecimal amountReceived = payPaymentRecord.getAmountReceived();
if (certificatePayment.getInvoiceRequirements() == 0) {
noTaxAmount = amountReceived;
tax = BigDecimal.ZERO;
}else {
noTaxAmount = amountReceived.divide(new BigDecimal("1.06"), 2, RoundingMode.HALF_UP);
tax = amountReceived.subtract(noTaxAmount);
}
//保存税额
certificatePayment.setConfirmTax(tax);
certificatePayment.setConfirmNoTaxAmount(noTaxAmount);
certificatePaymentMapper.updateById(certificatePayment); certificatePaymentMapper.updateById(certificatePayment);
//插入来款记录表 //插入来款记录表
@@ -644,6 +715,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
payPaymentRecord.setReviewTime(new Date()); payPaymentRecord.setReviewTime(new Date());
payPaymentRecord.setProjectId(certificatePayment.getId()); payPaymentRecord.setProjectId(certificatePayment.getId());
payPaymentRecord.setProjectType(Integer.valueOf(PayIncomeContractCommon.PROJECT_TYPE6)); payPaymentRecord.setProjectType(Integer.valueOf(PayIncomeContractCommon.PROJECT_TYPE6));
payPaymentRecord.setTax(tax);
payPaymentRecord.setNoTaxAmount(noTaxAmount);
payPaymentRecordMapper.insert(payPaymentRecord); payPaymentRecordMapper.insert(payPaymentRecord);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@@ -759,6 +834,19 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
} }
} }
/**
* 税额是否正确
* @param tax 税额
* @param noTaxAmount 未税金额
* @param amountReceived 总金额
*/
@Override
public void isTax(BigDecimal tax,BigDecimal noTaxAmount,BigDecimal amountReceived){
if (amountReceived.compareTo(tax.add(noTaxAmount)) != 0) {
throw new JeroBootException("税额和未税金额相加不等于总金额");
}
}
/** /**
* 累加实收并四舍五入 * 累加实收并四舍五入
* @param paidAmount 实收 * @param paidAmount 实收
@@ -771,7 +859,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
if(paidAmount == null){ if(paidAmount == null){
paidAmount = new BigDecimal("0"); paidAmount = new BigDecimal("0");
} }
return paidAmount.add(amountReceived).setScale(2,BigDecimal.ROUND_HALF_UP); if (amountReceived == null){
amountReceived = BigDecimal.ZERO;
}
return paidAmount.add(amountReceived).setScale(2, RoundingMode.HALF_UP);
} }
/** /**
@@ -782,12 +873,12 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
*/ */
@Override @Override
public Integer getInAccount(BigDecimal receivableAmount,BigDecimal paidAmount){ public Integer getInAccount(BigDecimal receivableAmount,BigDecimal paidAmount){
BigDecimal zero =new BigDecimal("0"); BigDecimal zero = BigDecimal.ZERO;
if(receivableAmount == null){ if(receivableAmount == null){
receivableAmount = new BigDecimal("0"); receivableAmount = BigDecimal.ZERO;
} }
if(paidAmount == null){ if(paidAmount == null){
paidAmount = new BigDecimal("0"); paidAmount = BigDecimal.ZERO;
} }
//应收=0 //应收=0
@@ -795,7 +886,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
return 3; return 3;
} }
//应收>实收>0 //应收>实收>0
if(receivableAmount.compareTo(paidAmount) == 1 && paidAmount.compareTo(zero)==1){ if(receivableAmount.compareTo(paidAmount) > 0 && paidAmount.compareTo(zero) > 0){
return 2; return 2;
} }
//应收=实收 //应收=实收
@@ -884,7 +975,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
BigDecimal newPaidAmount; BigDecimal newPaidAmount;
BigDecimal paidAmount; BigDecimal paidAmount;
Integer inAccount; Integer inAccount;
BigDecimal tax;
BigDecimal noTaxAmount;
//税额是否正确
isTax(payPaymentRecord.getTax(),payPaymentRecord.getNoTaxAmount(),payPaymentRecord.getAmountReceived());
switch (String.valueOf(payPaymentRecord.getProjectType())){ switch (String.valueOf(payPaymentRecord.getProjectType())){
// 普通项目 // 普通项目
case PayIncomeContractCommon.PROJECT_TYPE1: case PayIncomeContractCommon.PROJECT_TYPE1:
@@ -897,7 +991,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态 inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态
tax = addPaidAmount(payCommonProject.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(payCommonProject.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
payCommonProject.setPaidTax(tax);
payCommonProject.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
payCommonProject.setPaidAmount(newPaidAmount); payCommonProject.setPaidAmount(newPaidAmount);
payCommonProject.setInAccount(inAccount); payCommonProject.setInAccount(inAccount);
@@ -916,7 +1013,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态 inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态
tax = addPaidAmount(payWorking.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(payWorking.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
payWorking.setPaidTax(tax);
payWorking.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
payWorking.setPaidAmount(newPaidAmount); payWorking.setPaidAmount(newPaidAmount);
payWorking.setInAccount(inAccount); payWorking.setInAccount(inAccount);
@@ -938,7 +1038,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态 inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态
tax = addPaidAmount(meeting.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(meeting.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
meeting.setPaidTax(tax);
meeting.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
meeting.setPaidAmount(newPaidAmount); meeting.setPaidAmount(newPaidAmount);
meeting.setInAccount(inAccount); meeting.setInAccount(inAccount);
@@ -957,7 +1060,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收 newPaidAmount =addPaidAmount(paidAmount,payPaymentRecord.getAmountReceived());//累加实收
inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态 inAccount = getInAccount(receivableAmount, newPaidAmount);//到账状态
tax = addPaidAmount(member.getPaidTax(),payPaymentRecord.getTax());
noTaxAmount = addPaidAmount(member.getPaidNoTaxAmount(),payPaymentRecord.getNoTaxAmount());
member.setPaidTax(tax);
member.setPaidNoTaxAmount(noTaxAmount);
//更新主列表 //更新主列表
member.setPaidAmount(newPaidAmount); member.setPaidAmount(newPaidAmount);
member.setInAccount(inAccount); member.setInAccount(inAccount);
@@ -103,6 +103,7 @@ public class PayCommonProject implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING) @JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidAmount; private BigDecimal paidAmount;
@Excel(name = "确认到账金额(元)", width = 15,orderNum = "6")
@ApiModelProperty(value = "确认到账金额(元)") @ApiModelProperty(value = "确认到账金额(元)")
@DecimalMax(value = "9999999999.99",message = "确认到账金额(元)格式错误") @DecimalMax(value = "9999999999.99",message = "确认到账金额(元)格式错误")
@JsonFormat(shape = JsonFormat.Shape.STRING) @JsonFormat(shape = JsonFormat.Shape.STRING)
@@ -262,4 +263,43 @@ public class PayCommonProject implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String endAmount; private String endAmount;
@ApiModelProperty(value = "确认收入((1:全额(对勾),0:0(X),2:>0 && <总金额(半满标志)))")
private Integer affirmIncome;
/**确认金额税额*/
@ApiModelProperty(value = "确认金额税额")
@DecimalMax(value = "9999999999.99",message = "确认金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmTax;
/**确认金额未税*/
@ApiModelProperty(value = "确认金额未税")
@DecimalMax(value = "9999999999.99",message = "确认金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmNoTaxAmount;
/**到账金额税额*/
@ApiModelProperty(value = "到账金额税额")
@DecimalMax(value = "9999999999.99",message = "到账金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidTax;
/**到账金额未税*/
@ApiModelProperty(value = "到账金额未税")
@DecimalMax(value = "9999999999.99",message = "到账金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidNoTaxAmount;
/**开票金额税额*/
@ApiModelProperty(value = "开票金额税额")
@DecimalMax(value = "9999999999.99",message = "开票金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceTax;
/**开票金额未税*/
@ApiModelProperty(value = "开票金额未税")
@DecimalMax(value = "9999999999.99",message = "开票金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceNoTaxAmount;
} }
@@ -28,6 +28,9 @@ public class PayWorkingGroupSearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "应收总金额范围") @ApiModelProperty(value = "应收总金额范围")
private String allMoneyTwo; private String allMoneyTwo;
@@ -399,4 +399,43 @@ public class PayWorkingGroupSubItem implements Serializable {
@Size(max = 50,message = "联系人10备注长度不能大于50个字符") @Size(max = 50,message = "联系人10备注长度不能大于50个字符")
@TableField(exist = false) @TableField(exist = false)
private String remarksTen; private String remarksTen;
@ApiModelProperty(value = "确认收入((1:全额(对勾),0:0(X),2:>0 && <总金额(半满标志)))")
private Integer affirmIncome;
/**确认金额税额*/
@ApiModelProperty(value = "确认金额税额")
@DecimalMax(value = "9999999999.99",message = "确认金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmTax;
/**确认金额未税*/
@ApiModelProperty(value = "确认金额未税")
@DecimalMax(value = "9999999999.99",message = "确认金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal confirmNoTaxAmount;
/**到账金额税额*/
@ApiModelProperty(value = "到账金额税额")
@DecimalMax(value = "9999999999.99",message = "到账金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidTax;
/**到账金额未税*/
@ApiModelProperty(value = "到账金额未税")
@DecimalMax(value = "9999999999.99",message = "到账金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidNoTaxAmount;
/**开票金额税额*/
@ApiModelProperty(value = "开票金额税额")
@DecimalMax(value = "9999999999.99",message = "开票金额税额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceTax;
/**开票金额未税*/
@ApiModelProperty(value = "开票金额未税")
@DecimalMax(value = "9999999999.99",message = "开票金额未税")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal invoiceNoTaxAmount;
} }
@@ -38,6 +38,9 @@ public class PayWorkingGroupSubletSearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "来款用途") @ApiModelProperty(value = "来款用途")
private String chargeUse; private String chargeUse;
@@ -217,4 +217,6 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
List<DepartStatistics> queryPageListDepartment(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList); List<DepartStatistics> queryPageListDepartment(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList); AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
List<AllProjectStatistics> queryListAllProjectMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
} }
@@ -133,20 +133,19 @@
<!-- 工作组统计--> <!-- 工作组统计-->
<select id="queryPageListForStatistics" resultType="com.jero.project.entity.PayWorkingGroupStatistics"> <select id="queryPageListForStatistics" resultType="com.jero.project.entity.PayWorkingGroupStatistics">
select *, select *,
CONCAT(CAST(ROUND((confirmAmount/allMoney)*100,2) AS CHAR),'%') AS moneyRate CONCAT(CAST(ROUND((confirmAmount1/allMoney)*100,2) AS CHAR),'%') AS moneyRate
from ( from (
select select
superId as id, superId as id,
projectName as workGroup, projectName as workGroup,
sum(allMoney) as allMoney, sum(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount,
sum(confirmAmount) as confirmAmount1
from from
v_statistical v v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
type = 2 type = 2
<if test="ids != null and ids != ''"> <if test="ids != null and ids != ''">
@@ -164,6 +163,9 @@
</if> </if>
<if test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''"> <if test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSearch.paymentYear}, '%')
<if test="payWorkingGroupSearch.paymentMonth != null and payWorkingGroupSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{payWorkingGroupSearch.paymentMonth}, '%')
</if>
</if> </if>
<choose> <choose>
<when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''"> <when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''">
@@ -221,13 +223,11 @@
select superId as id, select superId as id,
projectName as workGroup, projectName as workGroup,
sum(allMoney) as allMoney, sum(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
type = 2 type = 2
<if test="ids != null and ids != ''"> <if test="ids != null and ids != ''">
@@ -245,6 +245,9 @@
</if> </if>
<if test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''"> <if test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSearch.paymentYear}, '%')
<if test="payWorkingGroupSearch.paymentMonth != null and payWorkingGroupSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{payWorkingGroupSearch.paymentMonth}, '%')
</if>
</if> </if>
<choose> <choose>
<when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''"> <when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''">
@@ -363,18 +366,16 @@
principalName, principalName,
chargeCompanyTemporaryName, chargeCompanyTemporaryName,
allMoney, allMoney,
comeAllMoney, paidNoTaxAmount as comeAllMoney,
chargeUse, chargeUse,
depart, depart,
createTime, createTime,
packText, packText,
pack, pack,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, invoiceNoTaxAmount as billMoney,
confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -427,6 +428,9 @@
</choose> </choose>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''"> <if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
<if test="allProjectStatisticsSearch.paymentMonth != null and allProjectStatisticsSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{allProjectStatisticsSearch.paymentMonth}, '%')
</if>
</if> </if>
<if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''"> <if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''">
and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%') and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%')
@@ -460,16 +464,15 @@
</if> </if>
</if> </if>
</select> </select>
<!-- 全所统计总金额统计--> <!-- 全所统计总金额统计-->
<select id="queryPageList33" resultType="com.jero.statistics.entity.AllMoney"> <select id="queryPageList33" resultType="com.jero.statistics.entity.AllMoney">
select sum(allMoney) as allMoney, select sum(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -523,6 +526,9 @@
</choose> </choose>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''"> <if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
<if test="allProjectStatisticsSearch.paymentMonth != null and allProjectStatisticsSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{allProjectStatisticsSearch.paymentMonth}, '%')
</if>
</if> </if>
<if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''"> <if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''">
and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%') and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%')
@@ -1077,21 +1083,21 @@
allMoney, allMoney,
comeAllMoney, comeAllMoney,
createTime, createTime,
CONCAT(CAST(ROUND((confirmAmount / allMoney) * 100, 2) AS CHAR), '%') AS finishRate, CONCAT(CAST(ROUND((confirmAmount1 / allMoney) * 100, 2) AS CHAR), '%') AS finishRate,
billMoney, billMoney,
confirmAmount confirmAmount,
confirmAmount1
from from
(select principalNameId as principalId, (select principalNameId as principalId,
principalName, principalName,
SUM(allMoney) as allMoney, SUM(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
createTime, createTime,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount,
sum(confirmAmount) as confirmAmount1
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1112,6 +1118,9 @@
</where> </where>
<if test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''"> <if test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleSearch.paymentYear}, '%')
<if test="principalPeopleSearch.paymentMonth != null and principalPeopleSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleSearch.paymentMonth}, '%')
</if>
</if> </if>
group by principalId ) ppp group by principalId ) ppp
<where> <where>
@@ -1167,14 +1176,12 @@
(select principalNameId as principalId, (select principalNameId as principalId,
principalName, principalName,
SUM(allMoney) as allMoney, SUM(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
createTime, createTime,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1195,6 +1202,9 @@
</where> </where>
<if test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''"> <if test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleSearch.paymentYear}, '%')
<if test="principalPeopleSearch.paymentMonth != null and principalPeopleSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleSearch.paymentMonth}, '%')
</if>
</if> </if>
group by principalId ) ppp group by principalId ) ppp
<where> <where>
@@ -1338,17 +1348,15 @@
projectName, projectName,
principalNameId as principalId, principalNameId as principalId,
allMoney, allMoney,
comeAllMoney, paidNoTaxAmount as comeAllMoney,
packText, packText,
pack, pack,
chargeUse, chargeUse,
chargeCompanyTemporaryName, chargeCompanyTemporaryName,
if(pmb.invoice_amount is null, 0.00, pmb.invoice_amount) as billMoney, invoiceNoTaxAmount as billMoney,
confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
principalNameId = #{principalPeopleDetailSearch.principalNameId} principalNameId = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''"> <if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
@@ -1382,6 +1390,9 @@
</choose> </choose>
<if test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''"> <if test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleDetailSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleDetailSearch.paymentYear}, '%')
<if test="principalPeopleDetailSearch.paymentMonth != null and principalPeopleDetailSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleDetailSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
</select> </select>
@@ -1395,17 +1406,15 @@
projectName, projectName,
principalNameId as principalId, principalNameId as principalId,
allMoney, allMoney,
comeAllMoney, paidNoTaxAmount as comeAllMoney,
packText, packText,
pack, pack,
chargeUse, chargeUse,
chargeCompanyTemporaryName, chargeCompanyTemporaryName,
if(pmb.invoice_amount is null, 0.00, pmb.invoice_amount) as billMoney, invoiceNoTaxAmount as billMoney,
confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
principalNameId = #{principalPeopleDetailSearch.principalNameId} principalNameId = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''"> <if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
@@ -1439,6 +1448,9 @@
</choose> </choose>
<if test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''"> <if test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleDetailSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleDetailSearch.paymentYear}, '%')
<if test="principalPeopleDetailSearch.paymentMonth != null and principalPeopleDetailSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleDetailSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
) pp ) pp
@@ -1717,20 +1729,20 @@
allMoney, allMoney,
comeAllMoney, comeAllMoney,
createTime, createTime,
CONCAT(CAST(ROUND((confirmAmount / allMoney) * 100, 2) AS CHAR), '%') AS finishRate, CONCAT(CAST(ROUND((confirmAmount1 / allMoney) * 100, 2) AS CHAR), '%') AS finishRate,
billMoney, billMoney,
confirmAmount from confirmAmount,
confirmAmount1 from
(select chargeCompanyId as chargeCompanyTemporaryId, (select chargeCompanyId as chargeCompanyTemporaryId,
chargeCompanyTemporaryName, chargeCompanyTemporaryName,
SUM(allMoney) as allMoney, SUM(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
createTime, createTime,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount,
sum(confirmAmount) as confirmAmount1
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1747,6 +1759,9 @@
</if> </if>
<if test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''"> <if test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{companyComeMoneySearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{companyComeMoneySearch.paymentYear}, '%')
<if test="companyComeMoneySearch.paymentMonth != null and companyComeMoneySearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{companyComeMoneySearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
group by chargeCompanyId group by chargeCompanyId
@@ -1805,14 +1820,12 @@
(select chargeCompanyTemporaryId, (select chargeCompanyTemporaryId,
chargeCompanyTemporaryName, chargeCompanyTemporaryName,
SUM(allMoney) as allMoney, SUM(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
createTime, createTime,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1829,6 +1842,9 @@
</if> </if>
<if test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''"> <if test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{companyComeMoneySearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{companyComeMoneySearch.paymentYear}, '%')
<if test="companyComeMoneySearch.paymentMonth != null and companyComeMoneySearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{companyComeMoneySearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
group by chargeCompanyId group by chargeCompanyId
@@ -1966,13 +1982,12 @@
<!-- 企业来款详情统计--> <!-- 企业来款详情统计-->
<select id="queryPageListForCompanyDetail" resultType="com.jero.statistics.entity.CompanyComeMoneyDetail"> <select id="queryPageListForCompanyDetail" resultType="com.jero.statistics.entity.CompanyComeMoneyDetail">
select * from( select * from(
select projectId,projectName,allMoney,comeAllMoney,chargeUse,packText,pack, select projectId,projectName,allMoney,chargeUse,packText,pack,
pmb.invoice_amount as billMoney, paidNoTaxAmount as comeAllMoney,
confirmAmount invoiceNoTaxAmount as billMoney,
confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId} chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId}
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
@@ -2014,6 +2029,9 @@
</choose> </choose>
<if test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''"> <if test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{CompanyComeMoneyDetailSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{CompanyComeMoneyDetailSearch.paymentYear}, '%')
<if test="CompanyComeMoneyDetailSearch.paymentMonth != null and CompanyComeMoneyDetailSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{CompanyComeMoneyDetailSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
) p ) p
@@ -2053,16 +2071,14 @@
select projectId, select projectId,
projectName, projectName,
allMoney, allMoney,
comeAllMoney, paidNoTaxAmount as comeAllMoney,
chargeUse, chargeUse,
packText, packText,
pack, pack,
pmb.invoice_amount as billMoney, invoiceNoTaxAmount as billMoney,
confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId} chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId}
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
@@ -2105,6 +2121,9 @@
</choose> </choose>
<if test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''"> <if test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{CompanyComeMoneyDetailSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{CompanyComeMoneyDetailSearch.paymentYear}, '%')
<if test="CompanyComeMoneyDetailSearch.paymentMonth != null and CompanyComeMoneyDetailSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{CompanyComeMoneyDetailSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
) pp ) pp
@@ -2116,19 +2135,19 @@
comeAllMoney, comeAllMoney,
departName, departName,
billMoney, billMoney,
CONCAT(CAST(ROUND((confirmAmount / allMoney) * 100, 2) AS CHAR), '%') AS finishRate, CONCAT(CAST(ROUND((confirmAmount1 / allMoney) * 100, 2) AS CHAR), '%') AS finishRate,
confirmAmount confirmAmount,
confirmAmount1
from from
(select (select
sum(allMoney) as allMoney, sum(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
depart as departName, depart as departName,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount,
sum(confirmAmount) as confirmAmount1
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<foreach item="item" open="departId in(" separator="," close=")" collection="idList"> <foreach item="item" open="departId in(" separator="," close=")" collection="idList">
#{item} #{item}
@@ -2139,6 +2158,9 @@
</if> </if>
<if test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''"> <if test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{departStatisticsSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{departStatisticsSearch.paymentYear}, '%')
<if test="departStatisticsSearch.paymentMonth != null and departStatisticsSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{departStatisticsSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
group by v.departId) p group by v.departId) p
@@ -2172,13 +2194,11 @@
<select id="queryPageListDepartment33" resultType="com.jero.statistics.entity.AllMoney"> <select id="queryPageListDepartment33" resultType="com.jero.statistics.entity.AllMoney">
select sum(allMoney) as allMoney, select sum(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney, sum(paidNoTaxAmount) as comeAllMoney,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
left join pay_confirm_payment_record pcpr on(pmbp.project_id=pcpr.project_id)
<where> <where>
<foreach item="item" open="departId in(" separator="," close=")" collection="idList"> <foreach item="item" open="departId in(" separator="," close=")" collection="idList">
#{item} #{item}
@@ -2189,7 +2209,28 @@
</if> </if>
<if test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''"> <if test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{departStatisticsSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{departStatisticsSearch.paymentYear}, '%')
<if test="departStatisticsSearch.paymentMonth != null and departStatisticsSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{departStatisticsSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
</select> </select>
<!-- 全所收入统计-->
<select id="queryListAllProjectMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
select
sum(paidNoTaxAmount) as comeAllMoney,
sum(invoiceNoTaxAmount) as billMoney,
sum(confirmNoTaxAmount) as confirmAmount,
DATE_FORMAT(pcpr.payment_date,'%Y-%m') as paymentDate
from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
<where>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
</if>
</where>
group by DATE_FORMAT(pcpr.payment_date,'%Y-%m')
order by paymentDate
</select>
</mapper> </mapper>
@@ -121,6 +121,9 @@
</choose> </choose>
<if test="payWorkingGroupSubletSearch.paymentYear != null and payWorkingGroupSubletSearch.paymentYear != ''"> <if test="payWorkingGroupSubletSearch.paymentYear != null and payWorkingGroupSubletSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSubletSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSubletSearch.paymentYear}, '%')
<if test="payWorkingGroupSubletSearch.paymentMonth != null and payWorkingGroupSubletSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{payWorkingGroupSubletSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
group by id group by id
@@ -184,6 +187,9 @@
</choose> </choose>
<if test="payWorkingGroupSubletSearch.paymentYear != null and payWorkingGroupSubletSearch.paymentYear != ''"> <if test="payWorkingGroupSubletSearch.paymentYear != null and payWorkingGroupSubletSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSubletSearch.paymentYear}, '%') and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSubletSearch.paymentYear}, '%')
<if test="payWorkingGroupSubletSearch.paymentMonth != null and payWorkingGroupSubletSearch.paymentMonth != ''">
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{payWorkingGroupSubletSearch.paymentMonth}, '%')
</if>
</if> </if>
</where> </where>
group by id) p group by id) p
@@ -238,4 +238,8 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
List<DepartStatistics> queryPageListDepartmentExcel(DepartStatisticsSearch departStatisticsSearch, List<String> idList); List<DepartStatistics> queryPageListDepartmentExcel(DepartStatisticsSearch departStatisticsSearch, List<String> idList);
AllMoney queryPageListDepartment33(DepartStatisticsSearch departStatisticsSearch, List<String> idList); AllMoney queryPageListDepartment33(DepartStatisticsSearch departStatisticsSearch, List<String> idList);
List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
} }
@@ -35,6 +35,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -630,4 +631,69 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
} }
} }
} }
@Override
public List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
return getAllProjectMoneyStatistics(allProjectStatisticsSearch, list);
}
@Override
public List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
List<AllProjectStatistics> list2=getAllProjectMoneyStatistics(allProjectStatisticsSearch, list);
AllMoney allMoney=payWorkingGroupMapper.queryPageList33(allProjectStatisticsSearch, idList);
List<String> comeAllMoneyList=list2.stream().map(allProjectStatistics -> allProjectStatistics.getComeAllMoney()).collect(Collectors.toList());
List<String> billMoneyList=list2.stream().map(allProjectStatistics -> allProjectStatistics.getBillMoney()).collect(Collectors.toList());
List<String> confirmMoneyList=list2.stream().map(allProjectStatistics -> allProjectStatistics.getConfirmAmount()).collect(Collectors.toList());
List<List<String>> list3 = new ArrayList<>();
list3.add(0,confirmMoneyList);
list3.add(1,billMoneyList);
list3.add(2,comeAllMoneyList);
AllProjectMoneyExcel comeAllProjectMoney=new AllProjectMoneyExcel("到账金额",allMoney.getComeAllMoney());
AllProjectMoneyExcel billAllProjectMoney=new AllProjectMoneyExcel("开票金额",allMoney.getBillMoney());
AllProjectMoneyExcel confirmAllProjectMoney=new AllProjectMoneyExcel("确认收入金额",allMoney.getConfirmAmount());
List<AllProjectMoneyExcel> excelList = new ArrayList<>();
excelList.add(0,confirmAllProjectMoney);
excelList.add(1,billAllProjectMoney);
excelList.add(2,comeAllProjectMoney);
for (int i=0; i < excelList.size(); i++) {
excelList.get(i).setJanuary(list3.get(i).get(0));
excelList.get(i).setFebruary(list3.get(i).get(1));
excelList.get(i).setMarch(list3.get(i).get(2));
excelList.get(i).setApril(list3.get(i).get(3));
excelList.get(i).setMay(list3.get(i).get(4));
excelList.get(i).setJune(list3.get(i).get(5));
excelList.get(i).setJuly(list3.get(i).get(6));
excelList.get(i).setAugust(list3.get(i).get(7));
excelList.get(i).setSeptember(list3.get(i).get(8));
excelList.get(i).setOctober(list3.get(i).get(9));
excelList.get(i).setNovember(list3.get(i).get(10));
excelList.get(i).setDecember(list3.get(i).get(11));
}
return excelList;
}
@NotNull
private List<AllProjectStatistics> getAllProjectMoneyStatistics(AllProjectStatisticsSearch allProjectStatisticsSearch, List<AllProjectStatistics> list) {
List<Integer> collect=list.stream()
.map(allProjectStatistics -> Integer.valueOf(allProjectStatistics.getPaymentDate().split("-")[1]))
.collect(Collectors.toList());
String paymentYear=allProjectStatisticsSearch.getPaymentYear();
for (int i=1; i <= 12; i++) {
if (!collect.contains(i)) {
StringBuilder stringBuilder=new StringBuilder().append(paymentYear);
AllProjectStatistics allProjectStatistics=new AllProjectStatistics("0.00", "0.00", "0.00", stringBuilder.append("-" + i).toString());
list.add(allProjectStatistics);
}
}
list.sort(Comparator.comparing(allProjectStatistics -> Integer.valueOf(allProjectStatistics.getPaymentDate().split("-")[1])));
return list;
}
} }
@@ -0,0 +1,96 @@
package com.jero.statistics.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.util.oConvertUtils;
import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysDepartService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.statistics.entity.AllMoney;
import com.jero.statistics.entity.AllProjectMoneyExcel;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import com.jero.util.AmountUtil;
import com.mchange.lang.IntegerUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* @Description: TODO
* @author: Kuang Kaixing
* @date: 2022/07/28 16:13
*/
@Api(tags = "全所收入统计")
@RestController
@RequestMapping("/statistics/allProjectMoneyStatistics")
@Slf4j
public class AllProjectMoneyStatisticsController {
@Resource
private SysUserMapper userMapper;
@Autowired
private ISysDepartService sysDepartService;
@Autowired
private ISysBaseAPI sysBaseAPI;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IPayWorkingGroupService payWorkingGroupService;
/**
* 分页列表查询
*
* @param allProjectStatisticsSearch 全所收入统计搜索
*/
@RequiresPermissions("wholeInstituteStatistics:search")
@ApiOperation(value = "全所收入统计搜索-列表查询", notes = "全所收入统计搜索-详情列表查询")
@GetMapping(value = "/list")
public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch) {
List<AllProjectStatistics> list = payWorkingGroupService.queryListAllProjectMoney(allProjectStatisticsSearch, null);
HashMap<String, Object> hashMap = new HashMap<>();
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, null);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("sumOfBillMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getBillMoney());
hashMap.put("sumOfConfirmAmount", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getConfirmAmount());
hashMap.put("list", list);
return Result.OK(hashMap);
}
/**
* 所领导统计导出
*/
@RequiresPermissions("wholeInstituteStatistics:export")
@AutoLog(value = "全所收入统计导出-导出统计")
@GetMapping(value = "/excel")
@ApiOperation(value = "全所收入统计导出-导出统计", notes = "全所收入统计导出-导出统计")
public ModelAndView excel(AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "selections", required = false) String selections) {
List<AllProjectMoneyExcel> list = payWorkingGroupService.queryListAllProjectMoneyExcel(allProjectStatisticsSearch, null);
return AmountUtil.exportListXls(list, AllProjectMoneyExcel.class, "收入统计");
}
}
@@ -7,11 +7,15 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Data @Data
public class AllMoney { public class AllMoney {
private String allMoney; private String allMoney;
@ApiModelProperty("到账金额未税")
private String comeAllMoney; private String comeAllMoney;
@ApiModelProperty("开票金额未税")
private String billMoney; private String billMoney;
@ApiModelProperty("确认金额未税")
private String confirmAmount; private String confirmAmount;
} }
@@ -0,0 +1,65 @@
package com.jero.statistics.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Description: 全所收入Excel
* @author: Kuang Kaixing
* @date: 2022/07/29 14:21
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AllProjectMoneyExcel {
@Excel(name = "合同",width=15,height=15)
private String category;
@Excel(name="1月",width=15,height=15)
private String january;
@Excel(name="2月",width=15,height=15)
private String february;
@Excel(name="3月",width=15,height=15)
private String march;
@Excel(name="4月",width=15,height=15)
private String april;
@Excel(name="5月",width=15,height=15)
private String may;
@Excel(name="6月",width=15,height=15)
private String june;
@Excel(name="7月",width=15,height=15)
private String july;
@Excel(name="8月",width=15,height=15)
private String august;
@Excel(name="9月",width=15,height=15)
private String september;
@Excel(name="10月",width=15,height=15)
private String october;
@Excel(name="11月",width=15,height=15)
private String november;
@Excel(name="12月",width=15,height=15)
private String december ;
@Excel(name="总计",width=15,height=15)
private String total;
public AllProjectMoneyExcel(String category, String total) {
this.category=category;
this.total=total;
}
}
@@ -2,14 +2,20 @@ package com.jero.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.Date;
/** /**
* @author zql * @author zql
* @date 2021/9/17 18:04 * @date 2021/9/17 18:04
*/ */
@Data @Data
@AllArgsConstructor
@NoArgsConstructor
public class AllProjectStatistics { public class AllProjectStatistics {
@ApiModelProperty(value = "项目id") @ApiModelProperty(value = "项目id")
private String projectId; private String projectId;
@@ -61,4 +67,15 @@ public class AllProjectStatistics {
@Excel(name = "项目负责人", width = 15) @Excel(name = "项目负责人", width = 15)
@ApiModelProperty(value = "项目负责人") @ApiModelProperty(value = "项目负责人")
private String principalName; private String principalName;
@Excel(name = "到账时间", width = 15)
@ApiModelProperty(value = "到账时间")
private String paymentDate;
public AllProjectStatistics(String confirmAmount, String billMoney, String comeAllMoney, String paymentDate) {
this.confirmAmount=confirmAmount;
this.billMoney=billMoney;
this.comeAllMoney=comeAllMoney;
this.paymentDate=paymentDate;
}
} }
@@ -50,6 +50,9 @@ public class AllProjectStatisticsSearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "字段") @ApiModelProperty(value = "字段")
private String column; private String column;
@@ -44,6 +44,9 @@ public class CompanyComeMoneyDetailSearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "字段") @ApiModelProperty(value = "字段")
private String column; private String column;
@@ -26,6 +26,10 @@ public class CompanyComeMoneyList {
@ApiModelProperty(value = "确认收入金额") @ApiModelProperty(value = "确认收入金额")
private String confirmAmount; private String confirmAmount;
@Excel(name = "确收率", width = 15)
@ApiModelProperty(value = "确收率")
private String finishRate;
@Excel(name = "开票金额", width = 15) @Excel(name = "开票金额", width = 15)
@ApiModelProperty(value = "开票金额") @ApiModelProperty(value = "开票金额")
private String billMoney; private String billMoney;
@@ -34,7 +38,5 @@ public class CompanyComeMoneyList {
@ApiModelProperty(value = "到账总金额") @ApiModelProperty(value = "到账总金额")
private String comeAllMoney; private String comeAllMoney;
@Excel(name = "确收率", width = 15)
@ApiModelProperty(value = "确收率")
private String finishRate;
} }
@@ -35,6 +35,9 @@ public class CompanyComeMoneySearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "字段") @ApiModelProperty(value = "字段")
private String column; private String column;
@@ -22,6 +22,10 @@ public class DepartStatistics {
@ApiModelProperty(value = "确认收入金额") @ApiModelProperty(value = "确认收入金额")
private String confirmAmount; private String confirmAmount;
@Excel(name = "确收率", width = 15)
@ApiModelProperty(value = "确收率")
private String finishRate;
@Excel(name = "开票金额", width = 15) @Excel(name = "开票金额", width = 15)
@ApiModelProperty(value = "开票金额") @ApiModelProperty(value = "开票金额")
private String billMoney; private String billMoney;
@@ -30,9 +34,7 @@ public class DepartStatistics {
@ApiModelProperty(value = "到账总金额") @ApiModelProperty(value = "到账总金额")
private String comeAllMoney; private String comeAllMoney;
@Excel(name = "确收率", width = 15)
@ApiModelProperty(value = "确收率")
private String finishRate;
} }
@@ -16,6 +16,9 @@ public class DepartStatisticsSearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "字段") @ApiModelProperty(value = "字段")
private String column; private String column;
@@ -44,6 +44,9 @@ public class PrincipalPeopleDetailSearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "字段") @ApiModelProperty(value = "字段")
private String column; private String column;
@@ -32,6 +32,9 @@ public class PrincipalPeopleSearch {
@ApiModelProperty(value = "确认年份") @ApiModelProperty(value = "确认年份")
private String paymentYear; private String paymentYear;
@ApiModelProperty(value = "确认月份")
private String paymentMonth;
@ApiModelProperty(value = "字段") @ApiModelProperty(value = "字段")
private String column; private String column;