opt: 代码格式化
This commit is contained in:
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
/**
|
||||
* 开启审计功能 -> @EnableJpaAuditing
|
||||
* https://www.cnblogs.com/niceyoo/p/10908647.html
|
||||
* '@ServletComponentScan https://blog.csdn.net/qq_36850813/article/details/101194250
|
||||
*
|
||||
* @author ldjun
|
||||
* @date 2021/2/22 9:20:19
|
||||
@@ -31,7 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@SpringBootApplication(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@ServletComponentScan //https://blog.csdn.net/qq_36850813/article/details/101194250
|
||||
@ServletComponentScan
|
||||
@EnableTransactionManagement
|
||||
@EnableMethodCache(basePackages = "org.nl")
|
||||
@EnableCreateCacheAnnotation
|
||||
|
||||
@@ -7,13 +7,14 @@ import com.baomidou.mybatisplus.core.toolkit.support.ColumnCache;
|
||||
import lombok.Data;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.config.MapOf;
|
||||
import org.nl.wms.sch.task_manage.enums.FieldConstant;
|
||||
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author ZZQ
|
||||
* @Date 2022/12/14 6:33 下午
|
||||
* 泛型必须为数据tb对应do:由mybatis管理
|
||||
@@ -37,31 +38,32 @@ public class BaseQuery<T> {
|
||||
|
||||
/**
|
||||
* 字段映射Map:指定字段对应QueryWrapper的查询类型
|
||||
* 字段与数据库字段对应,不支持驼峰
|
||||
* @see org.nl.common.enums.QueryTEnum
|
||||
* 字段与数据库字段对应,不支持驼峰
|
||||
*
|
||||
* @see org.nl.common.enums.QueryTEnum
|
||||
* 通过buid构建
|
||||
*/
|
||||
public Map<String, QParam> doP = MapOf.of("blurry", QParam.builder().k(new String[]{"name"}).type(QueryTEnum.LK).build()
|
||||
,"startTime", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LT).build()
|
||||
,"endTime", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LE).build()
|
||||
,"sort", QParam.builder().k(new String[]{"sort"}).type(QueryTEnum.BY).build()
|
||||
, "startTime", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LT).build()
|
||||
, "endTime", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LE).build()
|
||||
, "sort", QParam.builder().k(new String[]{"sort"}).type(QueryTEnum.BY).build()
|
||||
);
|
||||
|
||||
public QueryWrapper<T> build(){
|
||||
public QueryWrapper<T> build() {
|
||||
this.paramMapping();
|
||||
QueryWrapper<T> wrapper = new QueryWrapper<>();
|
||||
JSONObject json = (JSONObject)JSONObject.toJSON(this);
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(this);
|
||||
Type[] types = ((ParameterizedTypeImpl) this.getClass().getGenericSuperclass()).getActualTypeArguments();
|
||||
Map<String, ColumnCache> columnMap = LambdaUtils.getColumnMap((Class<?>) types[0]);
|
||||
json.forEach((key, vel) -> {
|
||||
if (vel != null && !key.equals("doP")){
|
||||
if (vel != null && !(FieldConstant.DOP).equals(key)) {
|
||||
QParam qParam = doP.get(key);
|
||||
if (qParam != null){
|
||||
QueryTEnum.build(qParam.type,wrapper,qParam.k,vel);
|
||||
}else {
|
||||
if (qParam != null) {
|
||||
QueryTEnum.build(qParam.type, wrapper, qParam.k, vel);
|
||||
} else {
|
||||
ColumnCache columnCache = columnMap.get(LambdaUtils.formatKey(key));
|
||||
if (columnCache!=null){
|
||||
wrapper.eq(columnCache.getColumn(),vel);
|
||||
if (columnCache != null) {
|
||||
wrapper.eq(columnCache.getColumn(), vel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,5 +71,8 @@ public class BaseQuery<T> {
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public void paramMapping(){};
|
||||
public void paramMapping() {
|
||||
}
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@ package org.nl.common.domain.query;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author ZZQ
|
||||
* @Date 2022/12/14 8:40 下午
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface LConsumer<X,Y,Z> {
|
||||
public interface LConsumer<X, Y, Z> {
|
||||
|
||||
void accept(X x,Y y,Z z);
|
||||
void accept(X x, Y y, Z z);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ import java.util.Locale;
|
||||
|
||||
|
||||
/**
|
||||
* 分页参数
|
||||
* @Author: lyd
|
||||
* @Description: 分页参数
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class PageQuery implements Serializable {
|
||||
@@ -57,37 +59,37 @@ public class PageQuery implements Serializable {
|
||||
pageNum = DEFAULT_PAGE_NUM;
|
||||
}
|
||||
Page<T> page = new Page<>(pageNum, pageSize);
|
||||
if (StringUtils.isNotEmpty(sort)){
|
||||
if (StringUtils.isNotEmpty(sort)) {
|
||||
String[] split = sort.split(",");
|
||||
for (int i = 0; i < (split.length & ~1); i=i+2) {
|
||||
for (int i = 0; i < (split.length & ~1); i = i + 2) {
|
||||
String col = split[i];
|
||||
OrderItem item = new OrderItem();
|
||||
item.setColumn(col);
|
||||
item.setAsc(split[i+1].toLowerCase(Locale.ROOT).equals("asc"));
|
||||
item.setAsc("asc".equals(split[i + 1].toLowerCase(Locale.ROOT)));
|
||||
page.addOrder(item);
|
||||
}
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
public <R,T> Page<T> build(Class<R> r) {
|
||||
public <R, T> Page<T> build(Class<R> r) {
|
||||
Integer pageNum = ObjectUtil.defaultIfNull(getPage(), DEFAULT_PAGE_NUM);
|
||||
Integer pageSize = ObjectUtil.defaultIfNull(getSize(), DEFAULT_PAGE_SIZE);
|
||||
if (pageNum <= 0) {
|
||||
pageNum = DEFAULT_PAGE_NUM;
|
||||
}
|
||||
Page<T> page = new Page<>(pageNum, pageSize);
|
||||
if (StringUtils.isNotEmpty(sort)){
|
||||
if (StringUtils.isNotEmpty(sort)) {
|
||||
String[] split = sort.split(",");
|
||||
for (int i = 0; i < (split.length & ~1); i=i+2) {
|
||||
for (int i = 0; i < (split.length & ~1); i = i + 2) {
|
||||
String col = split[i];
|
||||
if ("id".equals(col)){
|
||||
if ("id".equals(col)) {
|
||||
String mId = mappingId(r);
|
||||
col = StringUtils.isNotEmpty(mId)?mId:col;
|
||||
col = StringUtils.isNotEmpty(mId) ? mId : col;
|
||||
}
|
||||
OrderItem item = new OrderItem();
|
||||
item.setColumn(col);
|
||||
item.setAsc(split[i+1].toLowerCase(Locale.ROOT).equals("asc"));
|
||||
item.setAsc("asc".equals(split[i + 1].toLowerCase(Locale.ROOT)));
|
||||
page.addOrder(item);
|
||||
}
|
||||
|
||||
@@ -95,12 +97,12 @@ public class PageQuery implements Serializable {
|
||||
return page;
|
||||
}
|
||||
|
||||
private <R> String mappingId(R r){
|
||||
if (r instanceof Class){
|
||||
private <R> String mappingId(R r) {
|
||||
if (r instanceof Class) {
|
||||
Field[] fields = ((Class) r).getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
TableId[] byType = field.getAnnotationsByType(TableId.class);
|
||||
if (byType !=null && byType.length>0){
|
||||
if (byType != null && byType.length > 0) {
|
||||
TableId tableId = byType[0];
|
||||
return tableId.value();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
package org.nl.common.enums;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 日志类型枚举
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
public enum LogTypeEnum {
|
||||
/**
|
||||
* 设备日志
|
||||
*/
|
||||
DEVICE_LOG("设备日志"),
|
||||
/**
|
||||
* 接口日志
|
||||
*/
|
||||
INTERFACE_LOG("接口日志");
|
||||
|
||||
private String desc;
|
||||
|
||||
@@ -11,10 +11,25 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum NoticeEnum {
|
||||
/**
|
||||
* 未读
|
||||
*/
|
||||
HAVE_READ_OFF("1","未读"),
|
||||
/**
|
||||
* 已读
|
||||
*/
|
||||
HAVE_READ_ON("2", "已读"),
|
||||
/**
|
||||
* 未处理
|
||||
*/
|
||||
DEAL_STATUS_NO("1", "未处理"),
|
||||
/**
|
||||
* 已处理
|
||||
*/
|
||||
DEAL_STATUS_YES("2", "已处理"),
|
||||
/**
|
||||
* 无需处理
|
||||
*/
|
||||
DEAL_STATUS_NO_NEED("3", "无需处理");
|
||||
|
||||
private final String value;
|
||||
|
||||
@@ -11,8 +11,17 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PointStatusEnum {
|
||||
/**
|
||||
* 空位
|
||||
*/
|
||||
EMPTY_PLACE("1", "空位"),
|
||||
/**
|
||||
* 有料
|
||||
*/
|
||||
FULL_MATERIAL("2", "有料"),
|
||||
/**
|
||||
* 空载具
|
||||
*/
|
||||
EMPTY_VEHICLE("3", "空载具");
|
||||
private final String value;
|
||||
private final String description;
|
||||
|
||||
@@ -76,7 +76,6 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(value = NotLoginException.class)
|
||||
public ResponseEntity<ApiError> notLoginException(Exception e) {
|
||||
// log.error(ThrowableUtil.getStackTrace(e));
|
||||
return buildResponseEntity(ApiError.error(401,"token 失效"));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ import org.redisson.api.RedissonClient;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 代码生成工具
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
public class CodeUtil {
|
||||
|
||||
@SneakyThrows
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author ZZQ
|
||||
* @Date 2022/12/1 3:35 下午
|
||||
*/
|
||||
@@ -19,7 +19,7 @@ public class CopyUtil {
|
||||
List<T> list = new ArrayList(sources.size());
|
||||
Iterator var3 = sources.iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
while (var3.hasNext()) {
|
||||
Object source = var3.next();
|
||||
|
||||
try {
|
||||
|
||||
@@ -105,8 +105,9 @@ public class DesUtil {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String decrypt(String data, String key) throws Exception {
|
||||
if (data == null)
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
BASE64Decoder decoder = new BASE64Decoder();
|
||||
byte[] buf = decoder.decodeBuffer(data);
|
||||
|
||||
|
||||
@@ -61,16 +61,6 @@ public class SecurityUtils {
|
||||
return getCurrentUser().getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统用户Id
|
||||
*
|
||||
* @return 系统用户Id
|
||||
*/
|
||||
public static Long getDeptId() {
|
||||
// return getCurrentUser().getUser().getDept().getId();
|
||||
return 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户权限
|
||||
*
|
||||
|
||||
@@ -19,13 +19,22 @@ public class CurrentUser implements Serializable {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private String id;
|
||||
|
||||
//账号
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String username;
|
||||
//姓名
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String presonName;
|
||||
|
||||
//用户详细信息
|
||||
/**
|
||||
* 用户详细信息
|
||||
*/
|
||||
private SysUser user;
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
private List<String> permissions = new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -8,16 +8,16 @@ import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author ZZQ
|
||||
* @Date 2022/11/29 2:55 下午
|
||||
*/
|
||||
public class MapOf implements Serializable {
|
||||
|
||||
public static <K> HashMap of(K... key){
|
||||
public static <K> HashMap of(K... key) {
|
||||
HashMap map = new HashMap<>();
|
||||
for (int i = 0; i < (key.length & ~1); i=i+2) {
|
||||
map.put(key[i],key[i+1]);
|
||||
for (int i = 0; i < (key.length & ~1); i = i + 2) {
|
||||
map.put(key[i], key[i + 1]);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@ public class DynamicLogAppender {
|
||||
//设置日志记录器的滚动策略
|
||||
TimeBasedRollingPolicy policy = new TimeBasedRollingPolicy();
|
||||
policy.setFileNamePattern(oldLogPath+dynamicName+".%d{yyyy-MM-dd}.log");
|
||||
policy.setParent(appender); //设置父节点是appender
|
||||
//设置父节点是appender
|
||||
policy.setParent(appender);
|
||||
policy.setContext(context);
|
||||
policy.start();
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DynamicLogger {
|
||||
String logPath;//日志存储路径
|
||||
//日志存储路径
|
||||
String logPath;
|
||||
public DynamicLogger(String logPath) {
|
||||
this.logPath = logPath;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ public class LogMessageConstant {
|
||||
/** 背景颜色:黄色 */
|
||||
public final static String BACKGROUND_YELLOW = "\u001B[43m";
|
||||
/** 索引路径 */
|
||||
public final static String INDEX_DIR = "E:\\lucene\\index";
|
||||
public final static String INDEX_DIR = "D:\\lucene\\index";
|
||||
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ public class Searcher {
|
||||
//标准分词器,会自动去掉空格啊,is a the等单词
|
||||
Analyzer analyzer = new IKAnalyzer(true);
|
||||
|
||||
//记录索引开始时间
|
||||
// long startTime = System.currentTimeMillis();
|
||||
// 实际上Lucene本身不支持分页。因此我们需要自己进行逻辑分页。我们要准备分页参数:
|
||||
int pageSize = Integer.parseInt(whereJson.get("size").toString());// 每页条数
|
||||
int pageNum = Integer.parseInt(whereJson.get("page").toString()) - 1;// 当前页码
|
||||
@@ -90,13 +88,11 @@ public class Searcher {
|
||||
booleanQueryBuilder.add(termQuery, BooleanClause.Occur.MUST);
|
||||
}
|
||||
docs = searcher.search(booleanQueryBuilder.build(), end,sort);
|
||||
//记录索引时间
|
||||
// long endTime = System.currentTimeMillis();
|
||||
// log.info("匹配{}共耗时{}毫秒",booleanQueryBuilder.build(),(endTime-startTime));
|
||||
// log.info("查询到{}条日志文件", docs.totalHits.value);
|
||||
List<String> list = new ArrayList<>();
|
||||
ScoreDoc[] scoreDocs = docs.scoreDocs;
|
||||
if (end > docs.totalHits.value) end = (int) docs.totalHits.value;
|
||||
if (end > docs.totalHits.value) {
|
||||
end = (int) docs.totalHits.value;
|
||||
}
|
||||
|
||||
for (int i = start; i < end; i++) {
|
||||
ScoreDoc scoreDoc = scoreDocs[i];
|
||||
@@ -112,7 +108,6 @@ public class Searcher {
|
||||
LogMessageConstant.COLOR_MAGENTA + doc.get(LogMessageConstant.FIELD_CLASS_NAME) +
|
||||
LogMessageConstant.COLOR_RESET + " - " +
|
||||
LogMessageConstant.COLOR_BLACK + highlightKeyword(doc.get(LogMessageConstant.FIELD_MESSAGE), whereJson.getString("message"));
|
||||
// System.out.println(logInfo);
|
||||
list.add(logInfo);
|
||||
}
|
||||
reader.close();
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package org.nl.config.lucene;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 路径配置类
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
public class UrlConfig {
|
||||
public static String luceneUrl;
|
||||
|
||||
|
||||
@@ -3,15 +3,20 @@ package org.nl.config.mybatis;
|
||||
import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
|
||||
import com.baomidou.mybatisplus.generator.AutoGenerator;
|
||||
import com.baomidou.mybatisplus.generator.InjectionConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.*;
|
||||
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
|
||||
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.PackageConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 代码生成
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
public class CodeGenerator {
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,11 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: Mybatis-plus配置
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@EnableTransactionManagement
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
@@ -14,6 +14,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 日志检索
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "日志检索")
|
||||
@@ -24,8 +29,6 @@ public class LuceneController {
|
||||
private final LuceneService luceneService;
|
||||
|
||||
@PostMapping("/getAll")
|
||||
@ApiOperation("日志检索")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public ResponseEntity<Object> get(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(luceneService.getAll(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.nl.common.security.config.bean.LoginProperties;
|
||||
import org.nl.system.service.secutiry.impl.OnlineUserService;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -85,8 +86,8 @@ public class AuthorizationController {
|
||||
String uuid = IdUtil.simpleUUID();
|
||||
//当验证码类型为 arithmetic时且长度 >= 2 时,captcha.text()的结果有几率为浮点型
|
||||
String captchaValue = captcha.text();
|
||||
if (captcha.getCharType() - 1 == LoginCodeEnum.arithmetic.ordinal() && captchaValue.contains(".")) {
|
||||
captchaValue = captchaValue.split("\\.")[0];
|
||||
if (captcha.getCharType() - 1 == LoginCodeEnum.arithmetic.ordinal() && captchaValue.contains(GeneralDefinition.DOT)) {
|
||||
captchaValue = captchaValue.split(GeneralDefinition.ESCAPE_DOT)[0];
|
||||
}
|
||||
// 保存
|
||||
redisUtils.set(uuid, captchaValue, loginProperties.getLoginCode().getExpiration(), TimeUnit.MINUTES);
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.nl.system.service.role.ISysRoleService;
|
||||
import org.nl.system.service.secutiry.dto.AuthUserDto;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -52,9 +53,11 @@ public class MobileAuthorizationController {
|
||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
||||
// 校验数据库
|
||||
// 根据用户名查询,在比对密码
|
||||
// 拿到多个已经抛出异常
|
||||
SysUser userInfo = userService.getOne(new LambdaQueryWrapper<SysUser>()
|
||||
.eq(SysUser::getUsername, authUser.getUsername())); // 拿到多个已经抛出异常
|
||||
if (ObjectUtil.isEmpty(userInfo) || !userInfo.getPassword().equals(SaSecureUtil.md5BySalt(password, "salt"))) { // 这里需要密码加密
|
||||
.eq(SysUser::getUsername, authUser.getUsername()));
|
||||
// 这里需要密码加密
|
||||
if (ObjectUtil.isEmpty(userInfo) || !userInfo.getPassword().equals(SaSecureUtil.md5BySalt(password, GeneralDefinition.SALT))) {
|
||||
throw new BadRequestException("账号或密码错误!");
|
||||
}
|
||||
// 获取权限列表 - 登录查找权限
|
||||
@@ -74,13 +77,14 @@ public class MobileAuthorizationController {
|
||||
|
||||
// SaLoginModel 配置登录相关参数
|
||||
StpUtil.login(userInfo.getUser_id(), new SaLoginModel()
|
||||
.setDevice("PE") // 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setExtra("loginInfo", user) // Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
// 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setDevice("PE")
|
||||
// Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
.setExtra("loginInfo", user)
|
||||
);
|
||||
|
||||
// 返回 token 与 用户信息
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("roles", permissionList);
|
||||
jsonObject.put("user", userInfo);
|
||||
JSONObject authInfo = new JSONObject(2) {{
|
||||
put("token", "Bearer " + StpUtil.getTokenValue());
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
import org.nl.system.service.user.dto.UserQuery;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -108,13 +109,13 @@ public class UserController {
|
||||
String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("oldPass"));
|
||||
String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("newPass"));
|
||||
SysUser user = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, SecurityUtils.getCurrentUsername()));
|
||||
if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(oldPass, "salt"))) {
|
||||
if (!SaSecureUtil.md5BySalt(user.getPassword(), GeneralDefinition.SALT).equals(SaSecureUtil.md5BySalt(oldPass, GeneralDefinition.SALT))) {
|
||||
throw new BadRequestException("修改失败,旧密码错误");
|
||||
}
|
||||
if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(newPass, "salt"))) {
|
||||
if (!SaSecureUtil.md5BySalt(user.getPassword(), GeneralDefinition.SALT).equals(SaSecureUtil.md5BySalt(newPass, GeneralDefinition.SALT))) {
|
||||
throw new BadRequestException("新密码不能与旧密码相同");
|
||||
}
|
||||
user.setPassword(SaSecureUtil.md5BySalt(newPass, "salt"));
|
||||
user.setPassword(SaSecureUtil.md5BySalt(newPass, GeneralDefinition.SALT));
|
||||
userService.updateById(user);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@@ -131,16 +132,11 @@ public class UserController {
|
||||
public ResponseEntity<Object> updateEmail(@PathVariable String code,@RequestBody SysUser user) throws Exception {
|
||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,user.getPassword());
|
||||
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username",SecurityUtils.getCurrentUsername()));
|
||||
if(!SaSecureUtil.md5BySalt(userInfo.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(password, "salt"))){
|
||||
if(!SaSecureUtil.md5BySalt(userInfo.getPassword(), GeneralDefinition.SALT).equals(SaSecureUtil.md5BySalt(password, GeneralDefinition.SALT))){
|
||||
throw new BadRequestException("密码错误");
|
||||
}
|
||||
userService.update(new UpdateWrapper<SysUser>().set(userInfo.getUsername(),user.getEmail()));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果当前用户的角色级别低于创建用户的角色级别,则抛出权限不足的错误
|
||||
* @param resources /
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,18 @@ import java.util.Map;
|
||||
*/
|
||||
public interface ISysCodeRuleDetailService extends IService<SysCodeRuleDetail> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param form
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
IPage<SysCodeRuleDetail> queryAll(CodeRuleDetailQuery form, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param codeRuleDetail
|
||||
*/
|
||||
void create(SysCodeRuleDetail codeRuleDetail);
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
@Transactional(propagation=Propagation.REQUIRES_NEW)
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
||||
public String codeDemo(Map form) {
|
||||
String code = (String) form.get("code");
|
||||
String id = codeRuleMapper.selectOne(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, code)).getId();
|
||||
@@ -88,7 +88,7 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
if (!nowDate.equals(currentValue)) {
|
||||
isSame = false;
|
||||
}
|
||||
if (flag.equals("1")) {
|
||||
if ("1".equals(flag)) {
|
||||
detail.setInit_value(nowDate);
|
||||
detail.setCurrent_value(nowDate);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
value += fillchar;
|
||||
}
|
||||
value += numValue;
|
||||
if (flag.equals("1")) {
|
||||
if ("1".equals(flag)) {
|
||||
if (!isSame) {
|
||||
int initValue = Integer.parseInt(detail.getInit_value());
|
||||
if (StrUtil.isEmpty((initValue + ""))) {
|
||||
@@ -130,7 +130,7 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
}
|
||||
}
|
||||
demo += value;
|
||||
if (flag.equals("1")) {
|
||||
if ("1".equals(flag)) {
|
||||
codeRuleDetailMapper.updateById(detail);
|
||||
}
|
||||
log.info("更新成功:更新数据{}", detail);
|
||||
@@ -145,7 +145,9 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
List<SysCodeRule> sysCodeRules = codeRuleMapper.selectList(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, codeRule.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(sysCodeRules)) throw new BadRequestException("编号[" + sysCodeRules.get(0).getCode() + "]已存在");
|
||||
if (ObjectUtil.isNotEmpty(sysCodeRules)) {
|
||||
throw new BadRequestException("编号[" + sysCodeRules.get(0).getCode() + "]已存在");
|
||||
}
|
||||
codeRule.setId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
codeRule.setCreate_id(currentUserId);
|
||||
codeRule.setCreate_name(currentUsername);
|
||||
@@ -170,7 +172,9 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
List<SysCodeRule> sysCodeRules = codeRuleMapper.selectList(new LambdaQueryWrapper<SysCodeRule>()
|
||||
.eq(SysCodeRule::getCode, codeRule.getCode())
|
||||
.ne(SysCodeRule::getId, codeRule.getId()));
|
||||
if (ObjectUtil.isNotEmpty(sysCodeRules)) throw new BadRequestException("该编码code已存在,请校验!");
|
||||
if (ObjectUtil.isNotEmpty(sysCodeRules)) {
|
||||
throw new BadRequestException("该编码code已存在,请校验!");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
|
||||
@@ -11,6 +11,9 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CodeRuleTypeEnum {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
FIXED("01", "固定"),
|
||||
DATE("02", "日期"),
|
||||
ORDER("03", "顺序");
|
||||
|
||||
@@ -49,6 +49,11 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param deptIds
|
||||
*/
|
||||
void saveUserDeptRelation(String UserId, Collection<String> deptIds);
|
||||
|
||||
/**
|
||||
* 删除用户部门关系数据
|
||||
* @param user
|
||||
*/
|
||||
void delUserDeptRelation(String user);
|
||||
|
||||
/**
|
||||
@@ -63,8 +68,17 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
*/
|
||||
void delateDept(Set<String> deptIds);
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
* @param dept
|
||||
*/
|
||||
void createDept(SysDept dept);
|
||||
|
||||
/**
|
||||
* 获取部门数组
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<SysDept> getUserDeptByUserId(String userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
|
||||
import org.nl.system.service.dict.dto.DictQuery;
|
||||
import org.nl.wms.sch.task_manage.enums.FieldConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -39,14 +40,16 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
@Override
|
||||
public IPage<Dict> queryAll(Map whereJson, PageQuery page) {
|
||||
String blurry = null;
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get("blurry"))) blurry = whereJson.get("blurry").toString();
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get(FieldConstant.BLURRY))) {
|
||||
blurry = whereJson.get("blurry").toString();
|
||||
}
|
||||
IPage<Dict> pages = this.page(new Page<>(page.getPage() + 1, page.getSize()), new QueryWrapper<Dict>()
|
||||
.select("MAX(dict_id) AS dict_id, code, name")
|
||||
.lambda()
|
||||
.like(ObjectUtil.isNotEmpty(blurry), Dict::getCode, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry))
|
||||
.like(ObjectUtil.isNotEmpty(blurry), Dict::getName, blurry)
|
||||
.orderBy(true, true, Dict::getCode)
|
||||
.orderBy(true, true, Dict::getCode)
|
||||
.groupBy(Dict::getCode, Dict::getName));
|
||||
return pages;
|
||||
}
|
||||
@@ -59,7 +62,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
String date = DateUtil.now();
|
||||
List<Dict> oldDict = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>()
|
||||
.eq(ObjectUtil.isNotEmpty(dict.getCode()), Dict::getCode, dict.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(oldDict)) throw new BadRequestException("字典[" + dict.getCode() + "]已存在");
|
||||
if (ObjectUtil.isNotEmpty(oldDict)) {
|
||||
throw new BadRequestException("字典[" + dict.getCode() + "]已存在");
|
||||
}
|
||||
dict.setDict_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
dict.setCreate_id(currentUserId);
|
||||
dict.setCreate_name(nickName);
|
||||
@@ -78,8 +83,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
throw new BadRequestException("字典不存在");
|
||||
}
|
||||
List<Dict> dictList = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>().eq(Dict::getCode, dto.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(dictList) && !dto.getCode().equals(dict.getCode()))
|
||||
if (ObjectUtil.isNotEmpty(dictList) && !dto.getCode().equals(dict.getCode())) {
|
||||
throw new BadRequestException("字典[" + dto.getCode() + "]已存在");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentNickName = SecurityUtils.getCurrentNickName();
|
||||
// 根据code获取所有字典
|
||||
@@ -130,7 +136,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
// 校验是否已经有标签
|
||||
Dict one = sysDictMapper.selectOne(new LambdaQueryWrapper<Dict>().eq(Dict::getLabel, dict.getLabel())
|
||||
.eq(Dict::getCode, dict.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("标签[" + dict.getLabel() + "]已存在");
|
||||
if (ObjectUtil.isNotEmpty(one)) {
|
||||
throw new BadRequestException("标签[" + dict.getLabel() + "]已存在");
|
||||
}
|
||||
// 判断是否有空的值
|
||||
List<Dict> selectOne = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>().eq(Dict::getCode, dict.getCode()));
|
||||
Dict dic = selectOne.get(0);
|
||||
|
||||
@@ -26,6 +26,8 @@ public interface ICodeGeneratorService extends IService<CodeColumnConfig> {
|
||||
|
||||
/**
|
||||
* 获得所有的表格信息
|
||||
* @param name
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
IPage<TablesInfo> getTables(String name, PageQuery pageQuery);
|
||||
@@ -52,6 +54,12 @@ public interface ICodeGeneratorService extends IService<CodeColumnConfig> {
|
||||
@Async
|
||||
void sync(IPage<CodeColumnConfig> columnInfos, List<CodeColumnConfig> columnInfoList);
|
||||
|
||||
/**
|
||||
* 预览代码
|
||||
* @param byTableName
|
||||
* @param columns
|
||||
* @return
|
||||
*/
|
||||
ResponseEntity<Object> preview(CodeGenConfig byTableName, IPage<CodeColumnConfig> columns);
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,7 +73,12 @@ public class CodeColumnConfig implements Serializable {
|
||||
@ApiModelProperty(value = "日期注解")
|
||||
private String date_annotation;
|
||||
|
||||
// 创建默认的实体
|
||||
/**
|
||||
* 创建默认的实体
|
||||
* @param tableName
|
||||
* @param config
|
||||
* @return
|
||||
*/
|
||||
public static CodeColumnConfig createDefault(String tableName, ColumnInfo config) {
|
||||
CodeColumnConfig columnConfig = new CodeColumnConfig();
|
||||
columnConfig.setColumn_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
|
||||
@@ -61,7 +61,9 @@ public class StageImageServiceImpl extends ServiceImpl<StageImageMapper, StageIm
|
||||
public void update(StageImage entity) {
|
||||
StageImage dto = stageImageMapper.selectOne(new LambdaQueryWrapper<StageImage>()
|
||||
.eq(StageImage::getImage_uuid, entity.getImage_uuid()));
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
|
||||
@@ -65,7 +65,9 @@ public class StageServiceImpl extends ServiceImpl<StageMapper, Stage> implements
|
||||
@Override
|
||||
public void update(Stage dto) {
|
||||
Stage entity = stageMapper.selectOne(new LambdaQueryWrapper<Stage>().eq(Stage::getStage_uuid, dto.getStage_uuid()));
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
|
||||
@@ -23,8 +23,8 @@ public interface LuceneExecuteLogService {
|
||||
|
||||
/**
|
||||
* 接口日志,会保留历史记录
|
||||
*
|
||||
* @param luceneLogDto 日志结果对象
|
||||
* @param luceneLogDto
|
||||
* @throws IOException 日志结果对象
|
||||
*/
|
||||
void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException;
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package org.nl.system.service.lucene;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
public interface LuceneService {
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,7 +64,6 @@ public class LuceneExecuteLogServiceImpl implements LuceneExecuteLogService {
|
||||
//向document对象中添加域。
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getDevice_code())) {
|
||||
document.add(new StringField("device_code", luceneLogDto.getDevice_code(), Field.Store.YES));
|
||||
// document.add(new TextField("device_code", luceneLogDto.getDevice_code(), Field.Store.YES));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getContent())) {
|
||||
document.add(new StringField("fieldContent", luceneLogDto.getContent(), Field.Store.YES));
|
||||
@@ -90,7 +89,6 @@ public class LuceneExecuteLogServiceImpl implements LuceneExecuteLogService {
|
||||
//实现日志文件按业务独立生成日志文件到指定路径
|
||||
DynamicLogger loggerBuilder =new DynamicLogger(logPath+"\\"+luceneLogDto.getLogType()+"\\");
|
||||
Logger logger = loggerBuilder.getLogger(luceneLogDto.getDevice_code());
|
||||
// logger.info("设备{}建立索引共耗时{}毫秒",luceneLogDto.getDevice_code(),endTime-startTime);
|
||||
logger.info("{}",luceneLogDto.toString());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
@@ -98,7 +98,11 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
*/
|
||||
void update(SysMenu menu);
|
||||
|
||||
|
||||
/**
|
||||
* 获取菜单数据
|
||||
* @param userId 用户列表
|
||||
* @return
|
||||
*/
|
||||
List<MenuDto> findByUser(String userId);
|
||||
|
||||
/**
|
||||
@@ -108,8 +112,20 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @return /
|
||||
*/
|
||||
List<MenuVo> buildMenus(List<MenuDto> menuDtos);
|
||||
|
||||
/**
|
||||
* 构建菜单
|
||||
* @param menuDtos
|
||||
* @param pid
|
||||
* @return
|
||||
*/
|
||||
List<MenuVo> buildMenus(List<MenuDto> menuDtos,String pid);
|
||||
|
||||
/**
|
||||
* 构建菜单
|
||||
* @param systemType
|
||||
* @return
|
||||
*/
|
||||
List<MenuVo> buildMenus(String systemType);
|
||||
|
||||
/**
|
||||
@@ -134,6 +150,13 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
*/
|
||||
MenuDto doToDto(SysMenu sysMenu);
|
||||
|
||||
/**
|
||||
* 获取菜单
|
||||
* @param roleId 角色标识
|
||||
* @param systemType 系统类型
|
||||
* @param category 目录
|
||||
* @return
|
||||
*/
|
||||
List<Map> getMenusByRole(String roleId, String systemType, String category);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,11 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 菜单
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class MenuDto extends BaseDTO implements Serializable {
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
}
|
||||
}
|
||||
resources.setMenu_id(IdUtil.getStringId());
|
||||
if (resources.getPid().equals("0")) {
|
||||
if ("0".equals(resources.getPid())) {
|
||||
resources.setPid(null);
|
||||
addSystemTypeDict(resources);
|
||||
}
|
||||
@@ -202,7 +202,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
}
|
||||
}
|
||||
|
||||
if (resources.getPid().equals("0")) {
|
||||
if ("0".equals(resources.getPid())) {
|
||||
resources.setPid(null);
|
||||
if (StringUtils.isNotEmpty(menu.getPid())){
|
||||
addSystemTypeDict(resources);
|
||||
@@ -248,7 +248,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
if (menuId != null) {
|
||||
int count = baseMapper.findByPid(menuId).size();
|
||||
SysMenu sysMenu = baseMapper.selectById(menuId);
|
||||
if (ObjectUtil.isEmpty(sysMenu)) return;
|
||||
if (ObjectUtil.isEmpty(sysMenu)) {
|
||||
return;
|
||||
}
|
||||
sysMenu.setSub_count(count);
|
||||
baseMapper.updateById(sysMenu);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
||||
|
||||
/**
|
||||
* 获取未读的接收消息条数
|
||||
* @return
|
||||
*/
|
||||
Integer countByReceiveNotRead();
|
||||
|
||||
|
||||
@@ -87,7 +87,9 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
||||
@Override
|
||||
public void update(SysNotice entity) {
|
||||
SysNotice dto = sysNoticeMapper.selectById(entity.getNotice_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
sysNoticeMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@@ -183,7 +185,7 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
||||
res.put("data", "notice_message_update");
|
||||
SocketMsg messageInfo = new SocketMsg(res, MsgType.INFO);
|
||||
try {
|
||||
webSocketServer.sendInfo(messageInfo, "messageInfo");
|
||||
WebSocketServer.sendInfo(messageInfo, "messageInfo");
|
||||
} catch (IOException e) {
|
||||
throw new BadRequestException("消息发送失败");
|
||||
}
|
||||
|
||||
@@ -49,7 +49,9 @@ public class SysParamServiceImpl extends ServiceImpl<SysParamMapper, Param> impl
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Param param) {
|
||||
List code = paramMapper.selectByMap(MapOf.of("code", param.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(code)) throw new BadRequestException("编码不能一致");
|
||||
if (ObjectUtil.isNotEmpty(code)) {
|
||||
throw new BadRequestException("编码不能一致");
|
||||
}
|
||||
param.setId(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -12,8 +12,17 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum DataScopeEnum {
|
||||
|
||||
/**
|
||||
* 用户数据权限
|
||||
*/
|
||||
USER("user", "用户数据权限"),
|
||||
/**
|
||||
* 部门数据权限
|
||||
*/
|
||||
DEPT("dept", "部门数据权限"),
|
||||
/**
|
||||
* 自身数据权限
|
||||
*/
|
||||
SELF("self", "自身数据权限");
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
@@ -55,7 +55,9 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(SysDataPermission permission) {
|
||||
SysDataPermission sysDataPermission = dataPermissionMapper.selectOne(new LambdaQueryWrapper<SysDataPermission>().eq(SysDataPermission::getCode, permission.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(sysDataPermission)) throw new BadRequestException("编码为[" + permission.getCode() + "]的数据权限已存在");
|
||||
if (ObjectUtil.isNotEmpty(sysDataPermission)) {
|
||||
throw new BadRequestException("编码为[" + permission.getCode() + "]的数据权限已存在");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
@@ -74,7 +76,9 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(SysDataPermission permission) {
|
||||
SysDataPermission dataPermission = dataPermissionMapper.selectById(permission.getPermission_id());
|
||||
if (ObjectUtil.isEmpty(dataPermission)) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (ObjectUtil.isEmpty(dataPermission)) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
permission.setUpdate_time(DateUtil.now());
|
||||
permission.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
permission.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
@@ -86,7 +90,9 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
public void deleteAll(Set<String> ids) {
|
||||
ids.forEach(id -> {
|
||||
List<UserDataPermissionDto> permissions = userService.getUserDataPermissionByPermissionId(id);
|
||||
if (ObjectUtil.isNotEmpty(permissions)) throw new BadRequestException("存在相关联的数据权限,请解除关联后删除");
|
||||
if (ObjectUtil.isNotEmpty(permissions)) {
|
||||
throw new BadRequestException("存在相关联的数据权限,请解除关联后删除");
|
||||
}
|
||||
dataPermissionMapper.deleteById(id);
|
||||
});
|
||||
}
|
||||
@@ -108,13 +114,19 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
SysDataPermission sysDataPermission = dataPermissionMapper.selectOne(new LambdaQueryWrapper<SysDataPermission>().eq(SysDataPermission::getPermission_id, userDataPermissionDto.getPermission_id()));
|
||||
if (sysDataPermission.getCode().equals(DataScopeEnum.USER.getCode())) { // 用户权限
|
||||
List<String> userIds = dataPermissionMapper.findDataScopeUserIdBySelfUserIdAndScopeType(userId, userDataPermissionDto.getPermission_scope_type());
|
||||
if (ObjectUtil.isNotEmpty(userIds)) userDataPermissionDto.setUsers(userIds);
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
userDataPermissionDto.setUsers(userIds);
|
||||
}
|
||||
} else if (sysDataPermission.getCode().equals(DataScopeEnum.DEPT.getCode())) { // 部门权限
|
||||
List<String> deptIds = dataPermissionMapper.findDataScopeDeptIdBySelfUserIdAndScopeType(userId, userDataPermissionDto.getPermission_scope_type());
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) userDataPermissionDto.setDepts(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
userDataPermissionDto.setDepts(deptIds);
|
||||
}
|
||||
} else if (sysDataPermission.getCode().equals(DataScopeEnum.SELF.getCode())) { // 自身
|
||||
List<String> userIds = dataPermissionMapper.findDataScopeUserIdBySelfUserIdAndScopeType(userId, userDataPermissionDto.getPermission_scope_type());
|
||||
if (ObjectUtil.isNotEmpty(userIds)) userDataPermissionDto.setUsers(userIds);
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
userDataPermissionDto.setUsers(userIds);
|
||||
}
|
||||
}
|
||||
// 其他不做处理
|
||||
});
|
||||
@@ -126,7 +138,9 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
public void savePermission(JSONObject datas) {
|
||||
String user_id = datas.getString("user_id");
|
||||
JSONArray data = datas.getJSONArray("datas");
|
||||
if (ObjectUtil.isEmpty(user_id)) throw new BadRequestException("用户不能为空");
|
||||
if (ObjectUtil.isEmpty(user_id)) {
|
||||
throw new BadRequestException("用户不能为空");
|
||||
}
|
||||
// 删除用户绑定的数据
|
||||
userService.deleteDataPermissionById(user_id);
|
||||
dataPermissionMapper.deleteScopeBySelfUserId(user_id);
|
||||
|
||||
@@ -67,6 +67,11 @@ public interface ISysQuartzJobService extends IService<SysQuartzJob> {
|
||||
*/
|
||||
void deleteJob(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 执行子任务
|
||||
* @param tasks
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
void executionSubJob(String[] tasks) throws InterruptedException;
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,11 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: job运行
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(100)
|
||||
|
||||
@@ -22,7 +22,6 @@ public class AutoClearInteractionData {
|
||||
public void run(){
|
||||
Param max_rows_to_keep = paramService.findByCode("max_rows_to_keep");
|
||||
Param max_rows_to_delete = paramService.findByCode("max_rows_to_delete");
|
||||
// recordService.deleteByDay(interactionDay.getValue());
|
||||
recordService.deleteByRows(max_rows_to_keep, max_rows_to_delete);
|
||||
log.info("run 执行成功");
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ public class AutoClearLuceneData {
|
||||
// 获取时间戳
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
|
||||
Date date = dateFormat.parse(String.valueOf(sevenDaysAgo));
|
||||
long unixTimestamp = date.getTime(); // 获取Unix时间戳
|
||||
// 获取Unix时间戳
|
||||
long unixTimestamp = date.getTime();
|
||||
Query query = LongPoint.newRangeQuery("time", 0L, unixTimestamp);
|
||||
writer.deleteDocuments(query);
|
||||
writer.commit();
|
||||
|
||||
@@ -19,12 +19,33 @@ public class RedisKeyDefine {
|
||||
@AllArgsConstructor
|
||||
public enum KeyTypeEnum {
|
||||
|
||||
/**
|
||||
* String
|
||||
*/
|
||||
STRING("String"),
|
||||
/**
|
||||
* List
|
||||
*/
|
||||
LIST("List"),
|
||||
/**
|
||||
* Hash
|
||||
*/
|
||||
HASH("Hash"),
|
||||
/**
|
||||
* Set
|
||||
*/
|
||||
SET("Set"),
|
||||
/**
|
||||
* Sorted Set
|
||||
*/
|
||||
ZSET("Sorted Set"),
|
||||
/**
|
||||
* Stream
|
||||
*/
|
||||
STREAM("Stream"),
|
||||
/**
|
||||
* Pub/Sub
|
||||
*/
|
||||
PUBSUB("Pub/Sub");
|
||||
|
||||
/**
|
||||
@@ -39,9 +60,18 @@ public class RedisKeyDefine {
|
||||
@AllArgsConstructor
|
||||
public enum TimeoutTypeEnum {
|
||||
|
||||
FOREVER(1), // 永不超时
|
||||
DYNAMIC(2), // 动态超时
|
||||
FIXED(3); // 固定超时
|
||||
/**
|
||||
* 永不超时
|
||||
*/
|
||||
FOREVER(1),
|
||||
/**
|
||||
* 动态超时
|
||||
*/
|
||||
DYNAMIC(2),
|
||||
/**
|
||||
* 固定超时
|
||||
*/
|
||||
FIXED(3);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@@ -61,7 +91,6 @@ public class RedisKeyDefine {
|
||||
private final KeyTypeEnum keyType;
|
||||
/**
|
||||
* Value 类型
|
||||
*
|
||||
* 如果是使用分布式锁,设置为 {@link java.util.concurrent.locks.Lock} 类型
|
||||
*/
|
||||
private final Class<?> valueType;
|
||||
|
||||
@@ -12,17 +12,17 @@ public class RedisKeyRegistry {
|
||||
/**
|
||||
* Redis RedisKeyDefine 数组
|
||||
*/
|
||||
private static final List<RedisKeyDefine> defines = new ArrayList<>();
|
||||
private static final List<RedisKeyDefine> DEFINES = new ArrayList<>();
|
||||
|
||||
public static void add(RedisKeyDefine define) {
|
||||
defines.add(define);
|
||||
DEFINES.add(define);
|
||||
}
|
||||
|
||||
public static List<RedisKeyDefine> list() {
|
||||
return defines;
|
||||
return DEFINES;
|
||||
}
|
||||
|
||||
public static int size() {
|
||||
return defines.size();
|
||||
return DEFINES.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,12 @@ import java.util.Set;
|
||||
*/
|
||||
public interface ISysRoleService extends IService<SysRole> {
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param param
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<SysRole> query(Map param, PageQuery page);
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.nl.system.service.menu.dao.mapper.SysMenuMapper;
|
||||
import org.nl.system.service.role.ISysRoleService;
|
||||
import org.nl.system.service.role.dao.SysRole;
|
||||
import org.nl.system.service.role.dao.mapper.SysRoleMapper;
|
||||
import org.nl.wms.sch.task_manage.enums.FieldConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -44,7 +45,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
@Override
|
||||
public IPage<SysRole> query(Map param, PageQuery page) {
|
||||
String blurry = null;
|
||||
if (ObjectUtil.isNotEmpty(param.get("blurry"))) blurry = param.get("blurry").toString();
|
||||
if (ObjectUtil.isNotEmpty(param.get(FieldConstant.BLURRY))) {
|
||||
blurry = param.get("blurry").toString();
|
||||
}
|
||||
LambdaQueryWrapper<SysRole> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(ObjectUtil.isNotEmpty(blurry), SysRole::getName, blurry);
|
||||
IPage<SysRole> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
@@ -59,12 +62,16 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
public void create(JSONObject param) {
|
||||
//判断角色名字是否存在
|
||||
String name = param.getString("name");
|
||||
if (StrUtil.isEmpty(name)) throw new BadRequestException("角色名字不能为空!");
|
||||
if (StrUtil.isEmpty(name)) {
|
||||
throw new BadRequestException("角色名字不能为空!");
|
||||
}
|
||||
SysRole sysRole = JSONObject.parseObject(JSONObject.toJSONString(param), SysRole.class);
|
||||
|
||||
//判断角色名字是否存在
|
||||
SysRole role = roleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getName, sysRole.getName()));
|
||||
if (ObjectUtil.isNotEmpty(role)) throw new BadRequestException("角色【" + name + "】已存在!");
|
||||
if (ObjectUtil.isNotEmpty(role)) {
|
||||
throw new BadRequestException("角色【" + name + "】已存在!");
|
||||
}
|
||||
|
||||
String userId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
@@ -86,12 +93,16 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
SysRole sysRole = JSONObject.parseObject(JSONObject.toJSONString(param), SysRole.class);
|
||||
//判断角色名字是否存在
|
||||
String name = sysRole.getName();
|
||||
if (StrUtil.isEmpty(name)) throw new BadRequestException("角色名字不能为空!");
|
||||
if (StrUtil.isEmpty(name)) {
|
||||
throw new BadRequestException("角色名字不能为空!");
|
||||
}
|
||||
|
||||
//判断角色名字是否存在
|
||||
SysRole role = roleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getName, sysRole.getName())
|
||||
.ne(SysRole::getRole_id, sysRole.getRole_id()));
|
||||
if (ObjectUtil.isNotEmpty(role)) throw new BadRequestException("角色【" + name + "】已存在!");
|
||||
if (ObjectUtil.isNotEmpty(role)) {
|
||||
throw new BadRequestException("角色【" + name + "】已存在!");
|
||||
}
|
||||
String userId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.nl.system.service.secutiry.dto.AuthUserDto;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
import org.nl.system.service.user.dto.OnlineUserDto;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@@ -248,7 +249,8 @@ public class OnlineUserService {
|
||||
// 校验数据库
|
||||
// 根据用户名查询,在比对密码
|
||||
SysUser userInfo = sysUserService.getOne(new QueryWrapper<SysUser>().eq("username",authUser.getUsername()));
|
||||
if (userInfo == null||!userInfo.getPassword().equals(SaSecureUtil.md5BySalt(password, "salt"))) { // 这里需要密码加密
|
||||
// 这里需要密码加密
|
||||
if (userInfo == null||!userInfo.getPassword().equals(SaSecureUtil.md5BySalt(password, GeneralDefinition.SALT))) {
|
||||
throw new BadRequestException("账号或密码错误");
|
||||
}
|
||||
|
||||
@@ -270,8 +272,10 @@ public class OnlineUserService {
|
||||
|
||||
// SaLoginModel 配置登录相关参数
|
||||
StpUtil.login(userInfo.getUser_id(), new SaLoginModel()
|
||||
.setDevice("PC") // 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setExtra("loginInfo", user) // Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
// 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setDevice("PC")
|
||||
// Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
.setExtra("loginInfo", user)
|
||||
);
|
||||
|
||||
// 返回 token 与 用户信息
|
||||
|
||||
@@ -20,6 +20,12 @@ import java.util.Set;
|
||||
*/
|
||||
public interface IToolLocalStorageService extends IService<ToolLocalStorage> {
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
IPage<ToolLocalStorage> queryAll(ToolLocalStorageQuery criteria, PageQuery pageable);
|
||||
|
||||
/**
|
||||
|
||||
@@ -85,7 +85,9 @@ public class ToolLocalStorageServiceImpl extends ServiceImpl<ToolLocalStorageMap
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ToolLocalStorage resources) {
|
||||
ToolLocalStorage storage = localStorageMapper.selectById(resources.getStorage_id());
|
||||
if (ObjectUtil.isEmpty(storage)) throw new BadRequestException("文件信息不存在");
|
||||
if (ObjectUtil.isEmpty(storage)) {
|
||||
throw new BadRequestException("文件信息不存在");
|
||||
}
|
||||
resources.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
resources.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
resources.setUpdate_time(DateUtil.now());
|
||||
|
||||
@@ -21,20 +21,63 @@ import java.util.Map;
|
||||
*/
|
||||
public interface ISysUserService extends IService<SysUser> {
|
||||
|
||||
/**
|
||||
* 更新用户头像
|
||||
* @param avatar
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> updateAvatar(MultipartFile avatar);
|
||||
|
||||
/**
|
||||
* 获取用户详情
|
||||
* @param query
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
List<SysUserDetail> getUserDetail(UserQuery query, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param userDetail
|
||||
*/
|
||||
void create(Map userDetail);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param userDetail
|
||||
*/
|
||||
void update(Map userDetail);
|
||||
|
||||
/**
|
||||
* 获取权限
|
||||
* @param permissionId
|
||||
* @return
|
||||
*/
|
||||
List<UserDataPermissionDto> getUserDataPermissionByPermissionId(String permissionId);
|
||||
|
||||
/**
|
||||
* 通过用户Id获取用户数据权限
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<UserDataPermissionDto> getUserDataPermissionByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 删除用户权限
|
||||
* @param userId
|
||||
*/
|
||||
void deleteDataPermissionById(String userId);
|
||||
|
||||
/**
|
||||
* 插入数据权限
|
||||
* @param userDataPermissionDto
|
||||
*/
|
||||
void insertDataPermission(UserDataPermissionDto userDataPermissionDto);
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
List<String> getUserIdByDeptId(String deptId);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.nl.system.service.user.dto.SysUserDetail;
|
||||
import org.nl.system.service.user.dto.UserDataPermissionDto;
|
||||
import org.nl.system.service.user.dto.UserQuery;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.enums.FieldConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -81,25 +83,25 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
|
||||
BeanUtils.populate(sysUser,userDetail);
|
||||
// 默认密码 123456
|
||||
if (ObjectUtil.isEmpty(sysUser.getPassword())) {
|
||||
sysUser.setPassword(SaSecureUtil.md5BySalt("123456", "salt"));
|
||||
sysUser.setPassword(SaSecureUtil.md5BySalt(GeneralDefinition.DEFAULT_PASSWORD, GeneralDefinition.SALT));
|
||||
} else {
|
||||
sysUser.setPassword(SaSecureUtil.md5BySalt(sysUser.getPassword(), "salt"));
|
||||
sysUser.setPassword(SaSecureUtil.md5BySalt(sysUser.getPassword(), GeneralDefinition.SALT));
|
||||
}
|
||||
String userId = IdUtil.getStringId();
|
||||
sysUser.setUser_id(userId);
|
||||
this.save(sysUser);
|
||||
if (userDetail.get("depts") !=null){
|
||||
deptService.saveUserDeptRelation(userId,(List)userDetail.get("depts"));
|
||||
if (userDetail.get(FieldConstant.DEPTS) !=null){
|
||||
deptService.saveUserDeptRelation(userId,(List)userDetail.get(FieldConstant.DEPTS));
|
||||
};
|
||||
if (userDetail.get("roles") !=null){
|
||||
roleService.saveUserRoleRelation(userId,(List)userDetail.get("roles"));
|
||||
if (userDetail.get(FieldConstant.ROLES) !=null){
|
||||
roleService.saveUserRoleRelation(userId,(List)userDetail.get(FieldConstant.ROLES));
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Map userDetail) {
|
||||
if(CollectionUtils.isEmpty(userDetail) || ObjectUtil.isEmpty(userDetail.get("user_id"))){
|
||||
if(CollectionUtils.isEmpty(userDetail) || ObjectUtil.isEmpty(userDetail.get(FieldConstant.USER_ID))){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,7 +111,7 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
|
||||
ConvertUtils.register((aClass, o) -> {
|
||||
try {
|
||||
if (o == null){ return null; }
|
||||
return new SimpleDateFormat("yyyy-MM-dd").parse(o.toString());
|
||||
return new SimpleDateFormat(GeneralDefinition.DATE_FORMAT).parse(o.toString());
|
||||
}catch (Exception ex){
|
||||
return null;
|
||||
}
|
||||
@@ -122,11 +124,11 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
|
||||
sysUser.setUpdate_time(new Date());
|
||||
sysUser.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
this.updateById(sysUser);
|
||||
if (userDetail.get("deptIds")!=null){
|
||||
if (userDetail.get(FieldConstant.DEPTIDS)!=null){
|
||||
deptService.delUserDeptRelation(sysUser.getUser_id());
|
||||
deptService.saveUserDeptRelation(sysUser.getUser_id(), (List) userDetail.get("deptIds"));
|
||||
};
|
||||
if (userDetail.get("rolesIds") !=null){
|
||||
if (userDetail.get(FieldConstant.ROLESIDS) !=null){
|
||||
roleService.delUserRoleRelation(sysUser.getUser_id());
|
||||
roleService.saveUserRoleRelation(sysUser.getUser_id(),(List) userDetail.get("rolesIds"));
|
||||
}
|
||||
|
||||
@@ -24,12 +24,13 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
public class CockpitServiceImpl implements CockpitService {
|
||||
@Autowired
|
||||
private CockPitMapper cockPitMapper;
|
||||
private ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||
@Override
|
||||
public ConcurrentHashMap<String, Object> PressedMonitor() {
|
||||
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||
ConcurrentHashMap<String, Object> map = new ConcurrentHashMap<>();
|
||||
// 1、当前班次、计划生产、已生产、不合格产品数
|
||||
String dayShift = CommonUtils.getDayShift(); // 白班、晚班
|
||||
// 白班、晚班
|
||||
String dayShift = CommonUtils.getDayShift();
|
||||
map.put("DayShift", dayShift);
|
||||
CompletableFuture<List<PressProductHeaderVo>> listCompletableFuture = CompletableFuture.supplyAsync(
|
||||
() -> cockPitMapper.getPressProductHeaderList(dayShift), pool);
|
||||
|
||||
@@ -11,6 +11,11 @@ import java.util.List;
|
||||
* @Date: 2023/9/25
|
||||
*/
|
||||
public interface CockPitMapper {
|
||||
/**
|
||||
* 获取当班信息
|
||||
* @param dayShift
|
||||
* @return
|
||||
*/
|
||||
List<PressProductHeaderVo> getPressProductHeaderList(String dayShift);
|
||||
|
||||
/**
|
||||
@@ -20,10 +25,23 @@ public interface CockPitMapper {
|
||||
*/
|
||||
List<ShiftProductionVo> getShiftProductionList(String dayShift);
|
||||
|
||||
/**
|
||||
* 人员月生产
|
||||
* @param dayShift
|
||||
* @return
|
||||
*/
|
||||
List<PersonnelMonthlyProductionVo> getPersonnelMonthlyProductionList(String dayShift);
|
||||
|
||||
/**
|
||||
* 生产任务
|
||||
* @return
|
||||
*/
|
||||
List<ProductTaskVo> getProductionTaskList();
|
||||
|
||||
/**
|
||||
* 当月工单
|
||||
* @return mes系统的直接数据
|
||||
*/
|
||||
@DS("oracle")
|
||||
List<MonthlyWorkOrderVo> getMonthlyWorkOrderFutureList();
|
||||
}
|
||||
|
||||
@@ -25,9 +25,10 @@ public interface IDasDeviceCheckRecordService extends IService<DasDeviceCheckRec
|
||||
IPage<DasDeviceCheckRecord> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
* 创建
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo create(DasDeviceCheckRecord entity);
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,7 +58,9 @@ public class DasDeviceCheckRecordServiceImpl extends ServiceImpl<DasDeviceCheckR
|
||||
@Override
|
||||
public void update(DasDeviceCheckRecord entity) {
|
||||
DasDeviceCheckRecord dto = dasDeviceCheckRecordMapper.selectById(entity.getRecord_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
String now = DateUtil.now();
|
||||
entity.setRecord_time(now);
|
||||
|
||||
|
||||
@@ -25,9 +25,10 @@ public interface IDasDeviceOperationRecordService extends IService<DasDeviceOper
|
||||
IPage<DasDeviceOperationRecord> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
* 创建
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo create(DasDeviceOperationRecord entity);
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,7 +59,9 @@ public class DasDeviceOperationRecordServiceImpl extends ServiceImpl<DasDeviceOp
|
||||
@Override
|
||||
public void update(DasDeviceOperationRecord entity) {
|
||||
DasDeviceOperationRecord dto = dasDeviceOperationRecordMapper.selectById(entity.getRecord_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
entity.setRecord_time(DateUtil.now());
|
||||
|
||||
dasDeviceOperationRecordMapper.updateById(entity);
|
||||
|
||||
@@ -42,5 +42,9 @@ public interface IDasQualityInspectionService extends IService<DasQualityInspect
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 记录质检信息
|
||||
* @param applyTaskRequest
|
||||
*/
|
||||
void createByAcs(ApplyTaskRequest applyTaskRequest);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,9 @@ public class DasQualityInspectionServiceImpl extends ServiceImpl<DasQualityInspe
|
||||
@Override
|
||||
public void update(DasQualityInspection entity) {
|
||||
DasQualityInspection dto = dasQualityInspectionMapper.selectById(entity.getInspection_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
String now = DateUtil.now();
|
||||
entity.setInspection_time(now);
|
||||
|
||||
@@ -91,7 +93,8 @@ public class DasQualityInspectionServiceImpl extends ServiceImpl<DasQualityInspe
|
||||
}
|
||||
LambdaQueryWrapper<SchBasePoint> pointLam = new QueryWrapper<SchBasePoint>().lambda();
|
||||
pointLam.eq(SchBasePoint::getPoint_code, deviceCode);
|
||||
SchBasePoint one = pointService.getOne(pointLam); // 拆垛工位
|
||||
// 拆垛工位
|
||||
SchBasePoint one = pointService.getOne(pointLam);
|
||||
// 生产中的工单, 如果ACS能给就直接查
|
||||
PdmBdWorkorder deviceProductionTask = workorderService.getDeviceProductionTask(one.getParent_point_code());
|
||||
if (ObjectUtil.isEmpty(deviceProductionTask)) {
|
||||
|
||||
@@ -55,7 +55,9 @@ public class MdBaseBrickInfoServiceImpl extends ServiceImpl<MdBaseBrickInfoMappe
|
||||
@Override
|
||||
public void update(MdBaseBrickInfo entity) {
|
||||
MdBaseBrickInfo dto = mdBaseBrickInfoMapper.selectById(entity.getBrick_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
mdBaseBrickInfoMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@@ -105,7 +107,7 @@ public class MdBaseBrickInfoServiceImpl extends ServiceImpl<MdBaseBrickInfoMappe
|
||||
brickInfo.setBrick_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
brickInfo.setGet_station(dto.getGet_station());
|
||||
brickInfo.setPut_station(dto.getPut_station());
|
||||
brickInfo.setIs_qualified(dto.getIs_qualified().equals("1"));
|
||||
brickInfo.setIs_qualified("1".equals(dto.getIs_qualified()));
|
||||
brickInfo.setLaser_marking_code(dto.getLaser_marking_code());
|
||||
brickInfo.setGrinding_number(dto.getGrinding_number());
|
||||
brickInfo.setWeight(dto.getWeight());
|
||||
|
||||
@@ -70,5 +70,10 @@ public interface IMdBaseClassstandardService extends IService<MdBaseClassstandar
|
||||
*/
|
||||
List<MdBaseClassstandard> buildTree(ArrayList<MdBaseClassstandard> list);
|
||||
|
||||
/**
|
||||
* 根据编码获取分类名称下拉框
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
List<MdBaseClassstandard> getClassByCode(String code);
|
||||
}
|
||||
|
||||
@@ -15,11 +15,13 @@ import org.nl.wms.database.classification.service.IMdBaseClassstandardService;
|
||||
import org.nl.wms.database.classification.service.dao.MdBaseClassstandard;
|
||||
import org.nl.wms.database.classification.service.dao.mapper.MdBaseClassstandardMapper;
|
||||
import org.nl.wms.database.classification.service.dto.MdBaseClassstandardTrees;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -34,7 +36,7 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstandardMapper, MdBaseClassstandard> implements IMdBaseClassstandardService {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private MdBaseClassstandardMapper mdBaseClassstandardMapper;
|
||||
|
||||
@Override
|
||||
@@ -50,14 +52,14 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
IPage<MdBaseClassstandard> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
mdBaseClassstandardMapper.selectPage(pages, lam);
|
||||
pages.getRecords().forEach(classstandard -> {
|
||||
classstandard.setIs_leaf(!(classstandard.getSub_count() > 0));
|
||||
classstandard.setIs_leaf(classstandard.getSub_count() <= 0);
|
||||
classstandard.setHasChildren(classstandard.getSub_count() > 0);
|
||||
});
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MdBaseClassstandard entity) {
|
||||
// 判断是否存在
|
||||
MdBaseClassstandard mdBaseClassstandard = mdBaseClassstandardMapper
|
||||
@@ -65,7 +67,8 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
.eq(MdBaseClassstandard::getClass_code, entity.getClass_code())
|
||||
.eq(MdBaseClassstandard::getParent_class_id, entity.getParent_class_id())
|
||||
.eq(MdBaseClassstandard::getIs_delete, false));
|
||||
if (ObjectUtil.isNotEmpty(mdBaseClassstandard) && !mdBaseClassstandard.getClass_id().equals(entity.getClass_id())) {
|
||||
if (ObjectUtil.isNotEmpty(mdBaseClassstandard) && !mdBaseClassstandard.getClass_id()
|
||||
.equals(entity.getClass_id())) {
|
||||
throw new BadRequestException("存在相同的基础类别编号");
|
||||
}
|
||||
|
||||
@@ -85,16 +88,20 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
entity.setSub_count(0);
|
||||
mdBaseClassstandardMapper.insert(entity);
|
||||
// 更新节点
|
||||
if (ObjectUtil.isNotEmpty(entity.getParent_class_id()) && !entity.getParent_class_id().equals("0")) {
|
||||
if (ObjectUtil.isNotEmpty(entity.getParent_class_id()) && !entity.getParent_class_id()
|
||||
.equals(GeneralDefinition.NO)) {
|
||||
updateSubCnt(entity.getParent_class_id());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSubCnt(String parentClassId) {
|
||||
MdBaseClassstandard classObject = mdBaseClassstandardMapper.selectById(parentClassId);
|
||||
if (ObjectUtil.isEmpty(classObject)) return;
|
||||
if (ObjectUtil.isEmpty(classObject)) {
|
||||
return;
|
||||
}
|
||||
List<MdBaseClassstandard> classList = mdBaseClassstandardMapper
|
||||
.selectList(new LambdaQueryWrapper<MdBaseClassstandard>().eq(MdBaseClassstandard::getParent_class_id, parentClassId));
|
||||
.selectList(new LambdaQueryWrapper<MdBaseClassstandard>()
|
||||
.eq(MdBaseClassstandard::getParent_class_id, parentClassId));
|
||||
int size = classList.size();
|
||||
classObject.setSub_count(size);
|
||||
classObject.setIs_leaf(size > 0);
|
||||
@@ -104,7 +111,9 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
@Override
|
||||
public void update(MdBaseClassstandard entity) {
|
||||
MdBaseClassstandard dto = mdBaseClassstandardMapper.selectById(entity.getClass_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
// 判断是否存在
|
||||
MdBaseClassstandard mdBaseClassstandard = mdBaseClassstandardMapper
|
||||
.selectOne(new LambdaQueryWrapper<MdBaseClassstandard>()
|
||||
@@ -119,10 +128,9 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
if (entity.getParent_class_id() != null && entity.getClass_id().equals(entity.getParent_class_id())) {
|
||||
throw new BadRequestException("上级不能为自己");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
// 更新
|
||||
@@ -174,7 +182,7 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
List<MdBaseClassstandard> classstandardList = mdBaseClassstandardMapper.selectList(lam);
|
||||
classstandardList.forEach(classstandard -> {
|
||||
classstandard.setHasChildren(classstandard.getSub_count() > 0);
|
||||
classstandard.setLeaf(!(classstandard.getSub_count() > 0));
|
||||
classstandard.setLeaf(classstandard.getSub_count() <= 0);
|
||||
classstandard.setId(classstandard.getClass_id());
|
||||
classstandard.setLabel(classstandard.getClass_name());
|
||||
});
|
||||
@@ -190,7 +198,7 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<MdBaseClassstandard> getSuperior(MdBaseClassstandard classstandard, ArrayList<MdBaseClassstandard> res) {
|
||||
if (ObjectUtil.isEmpty(classstandard.getParent_class_id()) || classstandard.getParent_class_id().equals("0")) {
|
||||
if (ObjectUtil.isEmpty(classstandard.getParent_class_id()) || "0".equals(classstandard.getParent_class_id())) {
|
||||
// 父类id为空或者是0就是顶级类别
|
||||
List<MdBaseClassstandard> classstandardList = mdBaseClassstandardMapper
|
||||
.selectList(new LambdaQueryWrapper<MdBaseClassstandard>()
|
||||
@@ -215,14 +223,15 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
||||
list.forEach(classstandard -> {
|
||||
classstandard.setId(classstandard.getClass_id());
|
||||
classstandard.setLabel(classstandard.getClass_name());
|
||||
classstandard.setLeaf(!(classstandard.getSub_count() > 0));
|
||||
classstandard.setLeaf(classstandard.getSub_count() <= 0);
|
||||
classstandard.setHasChildren(classstandard.getSub_count() > 0);
|
||||
});
|
||||
List<MdBaseClassstandard> trees = new ArrayList<>(); // 待返回数据
|
||||
// 待返回数据
|
||||
List<MdBaseClassstandard> trees = new ArrayList<>();
|
||||
for (MdBaseClassstandard mdBaseClassstandard : list) {
|
||||
// 筛选父类的值
|
||||
if (ObjectUtil.isEmpty(mdBaseClassstandard.getParent_class_id())
|
||||
|| mdBaseClassstandard.getParent_class_id().equals("0")) {
|
||||
|| "0".equals(mdBaseClassstandard.getParent_class_id())) {
|
||||
// collect:获取当前对象的所有子级
|
||||
List<MdBaseClassstandard> collect = list.stream().filter(t -> t.getParent_class_id()
|
||||
.equals(mdBaseClassstandard.getClass_id())).collect(Collectors.toList());
|
||||
|
||||
@@ -43,6 +43,11 @@ public interface IMdBaseMaterialService extends IService<MdBaseMaterial> {
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 根据物料编码获取物料信息
|
||||
* @param materialCode
|
||||
* @return
|
||||
*/
|
||||
MdBaseMaterial findByCode(String materialCode);
|
||||
|
||||
/**
|
||||
|
||||
@@ -85,7 +85,9 @@ public class MdBaseMaterialServiceImpl extends ServiceImpl<MdBaseMaterialMapper,
|
||||
@Override
|
||||
public void update(MdBaseMaterial entity) {
|
||||
MdBaseMaterial dto = mdBaseMaterialMapper.selectById(entity.getMaterial_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -64,7 +64,9 @@ public class MdBaseVehicleServiceImpl extends ServiceImpl<MdBaseVehicleMapper, M
|
||||
@Override
|
||||
public void update(MdBaseVehicle entity) {
|
||||
MdBaseVehicle dto = mdBaseVehicleMapper.selectById(entity.getVehicle_code());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -12,50 +12,164 @@ import org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest;
|
||||
* @Date: 2023/6/26
|
||||
*/
|
||||
public interface AcsToWmsService {
|
||||
/** ACS请求接口 */
|
||||
/**
|
||||
* ACS请求接口
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse acsApply(JSONObject param);
|
||||
/** 任务:申请补满料盅托盘(叫料) */
|
||||
|
||||
/**
|
||||
* 任务:申请补满料盅托盘(叫料)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse applyPutFullVehicle(JSONObject param);
|
||||
/** 任务:申请补空料盅托盘(叫空盘) */
|
||||
|
||||
/**
|
||||
* 任务:申请补空料盅托盘(叫空盘)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse applyPutEmptyVehicle(JSONObject param);
|
||||
/** 任务:申请取走空料盅托盘(送空盘) */
|
||||
|
||||
/**
|
||||
* 任务:申请取走空料盅托盘(送空盘)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse applyTakeEmptyVehicle(JSONObject param);
|
||||
/** 任务:申请取走满料盅托盘(入库) */
|
||||
|
||||
/**
|
||||
* 任务:申请取走满料盅托盘(入库)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse applyTakeFullVehicle(JSONObject param);
|
||||
/** 任务:申请强制取走满料盅托盘(强制入库) */
|
||||
|
||||
/**
|
||||
* 任务:申请强制取走满料盅托盘(强制入库)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse applyForceTakeFullVehicle(JSONObject param);
|
||||
/** 任务:分拣回收剩料 */
|
||||
|
||||
/**
|
||||
* 任务:分拣回收剩料
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse applyForceTakeFullVehicleInStorage(JSONObject param);
|
||||
/** 强制去包装位(半托) 记录不包装 --- 业务不需要*/
|
||||
|
||||
/**
|
||||
* 强制去包装位(半托) 记录不包装 --- 业务不需要
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
String forceNoPackage(JSONObject param);
|
||||
/** 质检记录 */
|
||||
|
||||
/**
|
||||
* 质检记录
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse qualityInspection(JSONObject param);
|
||||
/** 分拣 - 记录钢托与木托的绑定 */
|
||||
|
||||
/**
|
||||
* 分拣 - 记录钢托与木托的绑定
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse applyGetPutStation(JSONObject param);
|
||||
/** 反馈压机残留重量*/
|
||||
|
||||
/**
|
||||
* 反馈压机残留重量
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse applyFeedbackWeight(JSONObject param);
|
||||
/** 申请贴标 */
|
||||
|
||||
/**
|
||||
* 申请贴标
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse applyLabelling(JSONObject param);
|
||||
/** 单次放置完成 - 每块砖的信息 */
|
||||
|
||||
/**
|
||||
* 单次放置完成 - 每块砖的信息
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse applyOneGrab(JSONObject param);
|
||||
/** 人工排产确认 */
|
||||
|
||||
/**
|
||||
* 人工排产确认
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse orderVerify(JSONObject param);
|
||||
/** 工单完成 */
|
||||
|
||||
/**
|
||||
* 工单完成
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse orderFinish(JSONObject param);
|
||||
/** 扫码成功申请*/
|
||||
|
||||
/**
|
||||
* 扫码成功申请
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse barcodeSuccessApply(JSONObject param);
|
||||
/** 扫码成功申请 - 判断是否静置完成 */
|
||||
|
||||
/**
|
||||
* 扫码成功申请 - 判断是否静置完成
|
||||
* @param baseRequest
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse isStandingFinish(ApplyTaskRequest baseRequest);
|
||||
/** 扫码成功申请 - 入窑记录时间 */
|
||||
|
||||
/**
|
||||
* 扫码成功申请 - 入窑记录时间
|
||||
* @param baseRequest
|
||||
* @return
|
||||
*/
|
||||
ApplyTaskResponse recordKilnTime(ApplyTaskRequest baseRequest);
|
||||
/** 压机叫料 */
|
||||
|
||||
/**
|
||||
* 压机叫料
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse pressRequestMaterial(JSONObject param);
|
||||
/** 任务反馈 */
|
||||
|
||||
/**
|
||||
* 任务反馈
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse feedbackTaskStatus(JSONObject param);
|
||||
/** 获取组盘信息 */
|
||||
|
||||
/**
|
||||
* 获取组盘信息
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
GetPalletizeResponse getVehicleInfo(JSONObject param);
|
||||
/** 实时修改点位状态 */
|
||||
|
||||
/**
|
||||
* 实时修改点位状态
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse realTimeSetPoint(JSONObject param);
|
||||
/** 布料记录 - 上传MES */
|
||||
|
||||
/**
|
||||
* 布料记录 - 上传MES
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
BaseResponse applyOneCloth(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ACS请求基础实体
|
||||
* @Author: lyd
|
||||
* @Description: ACS 请求基础实体
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class BaseRequest {
|
||||
|
||||
@@ -11,6 +11,11 @@ import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: ACS 响应的基础实体
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
||||
@@ -5,6 +5,11 @@ import cn.hutool.http.HttpStatus;
|
||||
import lombok.Data;
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 申请任务实体
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class ApplyTaskResponse extends BaseResponse {
|
||||
/**
|
||||
@@ -19,7 +24,9 @@ public class ApplyTaskResponse extends BaseResponse {
|
||||
private String mix_number;
|
||||
private String weight;
|
||||
private String label_message;
|
||||
// 特殊业务-无具体含义:目前是是否满足码满规定托盘数
|
||||
/**
|
||||
* 特殊业务-无具体含义:目前是是否满足码满规定托盘数
|
||||
*/
|
||||
private int is_satisfy;
|
||||
private String mudBatch;
|
||||
|
||||
|
||||
@@ -2,5 +2,10 @@ package org.nl.wms.ext.acs.service.dto.to.acs;
|
||||
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
public class FeedBackTaskStatusResponse extends BaseResponse {
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@ import lombok.Data;
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
|
||||
import org.nl.wms.ext.acs.service.dto.PalletizeDto;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class GetPalletizeResponse extends BaseResponse {
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ import org.nl.wms.ext.acs.service.dto.PalletizeDto;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ACS 任务申请请求实体
|
||||
* @Author: lyd
|
||||
* @Description: ACS 任务申请请求实体
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class ApplyTaskRequest extends BaseRequest {
|
||||
|
||||
@@ -3,6 +3,11 @@ package org.nl.wms.ext.acs.service.dto.to.wms;
|
||||
import lombok.Data;
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: ACS 布料机上报数据
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class ClothRequest extends BaseRequest {
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,9 @@ import lombok.Data;
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
|
||||
|
||||
/**
|
||||
* ACS任务反馈请求实体
|
||||
* @Author: lyd
|
||||
* @Description: ACS任务反馈请求实体
|
||||
* @Date: 2023/8/14
|
||||
*/
|
||||
@Data
|
||||
public class FeedBackTaskStatusRequest extends BaseRequest {
|
||||
|
||||
@@ -550,7 +550,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
* 人工排产确认
|
||||
*/
|
||||
@Override
|
||||
public BaseResponse orderVerify(JSONObject param) { // 执行中
|
||||
public BaseResponse orderVerify(JSONObject param) {
|
||||
String requestNo = param.getString("requestNo");
|
||||
String workorderCode = param.getString("order_code");
|
||||
if (workorderCode == null) {
|
||||
@@ -572,7 +572,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
* 工单完成
|
||||
*/
|
||||
@Override
|
||||
public BaseResponse orderFinish(JSONObject param) { // 完成
|
||||
public BaseResponse orderFinish(JSONObject param) {
|
||||
String requestNo = param.getString("requestNo");
|
||||
String workorderCode = param.getString("order_code");
|
||||
if (workorderCode == null) {
|
||||
@@ -672,7 +672,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(basePoint)) {
|
||||
// 记录当前位置
|
||||
one.setPoint_code(basePoint.getPoint_code()); // 当前位置
|
||||
one.setPoint_code(basePoint.getPoint_code());
|
||||
one.setPoint_name(basePoint.getPoint_name());
|
||||
one.setMove_way(one.getMove_way() + " -> " + basePoint.getPoint_code());
|
||||
}
|
||||
@@ -752,7 +752,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
groupInfo.setInto_kiln_time(DateUtil.now());
|
||||
if (ObjectUtil.isNotEmpty(basePoint)) {
|
||||
// 记录当前位置
|
||||
groupInfo.setPoint_code(basePoint.getPoint_code()); // 当前位置
|
||||
groupInfo.setPoint_code(basePoint.getPoint_code());
|
||||
groupInfo.setPoint_name(basePoint.getPoint_name());
|
||||
groupInfo.setMove_way(groupInfo.getMove_way() + " -> " + basePoint.getPoint_code());
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.util.List;
|
||||
public interface WmsToMesService {
|
||||
/**
|
||||
* wms上报mes泥料消耗记录
|
||||
* @param mesMudConsumptionDto
|
||||
*/
|
||||
void reportMudConsumption(MesMudConsumptionDto mesMudConsumptionDto);
|
||||
|
||||
@@ -37,6 +38,7 @@ public interface WmsToMesService {
|
||||
|
||||
/**
|
||||
* wms入滚筒线上报半成品入库信息
|
||||
* @param groupId
|
||||
*/
|
||||
void reportSemiProductionInfoIn(String groupId);
|
||||
|
||||
@@ -135,6 +137,11 @@ public interface WmsToMesService {
|
||||
*/
|
||||
int getTotal(String materialId);
|
||||
|
||||
/**
|
||||
* 获取用户实体
|
||||
* @param custerName
|
||||
* @return
|
||||
*/
|
||||
CusterDo getCusterByName(String custerName);
|
||||
|
||||
/**
|
||||
@@ -157,5 +164,9 @@ public interface WmsToMesService {
|
||||
*/
|
||||
IPage<SemiProductGXPFDo> queryMesScrapInfo(ScrapQuery query, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增工序报废
|
||||
* @param entity
|
||||
*/
|
||||
void addScrap(ScrapDto entity);
|
||||
}
|
||||
|
||||
@@ -251,8 +251,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
@Override
|
||||
@Async
|
||||
public void reportGdyMaterialInfoIn(SchBaseVehiclematerialgroup vehiclematerialgroup) {
|
||||
// 获取组盘信息
|
||||
// SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId);
|
||||
String workorderCode = vehiclematerialgroup.getWorkorder_code();
|
||||
// 获取工单
|
||||
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
|
||||
@@ -348,7 +346,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
@Override
|
||||
@Async
|
||||
public void reportPressUnusedMaterial(PdmBdWorkorder orderObj) {
|
||||
if (orderObj.getRegion_code().equals("FJ")) {
|
||||
if (GeneralDefinition.AREA_FJ.equals(orderObj.getRegion_code())) {
|
||||
return; // 分拣不需要
|
||||
}
|
||||
// 获取统计数量
|
||||
|
||||
@@ -8,5 +8,9 @@ import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
|
||||
* @Date: 2023/9/7
|
||||
*/
|
||||
public interface WmsToMmsService {
|
||||
/**
|
||||
* 混碾对接
|
||||
* @param workorder
|
||||
*/
|
||||
void addRequestMaterial(PdmBdWorkorder workorder);
|
||||
}
|
||||
|
||||
@@ -50,11 +50,14 @@ public interface ISysInteractRecordService extends IService<SysInteractRecord> {
|
||||
|
||||
/**
|
||||
* 创建记录
|
||||
* @param request
|
||||
* @param response
|
||||
* @param direction
|
||||
*/
|
||||
void saveRecord(Object request, BaseResponse response, String direction);
|
||||
|
||||
/**
|
||||
*
|
||||
* 记录对接日志
|
||||
* @param workorder
|
||||
* @param resultForAcs
|
||||
* @param direction
|
||||
@@ -81,6 +84,7 @@ public interface ISysInteractRecordService extends IService<SysInteractRecord> {
|
||||
|
||||
/**
|
||||
* 获取所有标题
|
||||
* @return
|
||||
*/
|
||||
List<String> getAllInteractName();
|
||||
}
|
||||
|
||||
@@ -75,7 +75,9 @@ public class SysInteractRecordServiceImpl extends ServiceImpl<SysInteractRecordM
|
||||
@Override
|
||||
public void update(SysInteractRecord entity) {
|
||||
SysInteractRecord dto = sysInteractRecordMapper.selectById(entity.getInteract_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
sysInteractRecordMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.nl.wms.pda.service;
|
||||
|
||||
import org.nl.wms.pda.service.dao.dto.*;
|
||||
import org.nl.wms.pda.service.dao.vo.*;
|
||||
import org.nl.wms.pdm.record.service.dao.PdmBdRequestMaterialRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,62 +11,189 @@ import java.util.List;
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
public interface PdaService {
|
||||
/**
|
||||
* 获取设备信息
|
||||
* @return
|
||||
*/
|
||||
List<DropdownListVo> getDeviceInfo();
|
||||
|
||||
/**
|
||||
* 获取设备状态
|
||||
* @return
|
||||
*/
|
||||
List<DropdownListVo> getDeviceStatus();
|
||||
|
||||
/**
|
||||
* 设备动作
|
||||
* @return
|
||||
*/
|
||||
List<DropdownListVo> deviceAction();
|
||||
|
||||
/**
|
||||
* 人工通过手持组盘
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo manualCreateByPda(ManualGroupDto entity);
|
||||
|
||||
/**
|
||||
* 获取混碾机编码
|
||||
* @return
|
||||
*/
|
||||
List<DropdownListVo> getBlendingCode();
|
||||
|
||||
/**
|
||||
* 生成混碾->压机任务
|
||||
* @param blendingMoveDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo sendTask(BlendingMoveDto blendingMoveDto);
|
||||
|
||||
/**
|
||||
* 强制静置
|
||||
* @param forcedRestingDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo forcedResting(ForcedRestingDto forcedRestingDto);
|
||||
|
||||
|
||||
/**
|
||||
* 显示静置时长
|
||||
* @return
|
||||
*/
|
||||
List<StandTimeShowVo> forcedRestingShow();
|
||||
|
||||
/**
|
||||
* 获取载具类型
|
||||
* @return
|
||||
*/
|
||||
List<DropdownListVo> getVehicleType();
|
||||
|
||||
/**
|
||||
* 人工分拣-显示工单
|
||||
* @return
|
||||
*/
|
||||
List<ManualWorkOrderVo> manualOrders();
|
||||
|
||||
/**
|
||||
* 人工分拣-开工
|
||||
* @param manualSortingDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo productionScheduling(ManualSortingDto manualSortingDto);
|
||||
|
||||
/**
|
||||
* 人工分拣-完工
|
||||
* @param manualSortingDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo productionComplete(ManualSortingDto manualSortingDto);
|
||||
|
||||
/**
|
||||
* 人工分拣-空盘入库-动作
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo emptyDiskIntoStorageTask();
|
||||
|
||||
/**
|
||||
* 人工分拣-空盘入库-显示任务信息
|
||||
* @return
|
||||
*/
|
||||
List<TaskShowVo> emptyDiskIntoStorageShow();
|
||||
|
||||
/**
|
||||
* 人工分拣-呼叫木托盘-动作
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo callingWoodenPalletTask();
|
||||
|
||||
/**
|
||||
* 人工分拣-呼叫木托盘-显示任务信息
|
||||
* @return
|
||||
*/
|
||||
List<TaskShowVo> callingWoodenPalletTaskShow();
|
||||
|
||||
/**
|
||||
* 人工分拣-呼叫物料-动作
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo callingMaterialTask();
|
||||
|
||||
/**
|
||||
* 人工分拣-呼叫物料-显示任务信息
|
||||
* @return
|
||||
*/
|
||||
List<TaskShowVo> callingMaterialTaskShow();
|
||||
|
||||
/**
|
||||
* 人工分拣-剩料入库-动作
|
||||
* @param manualResidueInDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo callingResidueMaterialTask(ManualResidueInDto manualResidueInDto);
|
||||
|
||||
/**
|
||||
* 人工分拣-剩料入库-显示任务信息
|
||||
* @return
|
||||
*/
|
||||
List<TaskShowVo> callingResidueMaterialTaskShow();
|
||||
|
||||
/**
|
||||
* 人工分拣-包装入库-动作
|
||||
* @param manualResidueInDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo packingTask(ManualResidueInDto manualResidueInDto);
|
||||
|
||||
/**
|
||||
* 人工分拣-包装入库-显示任务信息
|
||||
* @return
|
||||
*/
|
||||
List<TaskShowVo> packingTaskShow();
|
||||
|
||||
/**
|
||||
* 人工分拣-载具绑定
|
||||
* @param vehicleBindingDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo bindingVehicle(VehicleBindingDto vehicleBindingDto);
|
||||
|
||||
/**
|
||||
* 压机送料-动作
|
||||
* @param pressMoveDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo pressTask(PressMoveDto pressMoveDto);
|
||||
|
||||
/**
|
||||
* 货架盘点-物料查询
|
||||
* @param commonQueryDto
|
||||
* @return
|
||||
*/
|
||||
List<MaterialInfoVo> materialQuery(CommonQueryDto commonQueryDto);
|
||||
|
||||
/**
|
||||
* 货架盘点-更新
|
||||
* @param shelfSaveDto
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo updateData(ShelfSaveDto shelfSaveDto);
|
||||
|
||||
/**
|
||||
* 压机送料-下拉框
|
||||
* @return
|
||||
*/
|
||||
List<DropdownListVo> pressPointList();
|
||||
|
||||
/**
|
||||
* 要料信息-查询
|
||||
* @return
|
||||
*/
|
||||
List<RequestMaterialInfoVo> requestInfo();
|
||||
|
||||
/**
|
||||
* 要料信息-查询
|
||||
* @param requestMaterialInfoVo
|
||||
* @return
|
||||
*/
|
||||
PdaResponseVo deleteMaterialInfo(RequestMaterialInfoVo requestMaterialInfoVo);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ public class PdaServiceImpl implements PdaService {
|
||||
}
|
||||
// 获取压机工单
|
||||
PdmBdWorkorder bdWorkorder = workorderService.getDeviceProductionTask(entity.getPoint_code());
|
||||
// PdmBdWorkorder bdWorkorder = workorderService.getByCode(entity.getOrder_code());
|
||||
// 获取点位
|
||||
SchBasePoint basePoint = pointService.getById(entity.getPoint_code());
|
||||
// 获取物料
|
||||
@@ -193,6 +192,7 @@ public class PdaServiceImpl implements PdaService {
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已开工");
|
||||
case "5":
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已完工");
|
||||
default: break;
|
||||
}
|
||||
// 开工
|
||||
bdWorkorder.setOperator(manualSortingDto.getUsername());
|
||||
@@ -215,6 +215,7 @@ public class PdaServiceImpl implements PdaService {
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]未开工");
|
||||
case "5":
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已完工");
|
||||
default: break;
|
||||
}
|
||||
TaskUtils.setWorkOrderUpdateByPC(bdWorkorder);
|
||||
bdWorkorder.setRealproduceend_date(DateUtil.now());
|
||||
@@ -436,7 +437,7 @@ public class PdaServiceImpl implements PdaService {
|
||||
group.setSource_vehicle_code(basePoint.getPoint_code());
|
||||
group.setMove_way(basePoint.getPoint_code());
|
||||
group.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd"));
|
||||
group.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
||||
group.setGroup_status(GroupStatusEnum.IN_STORAGE.getType());
|
||||
group.setIs_delete(false);
|
||||
group.setIs_full(true);
|
||||
group.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
|
||||
@@ -29,14 +29,14 @@
|
||||
groupEntity.setVehicle_code(blendingMoveDto.getVehicle_code());
|
||||
groupEntity.setVehicle_type(GeneralDefinition.MATERIAL_CUP);
|
||||
groupEntity.setSource_vehicle_code(startPoint.getPoint_code());
|
||||
groupEntity.setPoint_code(startPoint.getPoint_code()); // 当前位置
|
||||
groupEntity.setPoint_code(startPoint.getPoint_code());
|
||||
groupEntity.setPoint_name(startPoint.getPoint_name());
|
||||
groupEntity.setMove_way(startPoint.getPoint_code()); // 头次
|
||||
// groupEntity.setMix_times(mixTimes); // 碾次
|
||||
groupEntity.setInstorage_time(DateUtil.now());
|
||||
// groupEntity.setMaterial_weight(blendingMoveDto.getMaterial_weight());
|
||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
|
||||
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
|
||||
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType());
|
||||
groupEntity.setIs_delete(false);
|
||||
// groupEntity.setExt_data(packNo);// todo: 对于混碾的组盘 暂时存吨袋号
|
||||
vehiclematerialgroupService.saveOrUpdate(groupEntity);
|
||||
|
||||
@@ -24,9 +24,10 @@ public interface IPdmBdMudConsumptionService extends IService<PdmBdMudConsumptio
|
||||
IPage<PdmBdMudConsumption> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
* 创建
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
String create(PdmBdMudConsumption entity);
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,7 +53,9 @@ public class PdmBdMudConsumptionServiceImpl extends ServiceImpl<PdmBdMudConsumpt
|
||||
@Override
|
||||
public void update(PdmBdMudConsumption entity) {
|
||||
PdmBdMudConsumption dto = pdmBdMudConsumptionMapper.selectById(entity.getRecord_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
String now = DateUtil.now();
|
||||
entity.setRecord_time(now);
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public interface IPdmBdRequestMaterialRecordService extends IService<PdmBdReques
|
||||
/**
|
||||
* 记录要料信息
|
||||
* @param workorder
|
||||
* @return
|
||||
*/
|
||||
PdmBdRequestMaterialRecord recordData(PdmBdWorkorder workorder);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,9 @@ public class PdmBdRequestMaterialRecordServiceImpl extends ServiceImpl<PdmBdRequ
|
||||
@Override
|
||||
public void update(PdmBdRequestMaterialRecord entity) {
|
||||
PdmBdRequestMaterialRecord dto = pdmBdRequestMaterialRecordMapper.selectById(entity.getRecord_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
pdmBdRequestMaterialRecordMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ public interface IPdmBdMaterialResidueService extends IService<PdmBdMaterialResi
|
||||
|
||||
/**
|
||||
* 添加数据
|
||||
* @param applyTaskRequest
|
||||
*/
|
||||
void addByApplyTaskRequest(ApplyTaskRequest applyTaskRequest);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,9 @@ public class PdmBdMaterialResidueServiceImpl extends ServiceImpl<PdmBdMaterialRe
|
||||
@Override
|
||||
public void update(PdmBdMaterialResidue entity) {
|
||||
PdmBdMaterialResidue dto = pdmBdMaterialResidueMapper.selectById(entity.getRecord_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
String now = DateUtil.now();
|
||||
entity.setRecord_time(now);
|
||||
|
||||
|
||||
@@ -49,7 +49,9 @@ public class PdmBdProductionProcessTrackingServiceImpl extends ServiceImpl<PdmBd
|
||||
@Override
|
||||
public void update(PdmBdProductionProcessTracking entity) {
|
||||
PdmBdProductionProcessTracking dto = pdmBdProductionProcessTrackingMapper.selectById(entity.getProcess_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -51,7 +51,9 @@ public class PdmBdVehicleBindingServiceImpl extends ServiceImpl<PdmBdVehicleBind
|
||||
@Override
|
||||
public void update(PdmBdVehicleBinding entity) {
|
||||
PdmBdVehicleBinding dto = pdmBdVehicleBindingMapper.selectById(entity.getAssociate_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
String now = DateUtil.now();
|
||||
entity.setRecord_time(now);
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ public interface IPdmBdWorkorderService extends IService<PdmBdWorkorder> {
|
||||
*/
|
||||
PdmBdWorkorder getDeviceProductionTask(String deviceCode);
|
||||
|
||||
/**
|
||||
* 根据工单编码获取工单信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
PdmBdWorkorder getByCode(String orderCode);
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,25 +9,81 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class AcsWorkOrderVo {
|
||||
private String workorder_code; // 工单编码
|
||||
private String device_code; // 设备编码
|
||||
private String material_code; // 半成品物料编码 - 工单物料编码
|
||||
private String product_code; // 产品代号 - 规格
|
||||
private String formula; // 配方 - 型号
|
||||
private String brick_code; // 砖型编码 - 自己维护
|
||||
private String plan_qty; // 计划数量
|
||||
private String a; // a边
|
||||
private String b; // b边
|
||||
private String h; // 高度
|
||||
private String w; // 宽度
|
||||
private String size_error; // 尺寸允许误差
|
||||
private String single_weight; // 单重允许误差
|
||||
// private String drawing_address; // 图纸地址
|
||||
private String standard_size_height1; // 标准尺寸1
|
||||
private String standard_size_height2; // 标准尺寸2
|
||||
private String standard_size_height3; // 标准尺寸3
|
||||
private String standard_size_height4; // 标准尺寸4
|
||||
private String standard_weight; // 标准重量
|
||||
private String detection_error; // 检测误差值 - 不用传
|
||||
/**
|
||||
* 工单编码
|
||||
*/
|
||||
private String workorder_code;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
/**
|
||||
* 半成品物料编码 - 工单物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 产品代号 - 规格
|
||||
*/
|
||||
private String product_code;
|
||||
/**
|
||||
* 配方 - 型号
|
||||
*/
|
||||
private String formula;
|
||||
/**
|
||||
* 砖型编码 - 自己维护
|
||||
*/
|
||||
private String brick_code;
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private String plan_qty;
|
||||
/**
|
||||
* a边
|
||||
*/
|
||||
private String a;
|
||||
/**
|
||||
* b边
|
||||
*/
|
||||
private String b;
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private String h;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private String w;
|
||||
/**
|
||||
* 尺寸允许误差
|
||||
*/
|
||||
private String size_error;
|
||||
/**
|
||||
* 单重允许误差
|
||||
*/
|
||||
private String single_weight;
|
||||
/**
|
||||
* 标准尺寸1
|
||||
*/
|
||||
private String standard_size_height1;
|
||||
/**
|
||||
* 标准尺寸2
|
||||
*/
|
||||
private String standard_size_height2;
|
||||
/**
|
||||
* 标准尺寸3
|
||||
*/
|
||||
private String standard_size_height3;
|
||||
/**
|
||||
* 标准尺寸4
|
||||
*/
|
||||
private String standard_size_height4;
|
||||
/**
|
||||
* 标准重量
|
||||
*/
|
||||
private String standard_weight;
|
||||
/**
|
||||
* 检测误差值 - 不用传
|
||||
*/
|
||||
private String detection_error;
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user