From c989b8744aa4c75015919daf60db4fec8adfccdb Mon Sep 17 00:00:00 2001 From: guo Date: Mon, 11 Dec 2023 18:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E6=85=A7=E6=A2=81=E5=9C=BA-=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E5=85=BB=E6=8A=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SmartBeamFieldMaintainDataController.java | 154 ++++++++++++++++++ .../entity/SmartBeamFieldMaintainData.java | 80 +++++++++ .../SmartBeamFieldMaintainDataMapper.java | 22 +++ .../xml/SmartBeamFieldMaintainDataMapper.xml | 23 +++ .../ISmartBeamFieldMaintainDataService.java | 30 ++++ ...SmartBeamFieldMaintainDataServiceImpl.java | 101 ++++++++++++ .../taskprogress/entity/TaskProgress.java | 2 + .../zhgd/xmgl/security/WebSecurityConfig.java | 4 + .../xmgl/task/StableWaterMixStationTask.java | 13 +- 9 files changed, 425 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMaintainDataController.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldMaintainData.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldMaintainDataMapper.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldMaintainDataMapper.xml create mode 100644 src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldMaintainDataService.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMaintainDataServiceImpl.java diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMaintainDataController.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMaintainDataController.java new file mode 100644 index 000000000..f6db017e4 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMaintainDataController.java @@ -0,0 +1,154 @@ +package com.zhgd.xmgl.modules.smartbeamfield.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo; +import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldMaintainData; +import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldMaintainDataService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.simpleframework.xml.core.Validate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; + + +/** + * @Title: Controller + * @Description: 智慧梁场-智能养护数据 + * @author: pds + * @date: 2023-12-11 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/smartBeamFieldMaintainData") +@Slf4j +@Api(tags = "智慧梁场-智能养护数据相关Api") +public class SmartBeamFieldMaintainDataController { + @Autowired + private ISmartBeamFieldMaintainDataService smartBeamFieldMaintainDataService; + + /** + * 分页列表查询 + * + * @return + */ + @ApiOperation(value = "分页列表查询智慧梁场-智能养护数据信息", notes = "分页列表查询智慧梁场-智能养护数据信息", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"), + }) + @GetMapping(value = "/page") + public Result> queryPageList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(smartBeamFieldMaintainDataService.queryPageList(paramMap)); + } + + /** + * 列表查询 + * + * @return + */ + @ApiOperation(value = "列表查询智慧梁场-智能养护数据信息", notes = "列表查询智慧梁场-智能养护数据信息", httpMethod = "GET") + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(smartBeamFieldMaintainDataService.queryList(paramMap)); + } + + /** + * 添加 + * + * @param smartBeamFieldMaintainData + * @return + */ + @ApiOperation(value = "添加智慧梁场-智能养护数据信息", notes = "添加智慧梁场-智能养护数据信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody @Validate SmartBeamFieldMaintainData smartBeamFieldMaintainData) { + smartBeamFieldMaintainDataService.add(smartBeamFieldMaintainData); + return Result.ok(); + } + + /** + * 编辑 + * + * @param smartBeamFieldMaintainData + * @return + */ + @ApiOperation(value = "编辑智慧梁场-智能养护数据信息", notes = "编辑智慧梁场-智能养护数据信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody SmartBeamFieldMaintainData smartBeamFieldMaintainData) { + smartBeamFieldMaintainDataService.edit(smartBeamFieldMaintainData); + return Result.ok(); + } + + /** + * 通过id删除 + * + * @return + */ + @ApiOperation(value = "删除智慧梁场-智能养护数据信息", notes = "删除智慧梁场-智能养护数据信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "智慧梁场-智能养护数据ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody HashMap map) { + String id = MapUtils.getString(map, "id"); + Result result = new Result(); + SmartBeamFieldMaintainData smartBeamFieldMaintainData = smartBeamFieldMaintainDataService.getById(id); + if (smartBeamFieldMaintainData == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = smartBeamFieldMaintainDataService.removeById(id); + if (ok) { + result.success("删除成功!"); + } + } + + return result; + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @ApiOperation(value = "通过id查询智慧梁场-智能养护数据信息", notes = "通过id查询智慧梁场-智能养护数据信息", httpMethod = "GET") + @ApiImplicitParam(name = "id", value = "智慧梁场-智能养护数据ID", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + Result result = new Result(); + SmartBeamFieldMaintainData smartBeamFieldMaintainData = smartBeamFieldMaintainDataService.getById(id); + if (smartBeamFieldMaintainData == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(smartBeamFieldMaintainData); + result.setSuccess(true); + } + return result; + } + + @ApiOperation(value = "统计智慧梁场-智能养护数据温度和湿度信息", notes = "统计智慧梁场-智能养护数据温度和湿度信息", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "makeBeamPedestalSn", value = "制梁台座编号", paramType = "query", required = true, dataType = "String"), + @ApiImplicitParam(name = "type", value = "类型:1今日", paramType = "query", required = true, dataType = "Integer"), + }) + @GetMapping(value = "/countCustomData") + public Result countCustomData(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(smartBeamFieldMaintainDataService.countCustomData(paramMap)); + } + + @ApiOperation(value = "查询智慧梁场-智能养护数据平均温度和湿度信息", notes = "查询智慧梁场-智能养护数据平均温度和湿度信息", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "makeBeamPedestalSn", value = "制梁台座编号", paramType = "query", required = true, dataType = "String"), + @ApiImplicitParam(name = "type", value = "类型:1今日", paramType = "query", required = true, dataType = "Integer"), + }) + @GetMapping(value = "/getAvgData") + public Result getAvgData(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(smartBeamFieldMaintainDataService.getAvgData(paramMap)); + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldMaintainData.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldMaintainData.java new file mode 100644 index 000000000..5e31a2624 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldMaintainData.java @@ -0,0 +1,80 @@ +package com.zhgd.xmgl.modules.smartbeamfield.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: 智慧梁场-智能养护数据 + * @author: pds + * @date: 2023-12-11 + * @version: V1.0 + */ +@Data +@TableName("smart_beam_field_maintain_data") +@ApiModel(value = "SmartBeamFieldMaintainData实体类", description = "SmartBeamFieldMaintainData") +public class SmartBeamFieldMaintainData implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键id") + private java.lang.Long id; + /** + * 制梁台座编号 + */ + @Excel(name = "制梁台座编号", width = 15) + @ApiModelProperty(value = "制梁台座编号") + private java.lang.String makeBeamPedestalSn; + /** + * 梁号 + */ + @Excel(name = "梁号", width = 15) + @ApiModelProperty(value = "梁号") + private java.lang.String beamNo; + /** + * 温度 + */ + @Excel(name = "温度", width = 15) + @ApiModelProperty(value = "温度") + private java.lang.Double temperature; + /** + * 湿度 + */ + @Excel(name = "湿度", width = 15) + @ApiModelProperty(value = "湿度") + private java.lang.Double humidity; + /** + * 项目sn + */ + @Excel(name = "项目sn", width = 15) + @ApiModelProperty(value = "项目sn") + private java.lang.String projectSn; + /** + * 创建时间 yyyy-MM-dd HH:mm:ss + */ + @Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss") + private java.util.Date createDate; + /** + * 更新时间 yyyy-MM-dd HH:mm:ss + */ + @Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss") + private java.util.Date updateDate; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldMaintainDataMapper.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldMaintainDataMapper.java new file mode 100644 index 000000000..01d03c57e --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldMaintainDataMapper.java @@ -0,0 +1,22 @@ +package com.zhgd.xmgl.modules.smartbeamfield.mapper; + +import org.apache.ibatis.annotations.Mapper; +import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldMaintainData; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.HashMap; +import java.util.List; + +/** + * @Description: 智慧梁场-智能养护数据 + * @author: pds + * @date: 2023-12-11 + * @version: V1.0 + */ +@Mapper +public interface SmartBeamFieldMaintainDataMapper extends BaseMapper { + + List> countCustomData(HashMap paramMap); + + SmartBeamFieldMaintainData getAvgData(HashMap paramMap); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldMaintainDataMapper.xml b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldMaintainDataMapper.xml new file mode 100644 index 000000000..cef9b3343 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldMaintainDataMapper.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldMaintainDataService.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldMaintainDataService.java new file mode 100644 index 000000000..5abccc88b --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldMaintainDataService.java @@ -0,0 +1,30 @@ +package com.zhgd.xmgl.modules.smartbeamfield.service; + +import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo; +import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldMaintainData; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.HashMap; +import java.util.List; + +/** + * @Description: 智慧梁场-智能养护数据 + * @author: pds + * @date: 2023-12-11 + * @version: V1.0 + */ +public interface ISmartBeamFieldMaintainDataService extends IService { + + IPage queryPageList(HashMap paramMap); + + List queryList(HashMap paramMap); + + void add(SmartBeamFieldMaintainData smartBeamFieldMaintainData); + + void edit(SmartBeamFieldMaintainData smartBeamFieldMaintainData); + + SmartBeamFieldMaintainData getAvgData(HashMap paramMap); + + FlexibleBigScreenVo countCustomData(HashMap paramMap); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMaintainDataServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMaintainDataServiceImpl.java new file mode 100644 index 000000000..37e732763 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMaintainDataServiceImpl.java @@ -0,0 +1,101 @@ +package com.zhgd.xmgl.modules.smartbeamfield.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo; +import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldMaintainData; +import com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldMaintainDataMapper; +import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldMaintainDataService; +import com.zhgd.xmgl.util.DateUtils; +import com.zhgd.xmgl.util.PageUtil; +import com.zhgd.xmgl.util.RefUtil; +import org.apache.commons.collections.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Objects; + +/** + * @Description: 智慧梁场-智能养护数据 + * @author: pds + * @date: 2023-12-11 + * @version: V1.0 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class SmartBeamFieldMaintainDataServiceImpl extends ServiceImpl implements ISmartBeamFieldMaintainDataService { + @Autowired + private SmartBeamFieldMaintainDataMapper smartBeamFieldMaintainDataMapper; + + @Override + public IPage queryPageList(HashMap paramMap) { + QueryWrapper queryWrapper = getQueryWrapper(paramMap); + Page page = PageUtil.getPage(paramMap); + IPage pageList = this.page(page, queryWrapper); + pageList.setRecords(dealList(pageList.getRecords())); + return pageList; + } + + @Override + public List queryList(HashMap paramMap) { + QueryWrapper queryWrapper = getQueryWrapper(paramMap); + return dealList(this.list(queryWrapper)); + } + + private QueryWrapper getQueryWrapper(HashMap paramMap) { + String alias = ""; + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(SmartBeamFieldMaintainData.class, paramMap, alias); + queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SmartBeamFieldMaintainData::getId)); + return queryWrapper; + } + + private List dealList(List list) { + return list; + } + + @Override + public void add(SmartBeamFieldMaintainData smartBeamFieldMaintainData) { + smartBeamFieldMaintainData.setId(null); + baseMapper.insert(smartBeamFieldMaintainData); + } + + @Override + public void edit(SmartBeamFieldMaintainData smartBeamFieldMaintainData) { + baseMapper.updateById(smartBeamFieldMaintainData); + } + + @Override + public SmartBeamFieldMaintainData getAvgData(HashMap paramMap) { + Integer type = MapUtils.getInteger(paramMap, "type"); + if (Objects.equals(1, type)) { + return baseMapper.getAvgData(paramMap); + } + return null; + } + + @Override + public FlexibleBigScreenVo countCustomData(HashMap paramMap) { + Integer type = MapUtils.getInteger(paramMap, "type"); + if (Objects.equals(1, type)) { + FlexibleBigScreenVo flexibleBigScreenVo = new FlexibleBigScreenVo(); + List> source = baseMapper.countCustomData(paramMap); + List dimensions = new ArrayList<>(); + dimensions.add("time"); + dimensions.add("temperature"); + dimensions.add("humidity"); + flexibleBigScreenVo.setDimensions(dimensions); + flexibleBigScreenVo.setSource(source); + List strList = DateUtils.getDateStrList(100, "HH:00"); + FlexibleBigScreenVo.fillTrendVos(flexibleBigScreenVo, strList, "HH:00"); + return flexibleBigScreenVo; + } + return null; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/taskprogress/entity/TaskProgress.java b/src/main/java/com/zhgd/xmgl/modules/taskprogress/entity/TaskProgress.java index 89f845547..8ba0b13a7 100644 --- a/src/main/java/com/zhgd/xmgl/modules/taskprogress/entity/TaskProgress.java +++ b/src/main/java/com/zhgd/xmgl/modules/taskprogress/entity/TaskProgress.java @@ -152,6 +152,8 @@ public class TaskProgress implements Serializable { @Excel(name = "结束预警", width = 15, replace = {"提前_1", "正常_2", "逾期_3"}) @ApiModelProperty(value = "结束预警:1提前2正常3逾期") private java.lang.Integer endWarning; + @ApiModelProperty(value = "bim构件") + private java.lang.String bimComponent; /** * 负责人名称 diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 5fb991742..ce6a9d595 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -254,6 +254,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/xmgl/smartGroutData/add").permitAll() .antMatchers("/xmgl/bimface/getDetailsByFileIdAndProjectSn").permitAll() .antMatchers("/xmgl/stableWaterMixStationData/add").permitAll() + .antMatchers("/xmgl/stableWaterMixStationData/page").permitAll() .antMatchers("/xmgl/hangBasketDetectKdeData/add").permitAll() .antMatchers("/xmgl/smartBeamFieldBeam/queryById").permitAll() .antMatchers("/xmgl/smartBeamFieldBeamToProcess/getMakeBeamProcess").permitAll() @@ -265,6 +266,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/xmgl/weight/weighBookVehicleInfo/pull/list").permitAll() .antMatchers("/xmgl/gouliPkpmModel/getBimTokenByProjectSn").permitAll() .antMatchers("/xmgl/gouliPkpmModel/queryById").permitAll() + .antMatchers("/xmgl/smartBeamFieldMaintainData/page").permitAll() + .antMatchers("/xmgl/smartBeamFieldMaintainData/countCustomData").permitAll() + .antMatchers("/xmgl/smartBeamFieldMaintainData/getAvgData").permitAll() .antMatchers(HttpMethod.OPTIONS, "/**").anonymous() .anyRequest().authenticated() // 剩下所有的验证都需要验证 .and() diff --git a/src/main/java/com/zhgd/xmgl/task/StableWaterMixStationTask.java b/src/main/java/com/zhgd/xmgl/task/StableWaterMixStationTask.java index 67e0c42be..429680a41 100644 --- a/src/main/java/com/zhgd/xmgl/task/StableWaterMixStationTask.java +++ b/src/main/java/com/zhgd/xmgl/task/StableWaterMixStationTask.java @@ -1,6 +1,7 @@ package com.zhgd.xmgl.task; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gexin.fastjson.JSON; import com.glodon.cloudt.rest.client.RestServiceClient; import com.glodon.cloudt.rest.client.data.HmacRestAuthInfo; import com.glodon.cloudt.rest.client.data.RestResponseInfo; @@ -13,6 +14,7 @@ import com.zhgd.xmgl.modules.project.mapper.ProjectMapper; import com.zhgd.xmgl.modules.stablewater.service.IStableWaterMixStationDataService; import com.zhgd.xmgl.util.ThirdPartRequestUtil; import lombok.extern.log4j.Log4j; +import lombok.extern.slf4j.Slf4j; import net.javacrumbs.shedlock.core.SchedulerLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -26,7 +28,7 @@ import java.util.List; /** * 水稳拌合站任务 */ -@Log4j +@Slf4j @Component @RestController public class StableWaterMixStationTask { @@ -68,7 +70,7 @@ public class StableWaterMixStationTask { //4.1构建认证信息 HmacRestAuthInfo restAuthInfo = new HmacRestAuthInfo(); //4.2设置授权文件路径 - restAuthInfo.setLicPath("C:\\Users\\Administrator\\Desktop\\auth.lic"); + restAuthInfo.setLicPath("C:\\Users\\Administrator\\Desktop\\t\\auth.lic"); //restAuthInfo.setLicPath(project.getGldLicPath()); //4.3权限认证 serviceClient.authenticate(restAuthInfo); @@ -77,15 +79,18 @@ public class StableWaterMixStationTask { //第5步:获取授权文件关联的GYS系统地址hostAddress String hostAddress = serviceClient.getRestRootAddress(); //第6步:设置请求接口的URI地址apiURI(以获取集成项目列表信息为例) - //String apiURI = "/api/inspection/v1.0/project/getTenantHasCodeProject"; - String apiURI = String.format("/api/mix/v1.0/mix/product/getMachineProductList?projectId=%s&beginTimestamp=20170710101010000", "672804614860800"); + String apiURI = "/api/inspection/v1.0/project/getTenantHasCodeProject"; + //String apiURI = String.format("/api/mix/v1.0/mix/product/getMachineProductList?projectId=%s&beginTimestamp=20170710101010000", "672804614860800"); //String apiURI = String.format("/api/mix/v1.0/mix/product/getMachineProductList?projectId=%s&beginTimestamp=20170710101010000", project.getGldProjectId()); //第7步:拼装完整的请求网址 String fullURL = hostAddress + apiURI; //第8步:请求数据准备(本例中为从GYS系统获取数据,无需进行请求数据的准备) + log.info("url:{}", fullURL); //第9步:发送请求,用来推送/获取数据 RestResponseInfo restResponseInfo = serviceClient.get(fullURL); + log.info("rs:{}", JSON.toJSONString(restResponseInfo)); + /** ------------ 处理请求返回结果 --------------*/ if (restResponseInfo.isSuccess()) {