diff --git a/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/controller/PointsMallReconciliationRecordController.java b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/controller/PointsMallReconciliationRecordController.java new file mode 100644 index 00000000..bd8af71d --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/controller/PointsMallReconciliationRecordController.java @@ -0,0 +1,37 @@ +package com.budwk.app.zhgh.pointsmall.reconciliationrecord.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.result.Result; +import com.budwk.app.zhgh.pointsmall.reconciliationrecord.param.PointsMallReconciliationRecordPageParam; +import com.budwk.app.zhgh.pointsmall.reconciliationrecord.service.PointsMallReconciliationRecordService; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; + +@IocBean +@Ok("json:full") +@At("/platform/zhgh/points-mall/reconciliationRecord") +public class PointsMallReconciliationRecordController { + + @Inject + private PointsMallReconciliationRecordService pointsMallReconciliationRecordService; + + @At("") + @Ok("beetl:/platform/zhgh/points-mall/reconciliationRecord/index.html") + @SaCheckPermission("points.mall.reconciliationrecord") + public void index() { + } + + @At + @SaCheckPermission("points.mall.reconciliationrecord") + public Result pageData(PointsMallReconciliationRecordPageParam param) { + return Result.success(pointsMallReconciliationRecordService.page(param)); + } + + @At + @SaCheckPermission("points.mall.reconciliationrecord") + public Result supplierList() { + return Result.success(pointsMallReconciliationRecordService.listSuppliers()); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/models/PointsMallReconciliationRecord.java b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/models/PointsMallReconciliationRecord.java new file mode 100644 index 00000000..b6a5bf5d --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/models/PointsMallReconciliationRecord.java @@ -0,0 +1,101 @@ +package com.budwk.app.zhgh.pointsmall.reconciliationrecord.models; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +@EqualsAndHashCode(callSuper = true) +@Table("points_mall_reconciliation_record") +@Comment("积分商城对账记录") +public class PointsMallReconciliationRecord extends BaseModel implements Serializable { + + @Name + @Column + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @Comment("供应商编码") + @ColDefine(type = ColType.VARCHAR, width = 64) + private String supplierId; + + @Column + @Comment("订单ID") + @ColDefine(type = ColType.VARCHAR, width = 64) + private String orderId; + + @Column + @Comment("用户ID") + @ColDefine(type = ColType.VARCHAR, width = 64) + private String userId; + + @Column + @Comment("平台退款") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal pRefund; + + @Column + @Comment("平台订单总金额") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal pTotalPrice; + + @Column + @Comment("平台现金金额") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal pCashAmount; + + @Column + @Comment("平台消费积分") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal pPointsPrice; + + @Column + @Comment("供应商退款") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal sRefund; + + @Column + @Comment("供应商订单总金额") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal sTotalPrice; + + @Column + @Comment("供应商现金金额") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal sCashAmount; + + @Column + @Comment("供应商消费积分") + @ColDefine(type = ColType.FLOAT, width = 18, precision = 2) + private BigDecimal sPointsPrice; + + @Column + @Comment("差异原因") + @ColDefine(type = ColType.VARCHAR, width = 1000) + private String diffReason; + + @Column + @Comment("差异类型") + private Integer diffType; + + @Column + @Comment("对账批次号") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String batchNo; + + @Column + @Comment("通知状态") + private Integer noticeStatus; + + @Column + @Comment("推送次数") + private Integer pushTime; +} diff --git a/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/param/PointsMallReconciliationRecordPageParam.java b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/param/PointsMallReconciliationRecordPageParam.java new file mode 100644 index 00000000..3560e973 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/param/PointsMallReconciliationRecordPageParam.java @@ -0,0 +1,17 @@ +package com.budwk.app.zhgh.pointsmall.reconciliationrecord.param; + +import com.budwk.app.base.param.PageForm; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class PointsMallReconciliationRecordPageParam extends PageForm { + + private String supplierId; + private String orderId; + private String userId; + private Integer diffType; + private String batchNo; + private Integer noticeStatus; +} diff --git a/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/service/PointsMallReconciliationRecordService.java b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/service/PointsMallReconciliationRecordService.java new file mode 100644 index 00000000..41d80b63 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/service/PointsMallReconciliationRecordService.java @@ -0,0 +1,17 @@ +package com.budwk.app.zhgh.pointsmall.reconciliationrecord.service; + +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.pointsmall.reconciliationrecord.models.PointsMallReconciliationRecord; +import com.budwk.app.zhgh.pointsmall.reconciliationrecord.param.PointsMallReconciliationRecordPageParam; +import com.budwk.app.zhgh.pointsmall.supplier.models.PointsMallSupplier; +import org.nutz.dao.entity.Record; + +import java.util.List; + +public interface PointsMallReconciliationRecordService extends BaseService { + + Pagination page(PointsMallReconciliationRecordPageParam param); + + List listSuppliers(); +} diff --git a/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/service/impl/PointsMallReconciliationRecordServiceImpl.java b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/service/impl/PointsMallReconciliationRecordServiceImpl.java new file mode 100644 index 00000000..405b3a43 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/pointsmall/reconciliationrecord/service/impl/PointsMallReconciliationRecordServiceImpl.java @@ -0,0 +1,57 @@ +package com.budwk.app.zhgh.pointsmall.reconciliationrecord.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.zhgh.pointsmall.reconciliationrecord.models.PointsMallReconciliationRecord; +import com.budwk.app.zhgh.pointsmall.reconciliationrecord.param.PointsMallReconciliationRecordPageParam; +import com.budwk.app.zhgh.pointsmall.reconciliationrecord.service.PointsMallReconciliationRecordService; +import com.budwk.app.zhgh.pointsmall.supplier.models.PointsMallSupplier; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.entity.Record; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.loader.annotation.IocBean; + +import java.util.List; + +@IocBean(args = {"refer:dao"}) +public class PointsMallReconciliationRecordServiceImpl extends BaseServiceImpl implements PointsMallReconciliationRecordService { + + public PointsMallReconciliationRecordServiceImpl(Dao dao) { + super(dao); + } + + @Override + public Pagination page(PointsMallReconciliationRecordPageParam param) { + Cnd cnd = Cnd.where("r.delFlag", "=", false); + if (StrUtil.isNotBlank(param.getSupplierId())) { + cnd.and("r.supplierId", "=", param.getSupplierId()); + } + if (StrUtil.isNotBlank(param.getOrderId())) { + cnd.and("r.orderId", "like", "%" + param.getOrderId() + "%"); + } + if (StrUtil.isNotBlank(param.getUserId())) { + cnd.and("r.userId", "like", "%" + param.getUserId() + "%"); + } + if (param.getDiffType() != null) { + cnd.and("r.diffType", "=", param.getDiffType()); + } + if (StrUtil.isNotBlank(param.getBatchNo())) { + cnd.and("r.batchNo", "like", "%" + param.getBatchNo() + "%"); + } + if (param.getNoticeStatus() != null) { + cnd.and("r.noticeStatus", "=", param.getNoticeStatus()); + } + cnd.desc("r.createdAt"); + Sql sql = Sqls.create("select r.*, s.supplierName from points_mall_reconciliation_record r left join points_mall_supplier s on r.supplierId = s.supplierId and s.delFlag = 0 $condition"); + sql.setCondition(cnd); + return listPageMap(param.getPageNumber(), param.getPageSize(), sql); + } + + @Override + public List listSuppliers() { + return dao().query(PointsMallSupplier.class, Cnd.where("delFlag", "=", false).asc("sortCode")); + } +} diff --git a/src/main/resources/views/platform/zhgh/points-mall/reconciliationRecord/index.html b/src/main/resources/views/platform/zhgh/points-mall/reconciliationRecord/index.html new file mode 100644 index 00000000..b8f85a22 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/points-mall/reconciliationRecord/index.html @@ -0,0 +1,196 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ currentRecord.batchNo || "-" }} + {{ currentRecord.orderId || "-" }} + {{ currentRecord.supplierName || currentRecord.supplierId || "-" }} + {{ currentRecord.userId || "-" }} + {{ currentRecord.pTotalPrice || "0" }} + {{ currentRecord.sTotalPrice || "0" }} + {{ currentRecord.pCashAmount || "0" }} + {{ currentRecord.sCashAmount || "0" }} + {{ currentRecord.pPointsPrice || "0" }} + {{ currentRecord.sPointsPrice || "0" }} + {{ currentRecord.pRefund || "0" }} + {{ currentRecord.sRefund || "0" }} + {{ diffTypeName(currentRecord.diffType) }} + {{ noticeStatusName(currentRecord.noticeStatus) }} + {{ currentRecord.pushTime || 0 }} + {{ currentRecord.diffReason || "-" }} + + + 关闭 + + +
+ + + +