缴费审核

This commit is contained in:
baozhipeng
2021-12-15 20:14:21 +08:00
parent e804d586ae
commit 27646dde59
6 changed files with 68 additions and 142 deletions
@@ -5,10 +5,10 @@ package com.jero.common.enums;
*/
public enum PaymentStatusEnum {
TO_BE_UPLOADED("TO_BE_UPLOADED"),//待上传
TO_BE_REVIEWED("TO_BE_REVIEWED"),//待审核
REJECTED("REJECTED"),//已拒绝
COMPLETED("COMPLETED");//已完结
TO_BE_UPLOADED("toBeUploaded"),//待上传
TO_BE_REVIEWED("toBeReviewed"),//待审核
REJECTED("rejected"),//已拒绝
COMPLETED("completed");//已完结
private String code;
@@ -1,42 +1,22 @@
package com.jero.payment.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.common.ProjectCommon;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.util.AuthenticationUtils;
import com.jero.mail.PayMailBillVO;
import com.jero.mail.service.IPayMailBillService;
import com.jero.payment.entity.PayPaymentCheck;
import com.jero.payment.entity.PayPaymentRecordSub;
import com.jero.payment.entity.PayPaymentRecord;
import com.jero.payment.service.IPayPaymentCheckService;
import com.jero.payment.service.IPayPaymentRecordService;
import com.jero.project.entity.PayCommonProject;
import com.jero.project.vo.PayCommonProjectOutput;
import com.jero.standards.memberinfo.entity.MemberInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
@Api(tags="到账审核")
@RestController
@RequestMapping("/paymentCheck/payPaymentCheck")
@Slf4j
public class PayPaymentCheckController extends JeroController<PayPaymentCheck, IPayPaymentCheckService> {
public class PayPaymentCheckController extends JeroController<PayPaymentRecordSub, IPayPaymentCheckService> {
@Autowired
private IPayPaymentCheckService payPaymentCheckService;
@@ -19,52 +19,70 @@ import java.io.Serializable;
import java.math.BigDecimal;
/**
* 来款审核
* 来款记录子表,记录每次审核
*/
@Data
@TableName("pay_payment_check")
@TableName("pay_payment_record_sub")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="pay_payment_check对象", description="pay_payment_check")
public class PayPaymentCheck implements Serializable {
@ApiModel(value="pay_payment_record_sub对象", description="pay_payment_record_sub")
public class PayPaymentRecordSub implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private String id;
private java.lang.String id;
/**项目id*/
@ApiModelProperty(value = "项目id")
@NotEmpty(message = "项目id不能为空")
private String projectId;
@ApiModelProperty(value = "来款记录id")
private String recordId;
private java.lang.String projectId;
/**主记录id*/
@ApiModelProperty(value = "主记录id")
private java.lang.String recordId;
/**项目类型*/
@ApiModelProperty(value = "项目类型")
@NotEmpty(message = "项目类型不能为空")
private Integer projectType;
@ApiModelProperty(value = "申请人名字")
private String applicantName;
/**到账金额*/
@ApiModelProperty(value = "到账金额")
@NotNull(message = "到账金额(元)不能为空")
@DecimalMax(value = "9999999999.99",message = "到账金额(元)格式错误")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal amountReceived;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
/**来款日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "来款日期")
@NotNull(message = "来款日期不能为空")
private java.util.Date paymentDate;
@ApiModelProperty(value = "付款凭证")
@NotEmpty(message = "付款凭证不能为空")
private String proof;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String remark;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
@ApiModelProperty(value = "审核结果")
private String reviewResult;
@ApiModelProperty(value = "申请人名字")
private String applicantName;
@ApiModelProperty(value = "缴费状态")
private String paymentStatus;
@ApiModelProperty(value = "审核人id")
private String reviewerId;
@@ -74,24 +92,4 @@ public class PayPaymentCheck implements Serializable {
@ApiModelProperty(value = "审核时间")
private String reviewTime;
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "创建人")
private String createBy;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
@ApiModelProperty(value = "更新人")
private String updateBy;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
}
@@ -1,19 +1,11 @@
package com.jero.payment.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.payment.entity.PayPaymentCheck;
import com.jero.payment.entity.PayPaymentRecord;
import com.jero.project.entity.PayCommonProject;
import com.jero.project.vo.PayCommonProjectOutput;
import io.lettuce.core.dynamic.annotation.Param;
import java.math.BigDecimal;
import java.util.List;
import com.jero.payment.entity.PayPaymentRecordSub;
/**
* 到账审核
*/
public interface PayPaymentCheckMapper extends BaseMapper<PayPaymentCheck> {
public interface PayPaymentCheckMapper extends BaseMapper<PayPaymentRecordSub> {
}
@@ -1,25 +1,15 @@
package com.jero.payment.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.payment.entity.PayPaymentCheck;
import com.jero.payment.entity.PayPaymentRecordSub;
import com.jero.payment.entity.PayPaymentRecord;
import com.jero.payment.vo.TbCheckVo;
import com.jero.project.entity.PayCommonProject;
import com.jero.project.vo.PayCommonProjectOutput;
import com.jero.standards.memberinfo.entity.MemberInfo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
/**
* 到账审核
*/
public interface IPayPaymentCheckService extends IService<PayPaymentCheck> {
public interface IPayPaymentCheckService extends IService<PayPaymentRecordSub> {
/**
* 申请
* @param payPaymentRecord
@@ -1,90 +1,42 @@
package com.jero.payment.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result;
import com.jero.common.common.ProjectCommon;
import com.jero.common.dto.SendMessageDTO;
import com.jero.common.enums.CompanyMessageEnums;
import com.jero.common.enums.ManagementMessageEnums;
import com.jero.common.enums.PaymentStatusEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.service.SendMessageService;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.AuthenticationUtils;
import com.jero.common.util.PasswordUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.company.entity.PayCompanyManagement;
import com.jero.company.entity.PayContactsManagement;
import com.jero.company.service.IPayCompanyManagementService;
import com.jero.company.service.IPayContactsManagementService;
import com.jero.contract.common.PayIncomeContractCommon;
import com.jero.meeting.common.MeetingSubitemCommon;
import com.jero.meeting.entity.PayMeeting;
import com.jero.meeting.entity.PayMeetingSituation;
import com.jero.meeting.mapper.PayMeetingSituationMapper;
import com.jero.meeting.service.IPayMeetingService;
import com.jero.member.entity.PayMemberProject;
import com.jero.member.entity.PayMemberProjectSubitem;
import com.jero.member.entity.TbMemberProject;
import com.jero.member.entity.TbMemberProjectSubitem;
import com.jero.member.mapper.PayMemberProjectSubitemMapper;
import com.jero.member.mapper.TbMemberProjectSubitemMapper;
import com.jero.member.service.IPayMemberProjectService;
import com.jero.member.service.ITbMemberProjectService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.payment.entity.PayPaymentCheck;
import com.jero.payment.entity.PayPaymentRecordSub;
import com.jero.payment.entity.PayPaymentRecord;
import com.jero.payment.mapper.PayPaymentCheckMapper;
import com.jero.payment.mapper.PayPaymentRecordMapper;
import com.jero.payment.service.IPayPaymentCheckService;
import com.jero.payment.service.IPayPaymentRecordService;
import com.jero.payment.vo.TbCheckVo;
import com.jero.project.entity.PayCommonProject;
import com.jero.project.entity.PayWorkingGroup;
import com.jero.project.entity.PayWorkingGroupSubItem;
import com.jero.project.mapper.PayCommonProjectMapper;
import com.jero.project.mapper.PayWorkingGroupSubItemMapper;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.project.vo.PayCommonProjectOutput;
import com.jero.standards.memberinfo.entity.MemberInfo;
import com.jero.temporary.entity.PayCompanyManagementTemporary;
import com.jero.temporary.entity.PayContactsManagementTemporary;
import com.jero.temporary.service.IPayCompanyManagementTemporaryService;
import com.jero.temporary.service.IPayContactsManagementTemporaryService;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 到账审核
*/
@Transactional(rollbackFor = Exception.class)
@Service
public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMapper, PayPaymentCheck> implements IPayPaymentCheckService {
public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMapper, PayPaymentRecordSub> implements IPayPaymentCheckService {
@Resource
private PayPaymentCheckMapper payPaymentCheckMapper;
@Autowired
@@ -108,6 +60,10 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
*/
@Override
public void applicant(PayPaymentRecord payPaymentRecord){
// LambdaQueryWrapper<PayPaymentRecord> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(PayPaymentRecord::getProjectId,payPaymentRecord.getProjectId());
// wrapper.eq(PayPaymentRecord::getPaymentStatus,PaymentStatusEnum.TO_BE_REVIEWED.getCode());
// TbMemberProjectSubitem tbMember = tbMemberProjectSubitemMapper.selectOne(wrapper);
switch (String.valueOf(payPaymentRecord.getProjectType())){
@@ -171,10 +127,15 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
default:break;
}
//插入来款记录表
//插入来款记录表、子表
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
payPaymentRecord.setApplicantName(sysUser.getRealname());
payPaymentRecordMapper.insert(payPaymentRecord);
PayPaymentRecordSub payPaymentRecordSub = new PayPaymentRecordSub();
payPaymentRecordSub.setRecordId(payPaymentRecord.getId());
BeanUtils.copyProperties(payPaymentRecord, payPaymentRecordSub);
payPaymentCheckMapper.insert(payPaymentRecordSub);
}
/**
@@ -200,6 +161,11 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
&& !PaymentStatusEnum.REJECTED.getCode().equals(paymentStatus)){
paymentStatus = PaymentStatusEnum.TO_BE_UPLOADED.getCode();//待上传
}
// 0 < 实收金额 && 实收金额 == 应收金额
if(paidAmount.compareTo(new BigDecimal("0.00")) > 0
&& paidAmount.compareTo(amountReceivable) == 0){
paymentStatus = PaymentStatusEnum.COMPLETED.getCode();//待完结
}
return paymentStatus;
}
}