Browse Source

feat:解决报错

zhanghui 3 months ago
parent
commit
7bcc5ab874

+ 1 - 1
src/main/java/org/springblade/modules/finance/mapper/AfterSalesMapper.java

@@ -39,7 +39,7 @@ public interface AfterSalesMapper extends BaseMapper<AfterSales> {
 	 */
 	List<AfterSalesVO> selectAfterSalesPage(IPage page, AfterSalesVO afterSales);
 
-	IPage<AfterSalesVO> selectUserAfterSalesList(IPage pag, Long userId);
+	IPage<AfterSalesVO> selectUserAfterSalesList(IPage pag, Long userId,Integer state);
 
     List<AfterSalesVO> getByGrouponIds(List<Long> gIds);
 

+ 8 - 0
src/main/java/org/springblade/modules/finance/mapper/AfterSalesMapper.xml

@@ -28,6 +28,14 @@
         FROM
             t_after_sales s
             WHERE s.user_id = #{userId}
+            <if test="state != null">
+                <if test="state == 1">
+                    and s.`status` = 3
+                </if>
+                <if test="state == 2">
+                    and s.refund_state = 1
+                </if>
+            </if>
             ORDER BY s.create_time desc
     </select>
     <select id="getByGrouponIds" resultType="org.springblade.modules.finance.vo.AfterSalesVO">

+ 1 - 1
src/main/java/org/springblade/modules/finance/service/IAfterSalesService.java

@@ -66,7 +66,7 @@ public interface IAfterSalesService extends IService<AfterSales> {
 
 	void bindLogisticsNo(String afterSalesNo, String logisticsNo);
 
-	IPage<AfterSalesVO> getUserAfterSalesList(IPage<Object> page, Long userId);
+	IPage<AfterSalesVO> getUserAfterSalesList(IPage<Object> page, Long userId,Integer state);
 
 	AfterSalesVO getUserAfterSalesDetail(Long afterSalesId);
 

+ 2 - 2
src/main/java/org/springblade/modules/finance/service/impl/AfterSalesServiceImpl.java

@@ -481,8 +481,8 @@ public class AfterSalesServiceImpl extends ServiceImpl<AfterSalesMapper, AfterSa
 	}
 
 	@Override
-	public IPage<AfterSalesVO> getUserAfterSalesList(IPage page, Long userId) {
-		IPage<AfterSalesVO> afterSalesVOS = baseMapper.selectUserAfterSalesList(page, userId);
+	public IPage<AfterSalesVO> getUserAfterSalesList(IPage page, Long userId,Integer state ) {
+		IPage<AfterSalesVO> afterSalesVOS = baseMapper.selectUserAfterSalesList(page, userId,state);
 		if (CollUtil.isEmpty(afterSalesVOS.getRecords())){
 			return afterSalesVOS;
 		}