From 960ba1bc6fb039a7f91d211f0693e5ce371c9ea4 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Tue, 9 Jan 2024 09:33:19 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E7=89=A9=E8=81=94=E7=BD=91=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../controller/DcDeviceController.java | 94 ++++++++++--------- 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 593e5a78..192c04f7 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -156,5 +156,5 @@ aj: # 物联平台ip地址 iot: - address: 127.0.0.1:8080 + address: http://127.0.0.1:8080 diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java index e372e786..871475b3 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java @@ -1,6 +1,7 @@ package com.zc.business.controller; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -8,7 +9,6 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.zc.business.domain.DcDevice; import com.zc.business.request.DeviceGetPropertiesOperateRequest; -import com.zc.business.request.DeviceOperateRequest; import com.zc.business.service.IDcDeviceService; import com.zc.common.core.httpclient.OkHttp; import com.zc.common.core.httpclient.exception.HttpException; @@ -20,15 +20,12 @@ import okhttp3.Response; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import javax.annotation.Resource; import javax.validation.Valid; import java.io.IOException; import java.util.HashMap; import java.util.List; -import java.util.Map; /** * 设备Controller @@ -135,6 +132,7 @@ public class DcDeviceController extends BaseController { /** * 根据物联设备id获取最新属性数据 + * * @param deviceId 物联设备id * @return 获取属性数据操作结果 */ @@ -144,30 +142,30 @@ public class DcDeviceController extends BaseController { OkHttp okHttp = new OkHttp(); Response response // 请求响应 = okHttp - .url(iotAddress + "/properties/latest/" + deviceId) // 请求地址 + .url(iotAddress + "/api/iot/device/properties/latest/" + deviceId) // 请求地址 .get(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); } /** * 查询设备指定属性列表 - * @param deviceId 设备id + * + * @param deviceId 设备id * @param propertyId 属性id - * @param queryParam 查询条件 + * @param props 查询条件 * @return 属性列表 */ @GetMapping("/properties/history/{deviceId}/{propertyId}") public AjaxResult queryDeviceProperties(@PathVariable @Parameter(description = "设备ID") String deviceId, @PathVariable @Parameter(description = "属性ID") String propertyId, - @Parameter(hidden = true) Map queryParam) throws HttpException, IOException { + @Parameter(hidden = true) HashMap props) throws HttpException, IOException { OkHttp okHttp = new OkHttp(); - RequestParams requestParams = new RequestParams(); - requestParams.put("queryParam", queryParam); + RequestParams requestParams = new RequestParams(props); Response response // 请求响应 = okHttp - .url(iotAddress + "/properties/history/" + deviceId + "/" + propertyId) // 请求地址 + .url(iotAddress + "/api/iot/device/properties/history/" + deviceId + "/" + propertyId) // 请求地址 .data(requestParams) .get(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); @@ -175,7 +173,8 @@ public class DcDeviceController extends BaseController { /** * 根据物联设备id获取最新属性数据 - * @param deviceId 物联设备id + * + * @param deviceId 物联设备id * @param propertyId 属性id * @return 获取属性数据操作结果 */ @@ -185,14 +184,15 @@ public class DcDeviceController extends BaseController { OkHttp okHttp = new OkHttp(); Response response // 请求响应 = okHttp - .url(iotAddress + "/properties/latest/" + deviceId + "/" + propertyId) // 请求地址 + .url(iotAddress + "/api/iot/device/properties/latest/" + deviceId + "/" + propertyId) // 请求地址 .get(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); } /** * 获取物联设备实时属性值 - * @param deviceId 物联设备id + * + * @param deviceId 物联设备id * @param propertyId 属性 * @return 属性实时数据 */ @@ -200,16 +200,15 @@ public class DcDeviceController extends BaseController { public AjaxResult getDeviceRealtimeProperty( @PathVariable String deviceId, @PathVariable String propertyId, - @RequestParam Map headers) throws HttpException, IOException { + @RequestParam HashMap props) throws HttpException, IOException { OkHttp okHttp = new OkHttp(); - RequestParams requestParams = new RequestParams(); - requestParams.put("headers", headers); + RequestParams requestParams = new RequestParams(props); Response response // 请求响应 = okHttp - .url(iotAddress + "/properties/realtime/" + deviceId + "/" + propertyId) // 请求地址 + .url(iotAddress + "/api/iot/device/properties/realtime/" + deviceId + "/" + propertyId) // 请求地址 .data(requestParams) .get(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); @@ -217,47 +216,51 @@ public class DcDeviceController extends BaseController { /** * 批量获取物联设备实时属性 + * * @param deviceId 物联设备id - * @param props 属性id集 + * @param props 属性id集 * @return 属性实时数据 */ - @GetMapping("/properties/realtime/{deviceId}") + @PostMapping("/properties/realtime/{deviceId}") public AjaxResult getDeviceRealtimeProperties( @PathVariable String deviceId, - @ModelAttribute DeviceGetPropertiesOperateRequest props) throws HttpException, IOException { + @RequestBody DeviceGetPropertiesOperateRequest props) throws HttpException, IOException { OkHttp okHttp = new OkHttp(); - RequestParams requestParams = new RequestParams(); - requestParams.put("props", props); + + String string = JSON.toJSONString(props); + JSONObject jsonObject = JSON.parseObject(string); + RequestParams requestParams = new RequestParams(jsonObject); + Response response // 请求响应 = okHttp - .url(iotAddress + "/properties/realtime/" + deviceId) // 请求地址 + .url(iotAddress + "/api/iot/device/properties/realtime/" + deviceId) // 请求地址 .data(requestParams) - .get(); // 请求方法 + .post(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); } /** * 发送设置属性指令到设备 + * * @param deviceId 物联设备id - * @param props 参数 + * @param props 参数 * @return 设备属性操作结果 */ @PostMapping("/properties/setting/{deviceId}") public AjaxResult setDeviceProperties( @PathVariable String deviceId, - @RequestBody DeviceOperateRequest> props + @RequestBody HashMap props ) throws HttpException, IOException { OkHttp okHttp = new OkHttp(); - RequestParams requestParams = new RequestParams(); - requestParams.put("props", props); + RequestParams requestParams = new RequestParams(props); Response response // 请求响应 = okHttp - .url(iotAddress + "/properties/setting/" + deviceId) // 请求地址 + .url(iotAddress + "/api/iot/device/properties/setting/" + deviceId) // 请求地址 .data(requestParams) .post(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); @@ -265,25 +268,26 @@ public class DcDeviceController extends BaseController { /** * 设备功能调用 - * @param deviceId 物联设备id + * + * @param deviceId 物联设备id * @param functionId 功能id - * @param props 调用参数 + * @param props 调用参数 * @return 调用结果 */ @PostMapping("/functions/{deviceId}/{functionId}") public AjaxResult invokedFunction( @PathVariable String deviceId, @PathVariable String functionId, - @RequestBody Map props) throws HttpException, IOException { + @RequestBody HashMap props) throws HttpException, IOException { OkHttp okHttp = new OkHttp(); - RequestParams requestParams = new RequestParams(); - requestParams.put("props", props); + RequestParams requestParams = new RequestParams(props); + Response response // 请求响应 = okHttp - .url(iotAddress + "/functions/" + deviceId + "/" + functionId) // 请求地址 + .url(iotAddress + "/api/iot/device/functions/" + deviceId + "/" + functionId) // 请求地址 .data(requestParams) .post(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); @@ -292,8 +296,9 @@ public class DcDeviceController extends BaseController { /** * 查询物联设备事件数据 - * @param deviceId 物联设备id - * @param eventId 事件id + * + * @param deviceId 物联设备id + * @param eventId 事件id * @param queryParam 查询条件 * @return 查询事件结果 */ @@ -301,18 +306,16 @@ public class DcDeviceController extends BaseController { public AjaxResult queryPagerDeviceEvents( @PathVariable @Parameter(description = "设备ID") String deviceId, @PathVariable @Parameter(description = "事件ID") String eventId, - @Parameter(hidden = true) Map queryParam - ) throws HttpException, IOException - { + @Parameter(hidden = true) HashMap queryParam + ) throws HttpException, IOException { OkHttp okHttp = new OkHttp(); - RequestParams requestParams = new RequestParams(); - requestParams.put("queryParam", queryParam); + RequestParams requestParams = new RequestParams(queryParam); Response response // 请求响应 = okHttp - .url(iotAddress + "/events/history/" + deviceId + "/" + eventId) // 请求地址 + .url(iotAddress + "/api/iot/device/events/history/" + deviceId + "/" + eventId) // 请求地址 .data(requestParams) .get(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); @@ -320,6 +323,7 @@ public class DcDeviceController extends BaseController { /** * 获取物联设备物模型 + * * @param id 物联设备id * @return 更新结果 */ @@ -329,7 +333,7 @@ public class DcDeviceController extends BaseController { OkHttp okHttp = new OkHttp(); Response response // 请求响应 = okHttp - .url(iotAddress + "/metadata/" + id) // 请求地址 + .url(iotAddress + "/api/iot/device/metadata/" + id) // 请求地址 .get(); // 请求方法 return JSON.parseObject(response.body().string(), AjaxResult.class); } From a609618b70a05a459b82d40ef0b520b9864890ec Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Wed, 10 Jan 2024 14:30:34 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=83=85=E6=8A=A5=E6=9D=BF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/service/impl/DcBoardServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java index 217f2d7a..75228554 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java @@ -59,7 +59,7 @@ public class DcBoardServiceImpl implements IDcBoardService { try{ //下发文件名 - Map param = new HashMap<>(); + HashMap param = new HashMap<>(); param.put("size","65535"); param.put("fileName","play010.lst"); ajaxResult = deviceController.invokedFunction(deviceId,"11",param); @@ -95,6 +95,7 @@ public class DcBoardServiceImpl implements IDcBoardService { releaseLog.setReleaseUserId(loginUser.getUsername()); releaseLog.setReleaseUserName(loginUser.getUser().getNickName()); releaseLog.setReleaseDeptId(loginUser.getDeptId().toString()); + releaseLog.setPlatform(loginUser.getUser().getUserType()); dcBoardReleaseLogMapper.insertDcBoardReleaseLog(releaseLog); } }catch (Exception e){ @@ -115,9 +116,9 @@ public class DcBoardServiceImpl implements IDcBoardService { AjaxResult ajaxResult = new AjaxResult(); try { - Map param = new HashMap<>(); + HashMap param = new HashMap<>(); param.put("async",false); - ajaxResult = deviceController.invokedFunction(deviceId,"3A",param); + ajaxResult = deviceController.getDeviceRealtimeProperty(deviceId,"3A",param); } catch (Exception e){ e.printStackTrace(); } From 24b43f0ba95225da57c264028ac0c30fd2416009 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Wed, 10 Jan 2024 17:01:56 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/zc/business/domain/DcDevice.java | 2 ++ .../com/zc/business/service/impl/DcDeviceServiceImpl.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java index e9e6364b..b9a91cb7 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java @@ -22,6 +22,8 @@ public class DcDevice { private Long productId; @ApiModelProperty("桩号") private String stakeMarkId; + @ApiModelProperty("方向1-上行(菏泽方向),2-中,3-下行(济南方向)") + private String direction; @ApiModelProperty("道路标识") private Long roadId; @ApiModelProperty("设备名称") diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java index d75648de..2a95e268 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java @@ -74,6 +74,11 @@ public class DcDeviceServiceImpl extends ServiceImpl i queryWrapper.eq(DcDevice::getDeviceType, dcDevice.getDeviceType()); } + // 方向 + if (Objects.nonNull(dcDevice.getDirection())) { + queryWrapper.eq(DcDevice::getDirection, dcDevice.getDirection()); + } + // 安装日期 if (Objects.nonNull(dcDevice.getInstallationDate())) { queryWrapper.eq(DcDevice::getInstallationDate, dcDevice.getInstallationDate()); From bc379486c9d999ecbb56703aefccb5980fde9e54 Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Thu, 11 Jan 2024 09:30:32 +0800 Subject: [PATCH 4/9] =?UTF-8?q?--=E5=8E=BB=E6=8E=89=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=9D=83=E9=99=90=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventProcessController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java index 142c5a39..8ad2c9fb 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java @@ -47,7 +47,7 @@ public class DcEventProcessController extends BaseController * 查询事件处理流程列表 */ @ApiOperation("查询事件处理流程列表") - @PreAuthorize("@ss.hasPermi('system:process:list')") + // @PreAuthorize("@ss.hasPermi('system:process:list')") @GetMapping("/list") public TableDataInfo list(DcEventProcess dcEventProcess) { @@ -62,7 +62,7 @@ public class DcEventProcessController extends BaseController * 导出事件处理流程列表 */ @ApiOperation("导出事件处理流程列表") - @PreAuthorize("@ss.hasPermi('system:process:export')") + // @PreAuthorize("@ss.hasPermi('system:process:export')") @Log(title = "事件处理流程", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventProcess dcEventProcess) @@ -76,7 +76,7 @@ public class DcEventProcessController extends BaseController * 获取事件处理流程详细信息 */ @ApiOperation("获取事件处理流程详细信息") - @PreAuthorize("@ss.hasPermi('system:process:query')") + // @PreAuthorize("@ss.hasPermi('system:process:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -87,7 +87,7 @@ public class DcEventProcessController extends BaseController * 新增事件处理流程 */ @ApiOperation("新增事件处理流程") - @PreAuthorize("@ss.hasPermi('system:process:add')") + // @PreAuthorize("@ss.hasPermi('system:process:add')") @Log(title = "事件处理流程", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) throws IOException, InvalidExtensionException { @@ -103,7 +103,7 @@ public class DcEventProcessController extends BaseController * 修改事件处理流程 */ @ApiOperation("修改事件处理流程") - @PreAuthorize("@ss.hasPermi('system:process:edit')") + // @PreAuthorize("@ss.hasPermi('system:process:edit')") @Log(title = "事件处理流程", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventProcess dcEventProcess) @@ -115,7 +115,7 @@ public class DcEventProcessController extends BaseController * 删除事件处理流程 */ @ApiOperation("删除事件处理流程") - @PreAuthorize("@ss.hasPermi('system:process:remove')") + // @PreAuthorize("@ss.hasPermi('system:process:remove')") @Log(title = "事件处理流程", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) From ebf4851a1e4d858f4a433edc97e493939ef0efd2 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 11 Jan 2024 09:32:48 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/controller/DcBoardController.java | 4 ++-- .../controller/DcBoardReleaseLogController.java | 12 ++++++------ .../business/controller/DcEventTypeController.java | 12 ++++++------ .../controller/DcInfoBoardTemplateController.java | 6 +++--- .../controller/DcInfoBoardVocabularyController.java | 12 ++++++------ .../business/controller/DcPublishInfoController.java | 12 ++++++------ 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcBoardController.java b/zc-business/src/main/java/com/zc/business/controller/DcBoardController.java index 6e2c7a98..2916248e 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcBoardController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcBoardController.java @@ -33,7 +33,7 @@ public class DcBoardController { * 情报板发布 */ @ApiOperation("情报板发布") - @PreAuthorize("@ss.hasPermi('business:board:publish')") +// @PreAuthorize("@ss.hasPermi('business:board:publish')") @PostMapping("/publish") public AjaxResult publish(@RequestBody DcBoardPublish dcBoardPublish){ return dcBoardService.publish(dcBoardPublish); @@ -44,7 +44,7 @@ public class DcBoardController { * 情报板回读 */ @ApiOperation("情报板回读") - @PreAuthorize("@ss.hasPermi('business:board:realtimeProperty')") +// @PreAuthorize("@ss.hasPermi('business:board:realtimeProperty')") @GetMapping("/realtimeProperty/{deviceId}") public AjaxResult realtimeProperty(@ApiParam(name = "deviceId", value = "设备id", required = true) @PathVariable("deviceId") String deviceId){ return dcBoardService.realtimeProperty(deviceId); diff --git a/zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java b/zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java index c2e53dc6..6a926a72 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java @@ -43,7 +43,7 @@ public class DcBoardReleaseLogController extends BaseController * 查询情报板内容发布日志列表 */ @ApiOperation("查询情报板内容发布日志列表") - @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:list')") +// @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:list')") @GetMapping("/list") public TableDataInfo list(DcBoardReleaseLog dcBoardReleaseLog) { @@ -56,7 +56,7 @@ public class DcBoardReleaseLogController extends BaseController * 导出情报板内容发布日志列表 */ @ApiOperation("导出情报板内容发布日志列表") - @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:export')") +// @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:export')") @Log(title = "情报板内容发布日志", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcBoardReleaseLog dcBoardReleaseLog) @@ -70,7 +70,7 @@ public class DcBoardReleaseLogController extends BaseController * 获取情报板内容发布日志详细信息 */ @ApiOperation("获取情报板内容发布日志详细信息") - @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:query')") +// @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@ApiParam(value = "id", name = "id",required = true) @PathVariable("id") Long id) { @@ -81,7 +81,7 @@ public class DcBoardReleaseLogController extends BaseController * 新增情报板内容发布日志 */ @ApiOperation("新增情报板内容发布日志") - @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:add')") +// @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:add')") @Log(title = "情报板内容发布日志", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcBoardReleaseLog dcBoardReleaseLog) @@ -92,7 +92,7 @@ public class DcBoardReleaseLogController extends BaseController /** * 修改情报板内容发布日志 */ - @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:edit')") +// @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:edit')") @Log(title = "情报板内容发布日志", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcBoardReleaseLog dcBoardReleaseLog) @@ -104,7 +104,7 @@ public class DcBoardReleaseLogController extends BaseController * 删除情报板内容发布日志 */ @ApiOperation("删除情报板内容发布日志") - @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:remove')") +// @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:remove')") @Log(title = "情报板内容发布日志", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@ApiParam(value = "id", name = "id",required = true) @PathVariable Long[] ids) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java index 87fd16d6..ea17ddb3 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java @@ -43,7 +43,7 @@ public class DcEventTypeController extends BaseController * 查询事件类型列表 */ @ApiOperation("查询事件类型列表") - @PreAuthorize("@ss.hasPermi('business:dcEventType:list')") +// @PreAuthorize("@ss.hasPermi('business:dcEventType:list')") @GetMapping("/list") public TableDataInfo list(DcEventType dcEventType) { @@ -55,7 +55,7 @@ public class DcEventTypeController extends BaseController /** * 导出事件类型列表 */ - @PreAuthorize("@ss.hasPermi('business:dcEventType:export')") +// @PreAuthorize("@ss.hasPermi('business:dcEventType:export')") @Log(title = "事件类型", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventType dcEventType) @@ -69,7 +69,7 @@ public class DcEventTypeController extends BaseController * 获取事件类型详细信息 */ @ApiOperation("获取事件类型详细信息") - @PreAuthorize("@ss.hasPermi('business:dcEventType:query')") +// @PreAuthorize("@ss.hasPermi('business:dcEventType:query')") @GetMapping(value = "/{eventType}") public AjaxResult getInfo(@PathVariable("eventType") @ApiParam(name = "eventType", value = "事件类型", required = true) Integer eventType) { @@ -80,7 +80,7 @@ public class DcEventTypeController extends BaseController * 新增事件类型 */ @ApiOperation("新增事件类型") - @PreAuthorize("@ss.hasPermi('business:dcEventType:add')") +// @PreAuthorize("@ss.hasPermi('business:dcEventType:add')") @Log(title = "事件类型", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventType dcEventType) @@ -92,7 +92,7 @@ public class DcEventTypeController extends BaseController * 修改事件类型 */ @ApiOperation("修改事件类型") - @PreAuthorize("@ss.hasPermi('business:dcEventType:edit')") +// @PreAuthorize("@ss.hasPermi('business:dcEventType:edit')") @Log(title = "事件类型", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventType dcEventType) @@ -104,7 +104,7 @@ public class DcEventTypeController extends BaseController * 删除事件类型 */ @ApiOperation("删除事件类型") - @PreAuthorize("@ss.hasPermi('business:dcEventType:remove')") +// @PreAuthorize("@ss.hasPermi('business:dcEventType:remove')") @Log(title = "事件类型", businessType = BusinessType.DELETE) @DeleteMapping("/{eventType}") public AjaxResult remove(@PathVariable @ApiParam(value = "事件类型", name = "eventType", required = true) Integer eventType) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java b/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java index 7787dd50..38ca85a7 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java @@ -38,7 +38,7 @@ public class DcInfoBoardTemplateController extends BaseController * 新增情报板模板 */ @ApiOperation("新增情报板模板") - @PreAuthorize("@ss.hasPermi('business:boardTemplate:add')") +// @PreAuthorize("@ss.hasPermi('business:boardTemplate:add')") @Log(title = "情报板模板", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcInfoBoardTemplate dcInfoBoardTemplate) @@ -50,7 +50,7 @@ public class DcInfoBoardTemplateController extends BaseController * 修改情报板模板 */ @ApiOperation("修改情报板模板") - @PreAuthorize("@ss.hasPermi('business:boardTemplate:edit')") +// @PreAuthorize("@ss.hasPermi('business:boardTemplate:edit')") @Log(title = "情报板模板", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcInfoBoardTemplate dcInfoBoardTemplate) @@ -62,7 +62,7 @@ public class DcInfoBoardTemplateController extends BaseController * 删除情报板模板 */ @ApiOperation("删除情报板模板") - @PreAuthorize("@ss.hasPermi('business:boardTemplate:remove')") +// @PreAuthorize("@ss.hasPermi('business:boardTemplate:remove')") @Log(title = "情报板模板", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") public AjaxResult remove(@PathVariable @ApiParam(value="id", name="id", required=true) Long id) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardVocabularyController.java b/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardVocabularyController.java index b2adb9e6..ea360148 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardVocabularyController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardVocabularyController.java @@ -43,7 +43,7 @@ public class DcInfoBoardVocabularyController extends BaseController * 查询情报板敏感字管理列表 */ @ApiOperation("查询情报板敏感字管理列表") - @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:list')") +// @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:list')") @GetMapping("/list") public TableDataInfo list(DcInfoBoardVocabulary dcInfoBoardVocabulary) { @@ -56,7 +56,7 @@ public class DcInfoBoardVocabularyController extends BaseController * 导出情报板敏感字管理列表 */ @ApiOperation("导出情报板敏感字管理列表") - @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:export')") +// @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:export')") @Log(title = "情报板敏感字管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcInfoBoardVocabulary dcInfoBoardVocabulary) @@ -70,7 +70,7 @@ public class DcInfoBoardVocabularyController extends BaseController * 获取情报板敏感字管理详细信息 */ @ApiOperation("获取情报板敏感字管理详细信息") - @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:query')") +// @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") @ApiParam(value="id", name="id", required=true) Long id) { @@ -81,7 +81,7 @@ public class DcInfoBoardVocabularyController extends BaseController * 新增情报板敏感字管理 */ @ApiOperation("新增情报板敏感字管理") - @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:add')") +// @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:add')") @Log(title = "情报板敏感字管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcInfoBoardVocabulary dcInfoBoardVocabulary) @@ -93,7 +93,7 @@ public class DcInfoBoardVocabularyController extends BaseController * 修改情报板敏感字管理 */ @ApiOperation("修改情报板敏感字管理") - @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:edit')") +// @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:edit')") @Log(title = "情报板敏感字管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcInfoBoardVocabulary dcInfoBoardVocabulary) @@ -105,7 +105,7 @@ public class DcInfoBoardVocabularyController extends BaseController * 删除情报板敏感字管理 */ @ApiOperation("删除情报板敏感字管理") - @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:remove')") +// @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:remove')") @Log(title = "情报板敏感字管理", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") public AjaxResult remove(@PathVariable @ApiParam(value="id", name="id", required=true) Long id) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java b/zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java index 35e82ade..f04ed1dd 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java @@ -43,7 +43,7 @@ public class DcPublishInfoController extends BaseController * 查询 信息发布记录列表 */ @ApiOperation("查询信息发布记录列表") - @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:list')") +// @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:list')") @GetMapping("/list") public TableDataInfo list(DcPublishInfo dcPublishInfo) { @@ -56,7 +56,7 @@ public class DcPublishInfoController extends BaseController * 导出 信息发布记录列表 */ @ApiOperation("导出信息发布记录") - @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:export')") +// @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:export')") @Log(title = " 信息发布记录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcPublishInfo dcPublishInfo) @@ -70,7 +70,7 @@ public class DcPublishInfoController extends BaseController * 获取 信息发布记录详细信息 */ @ApiOperation("获取 信息发布记录详细信息") - @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:query')") +// @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") @ApiParam(name = "id", value = "id", required = true) Long id) { @@ -81,7 +81,7 @@ public class DcPublishInfoController extends BaseController * 新增 信息发布记录 */ @ApiOperation("新增 信息发布记录") - @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:add')") +// @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:add')") @Log(title = " 信息发布记录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcPublishInfo dcPublishInfo) @@ -93,7 +93,7 @@ public class DcPublishInfoController extends BaseController * 修改 信息发布记录 */ @ApiOperation("修改 信息发布记录") - @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:edit')") +// @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:edit')") @Log(title = " 信息发布记录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcPublishInfo dcPublishInfo) @@ -105,7 +105,7 @@ public class DcPublishInfoController extends BaseController * 删除 信息发布记录 */ @ApiOperation("删除 信息发布记录") - @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:remove')") +// @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:remove')") @Log(title = " 信息发布记录", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") public AjaxResult remove(@PathVariable @ApiParam(name = "id", value = "id", required = true) Long id) From e639c7954355ecb45b66fd6c849fbf22da4b4ef1 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 11 Jan 2024 11:16:36 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/zc/business/domain/DcDevice.java | 2 -- .../com/zc/business/service/impl/DcDeviceServiceImpl.java | 5 ----- 2 files changed, 7 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java index b9a91cb7..a4531100 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java @@ -24,8 +24,6 @@ public class DcDevice { private String stakeMarkId; @ApiModelProperty("方向1-上行(菏泽方向),2-中,3-下行(济南方向)") private String direction; - @ApiModelProperty("道路标识") - private Long roadId; @ApiModelProperty("设备名称") private String deviceName; @ApiModelProperty("设备类型") diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java index 2a95e268..6182ed76 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java @@ -58,11 +58,6 @@ public class DcDeviceServiceImpl extends ServiceImpl i queryWrapper.eq(DcDevice::getStakeMarkId, dcDevice.getStakeMarkId()); } - // 道路标识 - if (Objects.nonNull(dcDevice.getRoadId())) { - queryWrapper.eq(DcDevice::getRoadId, dcDevice.getRoadId()); - } - // 设备名称 if (StringUtils.hasText(dcDevice.getDeviceName())) { queryWrapper.like(DcDevice::getDeviceName, dcDevice.getDeviceName()); From 0e9509b28b6e12febce990af223a388fc0a34acc Mon Sep 17 00:00:00 2001 From: zhao-meiyu <2970484253@qq.com> Date: Thu, 11 Jan 2024 20:10:20 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=BE=96=E5=8C=BA=E8=B7=AF=E6=AE=B5?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=BC=80=E5=8F=91,=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A8=A1=E6=9D=BF=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcRoadSectionController.java | 109 ++++++++++++ .../zc/business/domain/DcOrganization.java | 13 +- .../com/zc/business/domain/DcRoadSection.java | 159 ++++++++++++++++++ .../business/mapper/DcRoadSectionMapper.java | 64 +++++++ .../service/IDcRoadSectionService.java | 64 +++++++ .../impl/DcRoadSectionServiceImpl.java | 102 +++++++++++ .../mapper/business/DcOrganizationMapper.xml | 6 +- .../mapper/business/DcRoadSectionMapper.xml | 106 ++++++++++++ 8 files changed, 621 insertions(+), 2 deletions(-) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java create mode 100644 zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml diff --git a/zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java b/zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java new file mode 100644 index 00000000..2f7f759d --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java @@ -0,0 +1,109 @@ +package com.zc.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcRoadSection; +import com.zc.business.service.IDcRoadSectionService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 辖区路段Controller + * + * @author ruoyi + * @date 2024-01-11 + */ +@RestController +@RequestMapping("/business/roadSection") +public class DcRoadSectionController extends BaseController +{ + @Autowired + private IDcRoadSectionService dcRoadSectionService; + + /** + * 查询辖区路段列表 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:list')") + @GetMapping("/list") + public TableDataInfo list(DcRoadSection dcRoadSection) + { + startPage(); + List list = dcRoadSectionService.selectDcRoadSectionList(dcRoadSection); + return getDataTable(list); + } + + /** + * 导出辖区路段列表 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:export')") + @Log(title = "辖区路段", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcRoadSection dcRoadSection) + { + List list = dcRoadSectionService.selectDcRoadSectionList(dcRoadSection); + ExcelUtil util = new ExcelUtil<>(DcRoadSection.class); + util.exportExcel(response, list, "辖区路段数据"); + } + + /** + * 获取辖区路段详细信息 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(dcRoadSectionService.selectDcRoadSectionById(id)); + } + + /** + * 新增辖区路段 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:add')") + @Log(title = "辖区路段", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcRoadSection dcRoadSection) + { + return toAjax(dcRoadSectionService.insertDcRoadSection(dcRoadSection)); + } + + /** + * 修改辖区路段 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:edit')") + @Log(title = "辖区路段", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcRoadSection dcRoadSection) + { + return toAjax(dcRoadSectionService.updateDcRoadSection(dcRoadSection)); + } + + /** + * 删除辖区路段 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:remove')") + @Log(title = "辖区路段", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcRoadSectionService.deleteDcRoadSectionByIds(ids)); + } + //查询路线id与名称 + @PostMapping("/roadList") + public AjaxResult roadList(){ + return AjaxResult.success(dcRoadSectionService.selectRoadList()); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java b/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java index 82a66de0..fa621c9b 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java @@ -41,8 +41,19 @@ public class DcOrganization extends TreeEntity /** 描述 */ @Excel(name = "描述") private String description; + /** 方向 */ + @Excel(name = "方向") + private String direction; - public void setId(Long id) + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public void setId(Long id) { this.id = id; } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java b/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java new file mode 100644 index 00000000..50077904 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java @@ -0,0 +1,159 @@ +package com.zc.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 辖区路段对象 dc_road_section + * + * @author ruoyi + * @date 2024-01-11 + */ +public class DcRoadSection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 所属部门 */ + @Excel(name = "所属部门") + private Long deptId; + + /** 所属路线 */ + @Excel(name = "所属路线") + private Long roadId; + + /** 开始桩号 */ + @Excel(name = "开始桩号") + private String startStakeMark; + + /** 结束桩号 */ + @Excel(name = "结束桩号") + private String endStakeMark; + + /** 辖区路线名称 */ + @Excel(name = "辖区路线名称") + private String sectionName; + + /** 辖区路线编号 */ + @Excel(name = "辖区路线编号") + private String roadCode; + + /** 里程 */ + @Excel(name = "里程") + private String mileage; + /** 部门名称 */ + @Excel(name = "部门名称") + private String deptName; + /** 道路名称 */ + @Excel(name = "道路名称") + private String roadName; + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public void setRoadId(Long roadId) + { + this.roadId = roadId; + } + + public Long getRoadId() + { + return roadId; + } + public void setStartStakeMark(String startStakeMark) + { + this.startStakeMark = startStakeMark; + } + + public String getStartStakeMark() + { + return startStakeMark; + } + public void setEndStakeMark(String endStakeMark) + { + this.endStakeMark = endStakeMark; + } + + public String getEndStakeMark() + { + return endStakeMark; + } + public void setSectionName(String sectionName) + { + this.sectionName = sectionName; + } + + public String getSectionName() + { + return sectionName; + } + public void setRoadCode(String roadCode) + { + this.roadCode = roadCode; + } + + public String getRoadCode() + { + return roadCode; + } + public void setMileage(String mileage) + { + this.mileage = mileage; + } + + public String getMileage() + { + return mileage; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("deptId", getDeptId()) + .append("roadId", getRoadId()) + .append("startStakeMark", getStartStakeMark()) + .append("endStakeMark", getEndStakeMark()) + .append("sectionName", getSectionName()) + .append("roadCode", getRoadCode()) + .append("mileage", getMileage()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java new file mode 100644 index 00000000..02913bcb --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java @@ -0,0 +1,64 @@ +package com.zc.business.mapper; + +import java.util.HashMap; +import java.util.List; +import com.zc.business.domain.DcRoadSection; + +/** + * 辖区路段Mapper接口 + * + * @author ruoyi + * @date 2024-01-11 + */ +public interface DcRoadSectionMapper +{ + /** + * 查询辖区路段 + * + * @param id 辖区路段主键 + * @return 辖区路段 + */ + public DcRoadSection selectDcRoadSectionById(Long id); + + /** + * 查询辖区路段列表 + * + * @param dcRoadSection 辖区路段 + * @return 辖区路段集合 + */ + List selectDcRoadSectionList(DcRoadSection dcRoadSection); + + /** + * 新增辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int insertDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 修改辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int updateDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 删除辖区路段 + * + * @param id 辖区路段主键 + * @return 结果 + */ + int deleteDcRoadSectionById(Long id); + + /** + * 批量删除辖区路段 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteDcRoadSectionByIds(Long[] ids); + //查询路线id与名称 + List> selectRoadList(); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java b/zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java new file mode 100644 index 00000000..8a7d8b7e --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java @@ -0,0 +1,64 @@ +package com.zc.business.service; + +import java.util.HashMap; +import java.util.List; +import com.zc.business.domain.DcRoadSection; + +/** + * 辖区路段Service接口 + * + * @author ruoyi + * @date 2024-01-11 + */ +public interface IDcRoadSectionService +{ + /** + * 查询辖区路段 + * + * @param id 辖区路段主键 + * @return 辖区路段 + */ + public DcRoadSection selectDcRoadSectionById(Long id); + + /** + * 查询辖区路段列表 + * + * @param dcRoadSection 辖区路段 + * @return 辖区路段集合 + */ + List selectDcRoadSectionList(DcRoadSection dcRoadSection); + + /** + * 新增辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int insertDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 修改辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int updateDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 批量删除辖区路段 + * + * @param ids 需要删除的辖区路段主键集合 + * @return 结果 + */ + int deleteDcRoadSectionByIds(Long[] ids); + + /** + * 删除辖区路段信息 + * + * @param id 辖区路段主键 + * @return 结果 + */ + int deleteDcRoadSectionById(Long id); + //查询路线id与名称 + List> selectRoadList(); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java new file mode 100644 index 00000000..dd88fa91 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java @@ -0,0 +1,102 @@ +package com.zc.business.service.impl; + +import java.util.HashMap; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zc.business.mapper.DcRoadSectionMapper; +import com.zc.business.domain.DcRoadSection; +import com.zc.business.service.IDcRoadSectionService; + +/** + * 辖区路段Service业务层处理 + * + * @author ruoyi + * @date 2024-01-11 + */ +@Service +public class DcRoadSectionServiceImpl implements IDcRoadSectionService +{ + @Autowired + private DcRoadSectionMapper dcRoadSectionMapper; + + /** + * 查询辖区路段 + * + * @param id 辖区路段主键 + * @return 辖区路段 + */ + @Override + public DcRoadSection selectDcRoadSectionById(Long id) + { + return dcRoadSectionMapper.selectDcRoadSectionById(id); + } + + /** + * 查询辖区路段列表 + * + * @param dcRoadSection 辖区路段 + * @return 辖区路段 + */ + @Override + public List selectDcRoadSectionList(DcRoadSection dcRoadSection) + { + return dcRoadSectionMapper.selectDcRoadSectionList(dcRoadSection); + } + + /** + * 新增辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + @Override + public int insertDcRoadSection(DcRoadSection dcRoadSection) + { + dcRoadSection.setCreateTime(DateUtils.getNowDate()); + return dcRoadSectionMapper.insertDcRoadSection(dcRoadSection); + } + + /** + * 修改辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + @Override + public int updateDcRoadSection(DcRoadSection dcRoadSection) + { + dcRoadSection.setUpdateTime(DateUtils.getNowDate()); + return dcRoadSectionMapper.updateDcRoadSection(dcRoadSection); + } + + /** + * 批量删除辖区路段 + * + * @param ids 需要删除的辖区路段主键 + * @return 结果 + */ + @Override + public int deleteDcRoadSectionByIds(Long[] ids) + { + return dcRoadSectionMapper.deleteDcRoadSectionByIds(ids); + } + + /** + * 删除辖区路段信息 + * + * @param id 辖区路段主键 + * @return 结果 + */ + @Override + public int deleteDcRoadSectionById(Long id) + { + return dcRoadSectionMapper.deleteDcRoadSectionById(id); + } + //查询路线id与名称 + @Override + public List> selectRoadList() { + return dcRoadSectionMapper.selectRoadList(); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml b/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml index 083f1e00..5a627cb7 100644 --- a/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml @@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, parent_id, organization_type, organization_name, organization_address, stake_mark_id, rescue_unit, description, create_time, update_time from dc_organization + select id,direction, parent_id, organization_type, organization_name, organization_address, stake_mark_id, rescue_unit, description, create_time, update_time from dc_organization + + + and section.dept_id = #{deptId} + and section.road_id = #{roadId} + and section.start_stake_mark = #{startStakeMark} + and section.end_stake_mark = #{endStakeMark} + and section.section_name like concat('%', #{sectionName}, '%') + and section.road_code = #{roadCode} + + + + + + + + insert into dc_road_section + + id, + dept_id, + road_id, + start_stake_mark, + end_stake_mark, + section_name, + road_code, + mileage, + create_time, + update_time, + + + #{id}, + #{deptId}, + #{roadId}, + #{startStakeMark}, + #{endStakeMark}, + #{sectionName}, + #{roadCode}, + #{mileage}, + #{createTime}, + #{updateTime}, + + + + + update dc_road_section + + dept_id = #{deptId}, + road_id = #{roadId}, + start_stake_mark = #{startStakeMark}, + end_stake_mark = #{endStakeMark}, + section_name = #{sectionName}, + road_code = #{roadCode}, + mileage = #{mileage}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from dc_road_section where id = #{id} + + + + delete from dc_road_section where id in + + #{id} + + + \ No newline at end of file From 204a73c0651675b7de10d6de342d3851bddd3802 Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Fri, 12 Jan 2024 14:34:33 +0800 Subject: [PATCH 8/9] =?UTF-8?q?--=E5=A2=9E=E5=87=8Fjenkins=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=B7=BB=E5=8A=A0docke=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8Cjenkins=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8E=A8=E9=80=81=E3=80=82=E5=B0=86=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=EF=BC=8C=E6=97=A5=E5=BF=97=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=BA=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E3=80=82=E6=9B=B4=E6=94=B9=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E5=92=8Credis=E4=B8=BA=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 14 +++++ Jenkinsfile | 53 +++++++++++++++++++ .../src/main/resources/application-druid.yml | 4 +- .../src/main/resources/application.yml | 6 +-- 4 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..056e0e2e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# FROM java:8 +FROM anapsix/alpine-java:8_server-jre_unlimited +# 将当前目录下的jar包复制到docker容器的/目录下 +COPY *.jar /app.jar +# 运行过程中创建一个xx.jar文件 +RUN touch /app.jar + +ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +ENV PARAMS="--spring.profiles.active=druid" + +# 声明服务运行在8080端口 +EXPOSE 8088 +# 指定docker容器启动时运行jar包 +ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -jar /app.jar $PARAMS" ] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..cd2b9ad5 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,53 @@ +pipeline{ + agent any + environment { + IMAGE_NAME = "ruoyi-admin" + WS = "${WORKSPACE}" + } + + //定义流水线的加工流程 + stages { + //流水线的所有阶段 + stage('1.环境检查'){ + steps { + sh 'pwd && ls -alh' + sh 'printenv' + sh 'docker version' + sh 'java -version' + sh 'git --version' + } + } + + stage('2.编译'){ + agent { + docker { + image 'maven:3-alpine' + args '-v maven-repository:/root/.m2' + } + } + steps { + sh 'pwd && ls -alh' + sh 'mvn -v' + sh 'cd ${WS} && mvn clean package -s "/var/jenkins_home/appconfig/maven/settings.xml" -Dmaven.test.skip=true' + } + } + + stage('3.打包'){ + steps { + sh 'pwd && ls -alh' + sh 'echo ${WS}' + // sh 'mv ${WS}/${IMAGE_NAME}/target/*.jar ${WS}/${IMAGE_NAME}.jar && pwd && ls -alh && docker build -t ${IMAGE_NAME} .' + sh 'docker build -t ${IMAGE_NAME} -f Dockerfile ${WS}/${IMAGE_NAME}/target/' + } + } + + stage('4.部署'){ + // 删除容器和虚悬镜像 + steps { + sh 'pwd && ls -alh' + sh 'docker rm -f ${IMAGE_NAME} || true && docker rmi $(docker images -q -f dangling=true) || true' + sh 'docker run -d -p 8888:8080 --name ${IMAGE_NAME} -v /mydata/logs/${IMAGE_NAME}:/logs/${IMAGE_NAME} ${IMAGE_NAME}' + } + } + } +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index ea56f034..86e6f7da 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,10 +8,10 @@ spring: master: # 公司数据库地址 # url: jdbc:mysql://10.168.3.169:3306/athena?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 - url: jdbc:mysql://127.0.0.1:3306/jihe-hs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true + url: jdbc:mysql://39.106.31.193:3306/jihe-dc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true username: root # password: Platform123!@# - password: root + password: 123456 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 192c04f7..3f1b7d15 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -9,7 +9,7 @@ ruoyi: # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: C:/home/ruoyi/uploadPath + profile: /home/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 behavioral 行为验证码(拖动式与点触式) @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8080 + port: 8088 servlet: # 应用的访问路径 context-path: / @@ -69,7 +69,7 @@ spring: # 数据库索引 database: 0 # 密码 - password: + password: 123456 # 连接超时时间 timeout: 10s lettuce: From 2c37e6804515b80ec76ccad5a1b0f8342b981e45 Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Fri, 12 Jan 2024 17:51:08 +0800 Subject: [PATCH 9/9] =?UTF-8?q?--=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=20redis=E9=85=8D=E7=BD=AE=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-druid.yml | 4 ++-- ruoyi-admin/src/main/resources/application.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 86e6f7da..9849822d 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,10 +8,10 @@ spring: master: # 公司数据库地址 # url: jdbc:mysql://10.168.3.169:3306/athena?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 - url: jdbc:mysql://39.106.31.193:3306/jihe-dc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true + url: jdbc:mysql://10.168.56.204:3306/jihe-dc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true username: root # password: Platform123!@# - password: 123456 + password: Platform123!@# # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 3f1b7d15..ff3fd928 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8088 + port: 8080 servlet: # 应用的访问路径 context-path: / @@ -69,7 +69,7 @@ spring: # 数据库索引 database: 0 # 密码 - password: 123456 + password: Redis123!@# # 连接超时时间 timeout: 10s lettuce: