haungxing
1 year ago
11 changed files with 265 additions and 4 deletions
@ -0,0 +1,22 @@ |
|||||||
|
package com.hnac.hzims.operational.station.dto; |
||||||
|
|
||||||
|
import com.hnac.hzims.operational.station.entity.StationPushConfigEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName StationPushConfigDTO |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-07-04 17:11 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
@ApiModel("StationPushConfigEntity VO对象") |
||||||
|
public class StationPushConfigDTO extends StationPushConfigEntity implements Serializable { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
package com.hnac.hzims.operational.station.entity; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName StationPushConfiguration |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-07-04 16:15 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.SqlCondition; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.support.QueryField; |
||||||
|
import org.springblade.core.tenant.mp.TenantEntity; |
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull; |
||||||
|
import java.io.Serializable; |
||||||
|
@Data |
||||||
|
@ApiModel("站点类型推送FDP配置") |
||||||
|
@TableName("hzims_station_push_configuration") |
||||||
|
@EqualsAndHashCode |
||||||
|
public class StationPushConfigEntity extends TenantEntity implements Serializable { |
||||||
|
|
||||||
|
@ApiModelProperty("站点类型") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
@NotNull(message = "站点类型不能为空") |
||||||
|
private Integer stationType; |
||||||
|
|
||||||
|
@ApiModelProperty("站点类型名称") |
||||||
|
private String stationTypeName; |
||||||
|
|
||||||
|
@ApiModelProperty("是否推送至FDP") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
@NotNull(message = "是否推送不能为空") |
||||||
|
private Boolean isPush; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package com.hnac.hzims.operational.station.vo; |
||||||
|
|
||||||
|
import com.hnac.hzims.operational.station.entity.StationPushConfigEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName StationPushConfigVO |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-07-04 17:08 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
@ApiModel("StationPushConfigEntity VO对象") |
||||||
|
public class StationPushConfigVO extends StationPushConfigEntity implements Serializable { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
package com.hnac.hzims.operational.station.wrapper; |
||||||
|
|
||||||
|
import com.hnac.hzims.operational.station.entity.StationPushConfigEntity; |
||||||
|
import com.hnac.hzims.operational.station.vo.StationPushConfigVO; |
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName StationPushConfigWrapper |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-07-04 17:12 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
public class StationPushConfigWrapper extends BaseEntityWrapper<StationPushConfigEntity, StationPushConfigVO> { |
||||||
|
|
||||||
|
public static StationPushConfigWrapper build() { |
||||||
|
return new StationPushConfigWrapper(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public StationPushConfigVO entityVO(StationPushConfigEntity entity) { |
||||||
|
StationPushConfigVO stationPushConfigVO = BeanUtil.copy(entity,StationPushConfigVO.class); |
||||||
|
return stationPushConfigVO; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,73 @@ |
|||||||
|
package com.hnac.hzims.operational.station.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.hnac.hzims.operational.station.dto.StationPushConfigDTO; |
||||||
|
import com.hnac.hzims.operational.station.entity.StationPushConfigEntity; |
||||||
|
import com.hnac.hzims.operational.station.service.IStationPushConfigService; |
||||||
|
import com.hnac.hzims.operational.station.vo.StationPushConfigVO; |
||||||
|
import com.hnac.hzims.operational.station.wrapper.StationPushConfigWrapper; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiOperationSupport; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName StationPushConfigController |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-07-04 17:02 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@Api(value = "站点类型推送FDP配置管理",tags = "站点类型推送FDP配置管理") |
||||||
|
@RestController |
||||||
|
@RequestMapping("/station/push/config") |
||||||
|
@AllArgsConstructor |
||||||
|
public class StationPushConfigController extends BladeController { |
||||||
|
|
||||||
|
private final IStationPushConfigService configService; |
||||||
|
|
||||||
|
@GetMapping("/detail/{id}") |
||||||
|
@ApiOperation("查询详情") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
public R<StationPushConfigVO> detail(@PathVariable String id) { |
||||||
|
return R.data(StationPushConfigWrapper.build().entityVO(configService.getById(id))); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperation("查询列表") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
public R<List<StationPushConfigVO>> list(StationPushConfigDTO request) { |
||||||
|
return R.data(configService.list(request)); |
||||||
|
} |
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperation("保存站点推送配置") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
public R save(@RequestBody @Valid StationPushConfigDTO request) { |
||||||
|
return R.status(configService.save(BeanUtil.copy(request, StationPushConfigEntity.class))); |
||||||
|
} |
||||||
|
|
||||||
|
@DeleteMapping("/detail/{ids}") |
||||||
|
@ApiOperation("删除配置,按逗号分割") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
public R remove(@PathVariable String ids) { |
||||||
|
return R.status(configService.removeByIds(Func.toLongList(",",ids))); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("listPage") |
||||||
|
@ApiOperation("分页查询") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
public R<IPage<StationPushConfigVO>> listPage(Query query, StationPushConfigDTO request) { |
||||||
|
return R.data(configService.listPage(query,request)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
package com.hnac.hzims.operational.station.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.hnac.hzims.operational.station.entity.StationPushConfigEntity; |
||||||
|
|
||||||
|
public interface StationPushConfigMapper extends BaseMapper<StationPushConfigEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
package com.hnac.hzims.operational.station.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.hnac.hzims.operational.station.dto.StationPushConfigDTO; |
||||||
|
import com.hnac.hzims.operational.station.entity.StationPushConfigEntity; |
||||||
|
import com.hnac.hzims.operational.station.mapper.StationPushConfigMapper; |
||||||
|
import com.hnac.hzims.operational.station.service.IStationPushConfigService; |
||||||
|
import com.hnac.hzims.operational.station.vo.StationPushConfigVO; |
||||||
|
import com.hnac.hzims.operational.station.wrapper.StationPushConfigWrapper; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName StationPushConfigServiceImpl |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-07-04 16:24 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
@Slf4j |
||||||
|
public class StationPushConfigServiceImpl extends BaseServiceImpl<StationPushConfigMapper, StationPushConfigEntity> implements IStationPushConfigService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<StationPushConfigVO> list(StationPushConfigDTO request) { |
||||||
|
LambdaQueryWrapper<StationPushConfigEntity> lambda = Condition.getQueryWrapper(BeanUtil.copy(request, StationPushConfigEntity.class)).lambda(); |
||||||
|
lambda.eq(Func.isNotEmpty(request.getStatus()),StationPushConfigEntity::getStatus,request.getStatus()); |
||||||
|
return StationPushConfigWrapper.build().listVO(this.list(lambda)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<StationPushConfigVO> listPage(Query query, StationPushConfigDTO request) { |
||||||
|
LambdaQueryWrapper<StationPushConfigEntity> lambda = Condition.getQueryWrapper(BeanUtil.copy(request, StationPushConfigEntity.class)).lambda(); |
||||||
|
lambda.eq(Func.isNotEmpty(request.getStatus()),StationPushConfigEntity::getStatus,request.getStatus()); |
||||||
|
IPage page = this.page(Condition.getPage(query), lambda); |
||||||
|
page.setRecords(StationPushConfigWrapper.build().listVO(page.getRecords())); |
||||||
|
return page; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,2 +1,19 @@ |
|||||||
-- 站点表添加是否为国外 |
-- 站点表添加是否为国外 |
||||||
alter table `hzims_station` add column `is_abroad` TINYINT NULL comment '站点是否为国外 1:是;0:否'; |
alter table `hzims_station` add column `is_abroad` TINYINT(1) NULL comment '站点是否为国外 1:是;0:否'; |
||||||
|
-- 添加站点推送FDP配置表 |
||||||
|
CREATE TABLE IF NOT EXISTS `hzims_station_push_configuration` ( |
||||||
|
`ID` bigint(20) NOT NULL COMMENT '主键ID', |
||||||
|
`station_type` TINYINT(2) NULL DEFAULT NULL COMMENT '站点类型', |
||||||
|
`station_type_name` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点类型名称', |
||||||
|
`is_push` TINYINT(2) NULL DEFAULT NULL COMMENT '是否推送至FDP', |
||||||
|
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', |
||||||
|
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间', |
||||||
|
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', |
||||||
|
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', |
||||||
|
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', |
||||||
|
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', |
||||||
|
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ', |
||||||
|
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', |
||||||
|
PRIMARY KEY (`ID`) USING BTREE |
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic comment='站点类型推送FDP配置表'; |
||||||
|
SET FOREIGN_KEY_CHECKS = 1; |
||||||
|
Loading…
Reference in new issue