linxk před 2 týdny
rodič
revize
0dd5f22f24

+ 0 - 33
cif-service/src/main/java/com/txz/cif/enums/ApplicationTypeEnum.java

@@ -1,33 +0,0 @@
-package com.txz.cif.enums;
-
-/**
- * 应用类型
- */
-public enum ApplicationTypeEnum {
-
-
-    DREAM(1, "梦想庄园","pro,local,dev"),
-    ;
-
-    private Integer key;
-    private String value;
-    private String platform;
-
-    ApplicationTypeEnum(Integer key, String value,String platform) {
-        this.key = key;
-        this.value = value;
-        this.platform = platform;
-    }
-
-    public Integer getKey() {
-        return key;
-    }
-
-    public String getDesc() {
-        return value;
-    }
-
-    public String getPlatform() {
-        return platform;
-    }
-}

+ 0 - 37
cif-service/src/main/java/com/txz/cif/enums/LoginTypeEnum.java

@@ -1,37 +0,0 @@
-package com.txz.cif.enums;
-
-import lombok.Getter;
-
-/**
- * 支持登录类型 0,账号登录 1,手机短验登录 2,邮箱登录 3,微信公众号登录 4小天才登录
- */
-@Getter
-public enum LoginTypeEnum {
-
-    ACCOUNT_LOGIN(0, "账号登录"),
-    PHONE_LOGIN(1, "手机短验登录"),
-    EMAIL_LOGIN(2, "邮箱登录"),
-    WECHAT_OFFICIAL_LOGIN(3, "微信公众号登录"),
-    BBK_LOGIN(4, "步步高小天才登录"),
-    // BBK_APP_LOGIN(5, "步步高小天才APP登录"),
-
-    ;
-
-    private Integer key;
-    private String value;
-
-    LoginTypeEnum(Integer key, String value) {
-        this.key = key;
-        this.value = value;
-    }
-
-    public static String getValueByKey(int key) {
-        for (LoginTypeEnum value : values()) {
-            if (value.key == key) {
-                return value.value;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 78
cif-service/src/main/java/com/txz/cif/enums/MessageBizTypeEnum.java

@@ -1,78 +0,0 @@
-package com.txz.cif.enums;
-
-/**
- * 消息业务类型 1 收到新病例 2 收到新冰冻病例  3 处理中的病例信息更新 4 处理中的病例收到发起端新的消息留言 5 月账单结算
- */
-public enum MessageBizTypeEnum {
-
-    NEW_CASE(1, "收到新病例",true,"121"),
-    NEW_FROZEN_CASE(2, "收到新冰冻病例",true,"121"),
-    CASE_UPDATE(3, "处理中的病例信息更新",true,"221"),
-    CASE_MESSAGE(4, "处理中的病例收到发起端新的消息留言",false,"221"),
-    MONTH_SETTLE(5, "月账单结算",true,"220"),
-
-    CASE_MESSAGE2(6, "处理中的病例收到发起端新的消息留言",false,"221"),
-    ;
-
-    private Integer key;
-    private String value;
-    /**
-     * 用户活跃时是否发送
-     */
-    private Boolean active;
-
-    /**
-     * 指针 0短信 1邮箱 2站内信
-     * 是否强制发送 0不发送 1强制发送 2用户设置
-     */
-    private String control;
-
-    MessageBizTypeEnum(Integer key, String value,Boolean active,String control) {
-        this.key = key;
-        this.value = value;
-        this.active = active;
-        this.control = control;
-    }
-
-    public static String getValueByKey(int key) {
-        for (MessageBizTypeEnum value : values()) {
-            if (value.key == key) {
-                return value.value;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 获取 指针 下的是否强制发送
-     * @param key
-     * @param pointer 1短信 2邮箱 3站内信
-     * @return  0不发送 1强制发送 2用户设置
-     */
-    public static Integer getControlByKey(int key,int pointer) {
-        for (MessageBizTypeEnum value : values()) {
-            if (value.key == key) {
-
-                return Integer.parseInt(value.control.substring(pointer-1,pointer));
-            }
-        }
-        return null;
-    }
-
-    public static Boolean getActiveByKey(int key) {
-        for (MessageBizTypeEnum value : values()) {
-            if (value.key == key) {
-                return value.active;
-            }
-        }
-        return null;
-    }
-
-    public Integer getKey() {
-        return key;
-    }
-
-    public String getValue() {
-        return value;
-    }
-}

+ 0 - 36
cif-service/src/main/java/com/txz/cif/enums/PayTypeEnum.java

@@ -1,36 +0,0 @@
-package com.txz.cif.enums;
-
-/**
- * 支付方式 1微信公众号 2小天才服务号 3线下支付
- */
-public enum PayTypeEnum {
-
-    WECHAT_PAY((byte)1, "微信"),
-    H5_ALIPAY((byte)2, "支付宝H5"),
-    ;
-
-    private Byte key;
-    private String value;
-
-    PayTypeEnum(Byte key, String value) {
-        this.key = key;
-        this.value = value;
-    }
-
-    public static PayTypeEnum getEnum(Byte key) {
-        for (PayTypeEnum temp: PayTypeEnum.values()) {
-            if (temp.key.compareTo(key)== 0){
-                return temp;
-            }
-        }
-        return null;
-    }
-
-    public Byte getKey() {
-        return key;
-    }
-
-    public String getDesc() {
-        return value;
-    }
-}

+ 39 - 0
cif-service/src/main/java/com/txz/cif/enums/RechargeStatusEnum.java

@@ -0,0 +1,39 @@
+package com.txz.cif.enums;
+
+/**
+ *  状态 1处理中 2充值成功 3充值失败 4超时取消
+ */
+public enum RechargeStatusEnum {
+
+    PROCESSED(1, "处理中"),
+    SUCCESS(2, "充值成功"),
+    FAIL( 3, "充值失败"),
+    CANCEL( 4, "超时取消"),
+    ;
+
+    private Integer key;
+    private String value;
+
+    RechargeStatusEnum(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public static RechargeStatusEnum getEnum(Integer key) {
+        for (RechargeStatusEnum temp: RechargeStatusEnum.values()) {
+            if (temp.key.compareTo(key)== 0){
+                return temp;
+            }
+        }
+        return null;
+    }
+
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getDesc() {
+        return value;
+    }
+}

+ 37 - 0
cif-service/src/main/java/com/txz/cif/enums/RedEnvelopeStatusEnum.java

@@ -0,0 +1,37 @@
+package com.txz.cif.enums;
+
+/**
+ *  状态 1待结算 2已结算
+ */
+public enum RedEnvelopeStatusEnum {
+
+    PROCESSED(1, "待结算"),
+    SUCCESS(2, "已结算"),
+    ;
+
+    private Integer key;
+    private String value;
+
+    RedEnvelopeStatusEnum(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public static RedEnvelopeStatusEnum getEnum(Integer key) {
+        for (RedEnvelopeStatusEnum temp: RedEnvelopeStatusEnum.values()) {
+            if (temp.key.compareTo(key)== 0){
+                return temp;
+            }
+        }
+        return null;
+    }
+
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getDesc() {
+        return value;
+    }
+}

+ 0 - 40
cif-service/src/main/java/com/txz/cif/enums/SettleBizTypeEnum.java

@@ -1,40 +0,0 @@
-package com.txz.cif.enums;
-
-/**
- * 状态 1常规 2冰冻 3疑难
- */
-public enum SettleBizTypeEnum {
-
-    GENERAL(1, "常规"),
-    FROZEN(2, "冰冻"),
-    KNOTTY(3, "疑难"),
-
-    CONSULTATION(4, "会诊"),
-
-    ;
-
-    private Integer key;
-    private String value;
-
-    SettleBizTypeEnum(Integer key, String value) {
-        this.key = key;
-        this.value = value;
-    }
-
-    public static String getValueByKey(int key) {
-        for (SettleBizTypeEnum value : values()) {
-            if (value.key == key) {
-                return value.value;
-            }
-        }
-        return null;
-    }
-
-    public Integer getKey() {
-        return key;
-    }
-
-    public String getDesc() {
-        return value;
-    }
-}

+ 0 - 66
cif-service/src/main/java/com/txz/cif/enums/SysTypeEnum.java

@@ -1,66 +0,0 @@
-package com.txz.cif.enums;
-
-import lombok.Getter;
-
-/**
- * 系统分类
- */
-@Getter
-public enum SysTypeEnum {
-
-    Breast(1,"乳腺病理","Breast pathology"),
-    Thyroid(2,"甲状腺病理","Thyroid pathology"),
-    Dermato(3,"皮肤病理","Dermatopathology"),
-    Neuro(4,"神经系统病理","Neuropathology"),
-    Lung(5,"呼吸系统病理","Lung pathology"),
-    Gastrointestinal(6,"消化系统病理","Gastrointestinal pathology"),
-    Peritoneal_And_retroperitoneal(7,"腹膜及腹膜后病理","Peritoneal and retroperitoneal pathology"),
-    Soft_tissue(8,"软组织病理","Soft tissue pathology"),
-    Bone_and_joint(9,"骨和关节病理","Bone and joint pathology"),
-    Gynecologic(10,"妇产科病理","Gynecologic pathology"),
-    Hemato(11,"淋巴造血系统病理","Hematopathology"),
-    Urinary(12,"泌尿系统病理","Urinary pathology"),
-    Testicular_and_prostate(13,"男性生殖系统病理","Testicular and prostate pathology"),
-    Head_and_neck(14,"鼻、咽、眼、耳、喉病理","Head and neck pathology"),
-    Mediastinal(15,"纵隔病理","Mediastinal pathology"),
-    Cyto(16,"细胞学","Cytopathology"),
-    Endocrine(17,"内分泌","Endocrine pathology"),
-    Salivary_gland(18,"涎腺","Salivary gland pathology"),
-    Liver(19,"肝胆","Liver pathology"),
-    Pleural(20,"胸膜","Pleural pathology"),
-    Oral(21,"口腔、唇、舌、颌骨","Oral pathology"),
-    Pancreatic(22,"胰腺","Pancreatic pathology"),
-    Cardiovascular(23,"心血管","Cardiovascular pathology"),
-    Pediatric(24,"儿科","Pediatric pathology"),
-
-    ;
-
-    private Integer key;
-    private String value;
-    private String eName;
-
-    SysTypeEnum(Integer key, String value,String eName) {
-        this.key = key;
-        this.value = value;
-        this.eName= eName;
-    }
-
-    public static String getValueByKey(int key) {
-        for (SysTypeEnum value : values()) {
-            if (value.key.compareTo(key) == 0) {
-                return value.value;
-            }
-        }
-        return null;
-    }
-
-    public static String getEnameByKey(int key) {
-        for (SysTypeEnum value : values()) {
-            if (value.key.compareTo(key) == 0) {
-                return value.eName;
-            }
-        }
-        return null;
-    }
-
-}

+ 41 - 0
cif-service/src/main/java/com/txz/cif/enums/WithdrawStatusEnum.java

@@ -0,0 +1,41 @@
+package com.txz.cif.enums;
+
+/**
+ *  状态 1待审核 2处理中 3审核不通过 4提现成功 5提现失败 6超时取消
+ */
+public enum WithdrawStatusEnum {
+
+    WAITING_REVIEW(1, "待审核"),
+    PROCESSED(2, "处理中"),
+    REVIEW_FAIL(3, "审核不通过"),
+    SUCCESS(4, "成功"),
+    FAIL( 5, "失败"),
+    CANCEL( 6, "超时取消"),
+    ;
+
+    private Integer key;
+    private String value;
+
+    WithdrawStatusEnum(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public static WithdrawStatusEnum getEnum(Integer key) {
+        for (WithdrawStatusEnum temp: WithdrawStatusEnum.values()) {
+            if (temp.key.compareTo(key)== 0){
+                return temp;
+            }
+        }
+        return null;
+    }
+
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getDesc() {
+        return value;
+    }
+}

+ 21 - 7
cif-service/src/main/java/com/txz/cif/web/AccountApiController.java

@@ -9,10 +9,7 @@ import com.txz.cif.service.AccountFlowService;
 import com.txz.cif.service.AccountService;
 import com.txz.cif.service.RedEnvelopeService;
 import com.txz.cif.service.UserService;
-import com.txz.cif.web.bo.AccountFlowBO;
-import com.txz.cif.web.bo.AccountInfoBO;
-import com.txz.cif.web.bo.IndexCollectBO;
-import com.txz.cif.web.bo.UserInfoBO;
+import com.txz.cif.web.bo.*;
 import com.txz.cif.web.para.AccountFlowParam;
 
 import com.github.pagehelper.PageHelper;
@@ -59,7 +56,7 @@ public class AccountApiController extends AbstractApiController {
 	@Resource
 	private AuthService authService;
 
-	@ApiOperation(value = "查询账号信息", notes = "",httpMethod = "GET")
+	@ApiOperation(value = "查询收益账号信息", notes = "",httpMethod = "GET")
 	@GetMapping("/getAccountInfo")
 	public Result<AccountInfoBO> getAccountInfo(HttpServletRequest request) {
 		Long userId = authService.getTokenUserId(request);
@@ -70,10 +67,9 @@ public class AccountApiController extends AbstractApiController {
 		if (user == null ){
 			ResultGenerator.genFailResult(ResultCode.USER_IS_NULL);
 		}
-		Account wallet = accountService.getAccount(userId, 1);
 		Account earnings = accountService.getAccount(userId, 2);
 		AccountInfoBO bo = new AccountInfoBO();
-		bo.setBalance(wallet.getBalance().add(earnings.getBalance()));
+		bo.setBalance(earnings.getBalance());
 		bo.setSettledAmount(earnings.getTotalInamount());
 		BigDecimal pendingAmount = redEnvelopeService.sumWithDay(null,userId,1);
 		if (pendingAmount == null){
@@ -101,6 +97,24 @@ public class AccountApiController extends AbstractApiController {
 		return ResultGenerator.genSuccessResult(bo);
 	}
 
+	@ApiOperation(value = "查询钱包账号信息", notes = "",httpMethod = "GET")
+	@GetMapping("/getWalletAccountInfo")
+	public Result<AccountWalletInfoBO> getWalletAccountInfo(HttpServletRequest request) {
+		Long userId = authService.getTokenUserId(request);
+		if (userId == null ){
+			ResultGenerator.genFailResult(ResultCode.USERID_IS_NULL);
+		}
+		User user = userService.findById(userId);
+		if (user == null ){
+			ResultGenerator.genFailResult(ResultCode.USER_IS_NULL);
+		}
+		Account wallet = accountService.getAccount(userId, 1);
+		AccountWalletInfoBO bo = new AccountWalletInfoBO();
+		bo.setBalance(wallet.getBalance());
+		bo.setFreezeAmount(wallet.getFreezeAmount());
+		return ResultGenerator.genSuccessResult(bo);
+	}
+
 
 		@PostMapping("/accountFlowList")
 	@ApiOperation(value = "出入流水",httpMethod = "POST")

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

@@ -16,6 +16,9 @@ import cn.hutool.crypto.SecureUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 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.web.bo.EnumBo;
 import com.txz.cif.web.bo.UserBo;
@@ -58,7 +61,7 @@ public class UserApiController extends AbstractApiController {
     private RedEnvelopeService redEnvelopeService;
 
     @GetMapping("/getEnum")
-    @ApiOperation(value = "获取枚举(1支付方式)",httpMethod = "GET")
+    @ApiOperation(value = "获取枚举(1业务类型 2充值状态 3提现状态 4收益状态)",httpMethod = "GET")
     public Result<List<EnumBo>> getEnum(@RequestParam Integer id) {
         if(id == null){
             id = 1;
@@ -67,6 +70,15 @@ public class UserApiController extends AbstractApiController {
             case 1:
                 return ResultGenerator.genSuccessResult(Arrays.stream(BizTypeEnum.values())
                         .map(temp -> EnumBo.builder().code(temp.getKey()).name(temp.getValue()).build()).collect(Collectors.toList()));
+            case 2:
+                return ResultGenerator.genSuccessResult(Arrays.stream(RechargeStatusEnum.values())
+                        .map(temp -> EnumBo.builder().code(temp.getKey()).name(temp.getDesc()).build()).collect(Collectors.toList()));
+            case 3:
+                return ResultGenerator.genSuccessResult(Arrays.stream(WithdrawStatusEnum.values())
+                        .map(temp -> EnumBo.builder().code(temp.getKey()).name(temp.getDesc()).build()).collect(Collectors.toList()));
+            case 4:
+                return ResultGenerator.genSuccessResult(Arrays.stream(RedEnvelopeStatusEnum.values())
+                        .map(temp -> EnumBo.builder().code(temp.getKey()).name(temp.getDesc()).build()).collect(Collectors.toList()));
         }
         return ResultGenerator.genSuccessResult();
     }

+ 32 - 0
cif-service/src/main/java/com/txz/cif/web/bo/AccountWalletInfoBO.java

@@ -0,0 +1,32 @@
+package com.txz.cif.web.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import javax.persistence.*;
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@ApiModel(value="账号余额信息")
+public class AccountWalletInfoBO {
+
+
+    /**
+     * 余额
+     */
+    @ApiModelProperty(value="balance余额")
+    private BigDecimal balance;
+
+    /**
+     * 已结算金额
+     */
+    @ApiModelProperty(value="冻结金额")
+    private BigDecimal  freezeAmount;
+
+
+}