Browse Source

add:fab功能

master
zhangzq 5 months ago
parent
commit
b57e21cb9e
  1. 28
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/secutiry/MobileAuthorizationController.java
  2. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/secutiry/dto/AuthUserDto.java
  3. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java
  4. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java
  5. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml
  6. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  7. 20
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml
  8. 13
      lms/nladmin-ui/src/views/wms/sch/task/index.vue

28
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<Object> 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<Object> loginOut(@Validated @RequestBody AuthUserDto authUser){
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
redisUtils.del("JT_"+authUser.getUsername());
return new ResponseEntity(TableDataInfo.build(),HttpStatus.OK);
}
}

4
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 ;
}

7
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<Map> regionPoints(String regionCode){
Assert.notBlank(regionCode,"请求参数不能为空");
SchBaseRegion baseRegion = iSchBaseRegionService.getOne(new QueryWrapper<SchBaseRegion>().eq("region_code", regionCode));
String regionPoints = baseRegion.getRegion_points();
JSONObject pointConfig = JSON.parseObject(regionPoints);
return new ResponseEntity(pointConfig, HttpStatus.OK);
List<DeviceConfig> deviceConfigs = JSONArray.parseArray(regionPoints, DeviceConfig.class);
return new ResponseEntity(deviceConfigs, HttpStatus.OK);
}
/**

2
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> {
SchBasePoint selectByIdLock(String id);
List<OrderMater> getStructList(@Param("region_code") String region_code, @Param("vehicle_type")String vehicle_type);
List<OrderMater> getStructList(@Param("region_code") String region_code, @Param("vehicle_type")String vehicle_type,@Param("due_date")String due_date);
List<String> selectByRegionCode(@Param("region_code") String region_code);

3
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'
<if test="vehicle_type != null and vehicle_type != ''">
and sch_base_point.can_vehicle_type = #{vehicle_type}
</if>
<if test="due_date != null and due_date != ''">
and sch_base_vehiclematerialgroup.vehicle_type > #{vehicle_type}
</if>
and has_work = false
AND sch_base_vehiclematerialgroup.region_code = #{region_code}

12
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<SchBasePointMapper, Sch
@Autowired
private IMdBaseVehicleService iMdBaseVehicleService;
@Autowired
private ISysNoticeService noticeService;
private ISysParamService iSysParamService;
private final Object lock = new Object();
@ -463,7 +467,11 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Override
public List<OrderMater> getStructList(String region_code, String vehicle_type) {
List<OrderMater> 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<OrderMater> structList = pointMapper.getStructList(region_code, vehicle_type,dueDate.getValue());
return structList;
}

20
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:
#数据库索引

13
lms/nladmin-ui/src/views/wms/sch/task/index.vue

@ -182,8 +182,8 @@
<el-table-column prop="config_code" label="配置编码" :min-width="flexWidth('config_code',crud.data,'配置编码')" />
<el-table-column prop="point_code1" label="点位1" :min-width="flexWidth('point_code1',crud.data,'点位1')" />
<el-table-column prop="point_code2" label="点位2" :min-width="flexWidth('point_code2',crud.data,'点位2')" />
<el-table-column prop="point_code3" label="点位3" :min-width="flexWidth('point_code3',crud.data,'点位3')" />
<el-table-column prop="point_code4" label="点位4" :min-width="flexWidth('point_code4',crud.data,'点位4')" />
<el-table-column prop="point_code3" label="点位3" :min-width="flexWidth('point_code3',crud.data,'点位3')" />
<el-table-column prop="point_code4" label="点位4" :min-width="flexWidth('point_code4',crud.data,'点位4')" />
<!-- <el-table-column prop="start_wait_point" label="取货等待点" :min-width="flexWidth('start_wait_point',crud.data,'取货等待点')" />-->
<el-table-column v-if="false" prop="next_wait_point" label="放货等待点" :min-width="flexWidth('next_wait_point',crud.data,'放货等待点')" />
<el-table-column v-if="false" prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)">
@ -227,12 +227,12 @@
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
@click="doOperate(scope.row, 'a')"
>完成</el-button>
<!-- <el-button
<el-button
type="text"
icon="el-icon-error"
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
@click="doOperate(scope.row, 'b')"
>取消</el-button> -->
@click="doOperate(scope.row, 's')"
>任务调度</el-button>
</template>
</el-table-column>
</el-table>
@ -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)

Loading…
Cancel
Save