Commit 3b88fe25 by 刘宇峰

特约店、围栏bug修复

1 parent 3cbb784b
......@@ -10,5 +10,6 @@ public class TrialDriveShopSearch extends Page {
private Long area;
private Long province;
private Long city;
private String userIds;
}
......@@ -36,7 +36,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -46,7 +45,7 @@ import java.util.stream.Collectors;
@RefreshScope
public class TrialDriveShopService {
@Value("${specialshop.user.level:4}")
@Value("${specialshop.user.level:5}")
private Integer shopUserLevel;
@Autowired
......@@ -69,12 +68,28 @@ public class TrialDriveShopService {
public PageInfo<TrialDriveShopDTO> search(TrialDriveShopSearch search) {
Page page = PageHelper.startPage(search.getPageNumber(), search.getPageSize());
if (search.getCity() != null) {
R<List<User>> byOrg = userService.findByOrg(new FindUserRequest().setOrgIds(Lists.newArrayList(search.getCity())));
List<User> userList = byOrg.getDataList(new TypeToken<List<User>>() {
}.getType());
search.setUserIds(StringUtils.join(userList.stream().map(User::getId).toArray(), ","));
}
List<TrialDriveShopDTO> list = trialDriveShopMapper.search(search);
organizaService.drawOrganization(list);
return new PageInfo<>(list);
}
public List<TrialDriveShopExport> export(TrialDriveShopSearch search) {
if (search.getCity() != null) {
R<List<User>> byOrg = userService.findByOrg(new FindUserRequest().setOrgIds(Lists.newArrayList(search.getCity())));
List<User> userList = byOrg.getDataList(new TypeToken<List<User>>() {
}.getType());
search.setUserIds(StringUtils.join(userList.stream().map(User::getId).toArray(), ","));
}
List<TrialDriveShopExport> list = trialDriveShopMapper.export(search);
organizaService.drawOrganization(list);
return list;
......
......@@ -93,7 +93,7 @@
left join t_trial_drive_shop ttds on ttds.created_by = tu.id
left join t_electric_fence_copy tefc on tefc.fence_id = tef.id
left join (select * from t_approval where id in (select MAX(id) from t_approval group by biz_id,biz_type)) ta on ta.biz_id = tefc.id and ta.biz_type = 1
where tef.del_flag = 0
where tef.del_flag = 0 and ttds.del_flag = 0
and tef.biz_fence_type = 12
<if test="term != null and term !=''">
and (
......@@ -123,7 +123,7 @@
left join t_trial_drive_shop ttds on ttds.created_by = tu.id
left join t_electric_fence_copy tefc on tefc.fence_id = tef.id
left join (select * from t_approval where id in (select MAX(id) from t_approval group by biz_id,biz_type)) ta on ta.biz_id = tefc.id and ta.biz_type = 1
where tef.del_flag = 0
where tef.del_flag = 0 and ttds.del_flag = 0
and tef.biz_fence_type = 12
<if test="term != null and term !=''">
and (
......
......@@ -51,14 +51,8 @@
tu.account like CONCAT('%',#{term},'%')
)
</if>
<if test="area != null and area !=''">
and ttds.created_by in (select tu.id from t_user tu where tu.department_id = #{area})
</if>
<if test="province != null and province !=''">
and ttds.created_by in (select tu.id from t_user tu where tu.department_id = #{province})
</if>
<if test="city != null and city !=''">
and ttds.created_by in (select tu.id from t_user tu where tu.department_id = #{city})
<if test="userIds != null and userIds !=''">
and find_in_set(ttds.created_by,#{userIds})
</if>
order by ttds.id desc
</select>
......@@ -88,14 +82,8 @@
tu.account like CONCAT('%',#{term},'%')
)
</if>
<if test="area != null and area !=''">
and ttds.created_by in (select tu.id from t_user tu where tu.department_id = #{area})
</if>
<if test="province != null and province !=''">
and ttds.created_by in (select tu.id from t_user tu where tu.department_id = #{province})
</if>
<if test="city != null and city !=''">
and ttds.created_by in (select tu.id from t_user tu where tu.department_id = #{city})
<if test="userIds != null and userIds !=''">
and find_in_set(ttds.created_by,#{userIds})
</if>
order by ttds.id desc
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!