add:fab功能
This commit is contained in:
@@ -11,8 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
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.RsaUtils;
|
||||||
import org.nl.common.utils.dto.CurrentUser;
|
import org.nl.common.utils.dto.CurrentUser;
|
||||||
import org.nl.config.RsaProperties;
|
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.SysUserDetail;
|
||||||
import org.nl.system.service.user.dto.UserQuery;
|
import org.nl.system.service.user.dto.UserQuery;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -48,7 +53,9 @@ public class MobileAuthorizationController {
|
|||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
@ApiOperation("登录授权")
|
|
||||||
|
@Autowired
|
||||||
|
private RedisUtils redisUtils;
|
||||||
@PostMapping(value = "/login")
|
@PostMapping(value = "/login")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
||||||
@@ -67,7 +74,14 @@ public class MobileAuthorizationController {
|
|||||||
if (!userInfo.getIs_used()) {
|
if (!userInfo.getIs_used()) {
|
||||||
throw new BadRequestException("账号未激活");
|
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();
|
CurrentUser user = new CurrentUser();
|
||||||
user.setId(userInfo.getUser_id());
|
user.setId(userInfo.getUser_id());
|
||||||
@@ -105,4 +119,14 @@ public class MobileAuthorizationController {
|
|||||||
return ResponseEntity.ok(authInfo);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ import javax.validation.constraints.NotBlank;
|
|||||||
@Setter
|
@Setter
|
||||||
public class AuthUserDto {
|
public class AuthUserDto {
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private String uuid = "";
|
private String uuid = "";
|
||||||
|
|
||||||
|
private String regin_code ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.nl.wms.ext.fab.controller;
|
|||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -62,12 +63,14 @@ public class FabController {
|
|||||||
*/
|
*/
|
||||||
@Log("根据工序获取设备点位信息")
|
@Log("根据工序获取设备点位信息")
|
||||||
@GetMapping("/regionPoints")
|
@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){
|
public ResponseEntity<Map> regionPoints(String regionCode){
|
||||||
Assert.notBlank(regionCode,"请求参数不能为空");
|
Assert.notBlank(regionCode,"请求参数不能为空");
|
||||||
SchBaseRegion baseRegion = iSchBaseRegionService.getOne(new QueryWrapper<SchBaseRegion>().eq("region_code", regionCode));
|
SchBaseRegion baseRegion = iSchBaseRegionService.getOne(new QueryWrapper<SchBaseRegion>().eq("region_code", regionCode));
|
||||||
String regionPoints = baseRegion.getRegion_points();
|
String regionPoints = baseRegion.getRegion_points();
|
||||||
JSONObject pointConfig = JSON.parseObject(regionPoints);
|
List<DeviceConfig> deviceConfigs = JSONArray.parseArray(regionPoints, DeviceConfig.class);
|
||||||
return new ResponseEntity(pointConfig, HttpStatus.OK);
|
return new ResponseEntity(deviceConfigs, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
|||||||
|
|
||||||
SchBasePoint selectByIdLock(String id);
|
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);
|
List<String> selectByRegionCode(@Param("region_code") String region_code);
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,9 @@
|
|||||||
and sch_base_point.point_status = '2'
|
and sch_base_point.point_status = '2'
|
||||||
<if test="vehicle_type != null and vehicle_type != ''">
|
<if test="vehicle_type != null and vehicle_type != ''">
|
||||||
and sch_base_point.can_vehicle_type = #{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>
|
</if>
|
||||||
and has_work = false
|
and has_work = false
|
||||||
AND sch_base_vehiclematerialgroup.region_code = #{region_code}
|
AND sch_base_vehiclematerialgroup.region_code = #{region_code}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.wms.sch.point.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
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.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.enums.GoodsEnum;
|
import org.nl.common.enums.GoodsEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.system.service.notice.ISysNoticeService;
|
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.IMdBaseVehicleService;
|
||||||
import org.nl.wms.database.vehicle.service.dao.MdBaseVehicle;
|
import org.nl.wms.database.vehicle.service.dao.MdBaseVehicle;
|
||||||
import org.nl.wms.ext.fab.service.dto.OrderMater;
|
import org.nl.wms.ext.fab.service.dto.OrderMater;
|
||||||
@@ -67,7 +71,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IMdBaseVehicleService iMdBaseVehicleService;
|
private IMdBaseVehicleService iMdBaseVehicleService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysNoticeService noticeService;
|
private ISysParamService iSysParamService;
|
||||||
|
|
||||||
private final Object lock = new Object();
|
private final Object lock = new Object();
|
||||||
|
|
||||||
@@ -463,7 +467,11 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OrderMater> getStructList(String region_code, String vehicle_type) {
|
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;
|
return structList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
filters:
|
filters:
|
||||||
DruidFilter,stat
|
DruidFilter,stat
|
||||||
initial-size: 5 #初始化时建立物理连接的个数
|
initial-size: 15 #初始化时建立物理连接的个数
|
||||||
min-idle: 15 #最小连接池数量
|
min-idle: 20 #最小连接池数量
|
||||||
maxActive: 30 #最大连接池数量
|
maxActive: 60 #最大连接池数量
|
||||||
maxWait: 3000 #获取连接时最大等待时间,单位毫秒
|
maxWait: 20000 #获取连接时最大等待时间,单位毫秒
|
||||||
#申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
|
#申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
|
||||||
test-while-idle: true
|
test-while-idle: true
|
||||||
time-between-eviction-runs-millis: 300000 #既作为检测的间隔时间又作为test-while-idle执行的依据
|
time-between-eviction-runs-millis: 300000 #既作为检测的间隔时间又作为test-while-idle执行的依据
|
||||||
@@ -33,12 +33,12 @@ spring:
|
|||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
sqlserver:
|
# sqlserver:
|
||||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
url: jdbc:sqlserver://10.192.37.50:49206;DatabaseName=T1000_V01_V001
|
# url: jdbc:sqlserver://10.192.37.50:49206;DatabaseName=T1000_V01_V001
|
||||||
username: ${DB_USER:mes}
|
# username: ${DB_USER:mes}
|
||||||
password: ${DB_PWD:Abc~123456}
|
# password: ${DB_PWD:Abc~123456}
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
# type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
#数据库索引
|
#数据库索引
|
||||||
|
|||||||
@@ -182,8 +182,8 @@
|
|||||||
<el-table-column prop="config_code" label="配置编码" :min-width="flexWidth('config_code',crud.data,'配置编码')" />
|
<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_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_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_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_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 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="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)">
|
<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'"
|
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
|
||||||
@click="doOperate(scope.row, 'a')"
|
@click="doOperate(scope.row, 'a')"
|
||||||
>完成</el-button>
|
>完成</el-button>
|
||||||
<!-- <el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-error"
|
icon="el-icon-error"
|
||||||
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
|
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
|
||||||
@click="doOperate(scope.row, 'b')"
|
@click="doOperate(scope.row, 's')"
|
||||||
>取消</el-button> -->
|
>任务调度</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -353,6 +353,9 @@ export default {
|
|||||||
case 'd':// 详情
|
case 'd':// 详情
|
||||||
method_name = 'view'
|
method_name = 'view'
|
||||||
break
|
break
|
||||||
|
case 's':// 详情
|
||||||
|
method_name = 'view'
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if (method_name === 'view') {
|
if (method_name === 'view') {
|
||||||
// this.view(row)
|
// this.view(row)
|
||||||
|
|||||||
Reference in New Issue
Block a user