This commit is contained in:
2025-03-10 19:25:57 +08:00
parent 8b795f8343
commit 0ec1c55038
4 changed files with 357 additions and 9 deletions
@@ -1,12 +1,22 @@
package io.v.nutz.zhgh.memberCost.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import com.ijpay.wxpay.model.v3.Amount;
import io.v.nutz.base.annontation.RepeatSubmit;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.payment.wxpay.service.WxPayCommonService;
import io.v.nutz.base.payment.wxpay.vo.WxPayNeedParamVo;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.memberCost.model.MemberPaymentInfo;
import io.v.nutz.zhgh.memberCost.service.MemberPaymentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
@@ -38,18 +48,60 @@ public class MemberPaymentMineController {
@At
public Object pageData(){
return null;
@ViReturn
@RequiresPermissions("member.payment.mine")
public Object pageData(PageForm pageForm, Integer year, Integer isPay) {
Sql sql = Sqls.create("""
SELECT
mpp.`year`,
mpp.projectName,
mpp.startTime,
mpp.endTime,
mpi.id,
mpi.payId,
mpi.isPayment,
mpi.payPersonnel,
mpi.personType,
mpi.paymentMonth,
mpc.paymentStartMonth,
mpc.paymentEndMonth,
mpc.payStandards
FROM
`member_payment_info` mpi
LEFT JOIN member_payment_project mpp ON mpi.paymentProjectId = mpp.id
LEFT JOIN member_payment_config mpc ON mpc.id = mpp.configId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(mpp.createTime)", "=", year);
cnd.andEX("mpi.userId", "=", ShiroUtil.getUserId());
cnd.andEX("mpp.isDisabled", "=", 0);
if (ObjectUtil.isNotNull(isPay)) {
cnd.and("mpi.isPayment", "=", isPay);
}
sql.setCondition(cnd);
return memberPaymentService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@RepeatSubmit
public Object pcOrderPay(){
@RequiresPermissions("member.payment.mine")
public Object pcOrderPay(Integer paymentMoney) {
WxPayNeedParamVo paramVo = new WxPayNeedParamVo();
paramVo.setDescription("会费缴纳支付");
paramVo.setAttach("");
paramVo.setAmount(new Amount().setTotal(1));
paramVo.setAmount(new Amount().setTotal(paymentMoney));
return wxPayCommonService.nativePay(paramVo);
}
@At
@RequiresPermissions("member.payment.mine")
public Object getIsPay(String paymentInfoId) {
MemberPaymentInfo info = memberPaymentService.dao().fetch(MemberPaymentInfo.class,
Cnd.where("id", "=", paymentInfoId).and("isPayment", "=", 1));
return Result.success(info);
}
}