Sfoglia il codice sorgente

修改评价管理上关联的诊单

udream-cxs 4 anni fa
parent
commit
4a6315f464

+ 2 - 5
lift-push-pc/src/main/java/cn/com/ty/lift/push/websocket/config/WebSocketInterceptor.java

@@ -18,9 +18,7 @@ public class WebSocketInterceptor implements HandshakeInterceptor {
      * 进入handler之前的拦截
      */
     @Override
-    public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response,
-                                   WebSocketHandler wsHandler, Map<String, Object> map) {
-
+    public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> map) {
         if (request instanceof ServletServerHttpRequest) {
             ServletServerHttpRequest serverHttpRequest = (ServletServerHttpRequest) request;
             HttpServletRequest httpServletRequest = serverHttpRequest.getServletRequest();
@@ -32,8 +30,7 @@ public class WebSocketInterceptor implements HandshakeInterceptor {
     }
 
     @Override
-    public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
-                               Exception exception) {
+    public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) {
         System.out.println("进入成功");
     }
 

+ 23 - 21
lift-ud-service/src/main/java/cn/com/ty/lift/ud/chat/mapper/LiftCaseMapper.xml

@@ -706,20 +706,20 @@
     LEFT JOIN lift_brand as brand ON brand.id = t.brand_id
     left join question_bank que on que.lift_case_id = t.id
     <where>
-        <if test="expression != null" >
-            t.expression like CONCAT("%",#{expression},"%")
+        <if test="query.expression != null" >
+            t.expression like CONCAT("%",#{query.expression},"%")
         </if>
-        <if test="originator != null" >
-            and ui.name like CONCAT("%",#{originator},"%")
+        <if test="query.originator != null" >
+            and ui.name like CONCAT("%",#{query.originator},"%")
         </if>
-        <if test="chargeName != null" >
-            and ci.name like CONCAT("%",#{chargeName},"%")
+        <if test="query.chargeName != null" >
+            and ci.name like CONCAT("%",#{query.chargeName},"%")
         </if>
-        <if test="brandName != null" >
-            and brand.name like CONCAT("%",#{brandName},"%")
+        <if test="query.brandName != null" >
+            and brand.name like CONCAT("%",#{query.brandName},"%")
         </if>
-        <if test="statuz1 != null" >
-            and lift.statuz = #{statuz1}
+        <if test="query.statuz1 != null" >
+            and lift.statuz = #{query.statuz1}
         </if>
     </where>
     ORDER BY t.is_platform_specified desc,t.accept_status asc,t.update_time DESC
@@ -734,20 +734,20 @@
     LEFT JOIN lift_brand as brand ON brand.id = t.brand_id
     left join question_bank que on que.lift_case_id = t.id
       <where>
-          <if test="expression != null" >
-              t.expression like CONCAT("%",#{expression},"%")
+          <if test="query.expression != null" >
+              t.expression like CONCAT("%",#{query.expression},"%")
           </if>
-          <if test="originator != null" >
-              and ui.name like CONCAT("%",#{originator},"%")
+          <if test="query.originator != null" >
+              and ui.name like CONCAT("%",#{query.originator},"%")
           </if>
-          <if test="chargeName != null" >
-              and ci.name like CONCAT("%",#{chargeName},"%")
+          <if test="query.chargeName != null" >
+              and ci.name like CONCAT("%",#{query.chargeName},"%")
           </if>
-          <if test="brandName != null" >
-              and brand.name like CONCAT("%",#{brandName},"%")
+          <if test="query.brandName != null" >
+              and brand.name like CONCAT("%",#{query.brandName},"%")
           </if>
-          <if test="statuz1 != null" >
-              and lift.statuz = #{statuz1}
+          <if test="query.statuz1 != null" >
+              and lift.statuz = #{query.statuz1}
           </if>
       </where>
   </select>
@@ -872,8 +872,10 @@
   </select>
   
   <select id="getAllById" resultType="cn.com.ty.lift.ud.chat.mapper.entity.LiftCaseEntity">
-  SELECT t.*,brand.`name` as brandName from lift_case as t
+    SELECT t.*,brand.`name` as brandName,info.name chargeName
+    from lift_case as t
     LEFT JOIN lift_brand as brand ON brand.id = t.brand_id
+    LEFT JOIN user_info info on info.user_id = t.charger_id
     where t.id=#{id}
   </select>
 

+ 37 - 30
lift-ud-service/src/main/java/cn/com/ty/lift/ud/chat/service/impl/LiftCaseServiceImpl.java

@@ -707,41 +707,45 @@ public class LiftCaseServiceImpl extends ServiceImpl<LiftCaseMapper, LiftCaseEnt
 
     @Override
     public RestResponse refusedExperts(Long id) {
-        LiftCaseEntity selectById = caseMapper.selectById(id);
-        if (selectById.getAcceptStatus() == 2) {
+        LiftCaseEntity liftCaseEntity = caseMapper.selectById(id);
+        if (liftCaseEntity.getAcceptStatus() == 2) {
             return RestResponse.fail("订单已拒绝");
         }
-        if (selectById.getDataTable() == 1) {
+        if (liftCaseEntity.getDataTable() == 1) {
             // 退款
-            userInfoMapper.rechargePayBalance(selectById.getCreateUserId(), selectById.getPayCost() == null ? BigDecimal.ZERO : selectById.getPayCost());
+            userInfoMapper.rechargePayBalance(liftCaseEntity.getCreateUserId(), liftCaseEntity.getPayCost() == null ? BigDecimal.ZERO : liftCaseEntity.getPayCost());
             // 插入个人流水记录
-            UserInfoEntity byUserId = userInfoMapper.getByUserId(selectById.getCreateUserId());
+            UserInfoEntity userInfoEntity = userInfoMapper.getByUserId(liftCaseEntity.getCreateUserId());
+            //如果订单被拒绝,那么用户的退款流水记录支付渠道=发生时的支付渠道
+            UserBillEntity paiedBill = Optional.ofNullable(userBillMapper.selectOne(new QueryWrapper<UserBillEntity>().eq("flow_num", liftCaseEntity.getOrderSerialNumber()))).orElse(new UserBillEntity());
+
             UserBillEntity ube = new UserBillEntity();
-            ube.setUserId(selectById.getCreateUserId());
-            ube.setTargetUserId(selectById.getChargerId());
-            ube.setBalance(byUserId.getBalance());
+            ube.setUserId(liftCaseEntity.getCreateUserId());
+            ube.setTargetUserId(liftCaseEntity.getChargerId());
+            ube.setBalance(userInfoEntity.getBalance());
             ube.setType(2);
+            ube.setPayType(paiedBill.getPayType());
             ube.setBusinessType(8);
             ube.setDescr("拒绝接单退款到余额");
-            ube.setFlowNum(selectById.getOrderSerialNumber());
-            ube.setAmount(selectById.getPayCost() == null ? BigDecimal.ZERO : selectById.getPayCost());
+            ube.setFlowNum(liftCaseEntity.getOrderSerialNumber());
+            ube.setAmount(liftCaseEntity.getPayCost() == null ? BigDecimal.ZERO : liftCaseEntity.getPayCost());
             userBillMapper.insert(ube);
         }
         // 清除房间
         chatSessionMapper.delete(new QueryWrapper<ChatSessionEntity>()
                 .eq("data_id", id)
-                .eq("user_id", selectById.getCreateUserId()));
+                .eq("user_id", liftCaseEntity.getCreateUserId()));
         // 返还卡券
-        if (selectById.getCouponId() != null) {
-            couponMapper.updateUserCouponStatuz(selectById.getCouponId());
+        if (liftCaseEntity.getCouponId() != null) {
+            couponMapper.updateUserCouponStatuz(liftCaseEntity.getCouponId());
         }
-        if (selectById.getRedEnvelopeId() != null) {
-            couponMapper.updateUserCouponStatuz(selectById.getRedEnvelopeId());
+        if (liftCaseEntity.getRedEnvelopeId() != null) {
+            couponMapper.updateUserCouponStatuz(liftCaseEntity.getRedEnvelopeId());
         }
         // 修改诊单状态
         caseMapper.refusedExperts(id);
         // 推送消息
-        PushUserInfo pushUserInfo = iUserAccountService.getPushUserInfoByUserId(selectById.getCreateUserId().toString());
+        PushUserInfo pushUserInfo = iUserAccountService.getPushUserInfoByUserId(liftCaseEntity.getCreateUserId().toString());
         PushMessage pushMessage = PushMessage.orderChargeStatus("已拒绝");
         pushMessage.sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfo);
 
@@ -1005,38 +1009,41 @@ public class LiftCaseServiceImpl extends ServiceImpl<LiftCaseMapper, LiftCaseEnt
 
     @Override
     public RestResponse cancelCase(Long id) {
-        LiftCaseEntity selectById = caseMapper.selectById(id);
-        if (selectById.getAcceptStatus() == 9) {
+        LiftCaseEntity liftCaseEntity = caseMapper.selectById(id);
+        if (liftCaseEntity.getAcceptStatus() == 9) {
             return RestResponse.fail("订单已取消");
         }
-        if (selectById.getDataTable() == 1 && selectById.getStatuz() == 1) {
+        if (liftCaseEntity.getDataTable() == 1 && liftCaseEntity.getStatuz() == 1) {
             // 退款
-            userInfoMapper.rechargePayBalance(selectById.getCreateUserId(), selectById.getPayCost() == null ? BigDecimal.ZERO : selectById.getPayCost());
+            userInfoMapper.rechargePayBalance(liftCaseEntity.getCreateUserId(), liftCaseEntity.getPayCost() == null ? BigDecimal.ZERO : liftCaseEntity.getPayCost());
+            //退款渠道=支付渠道
+            UserBillEntity paiedBill = Optional.ofNullable(userBillMapper.selectOne(new QueryWrapper<UserBillEntity>().eq("flow_num", liftCaseEntity.getOrderSerialNumber()))).orElse(new UserBillEntity());
             // 插入个人流水记录
-            UserInfoEntity byUserId = userInfoMapper.getByUserId(selectById.getCreateUserId());
+            UserInfoEntity byUserId = userInfoMapper.getByUserId(liftCaseEntity.getCreateUserId());
             UserBillEntity ube = new UserBillEntity();
-            ube.setUserId(selectById.getCreateUserId());
-            ube.setTargetUserId(selectById.getChargerId());
+            ube.setUserId(liftCaseEntity.getCreateUserId());
+            ube.setTargetUserId(liftCaseEntity.getChargerId());
             ube.setBalance(byUserId.getBalance());
             ube.setType(2);
+            ube.setPayType(paiedBill.getPayType());
             ube.setBusinessType(14);
             ube.setDescr("取消订单退款到余额");
-            ube.setFlowNum(selectById.getOrderSerialNumber());
-            ube.setAmount(selectById.getPayCost() == null ? BigDecimal.ZERO : selectById.getPayCost());
+            ube.setFlowNum(liftCaseEntity.getOrderSerialNumber());
+            ube.setAmount(liftCaseEntity.getPayCost() == null ? BigDecimal.ZERO : liftCaseEntity.getPayCost());
             userBillMapper.insert(ube);
         }
         // 清除房间
         chatSessionMapper.delete(new QueryWrapper<ChatSessionEntity>()
                         .eq("data_id", id)
-                        .eq("create_user_id", selectById.getCreateUserId())
+                        .eq("create_user_id", liftCaseEntity.getCreateUserId())
 //                .last("and FIND_IN_SET("+selectById.getCreateUserId()+",user_id)")
         );
         // 返还卡券
-        if (selectById.getCouponId() != null) {
-            couponMapper.updateUserCouponStatuz(selectById.getCouponId());
+        if (liftCaseEntity.getCouponId() != null) {
+            couponMapper.updateUserCouponStatuz(liftCaseEntity.getCouponId());
         }
-        if (selectById.getRedEnvelopeId() != null) {
-            couponMapper.updateUserCouponStatuz(selectById.getRedEnvelopeId());
+        if (liftCaseEntity.getRedEnvelopeId() != null) {
+            couponMapper.updateUserCouponStatuz(liftCaseEntity.getRedEnvelopeId());
         }
         // 修改诊单状态
         caseMapper.cancelCase(id);

+ 1 - 2
lift-ud-service/src/main/java/cn/com/ty/lift/ud/dataBank/service/impl/LiftBrandServiceImpl.java

@@ -40,8 +40,7 @@ public class LiftBrandServiceImpl extends ServiceImpl<LiftBrandMapper, LiftBrand
         List<LiftBrandEntity> hotList = null;
         if (StringUtils.isNotBlank(lt.getSercheKey())) {
             selectList = liftBrandMapper.selectList(new QueryWrapper<LiftBrandEntity>().like("name", lt.getSercheKey()));
-            hotList = liftBrandMapper
-                .selectList(new QueryWrapper<LiftBrandEntity>().like("name", lt.getSercheKey()).eq("hot_flag", 1));
+            hotList = liftBrandMapper.selectList(new QueryWrapper<LiftBrandEntity>().like("name", lt.getSercheKey()).eq("hot_flag", 1));
         } else {
             selectList = liftBrandMapper.selectList(null);
             hotList = liftBrandMapper.getHotList();

+ 9 - 1
lift-ud-service/src/main/java/cn/com/ty/lift/ud/liftCaseAppeal/service/impl/LiftCaseAppealServiceImpl.java

@@ -2,9 +2,12 @@ package cn.com.ty.lift.ud.liftCaseAppeal.service.impl;
 
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Optional;
 
+import cn.com.ty.lift.ud.payment.mapper.UserBillMapper;
 import cn.com.ty.lift.ud.userInfo.mapper.entity.UserInfoEntity;
 import cn.com.ty.lift.ud.userInfo.service.IUserInfoService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jms.core.JmsMessagingTemplate;
 import org.springframework.stereotype.Service;
@@ -60,6 +63,9 @@ public class LiftCaseAppealServiceImpl extends ServiceImpl<LiftCaseAppealMapper,
 
     private @Autowired CouponMapper couponMapper;
 
+    @Autowired
+    private UserBillMapper userBillMapper;
+
     @Override
     public RestResponse selectByExample(LiftCaseAppealQuery query) {
         IPage page = query.page();
@@ -169,7 +175,8 @@ public class LiftCaseAppealServiceImpl extends ServiceImpl<LiftCaseAppealMapper,
 
         if (serviceCost.compareTo(new BigDecimal("0")) == 1) {
             iUserInfoService.rechargePayBalance(userId, serviceCost);
-
+            //退款渠道=支付渠道
+            UserBillEntity paiedBill = Optional.ofNullable(userBillMapper.selectOne(new QueryWrapper<UserBillEntity>().eq("flow_num", liftCaseEntity.getOrderSerialNumber()))).orElse(new UserBillEntity());
             // 用户账户流水记录,余额相应增加
             // BigDecimal latestBalanceList = iUserBillService.getLatestBalance(userId);
             UserInfoEntity byUserId = iUserInfoService.getByUserId(userId);
@@ -178,6 +185,7 @@ public class LiftCaseAppealServiceImpl extends ServiceImpl<LiftCaseAppealMapper,
             userBillEntity.setUserId(userId);
             userBillEntity.setTargetUserId(liftCaseEntity.getChargerId());
             userBillEntity.setType(2);
+            userBillEntity.setPayType(paiedBill.getPayType());
             userBillEntity.setAmount(serviceCost);
             userBillEntity.setBusinessType(10);
             userBillEntity.setDescr("申诉退款");

+ 1 - 2
lift-ud-service/src/main/java/cn/com/ty/lift/ud/pay/controller/AlipayController.java

@@ -485,8 +485,7 @@ public class AlipayController {
             AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
             request.setBizModel(model);
             String appCert = AlipaySignature.getCertSN(alipayConfig.getAppCertPath());
-            String apppayRootCert =
-                    FileUtils.readFileToString(new File(alipayConfig.getAlipayRootCertPath()), Charsets.toCharset("utf-8"));
+            String apppayRootCert = FileUtils.readFileToString(new File(alipayConfig.getAlipayRootCertPath()), Charsets.toCharset("utf-8"));
 
             // 这里必须添加 app公匙证书的序列号和阿里根证书的序列号
             request.putOtherTextParam("app_cert_sn", appCert);

+ 6 - 6
lift-ud-service/src/main/java/cn/com/ty/lift/ud/userInfo/service/impl/UserInfoServiceImpl.java

@@ -125,7 +125,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfoEnt
     @Override
     public UserInfoEntity getByUserId(Long id) {
         UserInfoEntity userInfo = userInfoMapper.getUserInfo(id);
-        ApplyExpert byUserId = applyExpertMapper.getByUserId(id);
+        ApplyExpert applyExpert = applyExpertMapper.getByUserId(id);
         StringBuilder proficiencyBrandName = new StringBuilder("");
         if (null != userInfo) {
             // 显示擅长品牌中文名称
@@ -148,11 +148,11 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfoEnt
                 userInfo.setRoleName("专家");
                 userInfo.setUserLevelName("专家");
             }
-            if(byUserId != null) {
-                userInfo.setAddress(byUserId.getResidentPlace());
-                userInfo.setWorkDate(byUserId.getWorkDate());
-                userInfo.setIntroduction(byUserId.getName()+",专业:"+byUserId.getProfessional()+","+userInfo.getProficiency());
-                userInfo.setExperience(byUserId.getWorkExperience());
+            if(applyExpert != null) {
+                userInfo.setAddress(applyExpert.getResidentPlace());
+                userInfo.setWorkDate(applyExpert.getWorkDate());
+                userInfo.setIntroduction(applyExpert.getName()+",专业:"+applyExpert.getProfessional()+","+userInfo.getProficiency());
+                userInfo.setExperience(applyExpert.getWorkExperience());
             }
             
             ScoreInfo scoreInfo = iExpertCommentService.getScoreByExpertId(userInfo.getUserId());