Parcourir la source

Merge branch 'master' of http://124.220.229.80:9093/root/cif

# Conflicts:
#	cif-service/src/main/java/com/txz/cif/web/UserApiController.java
linxk il y a 1 semaine
Parent
commit
cc56fcd45d

+ 5 - 0
cif-service/pom.xml

@@ -126,6 +126,11 @@
             <!--            <scope>provided</scope>-->
         </dependency>
 
+        <dependency>
+            <groupId>com.txz</groupId>
+            <artifactId>mall-api</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
 
         <!--异维科技dubbo接口包依赖-->
         <dependency>

+ 48 - 0
cif-service/src/main/java/com/txz/cif/dubbo/client/OrderDubboServiceClient.java

@@ -0,0 +1,48 @@
+package com.txz.cif.dubbo.client;
+
+
+import com.txz.mall.service.OrderDubboService;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.Reference;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class OrderDubboServiceClient {
+
+    @Reference
+    private OrderDubboService orderDubboService;
+
+    /**
+     * 拼团超时定时任务
+     */
+    public void scheduledTaskStorePinkSummaryClose() {
+        log.info("cif:scheduledTaskStorePinkSummaryClose start");
+        orderDubboService.scheduledTaskStorePinkSummaryClose();
+        log.info("cif:scheduledTaskStorePinkSummaryClose end");
+    }
+
+    ;
+
+    /**
+     * 自动签收定时任务
+     */
+    public void scheduledTaskBatchSigning() {
+        log.info("cif:scheduledTaskBatchSigning start");
+        orderDubboService.scheduledTaskBatchSigning();
+        log.info("cif:scheduledTaskBatchSigning end");
+    }
+
+    ;
+
+
+    public void orderTimeoutAutomaticCancel() {
+        log.info("cif:orderTimeoutAutomaticCancel start");
+        orderDubboService.orderTimeoutAutomaticCancel();
+        log.info("cif:orderTimeoutAutomaticCancel end");
+    }
+
+    ;
+
+}

+ 64 - 237
cif-service/src/main/java/com/txz/cif/model/PaymentChannel.java

@@ -2,301 +2,128 @@ package com.txz.cif.model;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import java.util.Date;
+import lombok.Data;
+
 import javax.persistence.*;
+import java.util.Date;
 
-@ApiModel(value="com.txz.cif.model.PaymentChannel")
+@ApiModel(value = "com.txz.cif.model.PaymentChannel")
 @Table(name = "c_payment_channel")
+@Data
 public class PaymentChannel {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @ApiModelProperty(value="id")
+    @ApiModelProperty(value = "id")
     private Long id;
-
+    
     /**
      * 支付通道编码
      */
     @Column(name = "channel_code")
-    @ApiModelProperty(value="channelCode支付通道编码")
+    @ApiModelProperty(value = "channelCode支付通道编码")
     private String channelCode;
-
+    
     /**
      * 通道名称
      */
     @Column(name = "channel_name")
-    @ApiModelProperty(value="channelName通道名称")
+    @ApiModelProperty(value = "channelName通道名称")
     private String channelName;
-
+    
     /**
      * 商户号
      */
     @Column(name = "merchant_num")
-    @ApiModelProperty(value="merchantNum商户号")
+    @ApiModelProperty(value = "merchantNum商户号")
     private String merchantNum;
-
+    
     /**
      * 应用id
      */
-    @ApiModelProperty(value="appid应用id")
+    @ApiModelProperty(value = "appid应用id")
     private String appid;
-
+    
+    /**
+     * bkash支付编码
+     */
+    private String bkashPayCode;
+    
+    /**
+     * nagad支付编码
+     */
+    private String nagadPayCode;
+    
+    /**
+     * rocket支付编码
+     */
+    private String rocketPayCode;
+    
+    /**
+     * bkash提现编码
+     */
+    private String bkashWithdrawCode;
+    
+    /**
+     * nagad提现编码
+     */
+    private String nagadWithdrawCode;
+    
+    /**
+     * rocket提现编码
+     */
+    private String rocketWithdrawCode;
+    
+    /**
+     * 异步通知地址
+     */
+    private String notifyUrl;
+    
     /**
      * 密钥
      */
     @Column(name = "secret_key")
-    @ApiModelProperty(value="secretKey密钥")
+    @ApiModelProperty(value = "secretKey密钥")
     private String secretKey;
-
+    
     /**
      * 创建人
      */
     @Column(name = "create_user")
-    @ApiModelProperty(value="createUser创建人")
+    @ApiModelProperty(value = "createUser创建人")
     private String createUser;
-
+    
     /**
      * 更新人
      */
     @Column(name = "update_user")
-    @ApiModelProperty(value="updateUser更新人")
+    @ApiModelProperty(value = "updateUser更新人")
     private String updateUser;
-
+    
     /**
      * 更新时间
      */
     @Column(name = "update_time")
-    @ApiModelProperty(value="updateTime更新时间")
+    @ApiModelProperty(value = "updateTime更新时间")
     private Date updateTime;
-
+    
     /**
      * 创建时间
      */
     @Column(name = "create_time")
-    @ApiModelProperty(value="createTime创建时间")
+    @ApiModelProperty(value = "createTime创建时间")
     private Date createTime;
-
+    
     /**
      * 删除标识 1是0否
      */
     @Column(name = "is_valid")
-    @ApiModelProperty(value="isValid删除标识 1是0否")
+    @ApiModelProperty(value = "isValid删除标识 1是0否")
     private Byte isValid;
-
+    
     /**
      * 版本号
      */
-    @ApiModelProperty(value="version版本号")
+    @ApiModelProperty(value = "version版本号")
     private Integer version;
-
-    /**
-     * @return id
-     */
-    public Long getId() {
-        return id;
-    }
-
-    /**
-     * @param id
-     */
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    /**
-     * 获取支付通道编码
-     *
-     * @return channel_code - 支付通道编码
-     */
-    public String getChannelCode() {
-        return channelCode;
-    }
-
-    /**
-     * 设置支付通道编码
-     *
-     * @param channelCode 支付通道编码
-     */
-    public void setChannelCode(String channelCode) {
-        this.channelCode = channelCode;
-    }
-
-    /**
-     * 获取通道名称
-     *
-     * @return channel_name - 通道名称
-     */
-    public String getChannelName() {
-        return channelName;
-    }
-
-    /**
-     * 设置通道名称
-     *
-     * @param channelName 通道名称
-     */
-    public void setChannelName(String channelName) {
-        this.channelName = channelName;
-    }
-
-    /**
-     * 获取商户号
-     *
-     * @return merchant_num - 商户号
-     */
-    public String getMerchantNum() {
-        return merchantNum;
-    }
-
-    /**
-     * 设置商户号
-     *
-     * @param merchantNum 商户号
-     */
-    public void setMerchantNum(String merchantNum) {
-        this.merchantNum = merchantNum;
-    }
-
-    /**
-     * 获取应用id
-     *
-     * @return appid - 应用id
-     */
-    public String getAppid() {
-        return appid;
-    }
-
-    /**
-     * 设置应用id
-     *
-     * @param appid 应用id
-     */
-    public void setAppid(String appid) {
-        this.appid = appid;
-    }
-
-    /**
-     * 获取密钥
-     *
-     * @return secret_key - 密钥
-     */
-    public String getSecretKey() {
-        return secretKey;
-    }
-
-    /**
-     * 设置密钥
-     *
-     * @param secretKey 密钥
-     */
-    public void setSecretKey(String secretKey) {
-        this.secretKey = secretKey;
-    }
-
-    /**
-     * 获取创建人
-     *
-     * @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;
-    }
-
-    /**
-     * 获取删除标识 1是0否
-     *
-     * @return is_valid - 删除标识 1是0否
-     */
-    public Byte getIsValid() {
-        return isValid;
-    }
-
-    /**
-     * 设置删除标识 1是0否
-     *
-     * @param isValid 删除标识 1是0否
-     */
-    public void setIsValid(Byte isValid) {
-        this.isValid = isValid;
-    }
-
-    /**
-     * 获取版本号
-     *
-     * @return version - 版本号
-     */
-    public Integer getVersion() {
-        return version;
-    }
-
-    /**
-     * 设置版本号
-     *
-     * @param version 版本号
-     */
-    public void setVersion(Integer version) {
-        this.version = version;
-    }
+    
 }

+ 3 - 1
cif-service/src/main/java/com/txz/cif/model/RechargeRecord.java

@@ -4,9 +4,9 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
 
+import javax.persistence.*;
 import java.math.BigDecimal;
 import java.util.Date;
-import javax.persistence.*;
 @Getter
 @Setter
 @NoArgsConstructor
@@ -154,5 +154,7 @@ public class RechargeRecord {
     @Column(name = "bank_account")
     @ApiModelProperty(value="银行")
     private String bankAccount;
+    
+    private String url;
 
 }

+ 44 - 0
cif-service/src/main/java/com/txz/cif/task/GeneralJob.java

@@ -5,6 +5,7 @@ import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import com.txz.cif.dubbo.client.OrderDubboServiceClient;
 import com.txz.cif.service.DayCutService;
 import com.txz.cif.configurer.Parameters;
 import com.xxl.job.core.biz.model.ReturnT;
@@ -36,6 +37,9 @@ public class GeneralJob {
     private DayCutService dayCutService;
 
 
+    @Resource
+    private OrderDubboServiceClient orderDubboServiceClient;
+
     @Resource
     private Parameters parameters;
 
@@ -84,6 +88,46 @@ public class GeneralJob {
 
 
 
+    @XxlJob("scheduledTaskStorePinkSummaryClose")
+    public ReturnT<String> scheduledTaskStorePinkSummaryClose(String param) throws Exception {
+        try {
+            logger.info("【执行拼团超时关闭拼团】开始");
+            orderDubboServiceClient.scheduledTaskStorePinkSummaryClose();
+            logger.info("【执行拼团超时关闭拼团】完成");
+        } catch (Exception e) {
+            logger.error("【执行拼团超时关闭拼团】异常:e{}", e);
+            return ReturnT.FAIL;
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
+    @XxlJob("scheduledTaskBatchSigning")
+    public ReturnT<String> scheduledTaskBatchSigning(String param) throws Exception {
+        try {
+            logger.info("【执行定时签收】开始");
+            orderDubboServiceClient.scheduledTaskBatchSigning();
+            logger.info("【执行定时签收】完成");
+        } catch (Exception e) {
+            logger.error("【执行定时签收】异常:e{}", e);
+            return ReturnT.FAIL;
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("orderTimeoutAutomaticCancel")
+    public ReturnT<String> orderTimeoutAutomaticCancel(String param) throws Exception {
+        try {
+            logger.info("【订单支付超时定时关单任务】开始");
+            orderDubboServiceClient.orderTimeoutAutomaticCancel();
+            logger.info("【订单支付超时定时关单任务】完成");
+        } catch (Exception e) {
+            logger.error("【订单支付超时定时关单任务】异常:e{}", e);
+            return ReturnT.FAIL;
+        }
+        return ReturnT.SUCCESS;
+    }
+
     public static void main(String[] args) {
 //        int quhao = 154;
 //        int weihao = 9642;

+ 115 - 0
cif-service/src/main/java/com/txz/cif/util/ShareCodeUtils.java

@@ -0,0 +1,115 @@
+package com.txz.cif.util;
+
+import java.util.Random;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/9/1
+ */
+
+public class ShareCodeUtils {
+    
+    /**
+     * 自定义进制字符数组(不包含0,1,容易与o,l混淆)
+     * 数组顺序可进行调整增加反推难度,A用来补位因此此数组不包含A,共32个字符。
+     */
+    private static final char[] BASE = new char[]{'H', 'V', 'E', '8', 'S', '2', 'D', 'Z', 'X', '9', 'C', '7', 'P',
+            '5', 'I', 'K', '3', 'M', 'J', 'U', 'F', 'R', '4', 'W', 'Y', 'L', 'T', 'N', '6', 'B', 'G', 'Q'};
+    
+    /**
+     * A补位字符,不能与自定义重复
+     */
+    private static final char SUFFIX_CHAR = 'A';
+    
+    /**
+     * 进制长度
+     */
+    private static final int BIN_LEN = BASE.length;
+    
+    /**
+     * 邀请码默认长度
+     */
+    private static final int INVITATION_CODE_LEN = 6;
+    
+    /**
+     * 将邀请码解码为ID
+     */
+    public static Long codeToId(String code) {
+        if (code == null || code.isEmpty()) {
+            return 0L;
+        }
+        
+        char[] charArray = code.toCharArray();
+        long result = 0L;
+        
+        for (int i = 0; i < charArray.length; i++) {
+            if (charArray[i] == SUFFIX_CHAR) {
+                break;
+            }
+            
+            int index = -1;
+            for (int j = 0; j < BIN_LEN; j++) {
+                if (charArray[i] == BASE[j]) {
+                    index = j;
+                    break;
+                }
+            }
+            
+            if (index == -1) {
+                return 0L;
+            }
+            
+            if (i > 0) {
+                result = result * BIN_LEN + index;
+            } else {
+                result = index;
+            }
+        }
+        return result;
+    }
+    
+    /**
+     * 将ID编码为6位邀请码
+     */
+    public static String idToInvitationCode(Long id) {
+        return idToInvitationCode(id, INVITATION_CODE_LEN);
+    }
+    
+    /**
+     * 将ID编码为指定长度的邀请码
+     */
+    public static String idToInvitationCode(Long id, int codeLen) {
+        if (id == null || id <= 0) {
+            return null;
+        }
+        
+        char[] buf = new char[Math.max(codeLen, BIN_LEN)];
+        int charPos = buf.length;
+        
+        long workId = id;
+        while (workId >= BIN_LEN) {
+            int index = (int) (workId % BIN_LEN);
+            buf[--charPos] = BASE[index];
+            workId /= BIN_LEN;
+        }
+        buf[--charPos] = BASE[(int) (workId % BIN_LEN)];
+        
+        String result = new String(buf, charPos, buf.length - charPos);
+        int len = result.length();
+        
+        if (len < codeLen) {
+            StringBuilder sb = new StringBuilder(codeLen);
+            sb.append(SUFFIX_CHAR);
+            Random random = new Random();
+            
+            for (int i = 0; i < codeLen - len - 1; i++) {
+                sb.append(BASE[random.nextInt(BIN_LEN)]);
+            }
+            
+            result += sb.toString();
+        }
+        
+        return result;
+    }
+    
+}

+ 131 - 124
cif-service/src/main/java/com/txz/cif/web/UserApiController.java

@@ -1,28 +1,30 @@
 package com.txz.cif.web;
 
-import java.lang.reflect.Member;
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.crypto.SecureUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+
 import com.txz.cif.configurer.LocalUtil;
+
+import com.txz.cif.core.*;
+
 import com.txz.cif.dubbo.client.OperatingConfigDubboServiceClient;
 import com.txz.cif.enums.BizTypeEnum;
 import com.txz.cif.enums.RechargeStatusEnum;
 import com.txz.cif.enums.RedEnvelopeStatusEnum;
 import com.txz.cif.enums.WithdrawStatusEnum;
-import com.txz.cif.util.IpUtils;
+import com.txz.cif.model.ConfigMember;
+import com.txz.cif.model.User;
+import com.txz.cif.service.ConfigMemberService;
+import com.txz.cif.service.RedEnvelopeService;
+import com.txz.cif.service.SequenceService;
+import com.txz.cif.service.UserService;
+import com.txz.cif.util.ShareCodeUtils;
 import com.txz.cif.web.bo.EnumBo;
 import com.txz.cif.web.bo.UserBo;
 import com.txz.cif.web.bo.UserInfoBO;
@@ -30,53 +32,57 @@ import com.txz.cif.web.para.LoginAccountParameters;
 import com.txz.cif.web.para.MyUserParam;
 import com.txz.cif.web.para.RegisterAccountParameters;
 import com.txz.cif.web.para.UserInfoForm;
-import com.txz.cif.core.*;
-import com.txz.cif.model.*;
-import com.txz.cif.service.*;
-import com.txz.cif.core.AuthService;
 import com.txz.operating.dto.ConfigDTO;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
-import lombok.extern.slf4j.Slf4j;
 import tk.mybatis.mapper.entity.Condition;
 import tk.mybatis.mapper.entity.Example;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
 @RestController
 @RequestMapping(value = "/api/user")
 @Api(tags = "[API]用户相关操作")
 @Slf4j
 public class UserApiController extends AbstractApiController {
-
+    
     @Resource
     private RedisUtil redisUtil;
-
+    
     @Resource
     private UserService userService;
-
+    
     @Resource
     private ConfigMemberService configMemberService;
-
+    
     @Resource
     private AuthService authService;
-
+    
     @Resource
     private SequenceService sequenceService;
-
-
+    
+    
     @Resource
     private RedEnvelopeService redEnvelopeService;
-
+    
     @Resource
     private OperatingConfigDubboServiceClient configDubboServiceClient;
-
+    
     @GetMapping("/getEnum")
-    @ApiOperation(value = "获取枚举(1业务类型 2充值状态 3提现状态 4收益状态 5收益业务类型)",httpMethod = "GET")
+    @ApiOperation(value = "获取枚举(1业务类型 2充值状态 3提现状态 4收益状态 5收益业务类型)", httpMethod = "GET")
     public Result<List<EnumBo>> getEnum(@RequestParam Integer id) {
-        if(id == null){
+        if (id == null) {
             id = 1;
         }
-        switch (id){
+        switch (id) {
             case 1:
                 return ResultGenerator.genSuccessResult(Arrays.stream(BizTypeEnum.values())
                         .map(temp -> {
@@ -131,17 +137,14 @@ public class UserApiController extends AbstractApiController {
         return ResultGenerator.genSuccessResult();
     }
 
-//    public static void main(String[] args) {
-//        System.out.println("RedEnvelopeStatusEnum."+RedEnvelopeStatusEnum.SUCCESS.name());
-//    }
-
+    
+    @ApiOperation(value = "用户登陆", notes = "", httpMethod = "POST")
 
-    @ApiOperation(value = "用户登陆", notes = "",httpMethod = "POST")
     @PostMapping("/login")
-    public Result<UserBo> login(@RequestBody LoginAccountParameters loginPara ,
-                                @RequestHeader(value = "version",defaultValue = "1.0.1") String version ,
+    public Result<UserBo> login(@RequestBody LoginAccountParameters loginPara,
+                                @RequestHeader(value = "version", defaultValue = "1.0.1") String version,
                                 HttpServletRequest request) {
-        if (StrUtil.isBlank(loginPara.getAccount())){
+        if (StrUtil.isBlank(loginPara.getAccount())) {
             return ResultGenerator.genFailResult(ResultCode.ACCOUNT_IS_NULL);
         }
         if (StringUtils.isBlank(loginPara.getPwd())) {
@@ -160,12 +163,12 @@ public class UserApiController extends AbstractApiController {
                 user = operators.get(0);
             }
             String pwd2 = SecureUtil.md5(loginPara.getPwd() + user.getSalt());
-            log.info("用户:"+loginPara.getAccount()+"登录密码:"+loginPara.getPwd() +"加密后:"+pwd2);
+            log.info("用户:" + loginPara.getAccount() + "登录密码:" + loginPara.getPwd() + "加密后:" + pwd2);
             if (StrUtil.equals(user.getPwd().toUpperCase(), pwd2.toUpperCase())) {
                 if (user == null) {
                     return ResultGenerator.genFailResult(ResultCode.USER_IS_NULL);
                 }
-                if (user.getStatus() != 1){
+                if (user.getStatus() != 1) {
                     return ResultGenerator.genFailResult(ResultCode.USER_STATUS_IS_ERROR);
                 }
                 String token = authService.buildJwtToken(user.getId());
@@ -174,121 +177,119 @@ public class UserApiController extends AbstractApiController {
             } else {
                 return ResultGenerator.genFailResult(ResultCode.UNLOGIN_PWD_ERROR);
             }
-
+            
             return ResultGenerator.genSuccessResult(UserBo.builder().token(user.getLastToken())
-                            .userId(user.getId()).icon(user.getHeadPic()).name(user.getName())
-                            .sseId(SecureUtil.md5("sse"+user.getId())).build());
-        } catch (Exception e){
-            log.error("登录异常:",e);
+                    .userId(user.getId()).icon(user.getHeadPic()).name(user.getName())
+                    .sseId(SecureUtil.md5("sse" + user.getId())).build());
+        } catch (Exception e) {
+            log.error("登录异常:", e);
             return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
         }
-
+        
     }
-
-
-    @ApiOperation(value = "获取Token内的参数", notes = "",httpMethod = "GET")
+    
+    
+    @ApiOperation(value = "获取Token内的参数", notes = "", httpMethod = "GET")
     @GetMapping("/getTokenParam")
     public Result getTokenParam(@RequestParam String authentication) {
         return ResultGenerator.genSuccessResult(authService.getClaimsFromToken(authentication));
     }
-
-
-    @ApiOperation(value = "获取验证码", notes = "",httpMethod = "GET")
+    
+    
+    @ApiOperation(value = "获取验证码", notes = "", httpMethod = "GET")
     @GetMapping("/getCode")
     public Result<UserInfoBO> getCode(@RequestParam String phoneNo) {
-//        Long userId = authService.getTokenUserId(request);
-        //TODO 发送短信
+        //        Long userId = authService.getTokenUserId(request);
+        // TODO 发送短信
         Result<Object> result = userService.sendCode(phoneNo);
         return ResultGenerator.genSuccessResult(result.getData().toString());
     }
-
-    @ApiOperation(value = "获取会员等级配置", notes = "",httpMethod = "GET")
+    
+    @ApiOperation(value = "获取会员等级配置", notes = "", httpMethod = "GET")
     @GetMapping("/memberConfigs")
     public Result<List<ConfigMember>> memberConfigs() {
         List<ConfigMember> result = configMemberService.findAll();
         return ResultGenerator.genSuccessResult(result);
     }
-
-
-
-
-    @ApiOperation(value = "查询用户资料", notes = "",httpMethod = "GET")
+    
+    
+    @ApiOperation(value = "查询用户资料", notes = "", httpMethod = "GET")
     @GetMapping("/getUserInfo")
     public Result<UserInfoBO> getUserInfo(HttpServletRequest request) {
-
+        
         Long userId = authService.getTokenUserId(request);
-        if (userId == null ){
+        if (userId == null) {
             ResultGenerator.genFailResult(ResultCode.OAUTH_INVALID_ACCESS_TOKEN);
         }
         User user = userService.findById(userId);
-        if (user == null){
+        if (user == null) {
             return ResultGenerator.genFailResult(ResultCode.USER_IS_NULL);
         }
-        if (StrUtil.isBlank(user.getHeadPic())){
-            String zm = user.getName().substring(0,1).toUpperCase();
+        if (StrUtil.isBlank(user.getHeadPic())) {
+            String zm = user.getName().substring(0, 1).toUpperCase();
             Integer index = RandomUtil.randomInt(10);
             com.txz.operating.result.Result<ConfigDTO> defaultAvatar = configDubboServiceClient.getConfigByCode("default_avatar");
-            String headPic = defaultAvatar.getData().getValueInfo()+ zm +"/"+zm+"_gradient_"+index+".png" ;
+            String headPic = defaultAvatar.getData().getValueInfo() + zm + "/" + zm + "_gradient_" + index + ".png";
             user.setHeadPic(headPic);
             userService.update(User.builder().id(userId).headPic(headPic).build());
         }
         UserInfoBO bo = user.generator();
         Condition c = new Condition(User.class);
-        c.createCriteria().andEqualTo("pid",user.getId());
+        c.createCriteria().andEqualTo("pid", user.getId());
         Integer invited = userService.countByCondition(c);
         bo.setInvitedNo(invited);
-        //下级要人数
+        // 下级要人数
         ConfigMember nextLevel = configMemberService.findBy("level", user.getVipLevel() + 1);
-        if (nextLevel == null){
+        if (nextLevel == null) {
             bo.setNextInvitedNo(invited);
         } else {
             bo.setNextInvitedNo(nextLevel.getInvitedNo());
         }
         c = new Condition(User.class);
-        c.createCriteria().andEqualTo("ppid",user.getId());
+        c.createCriteria().andEqualTo("ppid", user.getId());
         Integer invited2 = userService.countByCondition(c);
-        bo.setTeamNo(invited+invited2);
-        //7日收益
-        BigDecimal amount = redEnvelopeService.sumWithDay(7,user.getId(),3);
+        bo.setTeamNo(invited + invited2);
+        // 7日收益
+        BigDecimal amount = redEnvelopeService.sumWithDay(7, user.getId(), 3);
         bo.setL7DEarnings(amount);
         return ResultGenerator.genSuccessResult(bo);
     }
-
-    @ApiOperation(value = "更新用户", notes = "",httpMethod = "POST")
+    
+    @ApiOperation(value = "更新用户", notes = "", httpMethod = "POST")
     @PostMapping("/updateUser")
-    public Result<UserInfoBO> updateUser(@RequestBody UserInfoForm userForm,HttpServletRequest request) {
+    public Result<UserInfoBO> updateUser(@RequestBody UserInfoForm userForm, HttpServletRequest request) {
         Long userId = authService.getTokenUserId(request);
-        if (userId == null ){
+        if (userId == null) {
             ResultGenerator.genFailResult(ResultCode.OAUTH_INVALID_ACCESS_TOKEN);
         }
         User user = userService.findById(userId);
-        if (user == null){
+        if (user == null) {
             return ResultGenerator.genFailResult(ResultCode.USER_IS_NULL);
         }
-        User temp = BeanUtil.toBean(userForm,User.class);
+        User temp = BeanUtil.toBean(userForm, User.class);
         temp.setId(userId);
         userService.update(temp);
         user = userService.findById(userId);
-        if (StrUtil.isNotBlank(userForm.getPhoneNo())){
-            userService.resetPhoneNo(userId,userForm.getPhoneNo());
+        if (StrUtil.isNotBlank(userForm.getPhoneNo())) {
+            userService.resetPhoneNo(userId, userForm.getPhoneNo());
         }
         return ResultGenerator.genSuccessResult(user.generator());
     }
-
-
+    
+    
     @PostMapping("/register")
-    @ApiOperation(value = "注册",httpMethod = "POST")
+    @ApiOperation(value = "注册", httpMethod = "POST")
     public Result register(@RequestBody RegisterAccountParameters params) {
-        if(params == null){
+        if (params == null) {
             return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
         }
-        if(StrUtil.isBlank(params.getPhone())){
+        if (StrUtil.isBlank(params.getPhone())) {
             return ResultGenerator.genFailResult(ResultCode.ACCOUNT_IS_NULL);
         }
         Condition condition = new Condition(User.class);
-        condition.createCriteria().andEqualTo("phoneNo",params.getPhone());
+        condition.createCriteria().andEqualTo("phoneNo", params.getPhone());
         List<User> users = userService.findByCondition(condition);
-        if(CollUtil.isNotEmpty(users)){
+        if (CollUtil.isNotEmpty(users)) {
             return ResultGenerator.genFailResult(ResultCode.USER_IS_EXIST);
         }
         if (!userService.checkCode(params.getPhone(), params.getVerifyCode())) {
@@ -296,94 +297,100 @@ public class UserApiController extends AbstractApiController {
         }
         String salt = RandomUtil.randomString(4);
         String pwd2 = SecureUtil.md5(params.getPwd() + salt).toUpperCase();
-        log.error("[密码]"+params.getPhone() + " :"+pwd2);
-
+        log.error("[密码]" + params.getPhone() + " :" + pwd2);
+        
         String code = getInviteCode(0);
-        if (code == null){
+        if (code == null) {
             return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
         }
         User parent = userService.findBy("invitedCode", params.getCode());
-        String userNo = sequenceService.genSerialNumber("register_rule",null);
+        // String userNo = sequenceService.genSerialNumber("register_rule",null);
         User user = User.builder().createTime(DateUtil.date()).invitedCode(code)
-                .name(params.getName()).userNo(userNo).isDelete((byte)1).createUser("sys")
-                .status((byte)1).phoneNo(params.getPhone()).pwd(pwd2).salt(salt).build();
-        if (parent != null){
+                .name(params.getName())
+                // .userNo(userNo)
+                .isDelete((byte) 1).createUser("sys")
+                .status((byte) 1).phoneNo(params.getPhone()).pwd(pwd2).salt(salt).build();
+        if (parent != null) {
             user.setPid(parent.getId());
-            if (parent.getPid() != null){
+            if (parent.getPid() != null) {
                 user.setPpid(parent.getPid());
             }
         }
-        if (StrUtil.isBlank(user.getHeadPic())){
-            String zm = user.getName().substring(0,1).toUpperCase();
+        if (StrUtil.isBlank(user.getHeadPic())) {
+            String zm = user.getName().substring(0, 1).toUpperCase();
             Integer index = RandomUtil.randomInt(10);
             com.txz.operating.result.Result<ConfigDTO> defaultAvatar = configDubboServiceClient.getConfigByCode("default_avatar");
-            String headPic = defaultAvatar.getData().getValueInfo()+ zm +"/"+zm+"_gradient_"+index+".png" ;
+            String headPic = defaultAvatar.getData().getValueInfo() + zm + "/" + zm + "_gradient_" + index + ".png";
             user.setHeadPic(headPic);
         }
         user.setVipLevel(1);
         userService.add(user);
+        user.setUserNo(ShareCodeUtils.idToInvitationCode(user.getId()));
+        userService.update(user);
         user.setPwd("***");
         user.setSalt("***");
         return ResultGenerator.genSuccessResult(user);
     }
-
+    
     private String getInviteCode(int index) {
-        if (index > 10000){
+        if (index > 10000) {
             return null;
         }
         String s = RandomUtil.randomString(8);
         User inviteCode = userService.findBy("invitedCode", s);
-        if (inviteCode == null){
+        if (inviteCode == null) {
             return s;
         }
         return getInviteCode(index + 1);
     }
-
+    
     /**
      * 通过旧密码设置密码
      *
-     * @param userId       用户 UID
-     * @return          执行结果
+     * @param userId 用户 UID
+     *
+     * @return 执行结果
      */
-    @ApiOperation(value = "通过旧密码设置密码", notes = "",httpMethod = "GET")
+    @ApiOperation(value = "通过旧密码设置密码", notes = "", httpMethod = "GET")
     @GetMapping("/resetPwd")
-    public Result<Object> resetPwd(@RequestHeader(value = X_CLIENT_TOKEN_USERID,required = false) Long userId,
+    public Result<Object> resetPwd(@RequestHeader(value = X_CLIENT_TOKEN_USERID, required = false) Long userId,
                                    @RequestParam("pwd") String pwd,
                                    @RequestParam("newPwd") String newPwd
-                                   ) {
-        return userService.resetPwd(userId,pwd,newPwd);
+    ) {
+        return userService.resetPwd(userId, pwd, newPwd);
     }
-
+    
     /**
      * 通过旧密码设置密码
      *
-     * @param phoneNo       用户 UID
-     * @return          执行结果
+     * @param phoneNo 用户 UID
+     *
+     * @return 执行结果
      */
-    @ApiOperation(value = "通过验证码设置密码", notes = "",httpMethod = "GET")
+    @ApiOperation(value = "通过验证码设置密码", notes = "", httpMethod = "GET")
     @GetMapping("/resetPwdByCode")
     public Result<Object> resetPwdByCode(@RequestParam("phoneNo") String phoneNo,
-                                   @RequestParam("verifyCode") String verifyCode,
-                                   @RequestParam("newPwd") String newPwd
+                                         @RequestParam("verifyCode") String verifyCode,
+                                         @RequestParam("newPwd") String newPwd
     ) {
-        return userService.resetPwdByCode(phoneNo,verifyCode,newPwd);
+        return userService.resetPwdByCode(phoneNo, verifyCode, newPwd);
     }
-
-
+    
+    
     @PostMapping("/myUsers")
-    @ApiOperation(value = "获取我的邀请的用户",httpMethod = "POST")
+    @ApiOperation(value = "获取我的邀请的用户", httpMethod = "POST")
     public Result<List<User>> myUsers(@RequestBody MyUserParam param, HttpServletRequest request) {
         Long userId = authService.getTokenUserId(request);
-        if (userId == null ){
+        if (userId == null) {
             ResultGenerator.genFailResult(ResultCode.OAUTH_INVALID_ACCESS_TOKEN);
         }
         PageHelper.startPage(param.getPage(), param.getSize());
         Condition condition = new Condition(User.class);
         Example.Criteria criteria = condition.createCriteria();
-        if (param.getType() != null && param.getType() == 1){
-            criteria.andEqualTo("pid",userId);
+        if (param.getType() != null && param.getType() == 1) {
+            criteria.andEqualTo("pid", userId);
         } else {
-            criteria.andEqualTo("ppid",userId);
+            criteria.andEqualTo("ppid", userId);
         }
         if (StrUtil.isNotBlank(param.getName())) {
             criteria.andLike("name", "%" + param.getName() + "%");
@@ -397,7 +404,7 @@ public class UserApiController extends AbstractApiController {
         if (StrUtil.isNotBlank(param.getEndTime())) {
             criteria.andLessThanOrEqualTo("createTime", param.getEndTime());
         }
-
+        
         PageInfo pageInfo = null;
         try {
             List<User> list = userService.findByCondition(condition);
@@ -412,6 +419,6 @@ public class UserApiController extends AbstractApiController {
         }
         return ResultGenerator.genSuccessResult(pageInfo);
     }
-
-
+    
+    
 }

+ 49 - 0
cif-service/src/main/java/com/txz/cif/web/mng/OrderApiController.java

@@ -0,0 +1,49 @@
+package com.txz.cif.web.mng;
+
+import com.txz.cif.core.Result;
+
+import com.txz.cif.core.ResultGenerator;
+import com.txz.cif.dubbo.client.OrderDubboServiceClient;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+
+@Api(tags = "[后台]mall定时任务")
+@RestController
+@RequestMapping("/order/api/test")
+public class OrderApiController {
+
+    @Resource
+    private OrderDubboServiceClient orderDubboServiceClient;
+
+
+    @PostMapping("/scheduledTaskStorePinkSummaryClose")
+    @ApiOperation(value = "拼团超时定时任务",httpMethod = "POST")
+    public Result scheduledTaskStorePinkSummaryCloseTest() {
+        orderDubboServiceClient.scheduledTaskStorePinkSummaryClose();
+        return ResultGenerator.genSuccessResult();
+    }
+
+
+    @PostMapping("/scheduledTaskBatchSigning")
+    @ApiOperation(value = "自动签收定时任务",httpMethod = "POST")
+    public Result scheduledTaskBatchSigningTest() {
+        orderDubboServiceClient.scheduledTaskBatchSigning();
+        return ResultGenerator.genSuccessResult();
+    }
+
+    @PostMapping("/orderTimeoutAutomaticCancel")
+    @ApiOperation(value = "订单超时未支付定时取消",httpMethod = "POST")
+    public Result orderTimeoutAutomaticCancel() {
+        orderDubboServiceClient.orderTimeoutAutomaticCancel();
+        return ResultGenerator.genSuccessResult();
+    }
+
+}

+ 52 - 19
cif-service/src/main/java/com/txz/cif/web/para/PaymentChannelParam.java

@@ -10,44 +10,77 @@ import lombok.*;
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
-@ApiModel(value="支付通道入参")
+@ApiModel(value = "支付通道入参")
 public class PaymentChannelParam {
-
-
+    
+    
     /**
      * 支付通道编码
      */
-
-    @ApiModelProperty(value="channelCode支付通道编码")
+    
+    @ApiModelProperty(value = "channelCode支付通道编码")
     private String channelCode;
-
+    
     /**
      * 通道名称
      */
-    @ApiModelProperty(value="channelName通道名称")
+    @ApiModelProperty(value = "channelName通道名称")
     private String channelName;
-
+    
     /**
      * 商户号
      */
-
-    @ApiModelProperty(value="merchantNum商户号")
+    
+    @ApiModelProperty(value = "merchantNum商户号")
     private String merchantNum;
-
+    
     /**
      * 应用id
      */
-    @ApiModelProperty(value="appid应用id")
+    @ApiModelProperty(value = "appid应用id")
     private String appid;
-
+    
     /**
      * 密钥
      */
-
-    @ApiModelProperty(value="secretKey密钥")
+    
+    @ApiModelProperty(value = "secretKey密钥")
     private String secretKey;
-
-
-
-
+    
+    
+    /**
+     * bkash支付编码
+     */
+    private String bkashPayCode;
+    
+    /**
+     * nagad支付编码
+     */
+    private String nagadPayCode;
+    
+    /**
+     * rocket支付编码
+     */
+    private String rocketPayCode;
+    
+    /**
+     * bkash提现编码
+     */
+    private String bkashWithdrawCode;
+    
+    /**
+     * nagad提现编码
+     */
+    private String nagadWithdrawCode;
+    
+    /**
+     * rocket提现编码
+     */
+    private String rocketWithdrawCode;
+    
+    /**
+     * 异步通知地址
+     */
+    private String notifyUrl;
+    
 }

+ 55 - 21
cif-service/src/main/java/com/txz/cif/web/para/updateparam/PaymentChannelUpdateParam.java

@@ -11,51 +11,85 @@ import lombok.*;
 @Builder
 @ApiModel("支付通道修改入参")
 public class PaymentChannelUpdateParam {
-
-
-    @ApiModelProperty(value="id")
+    
+    
+    @ApiModelProperty(value = "id")
     private Long id;
-
-
-
+    
+    
     /**
      * 支付通道编码
      */
-    @ApiModelProperty(value="channelCode支付通道编码")
+    @ApiModelProperty(value = "channelCode支付通道编码")
     private String channelCode;
-
+    
     /**
      * 通道名称
      */
-    @ApiModelProperty(value="channelName通道名称")
+    @ApiModelProperty(value = "channelName通道名称")
     private String channelName;
-
+    
     /**
      * 商户号
      */
-
-    @ApiModelProperty(value="merchantNum商户号")
+    
+    @ApiModelProperty(value = "merchantNum商户号")
     private String merchantNum;
-
+    
     /**
      * 应用id
      */
-    @ApiModelProperty(value="appid应用id")
+    @ApiModelProperty(value = "appid应用id")
     private String appid;
-
+    
     /**
      * 密钥
      */
-
-    @ApiModelProperty(value="secretKey密钥")
+    
+    @ApiModelProperty(value = "secretKey密钥")
     private String secretKey;
-
+    
     /**
      * 1开启 0关闭
      */
-    @ApiModelProperty(value="status1开启 0关闭")
+    @ApiModelProperty(value = "status1开启 0关闭")
     private Byte status;
-
-    @ApiModelProperty(value="isValid删除标识 1是0否")
+    
+    @ApiModelProperty(value = "isValid删除标识 1是0否")
     private Byte isValid;
+    
+    /**
+     * bkash支付编码
+     */
+    private String bkashPayCode;
+    
+    /**
+     * nagad支付编码
+     */
+    private String nagadPayCode;
+    
+    /**
+     * rocket支付编码
+     */
+    private String rocketPayCode;
+    
+    /**
+     * bkash提现编码
+     */
+    private String bkashWithdrawCode;
+    
+    /**
+     * nagad提现编码
+     */
+    private String nagadWithdrawCode;
+    
+    /**
+     * rocket提现编码
+     */
+    private String rocketWithdrawCode;
+    
+    /**
+     * 异步通知地址
+     */
+    private String notifyUrl;
 }

+ 1 - 1
cif-service/src/main/resources/bootstrap.properties

@@ -50,7 +50,7 @@ dubbo.cloud.subscribed-services=operating
 dubbo.provider.dynamic=true
 dubbo.application.qos.enable=false
 dubbo.application.qos.port=-1
-dubbo.application.qos.accept.foreign.ip=true
+dubbo.application.qos.accept.foreign.ip=false
 dubbo.reference.com.foo.BarService.check=false
 dubbo.reference.check=false
 dubbo.consumer.check=false