feat: 对账记录
This commit is contained in:
+37
@@ -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());
|
||||
}
|
||||
}
|
||||
+101
@@ -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;
|
||||
}
|
||||
+17
@@ -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;
|
||||
}
|
||||
+17
@@ -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<PointsMallReconciliationRecord> {
|
||||
|
||||
Pagination<Record> page(PointsMallReconciliationRecordPageParam param);
|
||||
|
||||
List<PointsMallSupplier> listSuppliers();
|
||||
}
|
||||
+57
@@ -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<PointsMallReconciliationRecord> implements PointsMallReconciliationRecordService {
|
||||
|
||||
public PointsMallReconciliationRecordServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<Record> 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<PointsMallSupplier> listSuppliers() {
|
||||
return dao().query(PointsMallSupplier.class, Cnd.where("delFlag", "=", false).asc("sortCode"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user