From b57e21cb9e472580df606b2d0c669458d5107325 Mon Sep 17 00:00:00 2001 From: zhangzq Date: Mon, 26 Aug 2024 09:46:23 +0800 Subject: [PATCH] =?UTF-8?q?add:fab=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MobileAuthorizationController.java | 28 +++++++++++++++++-- .../service/secutiry/dto/AuthUserDto.java | 4 +-- .../wms/ext/fab/controller/FabController.java | 7 +++-- .../dao/mapper/SchBasePointMapper.java | 2 +- .../service/dao/mapper/SchBasePointMapper.xml | 3 ++ .../service/impl/SchBasePointServiceImpl.java | 12 ++++++-- .../main/resources/config/application-dev.yml | 20 ++++++------- .../src/views/wms/sch/task/index.vue | 13 +++++---- 8 files changed, 65 insertions(+), 24 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/secutiry/MobileAuthorizationController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/secutiry/MobileAuthorizationController.java index e06210e..3f27960 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/secutiry/MobileAuthorizationController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/secutiry/MobileAuthorizationController.java @@ -11,8 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.nl.common.base.TableDataInfo; import org.nl.common.domain.query.PageQuery; import org.nl.common.exception.BadRequestException; +import org.nl.common.logging.annotation.Log; +import org.nl.common.utils.RedisUtils; import org.nl.common.utils.RsaUtils; import org.nl.common.utils.dto.CurrentUser; import org.nl.config.RsaProperties; @@ -24,6 +28,7 @@ import org.nl.system.service.user.dao.SysUser; import org.nl.system.service.user.dto.SysUserDetail; import org.nl.system.service.user.dto.UserQuery; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -48,7 +53,9 @@ public class MobileAuthorizationController { private ISysUserService userService; @Autowired private ISysRoleService roleService; - @ApiOperation("登录授权") + + @Autowired + private RedisUtils redisUtils; @PostMapping(value = "/login") @SaIgnore public ResponseEntity login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception { @@ -67,7 +74,14 @@ public class MobileAuthorizationController { if (!userInfo.getIs_used()) { throw new BadRequestException("账号未激活"); } - + if (StringUtils.isNotEmpty(authUser.getRegin_code())){ + Object regin_code = redisUtils.get("JT_"+authUser.getUsername()); + if (regin_code!=null){ + throw new BadRequestException("当前设备工序已经登陆,无法继续选择"); + }else { + redisUtils.set("JT_"+authUser.getUsername(),authUser.getRegin_code()); + } + } // 登录输入,登出删除 CurrentUser user = new CurrentUser(); user.setId(userInfo.getUser_id()); @@ -105,4 +119,14 @@ public class MobileAuthorizationController { return ResponseEntity.ok(authInfo); } + + @PostMapping(value = "/loginOut") + @SaIgnore + @Log("PC登出") + public ResponseEntity loginOut(@Validated @RequestBody AuthUserDto authUser){ + // 密码解密 - 前端的加密规则: encrypt(根据实际更改) + redisUtils.del("JT_"+authUser.getUsername()); + return new ResponseEntity(TableDataInfo.build(),HttpStatus.OK); + } + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/secutiry/dto/AuthUserDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/secutiry/dto/AuthUserDto.java index 9d810f0..b6d3027 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/secutiry/dto/AuthUserDto.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/secutiry/dto/AuthUserDto.java @@ -28,13 +28,13 @@ import javax.validation.constraints.NotBlank; @Setter public class AuthUserDto { - @NotBlank private String username; - @NotBlank private String password; private String code; private String uuid = ""; + + private String regin_code ; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java index e9d4b8c..c6d263d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java @@ -3,6 +3,7 @@ package org.nl.wms.ext.fab.controller; import cn.dev33.satoken.annotation.SaIgnore; import cn.hutool.core.lang.Assert; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; @@ -62,12 +63,14 @@ public class FabController { */ @Log("根据工序获取设备点位信息") @GetMapping("/regionPoints") + //{"OUT1":"333","OUT2":"222","N1":"123","N2":"ltd"} + // [{"num":"1","type":"IN","device_code":"222","vehicle_type","1"}] public ResponseEntity regionPoints(String regionCode){ Assert.notBlank(regionCode,"请求参数不能为空"); SchBaseRegion baseRegion = iSchBaseRegionService.getOne(new QueryWrapper().eq("region_code", regionCode)); String regionPoints = baseRegion.getRegion_points(); - JSONObject pointConfig = JSON.parseObject(regionPoints); - return new ResponseEntity(pointConfig, HttpStatus.OK); + List deviceConfigs = JSONArray.parseArray(regionPoints, DeviceConfig.class); + return new ResponseEntity(deviceConfigs, HttpStatus.OK); } /** diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java index 82f849e..ad2b080 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java @@ -23,7 +23,7 @@ public interface SchBasePointMapper extends BaseMapper { SchBasePoint selectByIdLock(String id); - List getStructList(@Param("region_code") String region_code, @Param("vehicle_type")String vehicle_type); + List getStructList(@Param("region_code") String region_code, @Param("vehicle_type")String vehicle_type,@Param("due_date")String due_date); List selectByRegionCode(@Param("region_code") String region_code); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml index a4984c2..75425af 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml @@ -39,6 +39,9 @@ and sch_base_point.point_status = '2' and sch_base_point.can_vehicle_type = #{vehicle_type} + + + and sch_base_vehiclematerialgroup.vehicle_type > #{vehicle_type} and has_work = false AND sch_base_vehiclematerialgroup.region_code = #{region_code} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java index 5c28452..f35654e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.wms.sch.point.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; @@ -19,11 +20,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.nl.common.domain.query.PageQuery; import org.nl.common.enums.GoodsEnum; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.system.service.notice.ISysNoticeService; +import org.nl.system.service.param.ISysParamService; +import org.nl.system.service.param.dao.Param; import org.nl.wms.database.vehicle.service.IMdBaseVehicleService; import org.nl.wms.database.vehicle.service.dao.MdBaseVehicle; import org.nl.wms.ext.fab.service.dto.OrderMater; @@ -67,7 +71,7 @@ public class SchBasePointServiceImpl extends ServiceImpl getStructList(String region_code, String vehicle_type) { - List structList = pointMapper.getStructList(region_code, vehicle_type); + Param dueDate = iSysParamService.findByCode("due_date"); + if (dueDate!=null && StringUtils.isNotEmpty(dueDate.getValue())){ + DateUtil.offsetDay(new Date(), Integer.valueOf(dueDate.getValue())).toDateStr(); + } + List structList = pointMapper.getStructList(region_code, vehicle_type,dueDate.getValue()); return structList; } diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml index 8ccce9f..12d8f70 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml @@ -9,10 +9,10 @@ spring: druid: filters: DruidFilter,stat - initial-size: 5 #初始化时建立物理连接的个数 - min-idle: 15 #最小连接池数量 - maxActive: 30 #最大连接池数量 - maxWait: 3000 #获取连接时最大等待时间,单位毫秒 + initial-size: 15 #初始化时建立物理连接的个数 + min-idle: 20 #最小连接池数量 + maxActive: 60 #最大连接池数量 + maxWait: 20000 #获取连接时最大等待时间,单位毫秒 #申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 test-while-idle: true time-between-eviction-runs-millis: 300000 #既作为检测的间隔时间又作为test-while-idle执行的依据 @@ -33,12 +33,12 @@ spring: username: ${DB_USER:root} password: ${DB_PWD:123456} type: com.alibaba.druid.pool.DruidDataSource - sqlserver: - driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver - url: jdbc:sqlserver://10.192.37.50:49206;DatabaseName=T1000_V01_V001 - username: ${DB_USER:mes} - password: ${DB_PWD:Abc~123456} - type: com.alibaba.druid.pool.DruidDataSource +# sqlserver: +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://10.192.37.50:49206;DatabaseName=T1000_V01_V001 +# username: ${DB_USER:mes} +# password: ${DB_PWD:Abc~123456} +# type: com.alibaba.druid.pool.DruidDataSource redis: #数据库索引 diff --git a/lms/nladmin-ui/src/views/wms/sch/task/index.vue b/lms/nladmin-ui/src/views/wms/sch/task/index.vue index 346eda6..29d6ded 100644 --- a/lms/nladmin-ui/src/views/wms/sch/task/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/task/index.vue @@ -182,8 +182,8 @@ - - + + @@ -227,12 +227,12 @@ :disabled="scope.row.task_status==='5' || scope.row.task_status==='6'" @click="doOperate(scope.row, 'a')" >完成 - + @click="doOperate(scope.row, 's')" + >任务调度 @@ -353,6 +353,9 @@ export default { case 'd':// 详情 method_name = 'view' break + case 's':// 详情 + method_name = 'view' + break } if (method_name === 'view') { // this.view(row)