Browse Source

Merge branch 'dev' of 113.31.163.91:quanshu/mp-server into dev

chunping 3 years ago
parent
commit
10016b034e

+ 46 - 0
mp-admin/src/test/java/com/qs/mp/service/ChannelServiceTest.java

@@ -0,0 +1,46 @@
+package com.qs.mp.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.qs.mp.MpApplication;
+import com.qs.mp.channel.domain.Channel;
+import com.qs.mp.channel.service.IChannelService;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.TestPropertySource;
+
+@AutoConfigureMockMvc
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = MpApplication.class)
+@TestPropertySource(locations = "classpath:application-dev.yml")
+@ActiveProfiles("dev")
+public class ChannelServiceTest {
+
+	@Autowired
+	private IChannelService channelService;
+
+	@Test
+	public void testListChannel() {
+		Channel channel = new Channel();
+
+	}
+	
+	@Test
+	public void testAddChannel() {
+		Channel channel = new Channel();
+
+	}
+	
+	
+	@Test
+	public void testEditChannel() {
+		Channel channel = new Channel();
+
+	}
+	
+	
+
+}

+ 6 - 0
mp-service/src/main/java/com/qs/mp/channel/service/impl/ChannelServiceImpl.java

@@ -178,6 +178,12 @@ public class ChannelServiceImpl extends ServiceImpl<ChannelMapper, Channel> impl
 		QueryWrapper<Channel> queryWrapper = new QueryWrapper<>();
 		queryWrapper.eq("t1.parent_id", channel.getParentId());
 		queryWrapper.eq("t1.level", 0);
+		if(null != channel.getVerifyStatus()) {
+			queryWrapper.eq("t1.verify_status", channel.getVerifyStatus());
+		}
+		if(null != channel.getCertifyStatus()) {
+			queryWrapper.eq("t1.certify_status", channel.getCertifyStatus());
+		}
 		return getBaseMapper().selectSiteVoList(queryWrapper);
 	}
 

+ 2 - 2
mp-service/src/main/resources/mapper/channel/ChannelMapper.xml

@@ -109,7 +109,7 @@
 		from mp_channel t1
 		left join mp_channel t2 on t1.parent_id = t2.channel_id
 		${ew.customSqlSegment}
-		order by a.channel_id desc
+		order by t1.channel_id desc
 	</select>
 	
 	 <!-- 查询子经销商信息 -->
@@ -118,7 +118,7 @@
 		from mp_channel t1
 		left join mp_channel t2 on t1.parent_id = t2.channel_id
 		${ew.customSqlSegment}
-		order by a.channel_id desc
+		order by t1.channel_id desc
 	</select>
 
 	<!-- 查询渠道及其子渠道经销商用户数总和 -->