From 6b96359af7a9c826cd21220577c6307097ec35cc Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Thu, 5 May 2022 17:36:00 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KeyPlaceTaskPatrolController.java | 9 +++-- .../route/keyplacetask/KeyPlaceTask.java | 38 +++++++++++++++++++ .../KeyPlaceTaskPatrol.java | 38 +++++++++++++++++++ .../IKeyPlaceTaskPatrolRemoteService.java | 7 ++-- src/main/resources/application-test.yml | 2 +- .../assets/layuiadmin/modules/common.js | 20 +++++++++- .../templates/keyplacetask/list-offline.html | 29 ++++++-------- .../templates/keyplacetask/list.html | 29 +++++--------- 8 files changed, 125 insertions(+), 47 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetask/KeyPlaceTask.java create mode 100644 src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetaskpatrol/KeyPlaceTaskPatrol.java diff --git a/src/main/java/cn/com/tenlion/systemtask/controller/api/keyplacetaskpatrol/KeyPlaceTaskPatrolController.java b/src/main/java/cn/com/tenlion/systemtask/controller/api/keyplacetaskpatrol/KeyPlaceTaskPatrolController.java index ff50689..32ce1fa 100644 --- a/src/main/java/cn/com/tenlion/systemtask/controller/api/keyplacetaskpatrol/KeyPlaceTaskPatrolController.java +++ b/src/main/java/cn/com/tenlion/systemtask/controller/api/keyplacetaskpatrol/KeyPlaceTaskPatrolController.java @@ -3,6 +3,7 @@ package cn.com.tenlion.systemtask.controller.api.keyplacetaskpatrol; import cn.com.tenlion.systemtask.config.properties.UrlProperties; import cn.com.tenlion.systemtask.pojo.dtos.keyplacepatrol.KeyPlacePatrolDTO; import cn.com.tenlion.systemtask.pojo.vos.businesspagebus.KeyAreaCheckRenovationPatrolVO; +import cn.com.tenlion.systemtask.pojo.vos.businesspagebus.KeyPlacePatrolVO; import cn.com.tenlion.systemtask.remote.keyplacetaskpatrol.IKeyPlaceTaskPatrolRemoteService; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; @@ -43,10 +44,10 @@ public class KeyPlaceTaskPatrolController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("save") @CheckRequestBodyAnnotation - public SuccessResult save(@RequestBody KeyAreaCheckRenovationPatrolVO keyAreaCheckRenovationPatrolVO) { + public SuccessResult save(@RequestBody KeyPlacePatrolVO keyPlacePatrolVO) { String sendUrl = urlProperties.getBaseUrl(); String accessToken = OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(); - keyPlaceTaskPatrolRemoteService.save(sendUrl, keyAreaCheckRenovationPatrolVO, accessToken); + keyPlaceTaskPatrolRemoteService.save(sendUrl, keyPlacePatrolVO, accessToken); return new SuccessResult(); } @@ -72,10 +73,10 @@ public class KeyPlaceTaskPatrolController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("update/{keyPlaceTaskPatrolId}") @CheckRequestBodyAnnotation - public SuccessResult update(@PathVariable("keyPlaceTaskPatrolId") String keyPlaceTaskPatrolId, @RequestBody KeyAreaCheckRenovationPatrolVO keyAreaCheckRenovationPatrolVO) { + public SuccessResult update(@PathVariable("keyPlaceTaskPatrolId") String keyPlaceTaskPatrolId, @RequestBody KeyPlacePatrolVO keyPlacePatrolVO) { String sendUrl = urlProperties.getBaseUrl(); String accessToken = OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(); - keyPlaceTaskPatrolRemoteService.update(sendUrl, keyAreaCheckRenovationPatrolVO, keyPlaceTaskPatrolId, accessToken); + keyPlaceTaskPatrolRemoteService.update(sendUrl, keyPlacePatrolVO, keyPlaceTaskPatrolId, accessToken); return new SuccessResult(); } diff --git a/src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetask/KeyPlaceTask.java b/src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetask/KeyPlaceTask.java new file mode 100644 index 0000000..dc39c15 --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetask/KeyPlaceTask.java @@ -0,0 +1,38 @@ +package cn.com.tenlion.systemtask.controller.route.keyplacetask; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +/** + * @ClassName: KeyAreaTask + * @Description: 重点地区排查整治 + * @Author: CodeFactory + * @Date: 2021-10-12 16:37:43 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "重点地区巡查") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/keyplacetask") +public class KeyPlaceTask extends DefaultBaseController { + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("keyplacetask/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("keyplacetask/list"); + } + + @GetMapping("list-offline") + public ModelAndView listOffline() { + return new ModelAndView("keyplacetask/list-offline"); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetaskpatrol/KeyPlaceTaskPatrol.java b/src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetaskpatrol/KeyPlaceTaskPatrol.java new file mode 100644 index 0000000..1b9994f --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemtask/controller/route/keyplacetaskpatrol/KeyPlaceTaskPatrol.java @@ -0,0 +1,38 @@ +package cn.com.tenlion.systemtask.controller.route.keyplacetaskpatrol; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +/** + * @ClassName: KeyAreaTask + * @Description: 重点地区排查整治 + * @Author: CodeFactory + * @Date: 2021-10-12 16:37:43 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "重点地区巡查") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/keyplacetaskpatrol") +public class KeyPlaceTaskPatrol extends DefaultBaseController { + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("keyplacetaskpatrol/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("keyplacetaskpatrol/list"); + } + + @GetMapping("save") + public ModelAndView save() { + return new ModelAndView("keyplacetaskpatrol/save"); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemtask/remote/keyplacetaskpatrol/IKeyPlaceTaskPatrolRemoteService.java b/src/main/java/cn/com/tenlion/systemtask/remote/keyplacetaskpatrol/IKeyPlaceTaskPatrolRemoteService.java index 224eb7b..14d3bff 100644 --- a/src/main/java/cn/com/tenlion/systemtask/remote/keyplacetaskpatrol/IKeyPlaceTaskPatrolRemoteService.java +++ b/src/main/java/cn/com/tenlion/systemtask/remote/keyplacetaskpatrol/IKeyPlaceTaskPatrolRemoteService.java @@ -1,8 +1,7 @@ package cn.com.tenlion.systemtask.remote.keyplacetaskpatrol; -import cn.com.tenlion.systemtask.pojo.dtos.keyareataskpatrol.KeyAreaTaskPatrolDTO; import cn.com.tenlion.systemtask.pojo.dtos.keyplacepatrol.KeyPlacePatrolDTO; -import cn.com.tenlion.systemtask.pojo.vos.businesspagebus.KeyAreaCheckRenovationPatrolVO; +import cn.com.tenlion.systemtask.pojo.vos.businesspagebus.KeyPlacePatrolVO; import ink.wgink.annotation.rpc.rest.RemoteService; import ink.wgink.annotation.rpc.rest.method.RemoteDeleteMethod; import ink.wgink.annotation.rpc.rest.method.RemoteGetMethod; @@ -26,13 +25,13 @@ import java.util.Map; public interface IKeyPlaceTaskPatrolRemoteService { @RemotePostMethod("resource/keyplacepatrol/save") - SuccessResult save(@RemoteServerParams String remotePath, @RemoteJsonBodyParams KeyAreaCheckRenovationPatrolVO keyAreaCheckRenovationPatrolVO, @RemoteQueryParams("access_token") String access_token); + SuccessResult save(@RemoteServerParams String remotePath, @RemoteJsonBodyParams KeyPlacePatrolVO keyPlacePatrolVO, @RemoteQueryParams("access_token") String access_token); @RemoteDeleteMethod("resource/keyplacepatrol/remove/{ids}") SuccessResult remove(@RemoteServerParams String remotePath, @RemotePathParams("ids") String ids, @RemoteQueryParams("access_token") String access_token); @RemotePutMethod("resource/keyplacepatrol/update/{keyPlaceTaskPatrolId}") - SuccessResult update(@RemoteServerParams String remotePath, @RemoteJsonBodyParams KeyAreaCheckRenovationPatrolVO keyAreaCheckRenovationPatrolVO, @RemotePathParams("keyPlaceTaskPatrolId") String keyPlaceTaskPatrolId, @RemoteQueryParams("access_token") String access_token); + SuccessResult update(@RemoteServerParams String remotePath, @RemoteJsonBodyParams KeyPlacePatrolVO keyPlacePatrolVO, @RemotePathParams("keyPlaceTaskPatrolId") String keyPlaceTaskPatrolId, @RemoteQueryParams("access_token") String access_token); /** * 重点地区详情 diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 6012914..43a0c3c 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -171,7 +171,7 @@ security: check-token-access: ${security.oauth2.oauth-server}/oauth2_client/token_key server-other: - base-url: http://192.168.0.111:8081/systembase/ + base-url: http://192.168.0.111:8082/systembase/ house-url: http://192.168.0.111:8083/systemhouse/ population-url: http://192.168.0.111:8090/population/ case-url: http://192.168.0.120:8081/case/ diff --git a/src/main/resources/static/assets/layuiadmin/modules/common.js b/src/main/resources/static/assets/layuiadmin/modules/common.js index e9aebb0..2aace98 100644 --- a/src/main/resources/static/assets/layuiadmin/modules/common.js +++ b/src/main/resources/static/assets/layuiadmin/modules/common.js @@ -240,6 +240,23 @@ layui.define(function (exports) { return exportColumns; } + function getImgBase64(url, callback) { + var Img = new Image(), + dataURL = ''; + Img.src = url + '?v=' + Math.random(); + Img.setAttribute('crossOrigin', 'Anonymous'); + Img.onload = function() { + var canvas = document.createElement('canvas'), + width = Img.width, + height = Img.height; + canvas.width = width; + canvas.height = height; + canvas.getContext('2d').drawImage(Img, 0, 0, width, height); + dataURL = canvas.toDataURL('image/jpeg'); + return callback ? callback(dataURL) : null; + }; + } + //对外暴露的接口 exports('common', { refreshTree: refreshTree, @@ -248,6 +265,7 @@ layui.define(function (exports) { formatDate: formatDate, getBrowserType: getBrowserType, getIEBrowserVersion: getIEBrowserVersion, - listTableExportColumns: listTableExportColumns + listTableExportColumns: listTableExportColumns, + getImgBase64: getImgBase64 }); }); \ No newline at end of file diff --git a/src/main/resources/templates/keyplacetask/list-offline.html b/src/main/resources/templates/keyplacetask/list-offline.html index a347ada..0932612 100644 --- a/src/main/resources/templates/keyplacetask/list-offline.html +++ b/src/main/resources/templates/keyplacetask/list-offline.html @@ -59,7 +59,7 @@ var laydate = layui.laydate; var common = layui.common; var resizeTimeout = null; - var tableUrl = 'api/keyplacetask/listpage'; + var tableUrl = 'api/keyplacetask/listPage'; // 初始化表格 function initTable() { @@ -205,7 +205,7 @@ // 巡查记录 function patrolHis(data) { top.dialog.open({ - url: top.restAjax.path('route/keyareataskpatrol/list?keyPlaceId={keyPlaceId}', [data.keyPlaceId]), + url: top.restAjax.path('route/keyplacetaskpatrol/list?keyPlaceId={keyPlaceId}', [data.keyPlaceId]), title: "巡查记录列表", width: '80%', height: '80%', @@ -217,28 +217,21 @@ // 下派任务 function sendTask(data) { - /*where: { - name: data.securityArea, - man: data.leadDeptMan, - phone: data.leadDeptPhone, - time: data.rectificationTime, - grid: data.grid, - },*/ top.dialog.open({ - url: top.restAjax.path('route/distribute/save-offline?matterId={keyAreaCheckRenovationId}' + - '&name={securityArea}' + - '&phone={leadDeptPhone}' + + url: top.restAjax.path('route/distribute/save-offline?matterId={keyPlaceId}' + + '&name={placeName}' + + '&phone={linkPhone}' + '&time={rectificationTime}' + '&grid={grid}' + '&business={business}' + '&man={leadDeptMan}', - [data.keyAreaCheckRenovationId, - data.securityArea, - data.leadDeptPhone, - data.rectificationTime, + [data.keyPlaceId, + data.placeName, + data.linkPhone, + '', data.grid, - '6be1c56a-39f8-4254-88fd-b6d9d75b5361,list-keyplace', - data.leadDeptMan]), + '048b5445-3466-4aef-9848-30cae17b828d,list-keyplace', + data.linkMan]), title: "重点场所巡查任务下派", width: '98%', height: '98%', diff --git a/src/main/resources/templates/keyplacetask/list.html b/src/main/resources/templates/keyplacetask/list.html index 99de4af..55482ef 100644 --- a/src/main/resources/templates/keyplacetask/list.html +++ b/src/main/resources/templates/keyplacetask/list.html @@ -59,7 +59,7 @@ var laydate = layui.laydate; var common = layui.common; var resizeTimeout = null; - var tableUrl = 'api/keyplacetask/listpage'; + var tableUrl = 'api/keyplacetask/listPage'; // 初始化表格 function initTable() { @@ -182,7 +182,6 @@ {field: '', fixed: 'right', width: 230, title: '巡查记录', align:'center', templet: function(row) { var rowData = '
\n' + - ' 查看摄像头\n' + ' 下派任务\n' + ' 巡查记录\n' + '
'; @@ -218,28 +217,21 @@ // 下派任务 function sendTask(data) { - /*where: { - name: data.securityArea, - man: data.leadDeptMan, - phone: data.leadDeptPhone, - time: data.rectificationTime, - grid: data.grid, - },*/ top.dialog.open({ - url: top.restAjax.path('route/distribute/save-offline?matterId={keyAreaCheckRenovationId}' + - '&name={securityArea}' + - '&phone={leadDeptPhone}' + + url: top.restAjax.path('route/distribute/save-offline?matterId={keyPlaceId}' + + '&name={placeName}' + + '&phone={linkPhone}' + '&time={rectificationTime}' + '&grid={grid}' + '&business={business}' + '&man={leadDeptMan}', - [data.keyAreaCheckRenovationId, - data.securityArea, - data.leadDeptPhone, - data.rectificationTime, + [data.keyPlaceId, + data.placeName, + data.linkPhone, + '', data.grid, - '6be1c56a-39f8-4254-88fd-b6d9d75b5361,list-keyarea', - data.leadDeptMan]), + '048b5445-3466-4aef-9848-30cae17b828d,list-keyplace', + data.linkMan]), title: "重点场所巡查任务下派", width: '98%', height: '98%', @@ -258,7 +250,6 @@ patrolHis(data); }else if('addCamera' == obj.event) { top.dialog.msg('功能正在开发中'); - // addCamera(data); }else if('sendTask' == obj.event) { sendTask(data); }