linxk 2 settimane fa
parent
commit
bcb3f9fef4

+ 14 - 0
cif-api/src/main/java/com/txz/cif/enums/BizTypeEnum.java

@@ -1,5 +1,8 @@
 package com.txz.cif.enums;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * 支付业务类型枚举类
  * 类型 1001充值 2001提现  3001开团支付 3002参团支付  4001未成团退款 4002成团退款 5001开团红包收益 5002参团红包收益 5003签到红包收益 5004一级红包佣金 5005二级红包佣金 6001充值返点 7001提现手续费 8001冻结 9001解冻
@@ -58,6 +61,17 @@ public enum BizTypeEnum {
         return null;
     }
 
+    public static List<BizTypeEnum> getRedEnvelopeTypes() {
+        List<BizTypeEnum> ret =new ArrayList<>();
+        ret.add(BizTypeEnum.OPEN_GROUP_RED_ENVELOPE);
+        ret.add(BizTypeEnum.JOIN_GROUP_RED_ENVELOPE);
+        ret.add(BizTypeEnum.SIGN_RED_ENVELOPE);
+        ret.add(BizTypeEnum.FIRST_COMMISSION);
+        ret.add(BizTypeEnum.SECONDARY_COMMISSION);
+        ret.add(BizTypeEnum.PROMOTION_COMMISSION);
+        return ret;
+    }
+
     public static BizTypeEnum getByKey(int key) {
         for (BizTypeEnum value : values()) {
             if (value.key == key) {

+ 8 - 302
cif-service/src/main/java/com/txz/cif/model/RedEnvelope.java

@@ -14,7 +14,7 @@ import javax.persistence.*;
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
-@ApiModel(value="com.txz.cif.model.RedEnvelope")
+@ApiModel(value="收益")
 @Table(name = "c_red_envelope")
 public class RedEnvelope {
     @Id
@@ -130,305 +130,11 @@ public class RedEnvelope {
     @ApiModelProperty(value="version版本号")
     private String version;
 
-    /**
-     * @return id
-     */
-    public Long getId() {
-        return id;
-    }
-
-    /**
-     * @param id
-     */
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    /**
-     * 获取订单号
-     *
-     * @return order_no - 订单号
-     */
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    /**
-     * 设置订单号
-     *
-     * @param orderNo 订单号
-     */
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    /**
-     * 获取交易号
-     *
-     * @return tran_no - 交易号
-     */
-    public String getTranNo() {
-        return tranNo;
-    }
-
-    /**
-     * 设置交易号
-     *
-     * @param tranNo 交易号
-     */
-    public void setTranNo(String tranNo) {
-        this.tranNo = tranNo;
-    }
-
-    /**
-     * 获取用户id
-     *
-     * @return user_id - 用户id
-     */
-    public Long getUserId() {
-        return userId;
-    }
-
-    /**
-     * 设置用户id
-     *
-     * @param userId 用户id
-     */
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    /**
-     * 获取交易金额
-     *
-     * @return amount - 交易金额
-     */
-    public BigDecimal getAmount() {
-        return amount;
-    }
-
-    /**
-     * 设置交易金额
-     *
-     * @param amount 交易金额
-     */
-    public void setAmount(BigDecimal amount) {
-        this.amount = amount;
-    }
-
-    /**
-     * 获取余额
-     *
-     * @return balance - 余额
-     */
-    public BigDecimal getBalance() {
-        return balance;
-    }
-
-    /**
-     * 设置余额
-     *
-     * @param balance 余额
-     */
-    public void setBalance(BigDecimal balance) {
-        this.balance = balance;
-    }
-
-    /**
-     * 获取借方账户
-     *
-     * @return debit_account - 借方账户
-     */
-    public Long getDebitAccount() {
-        return debitAccount;
-    }
-
-    /**
-     * 设置借方账户
-     *
-     * @param debitAccount 借方账户
-     */
-    public void setDebitAccount(Long debitAccount) {
-        this.debitAccount = debitAccount;
-    }
-
-    /**
-     * 获取贷方账户
-     *
-     * @return credit_account - 贷方账户
-     */
-    public Long getCreditAccount() {
-        return creditAccount;
-    }
-
-    /**
-     * 设置贷方账户
-     *
-     * @param creditAccount 贷方账户
-     */
-    public void setCreditAccount(Long creditAccount) {
-        this.creditAccount = creditAccount;
-    }
-
-    /**
-     * 获取状态 1未结算 2已结算
-     *
-     * @return status - 状态 1未结算 2已结算
-     */
-    public Integer getStatus() {
-        return status;
-    }
-
-    /**
-     * 设置状态 1未结算 2已结算
-     *
-     * @param status 状态 1未结算 2已结算
-     */
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    /**
-     * 获取类型 1开团红包 2参团红包 3签到红包 4下级红包佣金 5下下级红包佣金
-     *
-     * @return biz_type - 类型 1开团红包 2参团红包 3签到红包 4下级红包佣金 5下下级红包佣金
-     */
-    public Integer getBizType() {
-        return bizType;
-    }
-
-    /**
-     * 设置类型 1开团红包 2参团红包 3签到红包 4下级红包佣金 5下下级红包佣金
-     *
-     * @param bizType 类型 1开团红包 2参团红包 3签到红包 4下级红包佣金 5下下级红包佣金
-     */
-    public void setBizType(Integer bizType) {
-        this.bizType = bizType;
-    }
-
-    /**
-     * 获取交易时间
-     *
-     * @return trans_time - 交易时间
-     */
-    public Date getTransTime() {
-        return transTime;
-    }
-
-    /**
-     * 设置交易时间
-     *
-     * @param transTime 交易时间
-     */
-    public void setTransTime(Date transTime) {
-        this.transTime = transTime;
-    }
-
-    /**
-     * 获取待结算时间
-     *
-     * @return settle_time - 待结算时间
-     */
-    public Date getSettleTime() {
-        return settleTime;
-    }
-
-    /**
-     * 设置待结算时间
-     *
-     * @param settleTime 待结算时间
-     */
-    public void setSettleTime(Date settleTime) {
-        this.settleTime = settleTime;
-    }
-
-    /**
-     * 获取创建人
-     *
-     * @return create_user - 创建人
-     */
-    public String getCreateUser() {
-        return createUser;
-    }
-
-    /**
-     * 设置创建人
-     *
-     * @param createUser 创建人
-     */
-    public void setCreateUser(String createUser) {
-        this.createUser = createUser;
-    }
-
-    /**
-     * 获取更新人
-     *
-     * @return update_user - 更新人
-     */
-    public String getUpdateUser() {
-        return updateUser;
-    }
-
-    /**
-     * 设置更新人
-     *
-     * @param updateUser 更新人
-     */
-    public void setUpdateUser(String updateUser) {
-        this.updateUser = updateUser;
-    }
-
-    /**
-     * 获取更新时间
-     *
-     * @return update_time - 更新时间
-     */
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    /**
-     * 设置更新时间
-     *
-     * @param updateTime 更新时间
-     */
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    /**
-     * 获取创建时间
-     *
-     * @return create_time - 创建时间
-     */
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    /**
-     * 设置创建时间
-     *
-     * @param createTime 创建时间
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    /**
-     * 获取版本号
-     *
-     * @return version - 版本号
-     */
-    public String getVersion() {
-        return version;
-    }
-
-    /**
-     * 设置版本号
-     *
-     * @param version 版本号
-     */
-    public void setVersion(String version) {
-        this.version = version;
-    }
+    @ApiModelProperty(value="用户名称")
+    private String name;
+    @Column(name = "phone_no")
+    @ApiModelProperty(value="电话")
+    private String phoneNo;
+    @ApiModelProperty(value="备注")
+    private String memo;
 }

+ 4 - 1
cif-service/src/main/java/com/txz/cif/web/UserApiController.java

@@ -61,7 +61,7 @@ public class UserApiController extends AbstractApiController {
     private RedEnvelopeService redEnvelopeService;
 
     @GetMapping("/getEnum")
-    @ApiOperation(value = "获取枚举(1业务类型 2充值状态 3提现状态 4收益状态)",httpMethod = "GET")
+    @ApiOperation(value = "获取枚举(1业务类型 2充值状态 3提现状态 4收益状态 5收益业务类型)",httpMethod = "GET")
     public Result<List<EnumBo>> getEnum(@RequestParam Integer id) {
         if(id == null){
             id = 1;
@@ -79,6 +79,9 @@ public class UserApiController extends AbstractApiController {
             case 4:
                 return ResultGenerator.genSuccessResult(Arrays.stream(RedEnvelopeStatusEnum.values())
                         .map(temp -> EnumBo.builder().code(temp.getKey()).name(temp.getDesc()).build()).collect(Collectors.toList()));
+            case 5:
+                return ResultGenerator.genSuccessResult(BizTypeEnum.getRedEnvelopeTypes().stream()
+                        .map(temp -> EnumBo.builder().code(temp.getKey()).name(temp.getValue()).build()).collect(Collectors.toList()));
         }
         return ResultGenerator.genSuccessResult();
     }

+ 26 - 4
cif-service/src/main/java/com/txz/cif/web/mng/RedEnvelopeController.java

@@ -1,4 +1,5 @@
 package com.txz.cif.web.mng;
+import cn.hutool.core.util.StrUtil;
 import com.txz.cif.core.Result;
 import com.txz.cif.core.ResultGenerator;
 import com.txz.cif.model.RedEnvelope;
@@ -8,6 +9,9 @@ import com.txz.cif.core.ResultCode;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.txz.cif.web.para.RedEnvelopeListParam;
+import com.txz.cif.web.para.RedEnvelopeListParam2;
+import com.txz.cif.web.para.RedEnvelopeParam;
 import org.springframework.web.bind.annotation.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -57,15 +61,33 @@ public class RedEnvelopeController {
 
     @PostMapping("/list")
 	@ApiOperation(value = "redEnvelope获取列表",httpMethod = "POST")
-    public Result<List<RedEnvelope>> list(@RequestBody RedEnvelope redEnvelope, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) {
+    public Result<List<RedEnvelope>> list(@RequestParam RedEnvelopeListParam2 param) {
 
-        PageHelper.startPage(page, size);
+        PageHelper.startPage(param.getPage(), param.getSize());
 
-        Condition condition = new Condition(redEnvelope.getClass());
+        Condition condition = new Condition(RedEnvelope.class);
         Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+		if (param.getType() != null){
+			criteria.andEqualTo("type", param.getType());
+		}
+		if (StrUtil.isNotBlank(param.getName()) ){
+			criteria.andEqualTo("name", param.getName());
+		}
+		if (StrUtil.isNotBlank(param.getPhoneNo()) ){
+			criteria.andEqualTo("phoneNo", param.getPhoneNo());
+		}
+		if (StrUtil.isNotBlank(param.getOrderNo()) ){
+			criteria.andEqualTo("orderNo", param.getOrderNo());
+		}
+		if (param.getStatus() != null){
+			criteria.andEqualTo("status", param.getStatus());
+		}
+		if (StrUtil.isNotBlank(param.getStartTime()) &&  StrUtil.isNotBlank(param.getEndTime())){
+			criteria.andBetween("createTime", param.getStartTime(),param.getEndTime());
+		}
 		PageInfo pageInfo = null;
 		try {
+			condition.setOrderByClause("create_time desc");
     		 List<RedEnvelope> list = redEnvelopeService.findByCondition(condition);
     		 pageInfo = new PageInfo(list);
 		} catch (Exception e) {

+ 54 - 0
cif-service/src/main/java/com/txz/cif/web/para/RedEnvelopeListParam2.java

@@ -0,0 +1,54 @@
+package com.txz.cif.web.para;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+
+import javax.validation.constraints.NotNull;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@ApiModel(value="红包集合管理入参")
+public class RedEnvelopeListParam2 {
+
+    @NotNull
+    @ApiModelProperty(value="页面")
+    private Integer page;
+
+    @NotNull
+    @ApiModelProperty(value="页面大小")
+    private Integer size;
+
+    /**
+     */
+    @ApiModelProperty(value="用户名 ")
+    private String name;
+
+    @ApiModelProperty(value="电话号码 ")
+    private String phoneNo;
+
+    @ApiModelProperty(value="订单号 ")
+    private String orderNo;
+
+    @ApiModelProperty(value="状态 1待结算 2已结算 ")
+    private Integer status;
+
+    @ApiModelProperty(value="类型 OPEN_GROUP_RED_ENVELOPE( 5001, \"开团红包收益\"),\n" +
+            "    JOIN_GROUP_RED_ENVELOPE( 5002, \"参团红包收益\"),\n" +
+            "    SIGN_RED_ENVELOPE( 5003, \"签到红包收益\"),\n" +
+            "    FIRST_COMMISSION( 5004, \"一级佣金\"),\n" +
+            "    SECONDARY_COMMISSION( 5005, \"二级佣金\"),\n" +
+            "    PROMOTION_COMMISSION( 5006, \"直推佣金\"), ")
+    private Integer type;
+
+    @ApiModelProperty(value="开始时间 ")
+    private String startTime;
+
+    @ApiModelProperty(value="结束时间 ")
+    private String endTime;
+
+
+}

+ 4 - 0
cif-service/src/main/resources/mapper/RedEnvelopeMapper.xml

@@ -22,6 +22,10 @@
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="version" jdbcType="VARCHAR" property="version" />
+
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="phone_no" jdbcType="VARCHAR" property="phoneNo" />
+    <result column="memo" jdbcType="VARCHAR" property="memo" />
   </resultMap>
 
   <select id="sumWithDay" resultType="java.math.BigDecimal">