瀏覽代碼

fix 订单状态

he2802 3 年之前
父節點
當前提交
0c47ff68e3

+ 8 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/inform/InformUserController.java

@@ -104,4 +104,12 @@ public class InformUserController extends BaseController {
         return toAjax(iInformUserService.removeAll(bo) ? 1 : 0);
     }
 
+    @ApiOperation("获取未读督学最新一条信息")
+    @Log(title = "获取未读督学最新一条信息", businessType = BusinessType.UPDATE)
+    @GetMapping("/selectLastUnStudyMsg")
+    public AjaxResult<InformUserVo> selectLastUnStudyMsg() {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iInformUserService.selectLastUnStudyMsg(loginUser.getUser().getUserId()));
+    }
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformUserMapper.java

@@ -25,4 +25,6 @@ public interface InformUserMapper extends BaseMapper<InformUser> {
     Long selectGradeId(@Param("goodsId") Long goodsId,@Param("userId") Long userId);
 
     List<MockApplyVo> listMockApply();
+
+    InformUserVo selectLastUnStudyMsg(@Param("time") Long time,@Param("userId") Long userId);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformUserService.java

@@ -8,6 +8,7 @@ import com.zhongzheng.modules.inform.bo.InformUserAddBo;
 import com.zhongzheng.modules.inform.bo.InformUserEditBo;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.mock.vo.MockApplyVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Collection;
 import java.util.List;
@@ -63,4 +64,6 @@ public interface IInformUserService extends IService<InformUser> {
 	Boolean removeAll(InformUserEditBo bo);
 
 	List<MockApplyVo> listMockApply();
+
+	InformUserVo selectLastUnStudyMsg(Long userId);
 }

+ 9 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformUserServiceImpl.java

@@ -36,10 +36,7 @@ import com.zhongzheng.modules.inform.vo.InformUserVo;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 
 import javax.swing.plaf.nimbus.State;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -264,4 +261,12 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
     public List<MockApplyVo> listMockApply() {
         return baseMapper.listMockApply();
     }
+
+    @Override
+    public InformUserVo selectLastUnStudyMsg(Long userId) {
+        Calendar cal = new GregorianCalendar();
+        cal.add(Calendar.DATE, -30);
+        Long time = cal.getTimeInMillis() / 1000;
+        return this.baseMapper.selectLastUnStudyMsg(time,userId);
+    }
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java

@@ -237,7 +237,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
             if(order.getStatus()==0){
                 throw new CustomException("订单无效");
             }
-            if(order.getOrderFrom()!=5){
+            if(order.getOrderFrom()!=5&&order.getOrderFrom()!=6){
                 throw new CustomException("不支持非录单订单退款");
             }
             //订单商品

+ 17 - 1
zhongzheng-system/src/main/resources/mapper/modules/inform/InformUserMapper.xml

@@ -149,6 +149,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LIMIT 1
     </select>
     <select id="listMockApply" resultType="com.zhongzheng.modules.mock.vo.MockApplyVo">
-        
+
+    </select>
+
+    <select id="selectLastUnStudyMsg" parameterType="map" resultMap="InformUserVo">
+        SELECT
+            iu.*
+        FROM
+            inform_user iu
+        where 1=1
+          and iu.user_id = #{userId}
+          and iu.receipt_status = 0
+          and iu.`status` =1
+          and iu.system_status = 1
+          and iu.remind_id in (28,29,31,32)
+        and iu.create_time >= #{time}
+        ORDER BY iu.create_time desc
+            LIMIT 1
     </select>
 </mapper>