From 7f3fb976c15db73f09fb9be6681b61d2faf1521f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E4=B8=9C=E4=BA=91=E5=88=99?= Date: Fri, 14 Jun 2024 11:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=81=94=E5=8D=A1=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8B=BE=E9=80=89=E6=93=8D=E4=BD=9C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E4=B8=AA=E5=88=92=E5=8D=A1=E5=8A=9F=E8=83=BD?= =?UTF-8?q?-2024-06-14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunze/card/YzCardController.java | 47 +- .../src/main/resources/application-druid.yml | 6 +- .../src/main/resources/application.yml | 6 +- .../common/mapper/yunze/YzCardMapper.java | 2 + .../mapper/quartz/yunze/YzCardMapper.xml | 14 + .../com/yunze/system/card/DistributeCard.java | 26 +- .../openApi/PublicOpenAapiController.java | 6 +- .../src/main/resources/json/MqinitArr.json | 4 + .../service/impl/yunze/YzCardServiceImpl.java | 22 + yunze-ui/src/api/yunze/flowcard/card/card.js | 7 + .../src/views/yunze/flowcard/card/index.vue | 2682 +++++++++++------ 11 files changed, 1837 insertions(+), 985 deletions(-) diff --git a/yunze-admin/src/main/java/com/yunze/web/controller/yunze/card/YzCardController.java b/yunze-admin/src/main/java/com/yunze/web/controller/yunze/card/YzCardController.java index b121d62..f70cc8c 100644 --- a/yunze-admin/src/main/java/com/yunze/web/controller/yunze/card/YzCardController.java +++ b/yunze-admin/src/main/java/com/yunze/web/controller/yunze/card/YzCardController.java @@ -1359,7 +1359,52 @@ public class YzCardController extends MyBaseController { } return Myerr("物联卡 公开查询简要信息 操作失败!"); } - + @Log(title = "划卡操作", businessType = BusinessType.UPDATE) + @PreAuthorize("@ss.hasPermi('yunze:card:divide')") + @PostMapping(value = "/divideOne", produces = {"application/json;charset=utf-8"}) + public String divideOne(@RequestBody String Pstr) { + HashMap Parammap = new HashMap(); + if (Pstr != null) { + Pstr = Pstr.replace("%2F", "/");//转义 / + } + try { + Pstr = AesEncryptUtil.desEncrypt(Pstr); + Parammap.putAll(JSON.parseObject((String) Pstr)); + Object set_dept_id = Parammap.get("set_dept_id"); + Object set_user_id = Parammap.get("set_user_id"); + Object set_dept_name = Parammap.get("set_dept_name"); + Object set_user_name = Parammap.get("set_user_name"); + if (set_dept_id != null && set_dept_id.toString() != "" && set_user_id != null && set_user_id.toString() != "" + && set_dept_name != null && set_dept_name.toString() != "" && set_user_name != null && set_user_name.toString() != "") { + LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest()); + SysUser currentUser = loginUser.getUser(); + String agent_id = currentUser.getDeptId().toString(); + // if(!set_dept_id.equals(agent_id)){ + //权限 管理 操作必须传入当前操作人 id + List agent_idArr = new ArrayList<>(); + if (currentUser.getDeptId() != 100) { + if (Parammap.get("agent_id") != null) { + List P_agent_id = (List) Parammap.get("agent_id"); + agent_idArr.addAll(P_agent_id); + } else { + agent_idArr.add(Integer.parseInt(currentUser.getDeptId().toString())); + Parammap.put("agent_id", agent_idArr); + } + } + Parammap.put("TaskAgent_id", agent_id); + return MyRetunSuccess(yzCardServiceImpl.dividCardOne(Parammap), null); + /*}else{ + return Myerr("不能操作!"); + }*/ + } else { + return Myerr("参数不全请核对后重试!"); + } + } catch (Exception e) { + String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); + logger.error("
yunze:card:divide " + "
ip = " + ip + "
", e.getCause().toString()); + } + return Myerr("划分卡信息 操作失败!"); + } @Log(title = "添加卡至自动轮询", businessType = BusinessType.UPDATE) @PreAuthorize("@ss.hasPermi('yunze:card:showhistoryUsed')") @PostMapping(value = "/addAutoPolling", produces = {"application/json;charset=utf-8"}) diff --git a/yunze-admin/src/main/resources/application-druid.yml b/yunze-admin/src/main/resources/application-druid.yml index d24c164..2e0a568 100644 --- a/yunze-admin/src/main/resources/application-druid.yml +++ b/yunze-admin/src/main/resources/application-druid.yml @@ -6,9 +6,11 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://127.0.0.1/iotdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://127.00.1:3306/demo_iotdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: iotdb +# username: demo_user password: www.5iot.cn +# password: Fr#3@4!PpL&58Vc6 #从库数据源 @@ -56,4 +58,4 @@ spring: merge-sql: true wall: config: - multi-statement-allow: true \ No newline at end of file + multi-statement-allow: true diff --git a/yunze-admin/src/main/resources/application.yml b/yunze-admin/src/main/resources/application.yml index a0976d3..7d734d7 100644 --- a/yunze-admin/src/main/resources/application.yml +++ b/yunze-admin/src/main/resources/application.yml @@ -59,13 +59,14 @@ spring: # redis 配置 redis: # 地址 + # host: 117.78.11.108 host: 127.0.0.1 # 端口,默认为6379 port: 6379 # 数据库索引 database: 0 # 密码 - password: Rdis20220107 + password: Redis@2022yz # 连接超时时间 timeout: 30s lettuce: @@ -81,14 +82,17 @@ spring: rabbitmq: ####连接地址 host: 127.0.0.1 + # host: 117.78.11.108 ####端口号 port: 5672 ####账号 username: IoTLinkRabbitMq + # username: userzf ## 心跳 请求的心跳超时,以秒为单位; 零表示没有 requested-heartbeat: 40 ####密码 password: 20220107@yzIot + # password: yz@zf20200808 ### 地址 virtual-host: /VirtualHosts listener: diff --git a/yunze-common/src/main/java/com/yunze/common/mapper/yunze/YzCardMapper.java b/yunze-common/src/main/java/com/yunze/common/mapper/yunze/YzCardMapper.java index 1a1692b..1ad8841 100644 --- a/yunze-common/src/main/java/com/yunze/common/mapper/yunze/YzCardMapper.java +++ b/yunze-common/src/main/java/com/yunze/common/mapper/yunze/YzCardMapper.java @@ -584,6 +584,8 @@ public interface YzCardMapper public List> findSynIsExist(Map map); void addAutoPolling(Map map); String selCardIsInAuto(Map map); + + void dividCardOne(Map map); } diff --git a/yunze-common/src/main/resources/mapper/quartz/yunze/YzCardMapper.xml b/yunze-common/src/main/resources/mapper/quartz/yunze/YzCardMapper.xml index 6175bfa..ff1f4ef 100644 --- a/yunze-common/src/main/resources/mapper/quartz/yunze/YzCardMapper.xml +++ b/yunze-common/src/main/resources/mapper/quartz/yunze/YzCardMapper.xml @@ -2296,6 +2296,20 @@ GROUP BY dept_id LIMIT 0,#{PageSize} + diff --git a/yunze-consumption-admin/src/main/java/com/yunze/system/card/DistributeCard.java b/yunze-consumption-admin/src/main/java/com/yunze/system/card/DistributeCard.java index f166a18..f12bc6e 100644 --- a/yunze-consumption-admin/src/main/java/com/yunze/system/card/DistributeCard.java +++ b/yunze-consumption-admin/src/main/java/com/yunze/system/card/DistributeCard.java @@ -1,8 +1,7 @@ package com.yunze.system.card; import com.alibaba.fastjson.JSON; -import com.rabbitmq.client.*; -import com.yunze.common.config.RabbitMQConfig; +import com.rabbitmq.client.Channel; import com.yunze.common.core.redis.RedisCache; import com.yunze.common.mapper.yunze.YzCardMapper; import com.yunze.common.mapper.yunze.YzExecutionTaskMapper; @@ -67,6 +66,24 @@ public class DistributeCard { } } + @RabbitHandler + @RabbitListener(queues = "admin_DistributeCardOne_queue") + public void DbCardOne(String msg, Channel channel) throws IOException { + try { + if (StringUtils.isEmpty(msg)) { + return; + } + Map map = JSON.parseObject(msg); + String set_dept_name = map.get("set_dept_name").toString();//上传新文件名 + String prefix = "admin_DistributeCardOne_queue"; + + yzCardMapper.dividCardOne(map); + + } catch (Exception e) { + log.error(">>错误 - 卡划分 消费者:{}<<", e.getMessage().toString()); + } + } + /** * 划卡执行 * @param map @@ -94,8 +111,9 @@ public class DistributeCard { task_map.put("type", "2"); yzExecutionTaskMapper.add(task_map);//添加执行 任务表 - List> list = yzCardMapper.BackupAssociate(); - OutCSV(list,DistributeBackupName,create_by); + //备份 :太卡先注释 + //List> list = yzCardMapper.BackupAssociate(); + //OutCSV(list,DistributeBackupName,create_by); //2.开始划卡 Map Pmap = new HashMap<>(); diff --git a/yunze-iotapi/src/main/java/com/yunze/iotapi/controller/openApi/PublicOpenAapiController.java b/yunze-iotapi/src/main/java/com/yunze/iotapi/controller/openApi/PublicOpenAapiController.java index 947fd66..3e9ce06 100644 --- a/yunze-iotapi/src/main/java/com/yunze/iotapi/controller/openApi/PublicOpenAapiController.java +++ b/yunze-iotapi/src/main/java/com/yunze/iotapi/controller/openApi/PublicOpenAapiController.java @@ -9,9 +9,9 @@ import com.yunze.apiCommon.utils.HttpUtil; import com.yunze.apiCommon.utils.UrlUtil; import com.yunze.common.mapper.mysql.YzUserMapper; import com.yunze.iotapi.service.impl.OpenApiServiceImpl; -import com.yunze.iotapi.utils.*; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; +import com.yunze.iotapi.utils.AgentCheckShiro; +import com.yunze.iotapi.utils.LogAnnotation; +import com.yunze.iotapi.utils.ResponseJson; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; diff --git a/yunze-quartz/src/main/resources/json/MqinitArr.json b/yunze-quartz/src/main/resources/json/MqinitArr.json index 31d6d42..b6f88b7 100644 --- a/yunze-quartz/src/main/resources/json/MqinitArr.json +++ b/yunze-quartz/src/main/resources/json/MqinitArr.json @@ -1,4 +1,8 @@ [{ + "card_queueName": "admin_DistributeCardOne_queue", + "card_exchangeName": "admin_exchange", + "card_routingKey": "admin.DistributeCardOne.queue" +},{ "card_queueName": "admin_CardImportSelImei_queue", "card_exchangeName": "admin_exchange", "card_routingKey": "admin.CardImportSelImei.queue" diff --git a/yunze-system/src/main/java/com/yunze/system/service/impl/yunze/YzCardServiceImpl.java b/yunze-system/src/main/java/com/yunze/system/service/impl/yunze/YzCardServiceImpl.java index 9f9fc48..c99683f 100644 --- a/yunze-system/src/main/java/com/yunze/system/service/impl/yunze/YzCardServiceImpl.java +++ b/yunze-system/src/main/java/com/yunze/system/service/impl/yunze/YzCardServiceImpl.java @@ -26,6 +26,7 @@ import com.yunze.system.service.yunze.IYzCardService; import com.yunze.system.service.yunze.IYzUserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.amqp.AmqpException; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -1478,6 +1479,27 @@ public class YzCardServiceImpl implements IYzCardService { } + public String dividCardOne(HashMap map) { + String bcvalue = map.get("Bcvalue").toString(); + String[] split = bcvalue.split(","); + List valueList = Arrays.asList(split); + map.put("valueList",valueList); + String Message = ""; + String polling_queueName = "admin_DistributeCardOne_queue"; + String polling_routingKey = "admin.DistributeCardOne.queue"; + String polling_exchangeName = "admin_exchange";//路由 + try { + rabbitTemplate.convertAndSend(polling_exchangeName, polling_routingKey, JSON.toJSONString(map), message -> { + // 设置消息过期时间 30 分钟 过期 + message.getMessageProperties().setExpiration("" + (30 * 1000 * 60)); + return message; + }); + } catch (AmqpException e) { + System.out.println("划卡 失败 " + e.getMessage().toString()); + return ("物联卡管理 划卡 操作失败!"); + } + return Message; + } } diff --git a/yunze-ui/src/api/yunze/flowcard/card/card.js b/yunze-ui/src/api/yunze/flowcard/card/card.js index 963c8b0..238d477 100644 --- a/yunze-ui/src/api/yunze/flowcard/card/card.js +++ b/yunze-ui/src/api/yunze/flowcard/card/card.js @@ -8,6 +8,13 @@ export function listCard(query) { data: query }) } +export function DivideCardOne(map) { + return request({ + url: '/yunze/card/divideOne', + method: 'post', + data: map + }) +} // 查询卡板详细 export function getCard(map) { diff --git a/yunze-ui/src/views/yunze/flowcard/card/index.vue b/yunze-ui/src/views/yunze/flowcard/card/index.vue index 5915c37..8f07ace 100644 --- a/yunze-ui/src/views/yunze/flowcard/card/index.vue +++ b/yunze-ui/src/views/yunze/flowcard/card/index.vue @@ -15,8 +15,10 @@
展开/折叠 - 全选/全不选 - 父子联动 + 全选/全不选 + + 父子联动 + - + - + - + - + +
+ + + + + + - - - - - - - - - - - + + + + {{ buttonText }} + +
@@ -445,7 +452,7 @@ >导出 - + @@ -468,6 +475,20 @@ >批量操作 + + + 划卡 + + + - + 操作 + 划卡 + 停机 - 复机 - 断网 + 复机 + + + 断网 开网 @@ -605,10 +630,24 @@ 变更分组及备注 + + + + 加入待续费 + + 查看待续费 + - + +
@@ -657,7 +696,7 @@ + :show-overflow-tooltip="true" width="140"> @@ -807,8 +868,66 @@ /> + + + + + + + + + + + + + 确 定 + + + + + + + + + + + + + 修改 + 取消 + + + + + + + + + + + + 修改 + 取消 + + + + + - - - - + @@ -1006,31 +1131,24 @@ - - - - - -
+ + + + + -
-
- - -
+
- - + + + +
+ + +
+ +