瀏覽代碼

实名认证修改

weifanli 3 年之前
父節點
當前提交
e1c2393468

+ 9 - 0
cooleshow-auth/auth-api/src/main/java/com/yonge/cooleshow/auth/api/dto/RealnameAuthReq.java

@@ -29,6 +29,7 @@ public class RealnameAuthReq implements Serializable {
     @ApiModelProperty(value = "是否修改用户信息", required = true)
     private Boolean isSave;
 
+    private Long userId;
     // 性别(1,男 0,女)
     private int gender;
     // 出生日期
@@ -36,6 +37,14 @@ public class RealnameAuthReq implements Serializable {
     // 头像
     private String avatar;
 
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
     public String getRealName() {
         return realName;
     }

+ 1 - 0
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/UserController.java

@@ -495,6 +495,7 @@ public class UserController extends BaseController {
                 user.setAvatar(
                         0 == idcardInfoExtractor.getGender() ? sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_GIRL) : sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_BOY));
             }
+            realNameAuthDto.setUserId(user.getId());
             realNameAuthDto.setGender(idcardInfoExtractor.getGender());
             realNameAuthDto.setBirthday(idcardInfoExtractor.getBirthday());
             realNameAuthDto.setAvatar(user.getAvatar());

+ 2 - 2
cooleshow-auth/auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -217,8 +217,8 @@
             <if test="param.gender != null">
                 gender_ = #{param.gender},
             </if>
-            <if test="param.birthdate != null and param.birthdate != ''">
-                birthdate_ = #{param.birthdate},
+            <if test="param.birthday != null">
+                birthdate_ = #{param.birthday},
             </if>
             <if test="param.avatar != null and param.avatar != ''">
                 avatar_ = #{param.avatar},

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

@@ -11,6 +11,7 @@ import com.yonge.cooleshow.biz.dal.enums.TimeTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.UserAccountRecordService;
 import com.yonge.cooleshow.biz.dal.support.DistributedLock;
 import com.yonge.cooleshow.biz.dal.vo.res.AccountTotal;
+import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.exception.BizException;
 import com.yonge.toolset.utils.date.DateUtil;
@@ -23,6 +24,8 @@ import com.yonge.cooleshow.biz.dal.dto.search.UserAccountSearch;
 import com.yonge.cooleshow.biz.dal.dao.UserAccountDao;
 import com.yonge.cooleshow.biz.dal.service.UserAccountService;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Calendar;
 import java.util.List;
 import java.util.concurrent.Future;
@@ -73,7 +76,39 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
     public HttpResponseResult<AccountTotal> accountTotal(TotalReq totalReq) {
         List<AccountTotal> infoList= baseMapper.accountTotal(totalReq);
 
-        return null;
+        BigDecimal practiceAmount = BigDecimal.ZERO;
+        BigDecimal liveAmount = BigDecimal.ZERO;
+        BigDecimal musicAmount = BigDecimal.ZERO;
+        for (AccountTotal info : infoList) {
+            info.setPracticeAmount(null == info.getPracticeAmount() ? BigDecimal.ZERO : info.getPracticeAmount());
+            info.setLiveAmount(null == info.getLiveAmount() ? BigDecimal.ZERO  : info.getLiveAmount());
+            info.setMusicAmount(null == info.getMusicAmount() ? BigDecimal.ZERO  : info.getMusicAmount());
+
+            practiceAmount = practiceAmount.add(info.getPracticeAmount());
+            liveAmount = liveAmount.add(info.getLiveAmount());
+            musicAmount = musicAmount.add(info.getMusicAmount());
+        }
+        AccountTotal total = new AccountTotal();
+
+        total.setTotalInAmount(practiceAmount.add(liveAmount).add(musicAmount));
+        total.setPracticeAmount(practiceAmount);
+        BigDecimal practiceRate = total.getPracticeAmount()
+                .divide(total.getTotalInAmount(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+        total.setPracticeRate(practiceRate);
+
+        total.setLiveAmount(liveAmount);
+        BigDecimal liveRate = total.getLiveAmount()
+                .divide(total.getTotalInAmount(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+        total.setLiveRate(liveRate);
+
+        total.setMusicAmount(musicAmount);
+        BigDecimal musicRate = total.getMusicAmount()
+                .divide(total.getTotalInAmount(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+        total.setMusicRate(musicRate);
+
+        total.setInfoList(infoList);
+
+        return HttpResponseResult.succeed(total);
     }
 
     private HttpResponseResult<UserAccountRecord> doAccountChange(UserAccountRecordDto accountRecordDto) {

+ 24 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderServiceImpl.java

@@ -334,7 +334,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
         } else {
             //入订单付款表,同时修改订单状态
             orderCancel(detail);
-            insertOrderPayment(responseResult, payReq);
+            errOrderPayment(responseResult, payReq);
             baseMapper.updateStatusByOrderNo(payReq.getOrderNo(), OrderStatusEnum.FAIL.getCode());
             return HttpResponseResult.failed(responseResult.getMsg());
         }
@@ -371,6 +371,29 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
     }
 
     /***
+     * 处理付款请求失败
+     * @author liweifan
+     * @param: res
+     * @param: payReq
+     * @updateTime 2022/4/13 17:56
+     * @return: com.yonge.cooleshow.biz.dal.entity.UserOrderPayment
+     */
+    private UserOrderPayment errOrderPayment(HttpResponseResult<Map<String, Object>> responseResult, OrderPayReq payReq) {
+        //查询
+        UserOrderPayment orderPayment = orderPaymentService.detailByOrderNo(payReq.getOrderNo());
+        if(null == orderPayment){
+            orderPayment = new UserOrderPayment();
+            orderPayment.setOrderNo(payReq.getOrderNo());
+            orderPayment.setPayChannel(payReq.getPayChannel());
+        }
+        orderPayment.setPayFailMsg(responseResult.getMsg());
+        orderPayment.setStatus(PayStatusEnum.failed);
+
+        orderPaymentService.saveOrUpdate(orderPayment);
+        return orderPayment;
+    }
+
+    /***
      * 处理待支付中订单
      * @author liweifan
      * @param: payReq

+ 5 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml

@@ -4,11 +4,12 @@
 <mapper namespace="com.yonge.cooleshow.biz.dal.dao.HomeDao">
 	<select id="getUserToDoNum" resultType="com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum">
 		select
-			(select count(1) from teacher_auth_entry_record where teacher_auth_status_ = 1) as entryNum,
-			(select count(1) from teacher_auth_musician_record where teacher_auth_status_ = 1) as musicianNum,
+			(select count(1) from teacher_auth_entry_record where teacher_auth_status_ = 'DOING') as entryNum,
+			(select count(1) from teacher_auth_musician_record where teacher_auth_status_ = 'DOING') as musicianNum,
         	(select count(1) from music_sheet where del_flag_ = 0 and audit_status_ = 'DOING') as musicNum
         from dual
 	</select>
+
     <select id="totalTeacher" resultType="com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher">
 		select
 			<if test="timeType != null and timeType == 'MONTH'">
@@ -90,6 +91,7 @@
 				<![CDATA[AND t.sys_day_ <= #{param.endTime} ]]>
 			</if>
 		</where>
+		order by t.sys_day_ desc
 		<if test="timeType != null and timeType == 'MONTH'">
 			group by t.sys_day_ymd_
 		</if>
@@ -175,6 +177,7 @@
 				<![CDATA[AND t.sys_day_ <= #{param.endTime} ]]>
 			</if>
 		</where>
+		order by t.sys_day_ desc
 		<if test="timeType != null and timeType == 'MONTH'">
 			group by t.sys_day_ymd_
 		</if>

+ 46 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserAccountMapper.xml

@@ -73,6 +73,51 @@
     </select>
 
     <select id="accountTotal" resultType="com.yonge.cooleshow.biz.dal.vo.res.AccountTotal">
-
+        select
+            <if test="timeType != null and timeType == 'MONTH'">
+                t.sys_day_ymd_ as timeStr,
+            </if>
+            <if test="timeType != null and timeType == 'YEAR'">
+                t.sys_day_ym_ as timeStr,
+            </if>
+            sum(a.practiceAmount) as practiceAmount,
+            sum(a.liveAmount) as liveAmount,
+            sum(a.musicAmount) as musicAmount
+        from sys_day t
+        left join (
+            select
+                DATE_FORMAT(t.create_time_, '%Y-%m-%d') as timeStr,
+                sum(if(t.biz_type_ = 'PRACTICE',1,0)) as practiceAmount,
+                sum(if(t.biz_type_ = 'LIVE',1,0)) as liveAmount,
+                sum(if(t.biz_type_ = 'MUSIC',1,0)) as musicAmount
+            from user_cash_account_record t
+            <where>
+                <if test="param.startTime !=null">
+                    <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
+                </if>
+                <if test="param.endTime !=null">
+                    <![CDATA[AND t.create_time_ <= #{param.endTime} ]]>
+                </if>
+                <if test="param.userId !=null">
+                    t.account_id_ = #{userId}
+                </if>
+            </where>
+            group by DATE_FORMAT(t.create_time_,'%Y-%m-%d')
+        ) a on t.sys_day_ymd_ = a.timeStr
+        <where>
+            <if test="param.startTime !=null">
+                <![CDATA[AND t.sys_day_ >= #{param.startTime} ]]>
+            </if>
+            <if test="param.endTime !=null">
+                <![CDATA[AND t.sys_day_ <= #{param.endTime} ]]>
+            </if>
+        </where>
+        order by t.sys_day_ desc
+        <if test="timeType != null and timeType == 'MONTH'">
+            group by t.sys_day_ymd_
+        </if>
+        <if test="timeType != null and timeType == 'YEAR'">
+            group by t.sys_day_ym_
+        </if>
     </select>
 </mapper>