update 工作组成员导出增加企业缴费凭证(最新上传的缴费凭证)

This commit is contained in:
lijiarao
2024-08-07 14:37:07 +08:00
parent bc839fafd9
commit a323f14893
6 changed files with 46 additions and 7 deletions
@@ -133,12 +133,7 @@ public class PayPaymentCheckController extends JeroController<PayPaymentRecordSu
@ApiOperation(value="获取最新一条缴费凭证", notes="获取最新一条缴费凭证")
@GetMapping(value = "/getLastProof")
public Result<?> getLastProof(String projectId) {
LambdaQueryWrapper<PayPaymentRecordSub> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PayPaymentRecordSub::getProjectId, projectId);
wrapper.isNotNull(PayPaymentRecordSub::getProof);
wrapper.orderByDesc(PayPaymentRecordSub::getCreateTime);
wrapper.last("limit 1");
PayPaymentRecordSub sub = payPaymentCheckService.getOne(wrapper);
PayPaymentRecordSub sub = payPaymentCheckService.getLastProof(projectId);
if (sub == null) {
return Result.OK("无数据");
}
@@ -55,4 +55,11 @@ public interface IPayPaymentCheckService extends IService<PayPaymentRecordSub> {
* @return
*/
String getPaymentStatus(BigDecimal amountReceivable, BigDecimal paidAmount, String paymentStatus, boolean changeReceivableAmountFlag);
/**
* 获取最新一条缴费凭证
* @param projectId
* @return
*/
PayPaymentRecordSub getLastProof(String projectId);
}
@@ -782,4 +782,14 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
return paymentStatus;
}
@Override
public PayPaymentRecordSub getLastProof(String projectId) {
LambdaQueryWrapper<PayPaymentRecordSub> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PayPaymentRecordSub::getProjectId, projectId);
wrapper.isNotNull(PayPaymentRecordSub::getProof);
wrapper.orderByDesc(PayPaymentRecordSub::getCreateTime);
wrapper.last("limit 1");
return payPaymentCheckService.getOne(wrapper);
}
}
@@ -26,12 +26,16 @@ import com.jero.mail.entity.PayMailBill;
import com.jero.mail.entity.PayMailBillProject;
import com.jero.mail.service.IPayMailBillProjectService;
import com.jero.mail.service.IPayMailBillService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.pack.entity.PayPackCompany;
import com.jero.pack.entity.PayPackCompanyProject;
import com.jero.pack.service.IPayPackCompanyProjectService;
import com.jero.pack.service.IPayPackCompanyService;
import com.jero.payment.entity.PayPaymentRecordSub;
import com.jero.payment.service.IPayPaymentCheckService;
import com.jero.project.common.PayProjectCommon;
import com.jero.project.entity.AnnualDataLocking;
import com.jero.project.entity.PayWorkingGroup;
@@ -54,6 +58,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -108,6 +113,10 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
private IPayWorkingGroupSubItemContactsService payWorkingGroupSubItemContactsService;
@Resource
private AnnualDataLockingService annualDataLockingService;
@Autowired
private IPayPaymentCheckService payPaymentCheckService;
@Resource
private IOSSFileService ossFileService;
/**
* 分页列表查询
@@ -815,6 +824,15 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
}
PayWorkingGroupSubItemExcel excel = new PayWorkingGroupSubItemExcel();
BeanUtils.copyProperties(workingGroupSubItem,excel);
//获取最新缴费凭证
PayPaymentRecordSub lastProof = payPaymentCheckService.getLastProof(workingGroupSubItem.getId());
if (lastProof != null){
String proof = lastProof.getProof();
if (StringUtils.isNotBlank(proof)) {
OSSFile ossFile = ossFileService.getById(proof);
excel.setPaymentRecord(ossFile.getUrl());
}
}
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = payWorkingGroupSubItemContactsList.stream().filter(o->Objects.equals(workingGroupSubItem.getId(),o.getWorkingGroupSubId())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItemContacts)){
listPayWorkingGroupSubItemContacts.sort(Comparator.comparing(PayWorkingGroupSubItemContacts::getOrderNum));
@@ -618,6 +618,6 @@ public class PayWorkingGroupSubItem implements Serializable {
@ApiModelProperty(value = "是否审核(1:是,0:否")
private Integer checkPaymentStatus;
@ApiModelProperty(value = "是否确认凭证(1:是,0:否")
@ApiModelProperty(value = "是否查看凭证(1:是,0:否")
private Integer confirmVoucher;
}
@@ -40,6 +40,11 @@ public class PayWorkingGroupSubItemExcel implements Serializable {
@Excel(name = "来款方式", width = 15, dicCode = "payment_type")
@ApiModelProperty(value = "来款方式(1:无,2:合同,3:收费通知)")
private Integer chargeWay;
/**缴费凭证*/
@Excel(name = "缴费凭证", type = 2 ,width = 40 , height = 20)
private String paymentRecord;
/**
* 待确收金额(元)
*/
@@ -86,6 +91,10 @@ public class PayWorkingGroupSubItemExcel implements Serializable {
@Excel(name = "需要发票", width = 15, dicCode = "invoice_type")
@ApiModelProperty(value = "需要发票(1:增值税普通发票,2:增值税专用发票,0:否)")
private Integer needInvoice;
@ApiModelProperty(value = "是否查看凭证(1:是,0:否")
@Excel(name = "是否查看凭证", width = 15, dicCode = "yn")
private Integer confirmVoucher;
/**
* 备注
*/