add: acs添加操作日志,lms优化冲床空满交换逻辑,添加入库天数显示
This commit is contained in:
@@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.nl.common.logging.annotation;
|
package org.nl.common.logging.annotation;
|
||||||
|
|
||||||
|
import org.nl.acs.enums.InterfaceLogType;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
@@ -28,4 +30,34 @@ import java.lang.annotation.Target;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Log {
|
public @interface Log {
|
||||||
String value() default "";
|
String value() default "";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否打印到日志文件
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isPrintToLogFile() default false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否插入操作日志表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isAddLogTable() default true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否接口日志
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isInterfaceLog() default false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口日志类型
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
InterfaceLogType interfaceLogType() default InterfaceLogType.DEFAULT;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,14 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*//*
|
*/
|
||||||
|
|
||||||
package org.nl.common.logging.aspect;
|
package org.nl.common.logging.aspect;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
@@ -31,6 +33,10 @@ import org.nl.common.utils.SecurityUtils;
|
|||||||
import org.nl.common.utils.StringUtils;
|
import org.nl.common.utils.StringUtils;
|
||||||
import org.nl.common.utils.ThrowableUtil;
|
import org.nl.common.utils.ThrowableUtil;
|
||||||
import org.nl.common.logging.domain.Log;
|
import org.nl.common.logging.domain.Log;
|
||||||
|
import org.nl.config.IdUtil;
|
||||||
|
import org.nl.system.service.logging.ISysLogService;
|
||||||
|
import org.nl.system.service.logging.dao.SysLog;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -41,79 +47,67 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Parameter;
|
import java.lang.reflect.Parameter;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @author Zheng Jie
|
|
||||||
* @date 2018-11-24
|
|
||||||
*//*
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Aspect
|
@Aspect
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class LogAspect {
|
public class LogAspect {
|
||||||
|
|
||||||
private final LogService logService;
|
@Autowired
|
||||||
|
private ISysLogService logService;
|
||||||
|
|
||||||
ThreadLocal<Long> currentTime = new ThreadLocal<>();
|
ThreadLocal<Long> currentTime = new ThreadLocal<>();
|
||||||
|
|
||||||
public LogAspect(LogService logService) {
|
public LogAspect(ISysLogService logService) {
|
||||||
this.logService = logService;
|
this.logService = logService;
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 配置切入点
|
|
||||||
*//*
|
|
||||||
|
|
||||||
@Pointcut("@annotation(org.nl.common.logging.annotation.Log)")
|
@Pointcut("@annotation(org.nl.common.logging.annotation.Log)")
|
||||||
public void logPointcut() {
|
public void logPointcut() {
|
||||||
// 该方法无方法体,主要为了让同类中其他方法使用此切入点
|
// 该方法无方法体,主要为了让同类中其他方法使用此切入点
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 配置环绕通知,使用在方法logPointcut()上注册的切入点
|
|
||||||
*
|
|
||||||
* @param joinPoint join point for advice
|
|
||||||
*//*
|
|
||||||
|
|
||||||
@Around("logPointcut()")
|
@Around("logPointcut()")
|
||||||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
String trackId = UUID.randomUUID().toString();
|
||||||
HttpServletRequest request = attributes.getRequest();
|
|
||||||
HttpServletResponse response = attributes.getResponse();
|
|
||||||
// HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
|
||||||
|
|
||||||
|
|
||||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
Method method = signature.getMethod();
|
Method method = signature.getMethod();
|
||||||
// 方法路径
|
// 方法路径
|
||||||
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
|
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
|
||||||
String params=getParameter(method, joinPoint.getArgs());
|
String params = getParameter(method, joinPoint.getArgs());
|
||||||
|
|
||||||
log.info("请求uri:{}", request.getRequestURI());
|
org.nl.common.logging.annotation.Log logInfo = method.getAnnotation(org.nl.common.logging.annotation.Log.class);
|
||||||
log.info("请求方法:{}",methodName);
|
|
||||||
log.info("请求方法参数:{}",params);
|
|
||||||
|
|
||||||
|
//是否输出到日志文件
|
||||||
|
if (logInfo.isPrintToLogFile()) {
|
||||||
|
log.info("track_id:{},请求方法:{},请求方法参数:{}", trackId, methodName, params);
|
||||||
|
}
|
||||||
|
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||||
|
String requestIp = StringUtils.getIp(request);
|
||||||
Object result;
|
Object result;
|
||||||
currentTime.set(System.currentTimeMillis());
|
long startTime = System.currentTimeMillis();
|
||||||
result = joinPoint.proceed();
|
try {
|
||||||
Log log = new Log("INFO",System.currentTimeMillis() - currentTime.get());
|
result = joinPoint.proceed();
|
||||||
currentTime.remove();
|
//是否把日志存到日志表
|
||||||
|
if (logInfo.isAddLogTable()) {
|
||||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log);
|
SysLog log = new SysLog("INFO", System.currentTimeMillis() - startTime);
|
||||||
|
logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error("track_id:{},error:{}", trackId, ex.getMessage());
|
||||||
|
SysLog log = new SysLog("ERROR", System.currentTimeMillis() - startTime);
|
||||||
|
log.setException_detail(ThrowableUtil.getStackTrace(ex).getBytes());
|
||||||
|
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint) joinPoint, log);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 根据方法和传入的参数获取请求参数
|
|
||||||
*//*
|
|
||||||
|
|
||||||
private String getParameter(Method method, Object[] args) {
|
private String getParameter(Method method, Object[] args) {
|
||||||
List<Object> argList = new ArrayList<>();
|
List<Object> argList = new ArrayList<>();
|
||||||
@@ -142,29 +136,13 @@ public class LogAspect {
|
|||||||
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 配置异常通知
|
|
||||||
*
|
|
||||||
* @param joinPoint join point for advice
|
|
||||||
* @param e exception
|
|
||||||
*//*
|
|
||||||
|
|
||||||
@AfterThrowing(pointcut = "logPointcut()", throwing = "e")
|
|
||||||
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
|
|
||||||
Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get());
|
|
||||||
currentTime.remove();
|
|
||||||
log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes());
|
|
||||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
|
||||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
try {
|
try {
|
||||||
return SecurityUtils.getCurrentUsername();
|
return SecurityUtils.getCurrentNickName();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package org.nl.system.service.logging;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.system.service.logging.dao.SysLog;
|
import org.nl.system.service.logging.dao.SysLog;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -25,6 +27,9 @@ public interface ISysLogService extends IService<SysLog> {
|
|||||||
*/
|
*/
|
||||||
IPage<SysLog> queryAll(Map criteria, PageQuery pageable);
|
IPage<SysLog> queryAll(Map criteria, PageQuery pageable);
|
||||||
|
|
||||||
|
@Async
|
||||||
|
void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, SysLog log);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询异常详情
|
* 查询异常详情
|
||||||
* @param id 日志ID
|
* @param id 日志ID
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -18,6 +19,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@TableName("sys_log")
|
@TableName("sys_log")
|
||||||
|
@NoArgsConstructor
|
||||||
public class SysLog implements Serializable {
|
public class SysLog implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -51,5 +53,10 @@ public class SysLog implements Serializable {
|
|||||||
|
|
||||||
private String create_time;
|
private String create_time;
|
||||||
|
|
||||||
|
public SysLog(String logType, Long time) {
|
||||||
|
this.log_type = logType;
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,35 @@
|
|||||||
package org.nl.system.service.logging.impl;
|
package org.nl.system.service.logging.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.common.utils.StringUtils;
|
||||||
import org.nl.common.utils.ValidationUtil;
|
import org.nl.common.utils.ValidationUtil;
|
||||||
import org.nl.system.service.logging.ISysLogService;
|
import org.nl.system.service.logging.ISysLogService;
|
||||||
import org.nl.system.service.logging.dao.SysLog;
|
import org.nl.system.service.logging.dao.SysLog;
|
||||||
import org.nl.system.service.logging.dao.mapper.SysLogMapper;
|
import org.nl.system.service.logging.dao.mapper.SysLogMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.lang.reflect.Parameter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,6 +66,60 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
|
|||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, SysLog logDto) {
|
||||||
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
|
Method method = signature.getMethod();
|
||||||
|
Log aopLog = method.getAnnotation(Log.class);
|
||||||
|
|
||||||
|
// 方法路径
|
||||||
|
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
|
||||||
|
|
||||||
|
// 描述
|
||||||
|
if (logDto != null) {
|
||||||
|
logDto.setDescription(aopLog.value());
|
||||||
|
}
|
||||||
|
assert logDto != null;
|
||||||
|
logDto.setRequest_ip(ip);
|
||||||
|
logDto.setLog_id(RandomUtil.randomString(5));
|
||||||
|
logDto.setAddress(StringUtils.getCityInfo(logDto.getRequest_ip()));
|
||||||
|
logDto.setMethod(methodName);
|
||||||
|
logDto.setUsername(username);
|
||||||
|
logDto.setParams(getParameter(method, joinPoint.getArgs()));
|
||||||
|
logDto.setBrowser(browser);
|
||||||
|
long currentTimeMillis = System.currentTimeMillis();
|
||||||
|
String dateString = DateUtil.date(currentTimeMillis).toString();
|
||||||
|
logDto.setCreate_time(dateString);
|
||||||
|
logMapper.insert(logDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getParameter(Method method, Object[] args) {
|
||||||
|
List<Object> argList = new ArrayList<>();
|
||||||
|
Parameter[] parameters = method.getParameters();
|
||||||
|
for (int i = 0; i < parameters.length; i++) {
|
||||||
|
//将RequestBody注解修饰的参数作为请求参数
|
||||||
|
RequestBody requestBody = parameters[i].getAnnotation(RequestBody.class);
|
||||||
|
if (requestBody != null) {
|
||||||
|
argList.add(args[i]);
|
||||||
|
}
|
||||||
|
//将RequestParam注解修饰的参数作为请求参数
|
||||||
|
RequestParam requestParam = parameters[i].getAnnotation(RequestParam.class);
|
||||||
|
if (requestParam != null) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
String key = parameters[i].getName();
|
||||||
|
if (!StrUtil.isEmpty(requestParam.value())) {
|
||||||
|
key = requestParam.value();
|
||||||
|
}
|
||||||
|
map.put(key, args[i]);
|
||||||
|
argList.add(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (argList.size() == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object findByErrDetail(String id) {
|
public Object findByErrDetail(String id) {
|
||||||
SysLog sysLog = logMapper.selectById(id);
|
SysLog sysLog = logMapper.selectById(id);
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
resources.setPid(null);
|
resources.setPid(null);
|
||||||
addSystemTypeDict(resources);
|
addSystemTypeDict(resources);
|
||||||
}
|
}
|
||||||
|
resources.setSub_count(0);
|
||||||
|
|
||||||
baseMapper.insert(resources);
|
baseMapper.insert(resources);
|
||||||
// 计算子节点数目
|
// 计算子节点数目
|
||||||
resources.setSub_count(0);
|
|
||||||
// 更新父节点菜单数目
|
// 更新父节点菜单数目
|
||||||
updateSubCnt(resources.getPid());
|
updateSubCnt(resources.getPid());
|
||||||
updateRootSystemType(resources);
|
updateRootSystemType(resources);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class FabController {
|
|||||||
private ISchBaseVehiclematerialgroupService iSchBaseVehiclematerialgroupService;
|
private ISchBaseVehiclematerialgroupService iSchBaseVehiclematerialgroupService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WmsToConnectorService wmsToConnectorService;
|
private WmsToConnectorService wmsToConnectorService;
|
||||||
private static final HashMap REGION_CODE = MapOf.of("货架", "1", "外协加工", "2", "内部加工", "3", "内部过道", "4","其他加工","5");
|
private static final HashMap REGION_CODE = MapOf.of("货架", "1", "内部加工", "2", "外协加工", "3", "内部过道", "4","其他加工","5");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -168,7 +168,8 @@ public class SchBaseVehiclematerialgroup implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String materialFile;
|
private String materialFile;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String between;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String material_name;
|
private String material_name;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.group.service.impl;
|
package org.nl.wms.sch.group.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
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.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
@@ -50,6 +51,8 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -109,6 +112,9 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
|
|||||||
if (CollUtil.isNotEmpty(schBaseVehiclematerialgroups)) {
|
if (CollUtil.isNotEmpty(schBaseVehiclematerialgroups)) {
|
||||||
item.setHasChildren(true);
|
item.setHasChildren(true);
|
||||||
}
|
}
|
||||||
|
// 计算两个日期之间的天数差
|
||||||
|
long daysBetween = DateUtil.between(DateUtil.parse(item.getCreate_time()), new Date(), DateUnit.DAY);
|
||||||
|
item.setBetween(daysBetween + "");
|
||||||
item.setHas_work(true);
|
item.setHas_work(true);
|
||||||
});
|
});
|
||||||
return schBaseVehiclematerialgroupIPage;
|
return schBaseVehiclematerialgroupIPage;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.sch.point.controller;
|
package org.nl.wms.sch.point.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -58,7 +59,7 @@ public class SchBasePointController {
|
|||||||
|
|
||||||
@Log("删除点位管理")
|
@Log("删除点位管理")
|
||||||
@ApiOperation("删除点位管理")
|
@ApiOperation("删除点位管理")
|
||||||
//@SaCheckPermission("@el.check('schBasePoint:del')")
|
@SaCheckPermission("schBasePoint:del")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
schBasePointService.deleteAll(ids);
|
schBasePointService.deleteAll(ids);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class CNTTask extends AbstractTask {
|
|||||||
|
|
||||||
|
|
||||||
private static final String TASK_CONFIG_CODE = "CNTTask";
|
private static final String TASK_CONFIG_CODE = "CNTTask";
|
||||||
private static final String[] EMPTY_POINT = {"13-01-01","13-01-03"};
|
private static final String[] EMPTY_POINT = {"13-01-01","13-01-04"};
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService pointService;
|
private ISchBasePointService pointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class FTGTask extends AbstractTask {
|
|||||||
|
|
||||||
|
|
||||||
private static final String TASK_CONFIG_CODE = "FTGTask";
|
private static final String TASK_CONFIG_CODE = "FTGTask";
|
||||||
private static final String[] EMPTY_POINT = {"13-01-02","13-01-04"};
|
private static final String[] EMPTY_POINT = {"13-01-02","13-01-03"};
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService pointService;
|
private ISchBasePointService pointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -224,6 +224,7 @@
|
|||||||
<el-table-column prop="material_path" label="物料图片路径" :min-width="flexWidth('material_path',crud.data,'物料图片路径')" />
|
<el-table-column prop="material_path" label="物料图片路径" :min-width="flexWidth('material_path',crud.data,'物料图片路径')" />
|
||||||
<el-table-column prop="create_name" label="创建人" width="100" />
|
<el-table-column prop="create_name" label="创建人" width="100" />
|
||||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||||
|
<el-table-column prop="between" label="入库天数" :min-width="flexWidth('between',crud.data,'入库天数')" />
|
||||||
<el-table-column v-if="false" prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
<el-table-column v-if="false" prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||||
<el-table-column v-if="false" prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
<el-table-column v-if="false" prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||||
|
|||||||
@@ -231,7 +231,7 @@
|
|||||||
<el-form-item label="载具编码" prop="vehicle_code">
|
<el-form-item label="载具编码" prop="vehicle_code">
|
||||||
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="允许载具类型" prop="can_vehicle_type">
|
<!--<el-form-item label="允许载具类型" prop="can_vehicle_type">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.can_vehicle_type"
|
v-model="form.can_vehicle_type"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>-->
|
||||||
<el-form-item label="点位状态" prop="point_status">
|
<el-form-item label="点位状态" prop="point_status">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.point_status"
|
v-model="form.point_status"
|
||||||
@@ -263,7 +263,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="点位类型" prop="point_type">
|
<!-- <el-form-item label="点位类型" prop="point_type">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.point_type"
|
v-model="form.point_type"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>-->
|
||||||
<el-form-item label="是否锁定">
|
<el-form-item label="是否锁定">
|
||||||
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_lock" :label="item.value">{{ item.label }}</el-radio>
|
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_lock" :label="item.value">{{ item.label }}</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -345,24 +345,15 @@
|
|||||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||||
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
<!-- <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<udOperation
|
<udOperation
|
||||||
style="display: inline"
|
style="display: inline"
|
||||||
:data="scope.row"
|
:data="scope.row"
|
||||||
:permission="permission"
|
:permission="permission"
|
||||||
/>
|
/>
|
||||||
<!-- <el-button
|
|
||||||
v-if="showButton(scope.row.point_status)"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-view"
|
|
||||||
@click="toView(scope.row)"
|
|
||||||
>
|
|
||||||
查看详情
|
|
||||||
</el-button> -->
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
@@ -431,7 +422,7 @@ export default {
|
|||||||
optShow: {
|
optShow: {
|
||||||
add: true,
|
add: true,
|
||||||
edit: true,
|
edit: true,
|
||||||
del: true,
|
del: false,
|
||||||
download: false,
|
download: false,
|
||||||
reset: true
|
reset: true
|
||||||
},
|
},
|
||||||
@@ -443,6 +434,11 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
permission: {
|
||||||
|
add: ['point:add'],
|
||||||
|
edit: ['admin', 'user:edit'],
|
||||||
|
del: ['admin', 'user:del']
|
||||||
|
},
|
||||||
dict: {
|
dict: {
|
||||||
label: {
|
label: {
|
||||||
point_status: {
|
point_status: {
|
||||||
|
|||||||
Reference in New Issue
Block a user