Browse Source

Merge remote-tracking branch 'origin/v1.0' into v1.0

v1.0
Yen 2 years ago
parent
commit
c37b79704b
  1. 4
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelController.java
  2. 16
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java
  3. 6
      src/main/java/com/qs/serve/modules/bms/controller/my/BmsChannelPointMyController.java
  4. 8
      src/main/java/com/qs/serve/modules/bms/entity/BmsChannelPoint.java
  5. 16
      src/main/resources/mapper/bms/BmsChannelPointMapper.xml

4
src/main/java/com/qs/serve/modules/bms/controller/BmsChannelController.java

@ -175,6 +175,10 @@ public class BmsChannelController {
param.setHeadChannel(headChannel.getChannelName());
param.setHeadChannelCode(headChannel.getChannelCode());
}
}else{
param.setHeadChannelId(0L);
param.setHeadChannel("");
param.setHeadChannelCode("");
}
boolean result = bmsChannelService.updateById(param);
if(!ori.getChannelName().equals(param.getChannelName())){

16
src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java

@ -64,6 +64,7 @@ public class BmsChannelPointController {
private SysPostUserService postUserService;
private BmsChannelPointMyController bmsChannelPointMyController;
private BmsChannelService bmsChannelService;
private BmsSupplierChannelService bmsSupplierChannelService;
/**
* 导出
@ -163,6 +164,15 @@ public class BmsChannelPointController {
if(param.getLoadByCurrent()!=null&&param.getLoadByCurrent().equals(1)){
return bmsChannelPointMyController.page4UnderAndMine(param);
}
if(StringUtils.hasText(param.getSeachSupplierName())){
BmsSupplierChannel searchSupplierChannel = new BmsSupplierChannel();
searchSupplierChannel.setSupplierName(param.getSeachSupplierName());
List<BmsSupplierChannel> bmsSupplierChannelList = bmsSupplierChannelService.selectSupplierChannelList(searchSupplierChannel);
List<Long> channelIds = bmsSupplierChannelList.stream().map(a->a.getChannelId()).collect(Collectors.toList());
param.setSeachChannelIds(channelIds);
}
PageUtil.startPage();
List<BmsChannelPoint> list = bmsChannelPointService.selectChannelPointList(param);
List<String> bizRegionIds = new ArrayList<>();
@ -193,6 +203,12 @@ public class BmsChannelPointController {
channelPoint.setSaleRegionName(regions[regions.length-1]);
}
}
BmsSupplierChannel searchSupplierChannel = new BmsSupplierChannel();
searchSupplierChannel.setChannelId(channelPoint.getChannelId());
List<BmsSupplierChannel> bmsSupplierChannelList = bmsSupplierChannelService.selectSupplierChannelList(searchSupplierChannel);
channelPoint.setSupplierNames(bmsSupplierChannelList.stream().map(b->b.getSupplierName()).collect(Collectors.toList()));
}
return R.byPageHelperList(list);
}

6
src/main/java/com/qs/serve/modules/bms/controller/my/BmsChannelPointMyController.java

@ -60,6 +60,7 @@ public class BmsChannelPointMyController {
private BmsRegionUserService bmsRegionUserService;
private SysPostUserService postUserService;
private BmsMasterUserService bmsMasterUserService;
private BmsSupplierChannelService bmsSupplierChannelService;
/**
@ -167,6 +168,11 @@ public class BmsChannelPointMyController {
channelPoint.setSaleRegionName(regions[regions.length-1]);
}
}
BmsSupplierChannel searchSupplierChannel = new BmsSupplierChannel();
searchSupplierChannel.setChannelId(channelPoint.getChannelId());
List<BmsSupplierChannel> bmsSupplierChannelList = bmsSupplierChannelService.selectSupplierChannelList(searchSupplierChannel);
channelPoint.setSupplierNames(bmsSupplierChannelList.stream().map(b->b.getSupplierName()).collect(Collectors.toList()));
}
return R.byPageList(count,pageList);
}

8
src/main/java/com/qs/serve/modules/bms/entity/BmsChannelPoint.java

@ -209,5 +209,13 @@ public class BmsChannelPoint implements Serializable {
@TableField(exist = false)
private String channelType;
@TableField(exist = false)
private String seachSupplierName;
@TableField(exist = false)
private List<Long> seachChannelIds;
@TableField(exist = false)
private List<String> supplierNames;
}

16
src/main/resources/mapper/bms/BmsChannelPointMapper.xml

@ -76,6 +76,12 @@
<if test="query.supplierId!=null and query.supplierId!=''">
and bms_supplier_channel.`supplier_id` = #{query.supplierId} and bms_supplier_channel.`del_flag` = 0
</if>
<if test="query.seachChannelIds!=null and query.seachChannelIds.size>0">
and `bms_channel_point`.`channel_id` in
<foreach collection="query.seachChannelIds" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach>
</if>
<if test="query.id != null"> and `bms_channel_point`.`id` = #{query.id}</if>
<if test="query.channelId != null"> and `bms_channel_point`.`channel_id` = #{query.channelId}</if>
<if test="query.channelName != null and query.channelName != ''"> and `bms_channel_point`.`channel_name` like concat('%',#{query.channelName},'%') </if>
@ -279,13 +285,16 @@
<select id="selectPointByUserIds" resultType="com.qs.serve.modules.bms.entity.BmsChannelPoint">
SELECT <include refid="bmsChannelPointSql"/> FROM
( SELECT channel_id FROM `bms_supplier_channel`
( SELECT distinct channel_id FROM `bms_supplier_channel`
LEFT JOIN `his_user_supplier` ON `his_user_supplier`.supplier_id = bms_supplier_channel.supplier_id
where his_user_supplier.user_id in
<foreach collection="userIds" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach>
<if test="supplierId != null and supplierId != ''"> and bms_supplier_channel.supplier_id = #{supplierId}</if>
<if test="query.seachSupplierName != null and query.seachSupplierName!=''">
and `his_user_supplier`.`supplier_name` like concat('%',#{query.seachSupplierName},'%')
</if>
and `bms_supplier_channel`.`del_flag` = 0
GROUP BY channel_id
) tmp left join`bms_channel_point` `bms_channel_point` ON `tmp`.channel_id = bms_channel_point.`channel_id`
@ -313,13 +322,16 @@
</select>
<select id="selectCountPointByUserIds" resultType="java.lang.Long">
SELECT count(1) FROM
( SELECT channel_id FROM `bms_supplier_channel`
( SELECT distinct channel_id FROM `bms_supplier_channel`
LEFT JOIN `his_user_supplier` ON `his_user_supplier`.supplier_id = bms_supplier_channel.supplier_id
where his_user_supplier.user_id in
<foreach collection="userIds" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach>
<if test="supplierId != null and supplierId != ''"> and bms_supplier_channel.supplier_id = #{supplierId}</if>
<if test="query.seachSupplierName != null and query.seachSupplierName!=''">
and `his_user_supplier`.`supplier_name` like concat('%',#{query.seachSupplierName},'%')
</if>
and `bms_supplier_channel`.`del_flag` = 0
GROUP BY channel_id
) tmp left join`bms_channel_point` `bms_channel_point` ON `tmp`.channel_id = bms_channel_point.`channel_id`

Loading…
Cancel
Save