From 2b480cb2de9ae57433077167b779b2e96558bf55 Mon Sep 17 00:00:00 2001 From: guo Date: Fri, 8 Dec 2023 17:50:56 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/GouliPkpmConfigController.java | 215 ++++++++-------- .../controller/GouliPkpmModelController.java | 231 +++++++++-------- .../goulipkpm/entity/GouliPkpmModel.java | 1 + .../goulipkpm/service/GouliPkpmService.java | 31 +++ .../service/IGouliPkpmConfigService.java | 2 + .../service/IGouliPkpmModelService.java | 4 + .../impl/GouliPkpmConfigServiceImpl.java | 8 + .../impl/GouliPkpmModelServiceImpl.java | 57 ++++- .../service/impl/ProjectServiceImpl.java | 6 +- ...SmartBeamFieldBeamToProcessController.java | 239 ++++++++---------- .../entity/SmartBeamFieldBeam.java | 2 +- .../entity/SmartBeamFieldProductionLine.java | 3 + .../entity/vo/CountDurationVo.java | 17 ++ .../SmartBeamFieldBeamToProcessMapper.java | 3 + .../SmartBeamFieldProductionLineMapper.java | 13 +- .../mapper/xml/SmartBeamFieldBeamMapper.xml | 10 +- .../xml/SmartBeamFieldBeamToProcessMapper.xml | 15 +- .../SmartBeamFieldProductionLineMapper.xml | 8 + .../ISmartBeamFieldBeamToProcessService.java | 3 +- .../impl/SmartBeamFieldBeamServiceImpl.java | 2 +- ...martBeamFieldBeamToProcessServiceImpl.java | 15 +- ...artBeamFieldProductionLineServiceImpl.java | 6 +- .../WeighBookVehicleInfoController.java | 12 + .../modules/weight/entity/vo/PullListVo.java | 27 ++ .../mapper/WeighBookVehicleInfoMapper.java | 4 + .../mapper/xml/WeighBookVehicleInfoMapper.xml | 8 + .../service/IWeighBookVehicleInfoService.java | 3 + .../impl/WeighBookVehicleInfoServiceImpl.java | 27 +- .../zhgd/xmgl/security/WebSecurityConfig.java | 2 + 29 files changed, 594 insertions(+), 380 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/GouliPkpmService.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/vo/CountDurationVo.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/PullListVo.java diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmConfigController.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmConfigController.java index 096ca5c74..acc54fce7 100644 --- a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmConfigController.java +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmConfigController.java @@ -1,27 +1,22 @@ package com.zhgd.xmgl.modules.goulipkpm.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.modules.goulipkpm.entity.GouliPkpmConfig; +import com.zhgd.xmgl.modules.goulipkpm.service.IGouliPkpmConfigService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiImplicitParams; - -import java.util.HashMap; - -import org.simpleframework.xml.core.Validate; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.List; - -import com.zhgd.jeecg.common.api.vo.Result; -import org.apache.commons.collections.MapUtils; -import com.zhgd.xmgl.modules.goulipkpm.service.IGouliPkpmConfigService; - -import com.baomidou.mybatisplus.core.metadata.IPage; +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; /** @@ -36,104 +31,110 @@ import org.springframework.web.bind.annotation.*; @Slf4j @Api(tags = "构力pkpm-配置信息表相关Api") public class GouliPkpmConfigController { - @Autowired - private IGouliPkpmConfigService gouliPkpmConfigService; + @Autowired + private IGouliPkpmConfigService gouliPkpmConfigService; - /** - * 分页列表查询 - * - * @return - */ - @ApiOperation(value = "分页列表查询构力pkpm-配置信息表信息", notes = "分页列表查询构力pkpm-配置信息表信息", 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(gouliPkpmConfigService.queryPageList(paramMap)); - } + /** + * 分页列表查询 + * + * @return + */ + @ApiOperation(value = "分页列表查询构力pkpm-配置信息表信息", notes = "分页列表查询构力pkpm-配置信息表信息", 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(gouliPkpmConfigService.queryPageList(paramMap)); + } - /** - * 列表查询 - * - * @return - */ - @ApiOperation(value = "列表查询构力pkpm-配置信息表信息", notes = "列表查询构力pkpm-配置信息表信息", httpMethod = "GET") - @GetMapping(value = "/list") - public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { - return Result.success(gouliPkpmConfigService.queryList(paramMap)); - } + /** + * 列表查询 + * + * @return + */ + @ApiOperation(value = "列表查询构力pkpm-配置信息表信息", notes = "列表查询构力pkpm-配置信息表信息", httpMethod = "GET") + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(gouliPkpmConfigService.queryList(paramMap)); + } - /** - * 添加 - * - * @param gouliPkpmConfig - * @return - */ - @ApiOperation(value = "添加构力pkpm-配置信息表信息", notes = "添加构力pkpm-配置信息表信息", httpMethod = "POST") - @PostMapping(value = "/add") - public Result add(@RequestBody @Validate GouliPkpmConfig gouliPkpmConfig) { - gouliPkpmConfigService.add(gouliPkpmConfig); - return Result.ok(); - } + /** + * 添加 + * + * @param gouliPkpmConfig + * @return + */ + @ApiOperation(value = "添加构力pkpm-配置信息表信息", notes = "添加构力pkpm-配置信息表信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody @Validate GouliPkpmConfig gouliPkpmConfig) { + gouliPkpmConfigService.add(gouliPkpmConfig); + return Result.ok(); + } - /** - * 编辑 - * - * @param gouliPkpmConfig - * @return - */ - @ApiOperation(value = "编辑构力pkpm-配置信息表信息", notes = "编辑构力pkpm-配置信息表信息", httpMethod = "POST") - @PostMapping(value = "/edit") - public Result edit(@RequestBody GouliPkpmConfig gouliPkpmConfig) { - gouliPkpmConfigService.edit(gouliPkpmConfig); - return Result.ok(); - } + /** + * 编辑 + * + * @param gouliPkpmConfig + * @return + */ + @ApiOperation(value = "编辑构力pkpm-配置信息表信息", notes = "编辑构力pkpm-配置信息表信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody GouliPkpmConfig gouliPkpmConfig) { + gouliPkpmConfigService.edit(gouliPkpmConfig); + return Result.ok(); + } - /** - * 通过id删除 - * - * @return - */ - @ApiOperation(value = "删除构力pkpm-配置信息表信息", notes = "删除构力pkpm-配置信息表信息", httpMethod = "POST") - @ApiImplicitParam(name = "id", value = "构力pkpm-配置信息表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(); - GouliPkpmConfig gouliPkpmConfig = gouliPkpmConfigService.getById(id); - if (gouliPkpmConfig == null) { - result.error500("未找到对应实体"); - } else { - boolean ok = gouliPkpmConfigService.removeById(id); - if (ok) { - result.success("删除成功!"); - } - } + /** + * 通过id删除 + * + * @return + */ + @ApiOperation(value = "删除构力pkpm-配置信息表信息", notes = "删除构力pkpm-配置信息表信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "构力pkpm-配置信息表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(); + GouliPkpmConfig gouliPkpmConfig = gouliPkpmConfigService.getById(id); + if (gouliPkpmConfig == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = gouliPkpmConfigService.removeById(id); + if (ok) { + result.success("删除成功!"); + } + } - return result; - } + return result; + } - /** - * 通过id查询 - * - * @param id - * @return - */ - @ApiOperation(value = "通过id查询构力pkpm-配置信息表信息", notes = "通过id查询构力pkpm-配置信息表信息", httpMethod = "GET") - @ApiImplicitParam(name = "id", value = "构力pkpm-配置信息表ID", paramType = "query", required = true, dataType = "Integer") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name = "id", required = true) String id) { - Result result = new Result(); - GouliPkpmConfig gouliPkpmConfig = gouliPkpmConfigService.getById(id); - if (gouliPkpmConfig == null) { - result.error500("未找到对应实体"); - } else { - result.setResult(gouliPkpmConfig); - result.setSuccess(true); - } - return result; - } + /** + * 通过id查询 + * + * @param id + * @return + */ + @ApiOperation(value = "通过id查询构力pkpm-配置信息表信息", notes = "通过id查询构力pkpm-配置信息表信息", httpMethod = "GET") + @ApiImplicitParam(name = "id", value = "构力pkpm-配置信息表ID", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + Result result = new Result(); + GouliPkpmConfig gouliPkpmConfig = gouliPkpmConfigService.getById(id); + if (gouliPkpmConfig == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(gouliPkpmConfig); + result.setSuccess(true); + } + return result; + } + @ApiOperation(value = "查询构力pkpm-配置信息表信息", notes = "查询构力pkpm-配置信息表信息", httpMethod = "GET") + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String") + @GetMapping(value = "/getConfigByProjectSn") + public Result getConfigByProjectSn(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(gouliPkpmConfigService.getConfigByProjectSn(paramMap)); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmModelController.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmModelController.java index a1484942e..14a89c5b4 100644 --- a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmModelController.java +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/controller/GouliPkpmModelController.java @@ -1,27 +1,22 @@ package com.zhgd.xmgl.modules.goulipkpm.controller; +import cn.hutool.http.Header; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.modules.goulipkpm.entity.GouliPkpmModel; import com.zhgd.xmgl.modules.goulipkpm.service.IGouliPkpmModelService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiImplicitParams; - -import java.util.HashMap; - -import org.simpleframework.xml.core.Validate; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.List; - -import com.zhgd.jeecg.common.api.vo.Result; -import org.apache.commons.collections.MapUtils; - -import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.*; 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; /** @@ -36,104 +31,122 @@ import org.springframework.web.bind.annotation.*; @Slf4j @Api(tags = "构力pkpm-模型相关Api") public class GouliPkpmModelController { - @Autowired - private IGouliPkpmModelService gouliPkpmModelService; + @Autowired + private IGouliPkpmModelService gouliPkpmModelService; - /** - * 分页列表查询 - * - * @return - */ - @ApiOperation(value = "分页列表查询构力pkpm-模型信息", notes = "分页列表查询构力pkpm-模型信息", 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(gouliPkpmModelService.queryPageList(paramMap)); - } + /** + * 分页列表查询 + * + * @return + */ + @ApiOperation(value = "分页列表查询构力pkpm-模型信息", notes = "分页列表查询构力pkpm-模型信息", 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(gouliPkpmModelService.queryPageList(paramMap)); + } - /** - * 列表查询 - * - * @return - */ - @ApiOperation(value = "列表查询构力pkpm-模型信息", notes = "列表查询构力pkpm-模型信息", httpMethod = "GET") - @GetMapping(value = "/list") - public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { - return Result.success(gouliPkpmModelService.queryList(paramMap)); - } + /** + * 列表查询 + * + * @return + */ + @ApiOperation(value = "列表查询构力pkpm-模型信息", notes = "列表查询构力pkpm-模型信息", httpMethod = "GET") + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(gouliPkpmModelService.queryList(paramMap)); + } - /** - * 添加 - * - * @param gouliPkpmModel - * @return - */ - @ApiOperation(value = "添加构力pkpm-模型信息", notes = "添加构力pkpm-模型信息", httpMethod = "POST") - @PostMapping(value = "/add") - public Result add(@RequestBody @Validate GouliPkpmModel gouliPkpmModel) { - gouliPkpmModelService.add(gouliPkpmModel); - return Result.ok(); - } + /** + * 添加 + * + * @param gouliPkpmModel + * @return + */ + @ApiOperation(value = "添加构力pkpm-模型信息", notes = "添加构力pkpm-模型信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody @Validate GouliPkpmModel gouliPkpmModel) { + gouliPkpmModelService.add(gouliPkpmModel); + return Result.ok(); + } - /** - * 编辑 - * - * @param gouliPkpmModel - * @return - */ - @ApiOperation(value = "编辑构力pkpm-模型信息", notes = "编辑构力pkpm-模型信息", httpMethod = "POST") - @PostMapping(value = "/edit") - public Result edit(@RequestBody GouliPkpmModel gouliPkpmModel) { - gouliPkpmModelService.edit(gouliPkpmModel); - return Result.ok(); - } + /** + * 编辑 + * + * @param gouliPkpmModel + * @return + */ + @ApiOperation(value = "编辑构力pkpm-模型信息", notes = "编辑构力pkpm-模型信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody GouliPkpmModel gouliPkpmModel) { + gouliPkpmModelService.edit(gouliPkpmModel); + return Result.ok(); + } - /** - * 通过id删除 - * - * @return - */ - @ApiOperation(value = "删除构力pkpm-模型信息", notes = "删除构力pkpm-模型信息", httpMethod = "POST") - @ApiImplicitParam(name = "id", value = "构力pkpm-模型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(); - GouliPkpmModel gouliPkpmModel = gouliPkpmModelService.getById(id); - if (gouliPkpmModel == null) { - result.error500("未找到对应实体"); - } else { - boolean ok = gouliPkpmModelService.removeById(id); - if (ok) { - result.success("删除成功!"); - } - } + /** + * 通过id删除 + * + * @return + */ + @ApiOperation(value = "删除构力pkpm-模型信息", notes = "删除构力pkpm-模型信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "构力pkpm-模型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(); + GouliPkpmModel gouliPkpmModel = gouliPkpmModelService.getById(id); + if (gouliPkpmModel == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = gouliPkpmModelService.removeById(id); + if (ok) { + result.success("删除成功!"); + } + } - return result; - } + return result; + } - /** - * 通过id查询 - * - * @param id - * @return - */ - @ApiOperation(value = "通过id查询构力pkpm-模型信息", notes = "通过id查询构力pkpm-模型信息", httpMethod = "GET") - @ApiImplicitParam(name = "id", value = "构力pkpm-模型ID", paramType = "query", required = true, dataType = "Integer") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name = "id", required = true) String id) { - Result result = new Result(); - GouliPkpmModel gouliPkpmModel = gouliPkpmModelService.getById(id); - if (gouliPkpmModel == null) { - result.error500("未找到对应实体"); - } else { - result.setResult(gouliPkpmModel); - result.setSuccess(true); - } - return result; - } + /** + * 通过id查询 + * + * @param id + * @return + */ + @ApiOperation(value = "通过id查询构力pkpm-模型信息", notes = "通过id查询构力pkpm-模型信息", httpMethod = "GET") + @ApiImplicitParam(name = "id", value = "构力pkpm-模型ID", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + Result result = new Result(); + GouliPkpmModel gouliPkpmModel = gouliPkpmModelService.getById(id); + if (gouliPkpmModel == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(gouliPkpmModel); + result.setSuccess(true); + } + return result; + } + @ApiOperation(value = "获取bim的token", notes = "获取bim的token", httpMethod = "GET") + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String") + @GetMapping(value = "/getBimTokenByProjectSn") + public Result getBimTokenByProjectSn(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(gouliPkpmModelService.getBimTokenByProjectSn(paramMap)); + } + + @ApiOperation(value = "设置成主模型", notes = "设置成主模型", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "urn", value = "文件标识", paramType = "body", required = true, dataType = "String"), + }) + @PostMapping(value = "/setEnableMainModel") + public Result setEnableMainModel(@RequestBody @ApiIgnore GouliPkpmModel gouliPkpmModel) { + gouliPkpmModelService.setEnableMainModel(gouliPkpmModel); + return Result.ok(); + } } + diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/entity/GouliPkpmModel.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/entity/GouliPkpmModel.java index 99a28f1fa..af6f6263a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/entity/GouliPkpmModel.java +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/entity/GouliPkpmModel.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/GouliPkpmService.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/GouliPkpmService.java new file mode 100644 index 000000000..8410f3c32 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/GouliPkpmService.java @@ -0,0 +1,31 @@ +package com.zhgd.xmgl.modules.goulipkpm.service; + +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.zhgd.xmgl.modules.goulipkpm.entity.GouliPkpmConfig; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.HashMap; + +@Service +@Slf4j +public class GouliPkpmService { + /** + * 获取token + * + * @return + */ + public String getToken(GouliPkpmConfig config) { + String url = "https://api.cloud.pkpm.cn/bimserver/auth/oauth/token"; + HashMap map = new HashMap<>(); + map.put("grant_type", "client_credentials"); + map.put("client_id", config.getClientId()); + map.put("client_secret", config.getClientSecret()); + log.info("url:{},body:{}", url, JSON.toJSONString(map)); + String rs = HttpUtil.post(url, map); + log.info("rs:{}", rs); + return JSON.parseObject(rs).getString("access_token"); + } + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmConfigService.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmConfigService.java index 24ad85aa9..e34ab15d0 100644 --- a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmConfigService.java +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmConfigService.java @@ -22,4 +22,6 @@ public interface IGouliPkpmConfigService extends IService { void add(GouliPkpmConfig gouliPkpmConfig); void edit(GouliPkpmConfig gouliPkpmConfig); + + GouliPkpmConfig getConfigByProjectSn(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmModelService.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmModelService.java index 0e025f45f..a4b7bc344 100644 --- a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmModelService.java +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/IGouliPkpmModelService.java @@ -22,4 +22,8 @@ public interface IGouliPkpmModelService extends IService { void add(GouliPkpmModel gouliPkpmModel); void edit(GouliPkpmModel gouliPkpmModel); + + String getBimTokenByProjectSn(HashMap paramMap); + + void setEnableMainModel(GouliPkpmModel gouliPkpmModel); } diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmConfigServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmConfigServiceImpl.java index 2bbd23fe4..62f77f5a3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmConfigServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmConfigServiceImpl.java @@ -1,8 +1,10 @@ package com.zhgd.xmgl.modules.goulipkpm.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zhgd.xmgl.modules.goulipkpm.entity.GouliPkpmConfig; import com.zhgd.xmgl.modules.goulipkpm.mapper.GouliPkpmConfigMapper; import com.zhgd.xmgl.modules.goulipkpm.service.IGouliPkpmConfigService; +import org.apache.commons.collections.MapUtils; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -66,4 +68,10 @@ public class GouliPkpmConfigServiceImpl extends ServiceImpl paramMap) { + return gouliPkpmConfigMapper.selectOne(new LambdaQueryWrapper() + .eq(GouliPkpmConfig::getProjectSn, MapUtils.getString(paramMap, "projectSn"))); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmModelServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmModelServiceImpl.java index cecaa7e06..555c78921 100644 --- a/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmModelServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/goulipkpm/service/impl/GouliPkpmModelServiceImpl.java @@ -1,23 +1,31 @@ package com.zhgd.xmgl.modules.goulipkpm.service.impl; -import com.zhgd.xmgl.modules.goulipkpm.entity.GouliPkpmModel; -import com.zhgd.xmgl.modules.goulipkpm.mapper.GouliPkpmModelMapper; -import com.zhgd.xmgl.modules.goulipkpm.service.IGouliPkpmModelService; -import org.springframework.stereotype.Service; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zhgd.jeecg.common.system.query.QueryGenerator; -import com.zhgd.xmgl.util.PageUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhgd.jeecg.common.execption.OpenAlertException; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.redis.lock.RedisRepository; +import com.zhgd.xmgl.modules.goulipkpm.entity.GouliPkpmConfig; +import com.zhgd.xmgl.modules.goulipkpm.entity.GouliPkpmModel; +import com.zhgd.xmgl.modules.goulipkpm.mapper.GouliPkpmConfigMapper; +import com.zhgd.xmgl.modules.goulipkpm.mapper.GouliPkpmModelMapper; +import com.zhgd.xmgl.modules.goulipkpm.service.GouliPkpmService; +import com.zhgd.xmgl.modules.goulipkpm.service.IGouliPkpmModelService; +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.HashMap; import java.util.List; -import com.zhgd.xmgl.util.RefUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.beans.factory.annotation.Autowired; - /** * @Description: 构力pkpm-模型 * @author: pds @@ -29,6 +37,12 @@ import org.springframework.beans.factory.annotation.Autowired; public class GouliPkpmModelServiceImpl extends ServiceImpl implements IGouliPkpmModelService { @Autowired private GouliPkpmModelMapper gouliPkpmModelMapper; + @Autowired + private GouliPkpmConfigMapper gouliPkpmConfigMapper; + @Autowired + private GouliPkpmService gouliPkpmService; + @Autowired + RedisRepository redisRepository; @Override public IPage queryPageList(HashMap paramMap) { @@ -66,4 +80,27 @@ public class GouliPkpmModelServiceImpl extends ServiceImpl paramMap) { + String projectSn = MapUtils.getString(paramMap, "projectSn"); + GouliPkpmConfig config = gouliPkpmConfigMapper.selectOne(new LambdaQueryWrapper() + .eq(GouliPkpmConfig::getProjectSn, projectSn)); + if (config == null || StrUtil.isBlank(config.getClientId()) || StrUtil.isBlank(config.getClientSecret())) { + throw new OpenAlertException("平台上尚未配置信息"); + } + return gouliPkpmService.getToken(config); + } + + @Override + public void setEnableMainModel(GouliPkpmModel gouliPkpmModel) { + gouliPkpmModelMapper.update(null, new LambdaUpdateWrapper() + .set(GouliPkpmModel::getIsEnable, 0) + .eq(GouliPkpmModel::getProjectSn, gouliPkpmModel.getProjectSn())); + gouliPkpmModelMapper.update(null, new LambdaUpdateWrapper() + .set(GouliPkpmModel::getIsEnable, 1) + .eq(GouliPkpmModel::getProjectSn, gouliPkpmModel.getProjectSn()) + .eq(GouliPkpmModel::getUrn, gouliPkpmModel.getUrn()) + ); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProjectServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProjectServiceImpl.java index 9ac6dfea0..ccc40f0cb 100644 --- a/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProjectServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProjectServiceImpl.java @@ -207,7 +207,11 @@ public class ProjectServiceImpl extends ServiceImpl impl @Override public ProjectInfoExtVo getProjectInfoBySn(Map map) { - ProjectInfoExtVo info = redisRepository.getOrSetEx("projectInfoBySn:" + map.get("projectSn"), (() -> projectMapper.getProjectInfoBySn(map))); + String projectSn = MapUtils.getString(map, "projectSn"); + if (StringUtils.isBlank(projectSn)) { + return null; + } + ProjectInfoExtVo info = redisRepository.getOrSetEx("projectInfoBySn:" + projectSn, (() -> projectMapper.getProjectInfoBySn(map))); if (info == null) { throw new NullPointerException(" 当前查询条件结果不存在!"); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldBeamToProcessController.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldBeamToProcessController.java index b877d4ba5..0d6c3594b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldBeamToProcessController.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldBeamToProcessController.java @@ -1,40 +1,23 @@ 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.modules.smartbeamfield.entity.SmartBeamFieldBeamToProcess; +import com.zhgd.xmgl.modules.smartbeamfield.entity.vo.CountDurationVo; +import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldBeamToProcessService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiImplicitParams; - -import java.util.HashMap; - -import org.simpleframework.xml.core.Validate; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.List; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.zhgd.jeecg.common.api.vo.Result; -import com.zhgd.jeecg.common.system.query.QueryGenerator; -import com.zhgd.jeecg.common.util.oConvertUtils; -import org.apache.commons.collections.MapUtils; -import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldBeamToProcessService; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; - +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 org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; /** @@ -49,114 +32,110 @@ import com.alibaba.fastjson.JSON; @Slf4j @Api(tags = "智慧梁场-制梁进度(梁下面的工序)相关Api") public class SmartBeamFieldBeamToProcessController { - @Autowired - private ISmartBeamFieldBeamToProcessService smartBeamFieldBeamToProcessService; + @Autowired + private ISmartBeamFieldBeamToProcessService smartBeamFieldBeamToProcessService; - /** - * 分页列表查询 - * - * @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(smartBeamFieldBeamToProcessService.queryPageList(paramMap)); - } + /** + * 分页列表查询 + * + * @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(smartBeamFieldBeamToProcessService.queryPageList(paramMap)); + } - /** - * 列表查询 - * - * @return - */ - @ApiOperation(value = "列表查询智慧梁场-梁和工序中间表信息", notes = "列表查询智慧梁场-梁和工序中间表信息", httpMethod = "GET") - @GetMapping(value = "/list") - public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { - return Result.success(smartBeamFieldBeamToProcessService.queryList(paramMap)); - } + /** + * 列表查询 + * + * @return + */ + @ApiOperation(value = "列表查询智慧梁场-梁和工序中间表信息", notes = "列表查询智慧梁场-梁和工序中间表信息", httpMethod = "GET") + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(smartBeamFieldBeamToProcessService.queryList(paramMap)); + } - /** - * 添加 - * - * @param smartBeamFieldBeamToProcess - * @return - */ - @ApiOperation(value = "添加智慧梁场-梁和工序中间表信息", notes = "添加智慧梁场-梁和工序中间表信息", httpMethod = "POST") - @PostMapping(value = "/add") - public Result add(@RequestBody @Validate SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) { - smartBeamFieldBeamToProcessService.add(smartBeamFieldBeamToProcess); - return Result.ok(); - } + /** + * 添加 + * + * @param smartBeamFieldBeamToProcess + * @return + */ + @ApiOperation(value = "添加智慧梁场-梁和工序中间表信息", notes = "添加智慧梁场-梁和工序中间表信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody @Validate SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) { + smartBeamFieldBeamToProcessService.add(smartBeamFieldBeamToProcess); + return Result.ok(); + } - /** - * 编辑 - * - * @param smartBeamFieldBeamToProcess - * @return - */ - @ApiOperation(value = "编辑智慧梁场-梁和工序中间表信息", notes = "编辑智慧梁场-梁和工序中间表信息", httpMethod = "POST") - @PostMapping(value = "/edit") - public Result edit(@RequestBody SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) { - smartBeamFieldBeamToProcessService.edit(smartBeamFieldBeamToProcess); - return Result.ok(); - } + /** + * 编辑 + * + * @param smartBeamFieldBeamToProcess + * @return + */ + @ApiOperation(value = "编辑智慧梁场-梁和工序中间表信息", notes = "编辑智慧梁场-梁和工序中间表信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) { + smartBeamFieldBeamToProcessService.edit(smartBeamFieldBeamToProcess); + 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(); - SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess = smartBeamFieldBeamToProcessService.getById(id); - if (smartBeamFieldBeamToProcess == null) { - result.error500("未找到对应实体"); - } else { - boolean ok = smartBeamFieldBeamToProcessService.removeById(id); - if (ok) { - result.success("删除成功!"); - } - } + /** + * 通过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(); + SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess = smartBeamFieldBeamToProcessService.getById(id); + if (smartBeamFieldBeamToProcess == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = smartBeamFieldBeamToProcessService.removeById(id); + if (ok) { + result.success("删除成功!"); + } + } - return result; - } + 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(); - SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess = smartBeamFieldBeamToProcessService.getById(id); - if (smartBeamFieldBeamToProcess == null) { - result.error500("未找到对应实体"); - } else { - result.setResult(smartBeamFieldBeamToProcess); - result.setSuccess(true); - } - return result; - } - - @ApiOperation(value = "查询制梁进度列表", notes = "查询制梁进度列表", httpMethod = "GET") - @ApiImplicitParams({ - @ApiImplicitParam(name = "smartBeamFieldBeamId", value = "智慧梁场-梁id", paramType = "query", required = true, dataType = "String"), - @ApiImplicitParam(name = "smartBeamFieldMakeBeamPedestalId", value = "智慧梁场-制梁台座id", paramType = "query", required = false, dataType = "String"), - }) - @GetMapping(value = "/getMakeBeamProcess") - public Result> getMakeBeamProcess(@ApiIgnore @RequestParam HashMap paramMap) { - return Result.success(smartBeamFieldBeamToProcessService.getMakeBeamProcess(paramMap)); - } + /** + * 通过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(); + SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess = smartBeamFieldBeamToProcessService.getById(id); + if (smartBeamFieldBeamToProcess == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(smartBeamFieldBeamToProcess); + result.setSuccess(true); + } + return result; + } + @ApiOperation(value = "统计时长", notes = "统计时长", httpMethod = "GET") + @ApiImplicitParam(name = "smartBeamFieldBeamId", value = "智慧梁场-梁id", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/countDuration") + public Result countDuration(@RequestParam String smartBeamFieldBeamId) { + return Result.success(smartBeamFieldBeamToProcessService.countDuration(smartBeamFieldBeamId)); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldBeam.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldBeam.java index 13af7e0cb..c56e81b6b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldBeam.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldBeam.java @@ -54,7 +54,7 @@ public class SmartBeamFieldBeam implements Serializable { */ @Excel(name = "是否占用该生产线", width = 15) @ApiModelProperty(value = "是否占用该生产线") - private java.lang.Integer useProductionLine; + private java.lang.Boolean useProductionLine; /** * 梁号 */ diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldProductionLine.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldProductionLine.java index 317dff9ec..64c84f189 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldProductionLine.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/SmartBeamFieldProductionLine.java @@ -67,4 +67,7 @@ public class SmartBeamFieldProductionLine implements Serializable { @TableField(exist = false) @ApiModelProperty(value = "智慧梁场-制梁台座列表(查询用)") List makeBeamPedestals; + @TableField(exist = false) + @ApiModelProperty(value = "是否占用该生产线") + private java.lang.Boolean useProductionLine; } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/vo/CountDurationVo.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/vo/CountDurationVo.java new file mode 100644 index 000000000..48835518a --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/entity/vo/CountDurationVo.java @@ -0,0 +1,17 @@ +package com.zhgd.xmgl.modules.smartbeamfield.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class CountDurationVo { + @ApiModelProperty("计划时长(s)") + private Integer planDuration; + @ApiModelProperty("实际时长(s)") + private Integer actualDuration; + @ApiModelProperty("计划时长(中文名称)") + private String planDurationName; + @ApiModelProperty("实际时长(中文名称)") + private String actualDurationName; + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java index 84a5a4489..d461f743a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToProcess; +import com.zhgd.xmgl.modules.smartbeamfield.entity.vo.CountDurationVo; import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; @@ -23,4 +24,6 @@ public interface SmartBeamFieldBeamToProcessMapper extends BaseMapper queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + CountDurationVo countDuration(String smartBeamFieldBeamId); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProductionLineMapper.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProductionLineMapper.java index 590c9a244..dc457819e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProductionLineMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProductionLineMapper.java @@ -1,17 +1,28 @@ package com.zhgd.xmgl.modules.smartbeamfield.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldProductionLine; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @Description: 智慧梁场-生产线 * @author: pds - * @date: 2023-12-05 + * @date: 2023-12-05 * @version: V1.0 */ @Mapper public interface SmartBeamFieldProductionLineMapper extends BaseMapper { SmartBeamFieldProductionLine queryById(String id); + + IPage queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamMapper.xml b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamMapper.xml index 61cd5a2e6..bd0628b3b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamMapper.xml @@ -2,15 +2,17 @@ select sbfbtp.* from smart_beam_field_beam_to_process sbfbtp - join smart_beam_field_make_beam_pedestal_to_process sbfmbptp on sbfbtp.smart_beam_field_make_beam_pedestal_id = + join smart_beam_field_make_beam_pedestal_to_process sbfmbptp + on sbfbtp.smart_beam_field_make_beam_pedestal_id = sbfmbptp.smart_beam_field_make_beam_pedestal_id - and sbfbtp.id = sbfmbptp.smart_beam_field_process_id + and sbfbtp.smart_beam_field_process_id = sbfmbptp.smart_beam_field_process_id join smart_beam_field_beam sbfb on sbfbtp.smart_beam_field_beam_id = sbfb.id join smart_beam_field_production_line_to_make_beam_pedestal sbfpltmbp on sbfbtp.smart_beam_field_make_beam_pedestal_id = sbfpltmbp.smart_beam_field_make_beam_pedestal_id - and sbfpltmbp.smart_beam_field_production_line_id=sbfb.smart_beam_field_production_line_id + and sbfpltmbp.smart_beam_field_production_line_id = sbfb.smart_beam_field_production_line_id ${ew.customSqlSegment} - order by sbfpltmbp.process_sort,sbfbtp.id + order by sbfpltmbp.process_sort, sbfbtp.id + + diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProductionLineMapper.xml b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProductionLineMapper.xml index bffc3792a..af4f4550e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProductionLineMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProductionLineMapper.xml @@ -29,4 +29,12 @@ group by bp.id order by sbfpl.id desc, mb.process_sort + + diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldBeamToProcessService.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldBeamToProcessService.java index 3548a8240..ceea9f510 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldBeamToProcessService.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/ISmartBeamFieldBeamToProcessService.java @@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.smartbeamfield.service; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToProcess; +import com.zhgd.xmgl.modules.smartbeamfield.entity.vo.CountDurationVo; import java.util.HashMap; import java.util.List; @@ -23,5 +24,5 @@ public interface ISmartBeamFieldBeamToProcessService extends IService getMakeBeamProcess(HashMap paramMap); + CountDurationVo countDuration(String smartBeamFieldBeamId); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java index 2fcb410da..6e3f70fd2 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java @@ -127,7 +127,7 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl getMakeBeamProcess(HashMap paramMap) { - String smartBeamFieldBeamId = MapUtils.getString(paramMap, "smartBeamFieldBeamId"); - String smartBeamFieldMakeBeamPedestalId = MapUtils.getString(paramMap, "smartBeamFieldMakeBeamPedestalId"); - return smartBeamFieldBeamToProcessMapper.selectList(new LambdaQueryWrapper() - .eq(StrUtil.isNotBlank(smartBeamFieldBeamId), SmartBeamFieldBeamToProcess::getSmartBeamFieldBeamId, smartBeamFieldBeamId) - .eq(StrUtil.isNotBlank(smartBeamFieldMakeBeamPedestalId), SmartBeamFieldBeamToProcess::getSmartBeamFieldMakeBeamPedestalId, smartBeamFieldMakeBeamPedestalId) - ); + public CountDurationVo countDuration(String smartBeamFieldBeamId) { + CountDurationVo vo = baseMapper.countDuration(smartBeamFieldBeamId); + vo.setActualDurationName(TimeUtil.toHourMinSecond(vo.getActualDuration())); + vo.setPlanDurationName(TimeUtil.toHourMinSecond(vo.getPlanDuration())); + return vo; } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldProductionLineServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldProductionLineServiceImpl.java index dd157090f..cac577f14 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldProductionLineServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldProductionLineServiceImpl.java @@ -46,7 +46,7 @@ public class SmartBeamFieldProductionLineServiceImpl extends ServiceImpl queryPageList(HashMap paramMap) { QueryWrapper queryWrapper = getQueryWrapper(paramMap); Page page = PageUtil.getPage(paramMap); - IPage pageList = this.page(page, queryWrapper); + IPage pageList = baseMapper.queryList(page, queryWrapper); pageList.setRecords(dealList(pageList.getRecords())); return pageList; } @@ -54,11 +54,11 @@ public class SmartBeamFieldProductionLineServiceImpl extends ServiceImpl queryList(HashMap paramMap) { QueryWrapper queryWrapper = getQueryWrapper(paramMap); - return dealList(this.list(queryWrapper)); + return dealList(baseMapper.queryList(queryWrapper)); } private QueryWrapper getQueryWrapper(HashMap paramMap) { - String alias = ""; + String alias = "sbfpl."; QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(SmartBeamFieldProductionLine.class, paramMap, alias); queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SmartBeamFieldProductionLine::getId)); return queryWrapper; diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighBookVehicleInfoController.java b/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighBookVehicleInfoController.java index 8dc0379f7..33fc23b4d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighBookVehicleInfoController.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighBookVehicleInfoController.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo; import com.zhgd.xmgl.modules.weight.entity.bo.WeighingTypeStatisticBo; +import com.zhgd.xmgl.modules.weight.entity.vo.PullListVo; import com.zhgd.xmgl.modules.weight.entity.vo.WeighingTypeStatisticVo; import com.zhgd.xmgl.modules.weight.enums.WeighingTypeEnum; import com.zhgd.xmgl.modules.weight.service.IWeighBookVehicleInfoService; @@ -16,6 +17,7 @@ import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletRequest; import java.util.Arrays; @@ -182,4 +184,14 @@ public class WeighBookVehicleInfoController { public Result getWeighingTypeStatistic(@RequestParam HashMap map) { return Result.success(weighBookVehicleInfoService.getWeighingTypeStatistic(map)); } + + @ApiOperation(value = "拉取过磅预约车辆数据列表(大于等于200条)", notes = "拉取过磅预约车辆数据列表(大于等于200条)", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"), + @ApiImplicitParam(name = "beginTimestamp", value = "开始时间", paramType = "query", required = true, dataType = "Integer") + }) + @GetMapping(value = "pull/list") + public Result pullList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(weighBookVehicleInfoService.pullList(paramMap)); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/PullListVo.java b/src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/PullListVo.java new file mode 100644 index 000000000..a3ecdcd06 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/PullListVo.java @@ -0,0 +1,27 @@ +package com.zhgd.xmgl.modules.weight.entity.vo; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.List; + +@Data +public class PullListVo { + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "开始时间") + private java.util.Date beginTimestamp; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "最大时间") + private java.util.Date maxTimestamp; + private Integer pageSize; + + private List list; + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighBookVehicleInfoMapper.java b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighBookVehicleInfoMapper.java index 326abcb2a..5fb814458 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighBookVehicleInfoMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighBookVehicleInfoMapper.java @@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -20,7 +21,10 @@ import java.util.List; @Mapper public interface WeighBookVehicleInfoMapper extends BaseMapper { + @Deprecated IPage getByLastPullTime(@Param("p") HashMap map, Page page); List getWeighingTypeStatistic(HashMap map); + + ArrayList pullList(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml index 00b0c731e..e68d34377 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml @@ -18,4 +18,12 @@ GROUP BY vi.weighing_type + + diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighBookVehicleInfoService.java b/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighBookVehicleInfoService.java index 443ac8fc7..9bcffd998 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighBookVehicleInfoService.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighBookVehicleInfoService.java @@ -5,6 +5,7 @@ import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo; import com.baomidou.mybatisplus.extension.service.IService; import com.zhgd.xmgl.modules.weight.entity.bo.WeighingTypeStatisticBo; +import com.zhgd.xmgl.modules.weight.entity.vo.PullListVo; import com.zhgd.xmgl.modules.weight.entity.vo.WeighingTypeStatisticVo; import javax.servlet.http.HttpServletRequest; @@ -22,4 +23,6 @@ public interface IWeighBookVehicleInfoService extends IService> queryPageList(WeighBookVehicleInfo weighBookVehicleInfo, Integer pageNo, Integer pageSize, HttpServletRequest req); WeighingTypeStatisticVo getWeighingTypeStatistic(HashMap map); + + PullListVo pullList(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java index 488c86855..6fa6339c4 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.zhgd.xmgl.modules.weight.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo; import com.zhgd.xmgl.modules.weight.entity.bo.WeighingTypeStatisticBo; +import com.zhgd.xmgl.modules.weight.entity.vo.PullListVo; import com.zhgd.xmgl.modules.weight.entity.vo.WeighingTypeStatisticVo; import com.zhgd.xmgl.modules.weight.enums.WeighingTypeEnum; import com.zhgd.xmgl.modules.weight.mapper.WeighBookVehicleInfoMapper; @@ -48,7 +50,7 @@ public class WeighBookVehicleInfoServiceImpl extends ServiceImpl pageList; - Page page = new Page(pageNo, pageSize); + Page page = new Page<>(pageNo, pageSize); if (StringUtils.isNotBlank(lastPullTime)) { DateTime dateTime = DateUtil.parse(lastPullTime); queryWrapper.ge(WeighBookVehicleInfo::getAddDateTime, dateTime); @@ -93,4 +95,27 @@ public class WeighBookVehicleInfoServiceImpl extends ServiceImpl paramMap) { + ArrayList list = weighBookVehicleInfoMapper.pullList(paramMap); + PullListVo pullListVo = new PullListVo(); + pullListVo.setBeginTimestamp(DateUtil.parseDateTime(MapUtils.getString(paramMap, "beginTimestamp"))); + if (CollUtil.isEmpty(list)) { + pullListVo.setMaxTimestamp(pullListVo.getBeginTimestamp()); + pullListVo.setPageSize(0); + return pullListVo; + } + WeighBookVehicleInfo weighBookVehicleInfo = list.get(list.size() - 1); + pullListVo.setMaxTimestamp(weighBookVehicleInfo.getUpdateTime()); + //补充最后相同时间的数据 + List weighBookVehicleInfos = weighBookVehicleInfoMapper.selectList(new LambdaQueryWrapper() + .eq(WeighBookVehicleInfo::getUpdateTime, DateUtil.formatDateTime(weighBookVehicleInfo.getUpdateTime())) + .ne(WeighBookVehicleInfo::getId, weighBookVehicleInfo.getId()) + ); + list.addAll(weighBookVehicleInfos); + pullListVo.setList(list); + pullListVo.setPageSize(list.size()); + return pullListVo; + } + } diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 2315b60e6..8fbbd1124 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -261,6 +261,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/xmgl/smartBeamFieldMakeBeamPedestal/getMakeBeamRecordList").permitAll() .antMatchers("/xmgl/project/saveProjectExtendInfo").permitAll() .antMatchers("/xmgl/project/getProjectExtendInfo").permitAll() + .antMatchers("/xmgl/gouliPkpm/getTokenByCode").permitAll() + .antMatchers("/xmgl/weight/weighBookVehicleInfo/pull/list").permitAll() .antMatchers(HttpMethod.OPTIONS, "/**").anonymous() .anyRequest().authenticated() // 剩下所有的验证都需要验证 .and()