Browse Source

实名认证提示修改

weifanli 2 years ago
parent
commit
65973c6465

+ 8 - 3
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/UserController.java

@@ -56,7 +56,6 @@ import com.yonge.toolset.utils.string.StringUtil;
 @RequestMapping("user")
 @Api(tags = "会员服务")
 public class UserController extends BaseController {
-
     @Autowired
     private SysUserService sysUserService;
     @Autowired
@@ -480,10 +479,16 @@ public class UserController extends BaseController {
         //通过身份证号获取身份信息
         IdcardInfoExtractor idcardInfoExtractor = new IdcardInfoExtractor(realNameAuthDto.getIdCardNo(), validatedAllIdcard);
         //todo 通过环境,不做实名判断
-        boolean verify = realnameAuthenticationPlugin.verify(realNameAuthDto.getRealName(), realNameAuthDto.getIdCardNo());
-        if (!verify) {
+        try {
+            boolean verify = realnameAuthenticationPlugin.verify(realNameAuthDto.getRealName(), realNameAuthDto.getIdCardNo());
+            if (!verify) {
+                return failed("未通过实名认证");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
             return failed("未通过实名认证");
         }
+
         if (realNameAuthDto.getSave()) {
             String defaultHeard = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD);
             if (StringUtil.isEmpty(user.getAvatar()) || user.getAvatar().equals(defaultHeard)) {

+ 0 - 2
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/SysManualController.java

@@ -37,8 +37,6 @@ public class SysManualController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
 
-
-
     @ApiOperation(value = "查询操作手册")
     @RequestMapping("/list")
     public HttpResponseResult<PageInfo<SysManualVo>> list( @RequestBody SysManualQueryInfo queryInfo) {

+ 10 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/UserAccountDao.java

@@ -5,7 +5,9 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
 import com.yonge.cooleshow.biz.dal.enums.InOrOutEnum;
+import com.yonge.cooleshow.biz.dal.vo.res.AccountTotal;
 import org.apache.ibatis.annotations.Param;
 import com.yonge.cooleshow.biz.dal.entity.UserAccount;
 import com.yonge.cooleshow.biz.dal.vo.UserAccountVo;
@@ -55,4 +57,12 @@ public interface UserAccountDao extends BaseMapper<UserAccount>{
 	 * @return: java.lang.Integer
 	 */
 	Integer changeAccount(@Param("userId") Long userId, @Param("transAmount") BigDecimal transAmount,@Param("inOrOut") String inOrOut);
+	/***
+	 * 收入统计
+	 * @author liweifan
+	 * @param: totalReq
+	 * @updateTime 2022/4/24 13:53
+	 * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.res.AccountTotal>
+	 */
+    List<AccountTotal> accountTotal(@Param("param")TotalReq totalReq);
 }

+ 10 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/TotalReq.java

@@ -16,6 +16,8 @@ import java.util.Date;
  */
 @ApiModel(value = "TotalReq对象", description = "统计查询对象")
 public class TotalReq {
+    @ApiModelProperty("用户id ")
+    private Long userId;
     @NotNull(message = "时间类型不能为空")
     @ApiModelProperty("时间类型 MONTH、月度  YEAR、年度")
     private TimeTypeEnum timeType;
@@ -32,6 +34,14 @@ public class TotalReq {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;
 
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
     public TimeTypeEnum getTimeType() {
         return timeType;
     }

+ 3 - 16
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserAccountServiceImpl.java

@@ -24,6 +24,7 @@ import com.yonge.cooleshow.biz.dal.dao.UserAccountDao;
 import com.yonge.cooleshow.biz.dal.service.UserAccountService;
 
 import java.util.Calendar;
+import java.util.List;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
@@ -59,6 +60,7 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
         Future<HttpResponseResult<UserAccountRecord>> httpResponseResultFuture = DistributedLock.of(redissonClient)
                 .callIfLockCanGet(CacheNameEnum.LOCK_CHANGE_ACCOUNT.getRedisKey(accountRecordDto.getUserId())
                         , () -> doAccountChange(accountRecordDto), 60L, TimeUnit.SECONDS);
+
         try {
             return httpResponseResultFuture.get();
         } catch (Exception e) {
@@ -69,22 +71,7 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
 
     @Override
     public HttpResponseResult<AccountTotal> accountTotal(TotalReq totalReq) {
-        //参数处理
-        Calendar calendar = Calendar.getInstance();
-        if (TimeTypeEnum.MONTH.equals(totalReq.getTimeType())) {
-            String[] classDateSp = totalReq.getDateTime().split("-");
-            calendar.set(Integer.parseInt(classDateSp[0]), Integer.parseInt(classDateSp[1]), 1, 0, 0, 0);
-            totalReq.setStartTime(calendar.getTime());
-            totalReq.setEndTime(DateUtil.dayEnd(DateUtil.getLastDayOfMonth(calendar.getTime())));
-        } else if (TimeTypeEnum.YEAR.equals(totalReq.getTimeType())) {
-            calendar.set(Integer.parseInt(totalReq.getDateTime()), 1, 1, 0, 0, 0);
-            totalReq.setStartTime(calendar.getTime());
-
-            calendar.set(Integer.parseInt(totalReq.getDateTime()), 12, 1, 0, 0, 0);
-            totalReq.setEndTime(DateUtil.dayEnd(DateUtil.getLastDayOfMonth(calendar.getTime())));
-        } else {
-            return HttpResponseResult.failed("参数异常");
-        }
+        List<AccountTotal> infoList= baseMapper.accountTotal(totalReq);
 
         return null;
     }

+ 40 - 30
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/res/AccountTotal.java

@@ -12,38 +12,40 @@ import java.util.List;
  */
 @ApiModel(value = "AccountTotal", description = "用户账户统计对象")
 public class AccountTotal {
-    @ApiModelProperty("总收入 ")
-    private BigDecimal amountTotalIn;
-    @ApiModelProperty("陪练课 ")
-    private BigDecimal practiceTotal;
-    @ApiModelProperty("陪练课-百分比 ")
+    @ApiModelProperty("总收入")
+    private BigDecimal totalInAmount;
+    @ApiModelProperty("陪练课")
+    private BigDecimal practiceAmount;
+    @ApiModelProperty("陪练课-百分比")
     private BigDecimal practiceRate;
-    @ApiModelProperty("直播课 ")
-    private BigDecimal liveTotal;
+    @ApiModelProperty("直播课")
+    private BigDecimal liveAmount;
     @ApiModelProperty("直播课-百分比")
     private BigDecimal liveRate;
-    @ApiModelProperty("乐谱 ")
-    private BigDecimal musicTotal;
-    @ApiModelProperty("乐谱-百分比 ")
+    @ApiModelProperty("乐谱")
+    private BigDecimal musicAmount;
+    @ApiModelProperty("乐谱-百分比")
     private BigDecimal musicRate;
 
-    @ApiModelProperty("详情数据 ")
-    private List<TotalInfoData> infoList;
+    @ApiModelProperty("时间(详情数据中使用)")
+    private String timeStr;
+    @ApiModelProperty("详情数据")
+    private List<AccountTotal> infoList;
 
-    public BigDecimal getAmountTotalIn() {
-        return amountTotalIn;
+    public BigDecimal getTotalInAmount() {
+        return totalInAmount;
     }
 
-    public void setAmountTotalIn(BigDecimal amountTotalIn) {
-        this.amountTotalIn = amountTotalIn;
+    public void setTotalInAmount(BigDecimal totalInAmount) {
+        this.totalInAmount = totalInAmount;
     }
 
-    public BigDecimal getPracticeTotal() {
-        return practiceTotal;
+    public BigDecimal getPracticeAmount() {
+        return practiceAmount;
     }
 
-    public void setPracticeTotal(BigDecimal practiceTotal) {
-        this.practiceTotal = practiceTotal;
+    public void setPracticeAmount(BigDecimal practiceAmount) {
+        this.practiceAmount = practiceAmount;
     }
 
     public BigDecimal getPracticeRate() {
@@ -54,12 +56,12 @@ public class AccountTotal {
         this.practiceRate = practiceRate;
     }
 
-    public BigDecimal getLiveTotal() {
-        return liveTotal;
+    public BigDecimal getLiveAmount() {
+        return liveAmount;
     }
 
-    public void setLiveTotal(BigDecimal liveTotal) {
-        this.liveTotal = liveTotal;
+    public void setLiveAmount(BigDecimal liveAmount) {
+        this.liveAmount = liveAmount;
     }
 
     public BigDecimal getLiveRate() {
@@ -70,12 +72,12 @@ public class AccountTotal {
         this.liveRate = liveRate;
     }
 
-    public BigDecimal getMusicTotal() {
-        return musicTotal;
+    public BigDecimal getMusicAmount() {
+        return musicAmount;
     }
 
-    public void setMusicTotal(BigDecimal musicTotal) {
-        this.musicTotal = musicTotal;
+    public void setMusicAmount(BigDecimal musicAmount) {
+        this.musicAmount = musicAmount;
     }
 
     public BigDecimal getMusicRate() {
@@ -86,11 +88,19 @@ public class AccountTotal {
         this.musicRate = musicRate;
     }
 
-    public List<TotalInfoData> getInfoList() {
+    public String getTimeStr() {
+        return timeStr;
+    }
+
+    public void setTimeStr(String timeStr) {
+        this.timeStr = timeStr;
+    }
+
+    public List<AccountTotal> getInfoList() {
         return infoList;
     }
 
-    public void setInfoList(List<TotalInfoData> infoList) {
+    public void setInfoList(List<AccountTotal> infoList) {
         this.infoList = infoList;
     }
 }

+ 0 - 59
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/res/TotalInfoData.java

@@ -1,59 +0,0 @@
-package com.yonge.cooleshow.biz.dal.vo.res;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @Author: liweifan
- * @Data: 2022/4/24 10:41
- */
-@ApiModel(value = "TotalInfoData", description = "统计数据详情对象")
-public class TotalInfoData {
-    @ApiModelProperty(value = "统计时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date totalTime;
-    @ApiModelProperty(value = "统计时间(yyyy-MM)")
-    private String totalMonth;
-    @ApiModelProperty(value = "统计时间(yyyy-MM-dd)")
-    private String totalDay;
-    @ApiModelProperty("数值 ")
-    private BigDecimal value;
-
-    public Date getTotalTime() {
-        return totalTime;
-    }
-
-    public void setTotalTime(Date totalTime) {
-        this.totalTime = totalTime;
-    }
-
-    public String getTotalMonth() {
-        return totalMonth;
-    }
-
-    public void setTotalMonth(String totalMonth) {
-        this.totalMonth = totalMonth;
-    }
-
-    public String getTotalDay() {
-        return totalDay;
-    }
-
-    public void setTotalDay(String totalDay) {
-        this.totalDay = totalDay;
-    }
-
-    public BigDecimal getValue() {
-        return value;
-    }
-
-    public void setValue(BigDecimal value) {
-        this.value = value;
-    }
-}

+ 4 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserAccountMapper.xml

@@ -71,4 +71,8 @@
         <include refid="baseColumns"/>
         FROM user_cash_account t
     </select>
+
+    <select id="accountTotal" resultType="com.yonge.cooleshow.biz.dal.vo.res.AccountTotal">
+
+    </select>
 </mapper>

+ 23 - 1
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/UserAccountController.java

@@ -6,6 +6,7 @@ import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
 import com.yonge.cooleshow.biz.dal.dto.search.UserAccountRecordSearch;
 import com.yonge.cooleshow.biz.dal.enums.InOrOutEnum;
+import com.yonge.cooleshow.biz.dal.enums.TimeTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.UserAccountRecordService;
 import com.yonge.cooleshow.biz.dal.service.UserAccountService;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
@@ -40,6 +41,7 @@ public class UserAccountController extends BaseController {
     private UserAccountRecordService userAccountRecordService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+
 	/**
      * 查询单条
      */
@@ -81,10 +83,30 @@ public class UserAccountController extends BaseController {
         return succeed(PageUtil.pageInfo(pages));
     }
 
-
     @ApiOperation(value = "收入数据统计")
     @PostMapping("/accountTotal")
     public HttpResponseResult<AccountTotal> accountTotal(@Valid @RequestBody TotalReq totalReq) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        totalReq.setUserId(user.getId());
+        //参数处理
+        Calendar calendar = Calendar.getInstance();
+        if (TimeTypeEnum.MONTH.equals(totalReq.getTimeType())) {
+            String[] classDateSp = totalReq.getDateTime().split("-");
+            calendar.set(Integer.parseInt(classDateSp[0]), Integer.parseInt(classDateSp[1]), 1, 0, 0, 0);
+            totalReq.setStartTime(calendar.getTime());
+            totalReq.setEndTime(DateUtil.dayEnd(DateUtil.getLastDayOfMonth(calendar.getTime())));
+        } else if (TimeTypeEnum.YEAR.equals(totalReq.getTimeType())) {
+            calendar.set(Integer.parseInt(totalReq.getDateTime()), 1, 1, 0, 0, 0);
+            totalReq.setStartTime(calendar.getTime());
+
+            calendar.set(Integer.parseInt(totalReq.getDateTime()), 12, 1, 0, 0, 0);
+            totalReq.setEndTime(DateUtil.dayEnd(DateUtil.getLastDayOfMonth(calendar.getTime())));
+        } else {
+            return HttpResponseResult.failed("参数异常");
+        }
         return userAccountService.accountTotal(totalReq);
     }
 

+ 1 - 2
toolset/thirdparty-component/src/main/java/com/yonge/toolset/thirdparty/user/realname/provider/LinkfaceRealnameAuthenticationPlugin.java

@@ -92,8 +92,7 @@ public class LinkfaceRealnameAuthenticationPlugin implements RealnameAuthenticat
 					msg = "查无此身份证号";
 				}
 			} else {
-				//msg = reason.get(status);
-				msg = reason.get("身份证号和姓名不一致");
+				msg = reason.get(status);
 			}
 			throw new ThirdpartyException("实名认证失败,原因:{}", msg);
 		}