ty
10 months ago
22 changed files with 373 additions and 34 deletions
@ -0,0 +1,39 @@
|
||||
package com.hnac.hzims.business.entity; |
||||
|
||||
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.tenant.mp.TenantEntity; |
||||
|
||||
import javax.validation.constraints.NotNull; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
@TableName("hzims_business_early") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "业务预警", description = "业务预警对象") |
||||
public class BusinessEarlyEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ApiModelProperty("任务ID") |
||||
@NotNull |
||||
private Long taskId; |
||||
|
||||
@ApiModelProperty("业务类型 :0 - 固定资产 1 - 日常维护 2 - 安全工器- 具 3 - 巡检 4 - 检修 5 - 缺陷 6 - 值班") |
||||
@NotNull |
||||
private Integer businessType; |
||||
|
||||
@ApiModelProperty("预警内容") |
||||
@NotNull |
||||
private String content; |
||||
|
||||
@ApiModelProperty("机构Id") |
||||
private Long deptId; |
||||
|
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.hnac.hzims.business.feign; |
||||
|
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
@Component |
||||
public class BusinessEarlyClientFallback implements IBusinessEarlyClient { |
||||
|
||||
@Override |
||||
public R<Boolean> save(BusinessEarlyEntity entity) { |
||||
return R.status(false); |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.hnac.hzims.business.feign; |
||||
|
||||
import com.hnac.hzims.alarm.config.constants.AlarmConstants; |
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@FeignClient( |
||||
value = AlarmConstants.APP_NAME, |
||||
fallback = BusinessEarlyClientFallback.class |
||||
) |
||||
public interface IBusinessEarlyClient { |
||||
|
||||
String API_PREFIX = "/feign/businessEarly"; |
||||
|
||||
String BUSINESS_EARLY_SAVE = API_PREFIX + "/save"; |
||||
|
||||
@PostMapping(BUSINESS_EARLY_SAVE) |
||||
R<Boolean> save(@RequestBody BusinessEarlyEntity entity); |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.hnac.hzims.business.vo; |
||||
|
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "告警对象", description = "各告警数据源保存对象") |
||||
public class BusinessEarlyVo extends BusinessEarlyEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
|
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.hnac.hzims.business.early.controller; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzims.business.early.service.BusinessEarlyService; |
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
import com.hnac.hzims.business.vo.BusinessEarlyVo; |
||||
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
||||
import com.hnac.hzims.common.logs.enums.BusinessType; |
||||
import com.hnac.hzims.common.logs.enums.OperatorType; |
||||
import com.hnac.hzims.operational.access.vo.ConstructionVo; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Api(tags = {"业务预警"}) |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/business/early") |
||||
public class BusinessEarlyController extends BladeController { |
||||
|
||||
private final BusinessEarlyService businessEarlyService; |
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "分页查询") |
||||
public R<IPage<BusinessEarlyVo>> list(BusinessEarlyVo early, Query query) { |
||||
return R.data(businessEarlyService.pageCondition(Condition.getPage(query), early)); |
||||
} |
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.business.early.feign; |
||||
|
||||
import com.hnac.hzims.business.early.service.BusinessEarlyService; |
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
import com.hnac.hzims.business.feign.IBusinessEarlyClient; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@RestController |
||||
@Slf4j |
||||
@RequiredArgsConstructor |
||||
public class BusinessEarlyClient implements IBusinessEarlyClient { |
||||
|
||||
private final BusinessEarlyService businessEarlyService; |
||||
|
||||
/** |
||||
* 业务预警信息保存 |
||||
* @param entity |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@PostMapping(BUSINESS_EARLY_SAVE) |
||||
public R<Boolean> save(@RequestBody BusinessEarlyEntity entity) { |
||||
return R.status(businessEarlyService.save(entity)); |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.hnac.hzims.business.early.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
public interface BusinessEarlyMapper extends BaseMapper<BusinessEarlyEntity> { |
||||
|
||||
} |
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.hnac.hzims.business.early.mapper.BusinessEarlyMapper"> |
||||
|
||||
|
||||
</mapper> |
@ -0,0 +1,15 @@
|
||||
package com.hnac.hzims.business.early.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
import com.hnac.hzims.business.vo.BusinessEarlyVo; |
||||
import com.hnac.hzims.operational.access.vo.ConstructionVo; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
public interface BusinessEarlyService extends BaseService<BusinessEarlyEntity> { |
||||
|
||||
IPage<BusinessEarlyVo> pageCondition(IPage<BusinessEarlyVo> page, BusinessEarlyVo early); |
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.hnac.hzims.business.early.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.hnac.hzims.business.early.mapper.BusinessEarlyMapper; |
||||
import com.hnac.hzims.business.early.service.BusinessEarlyService; |
||||
import com.hnac.hzims.business.entity.BusinessEarlyEntity; |
||||
import com.hnac.hzims.business.vo.BusinessEarlyVo; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@AllArgsConstructor |
||||
@Service |
||||
@Slf4j |
||||
public class BusinessEarlyServiceImpl extends BaseServiceImpl<BusinessEarlyMapper, BusinessEarlyEntity> implements BusinessEarlyService { |
||||
|
||||
@Override |
||||
public IPage<BusinessEarlyVo> pageCondition(IPage<BusinessEarlyVo> page, BusinessEarlyVo early) { |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.hnac.hzims.operational.constants; |
||||
|
||||
public interface RoleAliasConstants { |
||||
|
||||
/**项目经理**/ |
||||
String PROJECT_MANAGER = "projectManager"; |
||||
|
||||
} |
Binary file not shown.
Loading…
Reference in new issue