Browse Source

添加字段

v1.0
15989082884@163.com 2 years ago
parent
commit
4834cee34d
  1. 12
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelController.java
  2. 1
      src/main/java/com/qs/serve/modules/bms/entity/BmsChannel.java
  3. 2
      src/main/resources/mapper/bms/BmsChannelMapper.xml

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

@ -146,6 +146,12 @@ public class BmsChannelController {
@PreAuthorize("hasRole('bms:channel:update')") @PreAuthorize("hasRole('bms:channel:update')")
public R<?> updateById(@RequestBody @Valid BmsChannel param){ public R<?> updateById(@RequestBody @Valid BmsChannel param){
BmsChannel ori = bmsChannelService.getById(param.getId()); BmsChannel ori = bmsChannelService.getById(param.getId());
if(param.getHeadChannelId()!=null){
BmsChannel headChannel = bmsChannelService.getById(param.getHeadChannelId());
if(headChannel!=null){
param.setHeadChannel(headChannel.getChannelName());
}
}
boolean result = bmsChannelService.updateById(param); boolean result = bmsChannelService.updateById(param);
if(!ori.getChannelName().equals(param.getChannelName())){ if(!ori.getChannelName().equals(param.getChannelName())){
List<BmsChannelPoint> channelPoints = bmsChannelPointService.listByChannelId(param.getId()); List<BmsChannelPoint> channelPoints = bmsChannelPointService.listByChannelId(param.getId());
@ -178,6 +184,12 @@ public class BmsChannelController {
@PreAuthorize("hasRole('bms:channel:insert')") @PreAuthorize("hasRole('bms:channel:insert')")
public R<?> save(@RequestBody @Valid BmsChannel param){ public R<?> save(@RequestBody @Valid BmsChannel param){
param.setChannelCode("D"+ StringUtils.genShortId()); param.setChannelCode("D"+ StringUtils.genShortId());
if(param.getHeadChannelId()!=null){
BmsChannel headChannel = bmsChannelService.getById(param.getHeadChannelId());
if(headChannel!=null){
param.setHeadChannel(headChannel.getChannelName());
}
}
bmsChannelService.save(param); bmsChannelService.save(param);
if(CollectionUtil.isNotEmpty(param.getSupplierIds())){ if(CollectionUtil.isNotEmpty(param.getSupplierIds())){
BmsSupplierChannelBo channelBo = new BmsSupplierChannelBo(); BmsSupplierChannelBo channelBo = new BmsSupplierChannelBo();

1
src/main/java/com/qs/serve/modules/bms/entity/BmsChannel.java

@ -63,6 +63,7 @@ public class BmsChannel implements Serializable {
/** 可投放费用标识 */ /** 可投放费用标识 */
private Integer costFlag; private Integer costFlag;
private Long headChannelId;
/** 总公司渠道 */ /** 总公司渠道 */
private String headChannel; private String headChannel;

2
src/main/resources/mapper/bms/BmsChannelMapper.xml

@ -10,6 +10,7 @@
<result property="channelName" column="channel_name"/> <result property="channelName" column="channel_name"/>
<result property="channelType" column="channel_type"/> <result property="channelType" column="channel_type"/>
<result property="headChannel" column="head_channel"/> <result property="headChannel" column="head_channel"/>
<result property="headChannelId" column="head_channel_id"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
@ -26,6 +27,7 @@
bms_channel.`channel_name`, bms_channel.`channel_name`,
bms_channel.`channel_type`, bms_channel.`channel_type`,
bms_channel.`head_channel`, bms_channel.`head_channel`,
bms_channel.`head_channel_id`,
bms_channel.`remark`, bms_channel.`remark`,
bms_channel.`create_time`, bms_channel.`create_time`,
bms_channel.`update_time`, bms_channel.`update_time`,

Loading…
Cancel
Save