mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
取消板件自动写入,bug1255,1225
This commit is contained in:
@@ -170,6 +170,11 @@
|
||||
<artifactId>cf-spring-boot-starter-biz-error-code</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-ip</artifactId>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-framework</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>主键id生成</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 -->
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.framework.id.config;
|
||||
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
* ip自动注册配置
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@AutoConfiguration
|
||||
public class ChenfengIDAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public SnowflakeIdWorker3rd ipQueryService() {
|
||||
return new SnowflakeIdWorker3rd();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.cf.imes.module.manage.util;
|
||||
package com.cf.imes.framework.id.core.util;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.cf.imes.module.manage.util;
|
||||
package com.cf.imes.framework.id.core.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
+1
@@ -0,0 +1 @@
|
||||
com.cf.imes.framework.id.config.ChenfengIDAutoConfiguration
|
||||
+4
-1
@@ -4,6 +4,7 @@ import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.common.util.monitor.TracerUtils;
|
||||
@@ -310,7 +311,9 @@ public class OperateLogAspect {
|
||||
String argName = argNames[i];
|
||||
Object argValue = argValues[i];
|
||||
// 被忽略时,标记为 ignore 字符串,避免和 null 混在一起
|
||||
args.put(argName, !isIgnoreArgs(argValue) ? argValue : "[ignore]");
|
||||
if (ObjectUtil.isNotNull(argValue)) {
|
||||
args.put(argName, !isIgnoreArgs(argValue) ? argValue : "[ignore]");
|
||||
}
|
||||
}
|
||||
return JsonUtils.toJsonString(args);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.amqp</groupId>
|
||||
<artifactId>spring-rabbit</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
|
||||
+85
-9
@@ -1,12 +1,25 @@
|
||||
package com.cf.imes.framework.mq.rabbitmq.config;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.cf.imes.framework.mq.rabbitmq.constant.RabbitMqConstants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.utils.SerializationUtils;
|
||||
import org.springframework.amqp.core.Binding;
|
||||
import org.springframework.amqp.core.BindingBuilder;
|
||||
import org.springframework.amqp.core.DirectExchange;
|
||||
import org.springframework.amqp.core.FanoutExchange;
|
||||
import org.springframework.amqp.core.Queue;
|
||||
import org.springframework.amqp.core.QueueBuilder;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.amqp.support.converter.MessageConverter;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.mq.rabbitmq.constant.RabbitMqConstants.ORDER_IMPORT_DEAD_LETTER_EXCHANGE;
|
||||
import static com.cf.imes.framework.mq.rabbitmq.constant.RabbitMqConstants.ORDER_IMPORT_DEAD_LETTER_QUEUE;
|
||||
import static com.cf.imes.framework.mq.rabbitmq.constant.RabbitMqConstants.ORDER_IMPORT_DEAD_LETTER_ROUTING_KEY;
|
||||
|
||||
/**
|
||||
* RabbitMQ 消息队列配置类
|
||||
@@ -18,12 +31,75 @@ import java.lang.reflect.Field;
|
||||
@ConditionalOnClass(name = "org.springframework.amqp.rabbit.core.RabbitTemplate")
|
||||
public class ChenfengRabbitMQAutoConfiguration {
|
||||
|
||||
static {
|
||||
// 强制设置 SerializationUtils 的 TRUST_ALL 为 true,避免 RabbitMQ Consumer 反序列化消息报错
|
||||
// 为什么不通过设置 spring.amqp.deserialization.trust.all 呢?因为可能在 SerializationUtils static 初始化后
|
||||
Field trustAllField = ReflectUtil.getField(SerializationUtils.class, "TRUST_ALL");
|
||||
ReflectUtil.removeFinalModify(trustAllField);
|
||||
ReflectUtil.setFieldValue(SerializationUtils.class, trustAllField, true);
|
||||
/**
|
||||
* Jackson2JsonMessageConverter Bean:使用 jackson 序列化消息
|
||||
*/
|
||||
@Bean
|
||||
public MessageConverter createMessageConverter() {
|
||||
return new Jackson2JsonMessageConverter();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生产单导入交换机、队列、绑定声明
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public FanoutExchange orderImportFanoutExchange() {
|
||||
return new FanoutExchange(RabbitMqConstants.ORDER_IMPORT_DEFAULT_EXCEL_EXCHANGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产单导入队列声明
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue orderImportQueue() {
|
||||
Map<String, Object> args = new HashMap<>(1);
|
||||
// x-dead-letter-exchange 这里声明当前队列绑定的死信交换机
|
||||
args.put("x-dead-letter-exchange", ORDER_IMPORT_DEAD_LETTER_EXCHANGE);
|
||||
// 设置死信路由键
|
||||
args.put("x-dead-letter-routing-key", ORDER_IMPORT_DEAD_LETTER_ROUTING_KEY);
|
||||
return QueueBuilder.durable(RabbitMqConstants.ORDER_IMPORT_DEFAULT_EXCEL_QUEUE).withArguments(args).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产单excel导入交换机声明
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Binding orderImportDefaultExcelBinding() {
|
||||
return BindingBuilder.bind(orderImportQueue()).to(orderImportFanoutExchange());
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产单导入死信交换机声明
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange orderImportDeadLetterExchange(){
|
||||
return new DirectExchange(ORDER_IMPORT_DEAD_LETTER_EXCHANGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产单导入死信队列声明
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue orderImportDeadLetterQueue() {
|
||||
return new Queue(ORDER_IMPORT_DEAD_LETTER_QUEUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产单导入死信队列、交换机、绑定声明
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Binding deadLetterBindingA() {
|
||||
return BindingBuilder.bind(orderImportDeadLetterQueue()).to(orderImportDeadLetterExchange()).with(ORDER_IMPORT_DEAD_LETTER_ROUTING_KEY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.cf.imes.framework.mq.rabbitmq.constant;
|
||||
|
||||
/**
|
||||
* rabbitmq常量
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/6 11:15
|
||||
*/
|
||||
public class RabbitMqConstants {
|
||||
/**
|
||||
* 生产单导入交换机
|
||||
*/
|
||||
public static final String ORDER_IMPORT_DEFAULT_EXCEL_EXCHANGE = "order_import_default_excel_exchange";
|
||||
|
||||
/**
|
||||
* 生产单导入队列
|
||||
*/
|
||||
public static final String ORDER_IMPORT_DEFAULT_EXCEL_QUEUE = "order_import_default_excel_queue";
|
||||
|
||||
/**
|
||||
* 生产单导入死信交换机
|
||||
*/
|
||||
public static final String ORDER_IMPORT_DEAD_LETTER_EXCHANGE = "order_import_dead_letter_exchange";
|
||||
|
||||
/**
|
||||
* 生产单导入死信队列
|
||||
*/
|
||||
public static final String ORDER_IMPORT_DEAD_LETTER_QUEUE = "order_import_dead_letter_queue";
|
||||
|
||||
/**
|
||||
* 生产单导入死信路由键
|
||||
*/
|
||||
public static final String ORDER_IMPORT_DEAD_LETTER_ROUTING_KEY = "order_import_dead_letter_routing_key";
|
||||
}
|
||||
+6
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator;
|
||||
import com.baomidou.mybatisplus.extension.incrementer.*;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import com.cf.imes.framework.mybatis.core.injector.MybatisPlusInjector;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -75,4 +76,9 @@ public class ChenfengMybatisAutoConfiguration {
|
||||
throw new IllegalArgumentException("DbType为空");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInjector mybatisPlusInjector() {
|
||||
return new MybatisPlusInjector();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.cf.imes.framework.mybatis.core.injector;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础批量映射器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/14 14:54
|
||||
*/
|
||||
public interface BaseBatchMapper<T> extends BaseMapper<T> {
|
||||
/**
|
||||
* 批量插入
|
||||
* 区别于mybatisplus的saveBatch:拼接(a,b,c,...)value(aval,bval,cval,...)而不是把多个insert一次性提交到数据库
|
||||
*
|
||||
* @param entityList
|
||||
* @return
|
||||
*/
|
||||
int insertBatchSomeColumn(List<T> entityList);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.cf.imes.framework.mybatis.core.injector;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
|
||||
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Gqr
|
||||
* @since 2025/1/14 14:46
|
||||
*/
|
||||
public class MybatisPlusInjector extends DefaultSqlInjector {
|
||||
@Override
|
||||
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
|
||||
List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
|
||||
methodList.add(new InsertBatchSomeColumn(i -> i.getFieldFill() != FieldFill.UPDATE));
|
||||
return methodList;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.cf.imes.framework.mybatis.core.query;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
|
||||
/**
|
||||
* LambdaUpdateWrapper拓展
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/22 15:58
|
||||
*/
|
||||
public class LambdaUpdateWrapperX<T> extends LambdaUpdateWrapper<T> {
|
||||
public LambdaUpdateWrapperX<T> eqIfPresent(SFunction<T, ?> column, Object val) {
|
||||
if (ObjectUtil.isNotEmpty(val)) {
|
||||
return (LambdaUpdateWrapperX<T>) super.eq(column, val);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LambdaUpdateWrapperX<T> eq(SFunction<T, ?> column, Object val) {
|
||||
super.eq(column, val);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -82,7 +82,7 @@ public class ChenfengCacheAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisLockUtil lockUtil(ChenfengCacheProperties chenfengCacheProperties, RedissonClient client) {
|
||||
return new RedisLockUtil(chenfengCacheProperties, client);
|
||||
public RedisLockUtil lockUtil(ChenfengCacheProperties chenfengCacheProperties, RedissonClient client, RedisTemplate redisTemplate) {
|
||||
return new RedisLockUtil(chenfengCacheProperties, client, redisTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,5 +34,5 @@ public class ChenfengCacheProperties {
|
||||
* 等待获取锁的时间,单位:毫秒(ms)
|
||||
* 默认0.5秒
|
||||
*/
|
||||
private int lockWaitTime = 500;
|
||||
private int lockWaitTime = 5000;
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.cf.imes.framework.redis.constants;
|
||||
|
||||
/**
|
||||
* 多模块公用redis key常量
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/14 15:22
|
||||
*/
|
||||
public class RedisKeyConstants {
|
||||
/**
|
||||
* 生产单导入
|
||||
*/
|
||||
public static final String ORDER_IMPORT_LOCK_KEY = "order_import:%s";
|
||||
}
|
||||
+37
@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -23,6 +24,8 @@ public class RedisLockUtil {
|
||||
|
||||
private RedissonClient redissonClient;
|
||||
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* 加锁
|
||||
*
|
||||
@@ -63,6 +66,7 @@ public class RedisLockUtil {
|
||||
|
||||
/**
|
||||
* 解锁
|
||||
* 使用注意:配合以上两个redisson的lock只能在当前线程中unlock,否则失败!!!
|
||||
*
|
||||
* @param key rediskey
|
||||
*/
|
||||
@@ -74,4 +78,37 @@ public class RedisLockUtil {
|
||||
log.error("[RedisLockUtil][unlock]解锁失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动set nx ex加锁
|
||||
* 使用注意:可用于跨服务
|
||||
*
|
||||
* @param key
|
||||
* @param uniqeKey 解锁的时候校验,避免其他任务误解
|
||||
* @param timeout
|
||||
* @return
|
||||
*/
|
||||
public boolean lock(String key, String uniqeKey, Integer timeout) {
|
||||
return redisTemplate.opsForValue().setIfAbsent(key, uniqeKey, timeout, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁
|
||||
* 校验唯一值后删除key
|
||||
* 使用注意:可用于跨服务
|
||||
*
|
||||
* @param key
|
||||
* @param uniqeKey 解锁时校验,避免同key下其他任务解锁到
|
||||
*/
|
||||
public void unlock(String key, String uniqeKey) {
|
||||
Object object = redisTemplate.opsForValue().get(key);
|
||||
if (ObjectUtil.equal(object, uniqeKey)) {
|
||||
Boolean delete = redisTemplate.delete(key);
|
||||
if (delete) {
|
||||
log.info(String.format("[RedisLockUtil][unlock][%s]解锁", key));
|
||||
} else {
|
||||
log.error(String.format("[RedisLockUtil][unlock][%s]解锁失败", key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<module>cf-spring-boot-starter-biz-organ</module>
|
||||
<module>cf-spring-boot-starter-biz-data-permission</module>
|
||||
<module>cf-spring-boot-starter-biz-error-code</module>
|
||||
<module>cf-spring-boot-starter-biz-id</module>
|
||||
<module>cf-spring-boot-starter-biz-ip</module>
|
||||
|
||||
<module>cf-spring-boot-starter-flowable</module>
|
||||
|
||||
+15
-1
@@ -71,10 +71,24 @@ public class ErrorCodeConstants {
|
||||
public static final ErrorCode CHANGE_DETAILS_ITEM_ERROR = new ErrorCode(1_002_032_001, "明细转换失败");
|
||||
public static final ErrorCode ORDER_MATCH_NOT = new ErrorCode(1_002_033_001, "板材库缺少相关板材,请在板材库中进行添加之后再进行导入");
|
||||
|
||||
// ========== 自定义板编号生成 ==========
|
||||
// ========== 自定义板编号生成 1_002_030_ ==========
|
||||
public static final ErrorCode CUSTOM_PLATENO_GENERATE_ORDERNO_RULE_NOT_SUPPORT_RESETMODE = new ErrorCode(1_002_030_001, "自定义版编号生产单序号规则中存在不支持的复位类型:{}");
|
||||
public static final ErrorCode CUSTOM_PLATENO_GENERATE_BODY_RULE_NOT_SUPPORT_RESETMODE = new ErrorCode(1_002_030_002, "自定义版编号柜体序号规则中存在不支持的复位类型:{}");
|
||||
public static final ErrorCode CUSTOM_PLATENO_GENERATE_PROCESSGROUP_RULE_NOT_SUPPORT_RESETMODE = new ErrorCode(1_002_030_003, "自定义版编号加工组序号规则中存在不支持的复位类型:{}");
|
||||
public static final ErrorCode CUSTOM_PLATENO_GENERATE_PLATE_RULE_NOT_SUPPORT_RESETMODE = new ErrorCode(1_002_030_004, "自定义版编号板件序号规则中存在不支持的复位类型:{}");
|
||||
public static final ErrorCode CUSTOM_PLATENO_GENERATE_ORG_CUSTOM_PLATENO_SEQ_MODIFY_ERROR = new ErrorCode(1_002_030_005, "保存组织下自定义板编号序号配置失败,请联系客服处理");
|
||||
|
||||
// ========== 生产单导入 1_002_031 ==========
|
||||
public static final ErrorCode ORDER_IMPORT_TYPE_NOT_SUPPORT = new ErrorCode(1_002_031_001, "不支持的生产单导入类型:{}");
|
||||
public static final ErrorCode ORDER_IMPORT_ORGAN_LOCK_ERROR = new ErrorCode(1_002_031_002, "组织下存在正在导入的生产单,请稍后再试");
|
||||
public static final ErrorCode ORDER_IMPORT_FILE_ANALYZE_ERROR = new ErrorCode(1_002_031_003, "生产单导入文件解析失败,请检查文件类型和格式");
|
||||
public static final ErrorCode ORDER_IMPORT_ORDER_FIELD_EMPTY = new ErrorCode(1_002_031_004, "生产单信息【{}】不能为空");
|
||||
public static final ErrorCode ORDER_IMPORT_ORDER_FIELD_LENGTH_ERROR = new ErrorCode(1_002_031_005, "生产单信息【{}】长度不能超过【{}】个字符");
|
||||
public static final ErrorCode ORDER_IMPORT_ORDER_FIELD_MOBILE_FORMAT_ERROR = new ErrorCode(1_002_031_006, "生产单信息【{}】手机号格式错误");
|
||||
public static final ErrorCode ORDER_IMPORT_ORDER_FIELD_DATE_FORMAT_ERROR = new ErrorCode(1_002_031_007, "生产单信息【{}】日期格式错误");
|
||||
public static final ErrorCode ORDER_IMPORT_ORDER_NOT_EXISTS = new ErrorCode(1_002_031_008, "生产单【{}】不存在");
|
||||
public static final ErrorCode ORDER_IMPORT_ORDER_CUSTOMERNO_EXISTS = new ErrorCode(1_002_031_009, "{}【{}】已存在");
|
||||
public static final ErrorCode ORDER_IMPORT_DETAIL_FIELD_EMPTY = new ErrorCode(1_002_031_010, "导入校验异常:第{}行,导入明细【{}】不能为空");
|
||||
public static final ErrorCode ORDER_IMPORT_DETAIL_FIELD_LENGTH_ERROR = new ErrorCode(1_002_031_011, "导入校验异常:第{}行,导入明细【{}】长度不能超过【{}】个字符");
|
||||
public static final ErrorCode ORDER_IMPORT_DETAIL_VALID_ERROR = new ErrorCode(1_002_031_012, "导入校验异常:{}");
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
/**
|
||||
* 生产单导入常量
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/14 16:18
|
||||
*/
|
||||
public class OrderImportConstants {
|
||||
/**
|
||||
* 导入商品缺省goodsid
|
||||
*/
|
||||
public static final String DEFAULT_GOODS_ID = "no_code_1132589&";
|
||||
|
||||
/**
|
||||
* 房间、柜体缺省name
|
||||
*/
|
||||
public static final String NOT_ASSIGNED = "未命名";
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 生产单导入状态枚举
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:20
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderImportStatusEnum {
|
||||
/**
|
||||
* 未导入
|
||||
*/
|
||||
IMPORT_NOT_YET(0),
|
||||
|
||||
/**
|
||||
* 导入成功
|
||||
*/
|
||||
IMPORT_SUCCESS(10),
|
||||
|
||||
/**
|
||||
* 导入失败
|
||||
*/
|
||||
IMPORT_FAIL(2);
|
||||
|
||||
private int status;
|
||||
|
||||
/**
|
||||
* 是否匹配
|
||||
*
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
public static OrderImportStatusEnum match(int status) {
|
||||
for (OrderImportStatusEnum statusEnum : OrderImportStatusEnum.values()) {
|
||||
if (statusEnum.status == status) {
|
||||
return statusEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 生产单导入任务状态枚举
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:20
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderImportTaskStatusEnum {
|
||||
/**
|
||||
* 创建未消费
|
||||
*/
|
||||
CREATE_NOT_CONSUME(0),
|
||||
|
||||
/**
|
||||
* 创建已接收
|
||||
*/
|
||||
CREATE_RECEIVE(10),
|
||||
|
||||
/**
|
||||
* 消费成功
|
||||
*/
|
||||
CONSUME_SUCCESS(20),
|
||||
|
||||
/**
|
||||
* 消费失败
|
||||
*/
|
||||
CONSUME_FAIL(30);
|
||||
|
||||
private int status;
|
||||
|
||||
/**
|
||||
* 是否匹配
|
||||
*
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
public static OrderImportTaskStatusEnum match(int status) {
|
||||
for (OrderImportTaskStatusEnum statusEnum : OrderImportTaskStatusEnum.values()) {
|
||||
if (statusEnum.status == status) {
|
||||
return statusEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 生产单导入临时表类型枚举
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:20
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderImportTmpDataTypeEnum {
|
||||
ORDER(0),
|
||||
PLATE(1),
|
||||
PART(2);
|
||||
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* 是否匹配
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static OrderImportTmpDataTypeEnum match(int type) {
|
||||
for (OrderImportTmpDataTypeEnum typeEnum : OrderImportTmpDataTypeEnum.values()) {
|
||||
if (typeEnum.type == type) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 生产单导入类型枚举
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:20
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderImportTypeEnum {
|
||||
EXCEL(0),
|
||||
JSON(1),
|
||||
XML(2),
|
||||
API(3);
|
||||
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* 是否匹配
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static OrderImportTypeEnum match(int type) {
|
||||
for (OrderImportTypeEnum typeEnum : OrderImportTypeEnum.values()) {
|
||||
if (typeEnum.type == type) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -182,6 +182,15 @@
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
@@ -272,6 +281,14 @@
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-web</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-mq</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
||||
+16
@@ -393,6 +393,22 @@ public class OrderController {
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
@Operation(summary = "生产单导入新增")
|
||||
@Parameters({
|
||||
@Parameter(name = "file", description = "文件", required = true),
|
||||
@Parameter(name = "type", description = "文件类型", required = true),
|
||||
@Parameter(name = "id", description = "生产单id")
|
||||
})
|
||||
@OperateLog(type = IMPORT)
|
||||
@PreAuthorize("@ss.hasPermission('production:manager-list:create')")
|
||||
public void orderImport(@RequestPart("file") MultipartFile file,
|
||||
@RequestParam(value = "type") Integer type,
|
||||
@RequestParam(value = "id", required = false) Long orderId) {
|
||||
OrderImportAsyncReqVO orderImportAsyncReqVO = new OrderImportAsyncReqVO(orderId, type, null);
|
||||
orderService.orderImportAsync(orderImportAsyncReqVO, file);
|
||||
}
|
||||
|
||||
|
||||
// 生产单详情
|
||||
@GetMapping("/get-room")
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.cf.imes.module.executor.controller.admin.order.vo.order;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 生产单异步导入 reqVO
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 17:05
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderImportAsyncReqVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1237291692917676281L;
|
||||
|
||||
/**
|
||||
* 生产单id
|
||||
*/
|
||||
Long orderId;
|
||||
|
||||
/**
|
||||
* 导入类型,参考OrderImportTypeEnum
|
||||
*/
|
||||
Integer type;
|
||||
|
||||
/**
|
||||
* 外部订单号:api导入用
|
||||
*/
|
||||
String orderNo;
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.orderImport;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 生产单导入任务
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:30
|
||||
*/
|
||||
@TableName("order_import_task")
|
||||
@KeySequence("order_import_task_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderImportTaskDO extends BaseDO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
/**
|
||||
* 导入类型,参考OrderImportTypeEnum
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 导入状态
|
||||
*/
|
||||
private Integer importStatus;
|
||||
|
||||
/**
|
||||
* 消费状态
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.orderImport;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 生产单导入临时表
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:36
|
||||
*/
|
||||
@TableName("order_import_temp_data")
|
||||
@KeySequence("order_import_temp_data_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderImportTempDataDO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
/**
|
||||
* 导入任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 生产单id(补板用)
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String outerGoodsId;
|
||||
|
||||
/**
|
||||
* imes商品id
|
||||
*/
|
||||
private String innerGoodsId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
|
||||
/**
|
||||
* 材料
|
||||
*/
|
||||
private String material;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 纹路
|
||||
*/
|
||||
private String wave;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private String width;
|
||||
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private String thickness;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 是否复合部件
|
||||
*/
|
||||
@TableField("is_composite")
|
||||
private String isComposite;
|
||||
|
||||
/**
|
||||
* 配件主类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 配件子类型
|
||||
*/
|
||||
private String subType;
|
||||
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
private String roomName;
|
||||
|
||||
/**
|
||||
* 柜体名称
|
||||
*/
|
||||
private String bodyName;
|
||||
|
||||
/**
|
||||
* 加工组类型
|
||||
*/
|
||||
private String groupTypeName;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creater;
|
||||
|
||||
/**
|
||||
* 导入数据明细
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Double num;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private int sort;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.orderImport;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderImport.OrderImportTaskDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产单导入任务 Mapper
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderImportTaskMapper extends BaseMapper<OrderImportTaskDO> {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.orderImport;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.injector.BaseBatchMapper;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderImport.OrderImportTempDataDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产单导入临时表 Mapper
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderImportTempDataMapper extends BaseBatchMapper<OrderImportTempDataDO> {
|
||||
}
|
||||
+2
-2
@@ -98,12 +98,12 @@ public class BodyNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRuleS
|
||||
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
|
||||
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
|
||||
if (ObjectUtil.equal(ResetModeEnum.ORDER, resetModeEnum)) {
|
||||
orderCustomPlateNoSeqVO.setBodyNoSeq(ruleDTO.getInitValue());
|
||||
orderCustomPlateNoSeqVO.setBodyNoSeq(null);
|
||||
} else if (ObjectUtil.equal(ResetModeEnum.ROOM, resetModeEnum)) {
|
||||
List<OrderCustomPlateNoSeqRoomVO> rooms = orderCustomPlateNoSeqVO.getRooms();
|
||||
if (CollUtil.isNotEmpty(rooms)) {
|
||||
for (OrderCustomPlateNoSeqRoomVO roomVO : rooms) {
|
||||
roomVO.setBodyNoSeq(ruleDTO.getInitValue());
|
||||
roomVO.setBodyNoSeq(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ public class OrderNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
|
||||
for (OrderDO orderDO : orderDOS) {
|
||||
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
|
||||
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
|
||||
orderCustomPlateNoSeqVO.setOrderNoSeq(ruleDTO.getInitValue());
|
||||
orderCustomPlateNoSeqVO.setOrderNoSeq(null);
|
||||
orderMapper.update(new LambdaUpdateWrapper<OrderDO>().eq(OrderDO::getId, orderDO.getId()).set(OrderDO::getCustomPlatenoSeq, JsonUtils.zipString(JSON.toJSONString(orderCustomPlateNoSeqVO))));
|
||||
}
|
||||
}
|
||||
|
||||
+7
-10
@@ -93,18 +93,17 @@ public class PlateNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
|
||||
List<OrderDO> orderDOS = orderMapper.selectList(
|
||||
new LambdaQueryWrapper<OrderDO>().eq(OrderDO::getCustomPlatenoConfigId, configId).eq(OrderDO::getOrganId, OrganContextHolder.getOrganId()));
|
||||
|
||||
Integer initValue = ruleDTO.getInitValue();
|
||||
ResetModeEnum resetModeEnum = ResetModeEnum.getByMode(ruleDTO.getResetMode());
|
||||
// 根据复位模式更新生产单的序号
|
||||
for (OrderDO orderDO : orderDOS) {
|
||||
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
|
||||
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
|
||||
if (ObjectUtil.equal(ResetModeEnum.ORDER, resetModeEnum)) {
|
||||
orderCustomPlateNoSeqVO.setPlateNoSeq(initValue);
|
||||
orderCustomPlateNoSeqVO.setPlateNoSeq(null);
|
||||
} else if (ObjectUtil.equal(ResetModeEnum.ROOM, resetModeEnum)) {
|
||||
resetRoomPlateSeq(orderCustomPlateNoSeqVO.getRooms(), initValue);
|
||||
resetRoomPlateSeq(orderCustomPlateNoSeqVO.getRooms());
|
||||
} else if (ObjectUtil.equal(ResetModeEnum.BODY, resetModeEnum)) {
|
||||
resetBodyPlateSeq(orderCustomPlateNoSeqVO.getRooms(), initValue);
|
||||
resetBodyPlateSeq(orderCustomPlateNoSeqVO.getRooms());
|
||||
}
|
||||
orderMapper.update(new LambdaUpdateWrapper<OrderDO>().eq(OrderDO::getId, orderDO.getId()).set(OrderDO::getCustomPlatenoSeq, JsonUtils.zipString(JSON.toJSONString(orderCustomPlateNoSeqVO))));
|
||||
}
|
||||
@@ -115,12 +114,11 @@ public class PlateNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
|
||||
* 复位生产单下房间中的板件序号
|
||||
*
|
||||
* @param rooms
|
||||
* @param initValue
|
||||
*/
|
||||
private void resetRoomPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms, Integer initValue) {
|
||||
private void resetRoomPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms) {
|
||||
if (CollUtil.isNotEmpty(rooms)) {
|
||||
for (OrderCustomPlateNoSeqRoomVO roomVO : rooms) {
|
||||
roomVO.setPlateNoSeq(initValue);
|
||||
roomVO.setPlateNoSeq(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,15 +127,14 @@ public class PlateNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
|
||||
* 复位生产单下柜体中的板件序号
|
||||
*
|
||||
* @param rooms
|
||||
* @param initValue
|
||||
*/
|
||||
private void resetBodyPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms, Integer initValue) {
|
||||
private void resetBodyPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms) {
|
||||
if (CollUtil.isNotEmpty(rooms)) {
|
||||
for (OrderCustomPlateNoSeqRoomVO roomVO : rooms) {
|
||||
List<OrderCustomPlateNoSeqBodyVO> bodys = roomVO.getBodys();
|
||||
if (CollUtil.isNotEmpty(bodys)) {
|
||||
for (OrderCustomPlateNoSeqBodyVO bodyVO : bodys) {
|
||||
bodyVO.setPlateNoSeq(initValue);
|
||||
bodyVO.setPlateNoSeq(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public class RoomNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRuleS
|
||||
for (OrderDO orderDO : orderDOS) {
|
||||
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
|
||||
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
|
||||
orderCustomPlateNoSeqVO.setRoomNoSeq(ruleDTO.getInitValue());
|
||||
orderCustomPlateNoSeqVO.setRoomNoSeq(null);
|
||||
orderMapper.update(new LambdaUpdateWrapper<OrderDO>().eq(OrderDO::getId, orderDO.getId()).set(OrderDO::getCustomPlatenoSeq, JsonUtils.zipString(JSON.toJSONString(orderCustomPlateNoSeqVO))));
|
||||
}
|
||||
}
|
||||
|
||||
+26
-18
@@ -10,6 +10,7 @@ import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsResp
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiDataTypeVo;
|
||||
import org.springframework.boot.system.ApplicationHome;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
@@ -39,7 +40,7 @@ public interface OrderService {
|
||||
* @param id 编号
|
||||
* @return 生产单表 order_{N}
|
||||
*/
|
||||
OrderDO getOrder(Long id );
|
||||
OrderDO getOrder(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单表 order_{N}分页
|
||||
@@ -63,44 +64,45 @@ public interface OrderService {
|
||||
* @param orderId: 生产单Id
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String,Object> getModule(Long orderId, Integer deleted);
|
||||
Map<String, Object> getModule(Long orderId, Integer deleted);
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @return List<OrderPlatesDetailReqVO>
|
||||
* 需要修改返回值
|
||||
* 需要修改返回值
|
||||
*/
|
||||
PageResult<OrderPlatesDetailReqVO> getPlatesDetail(Long orderId, Set<Long> roomId, Set<Long> bodyId, Set<Long> groupId, String groupName, Integer pageNo, Integer pageSize, Integer deleted);
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @return List<OrderPartsRespVO>
|
||||
* 需要修改返回值
|
||||
* 需要修改返回值
|
||||
*/
|
||||
PageResult<OrderPartsRespVO> getPartsDetail(Long orderId, Set<Long> roomId , Set<Long> bodyId, Set<Long> groupId, String name, Integer pageNo, Integer pageSize, Integer deleted, Set<String> types);
|
||||
PageResult<OrderPartsRespVO> getPartsDetail(Long orderId, Set<Long> roomId, Set<Long> bodyId, Set<Long> groupId, String name, Integer pageNo, Integer pageSize, Integer deleted, Set<String> types);
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @return List<OrderGoodsDetailRespVO>
|
||||
* 需要修改返回值
|
||||
* 需要修改返回值
|
||||
*/
|
||||
PageResult<OrderGoodsDetailRespVO> getGoodsDetail(Long orderId, Set<Long> roomId , Set<Long> bodyId, Set<Long> groupId, Set<Long> goodsId, Integer pageNo, Integer pageSize, Integer deleted);
|
||||
PageResult<OrderGoodsDetailRespVO> getGoodsDetail(Long orderId, Set<Long> roomId, Set<Long> bodyId, Set<Long> groupId, Set<Long> goodsId, Integer pageNo, Integer pageSize, Integer deleted);
|
||||
|
||||
/**
|
||||
* 删除柜体/柜体还原
|
||||
*
|
||||
* @param orderId: 生产单id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
*/
|
||||
void updateDeleteBody(Long orderId , Set<Long> roomId, Long bodyId, Integer status);
|
||||
void updateDeleteBody(Long orderId, Set<Long> roomId, Long bodyId, Integer status);
|
||||
|
||||
void updateRestoreBody(Long orderId , Set<Long> roomId, Long bodyId, Integer status);
|
||||
void updateRestoreBody(Long orderId, Set<Long> roomId, Long bodyId, Integer status);
|
||||
|
||||
/**
|
||||
* @param apiDataTypeVo:生产单号
|
||||
@@ -121,7 +123,7 @@ public interface OrderService {
|
||||
/**
|
||||
* 打印/导出数据获取 (单文件)
|
||||
*/
|
||||
Map<String, Object> getPrintDataMap(Long orderId, String type,HttpServletResponse response) ;
|
||||
Map<String, Object> getPrintDataMap(Long orderId, String type, HttpServletResponse response);
|
||||
|
||||
default String getSavePath() {
|
||||
ApplicationHome applicationHome = new ApplicationHome(this.getClass());
|
||||
@@ -164,4 +166,10 @@ public interface OrderService {
|
||||
*/
|
||||
void realDeletedOrder(Long orderId);
|
||||
|
||||
/**
|
||||
* 生产单异步导入
|
||||
*
|
||||
* @param importAsyncReqVO
|
||||
*/
|
||||
void orderImportAsync(OrderImportAsyncReqVO importAsyncReqVO, MultipartFile file);
|
||||
}
|
||||
+28
-1
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.executor.service.order;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -10,10 +11,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.enums.DeletedCodeEnum;
|
||||
import com.cf.imes.framework.common.enums.OrderPackageStatusEnum;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
@@ -62,13 +65,17 @@ import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
import com.cf.imes.module.executor.service.customplateno.CustomPlateNoGenerateService;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.FieldConstants;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.PlateDetail;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.executor.service.orderImport.OrderImportHandler;
|
||||
import com.cf.imes.module.executor.service.orderImport.factory.OrderImportHandlerFactory;
|
||||
import com.cf.imes.module.executor.service.plan.PlanService;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiDataTypeVo;
|
||||
import org.springframework.aop.framework.AopContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -162,6 +169,13 @@ public class OrderServiceImpl implements OrderService {
|
||||
String ORDER_REMAIN_PLATE_MODEL = "imes_order_optimize_plate_model";
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private PlanService planService;
|
||||
|
||||
@Autowired
|
||||
private OrderImportHandlerFactory orderImportHandlerFactory;
|
||||
|
||||
@Override
|
||||
public void updateOrder(OrderSaveReqVO updateReqVO) {
|
||||
// 校验存在, 生产单未删除
|
||||
@@ -1377,5 +1391,18 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void orderImportAsync(OrderImportAsyncReqVO importAsyncReqVO, MultipartFile file) {
|
||||
// 根据导入类型和工厂(预留)获取处理类
|
||||
OrderImportHandler orderImportHandler = orderImportHandlerFactory.getOrderImportHandler(importAsyncReqVO.getType(), null);
|
||||
// 如果是补板校验生产单存在
|
||||
Long orderId = importAsyncReqVO.getOrderId();
|
||||
if (ObjectUtil.isNotNull(orderId)) {
|
||||
Optional.ofNullable(getOrder(orderId)).orElseThrow(() -> ServiceExceptionUtil.exception(ORDER_IMPORT_ORDER_NOT_EXISTS, orderId));
|
||||
}
|
||||
// 准备前置数据,准备完成发送消息消费解析临时表
|
||||
orderImportHandler.prepareAndConvert(importAsyncReqVO, file);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.service.orderImport;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderImportAsyncReqVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 生产单导入处理器抽象类
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/11/8 16:45
|
||||
*/
|
||||
public interface OrderImportHandler {
|
||||
/**
|
||||
* 获取工厂名,默认走default
|
||||
* @return
|
||||
*/
|
||||
String getFactoryName();
|
||||
|
||||
/**
|
||||
* 准备、转换前置数据
|
||||
*
|
||||
*/
|
||||
void prepareAndConvert(OrderImportAsyncReqVO importAsyncReqVO, MultipartFile file);
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.factory;
|
||||
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.module.executor.enums.ErrorCodeConstants;
|
||||
import com.cf.imes.module.executor.enums.OrderImportTypeEnum;
|
||||
import com.cf.imes.module.executor.service.orderImport.OrderImportHandler;
|
||||
import com.cf.imes.module.executor.service.orderImport.handler.api.AbstractApiOrderImportHandler;
|
||||
import com.cf.imes.module.executor.service.orderImport.handler.excel.AbstractExcelOrderImportHandler;
|
||||
import com.cf.imes.module.executor.service.orderImport.handler.json.AbstractJsonOrderImportHandler;
|
||||
import com.cf.imes.module.executor.service.orderImport.handler.xml.AbstractXmlOrderImportHandler;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 生产单导入处理器工厂类
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/11/28 16:21
|
||||
*/
|
||||
@Component
|
||||
public class OrderImportHandlerFactory {
|
||||
private final ApplicationContext applicationContext;
|
||||
|
||||
@Autowired
|
||||
public OrderImportHandlerFactory(ApplicationContext applicationContext) {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据导入类型获取对应的处理器
|
||||
*
|
||||
* @param type 导入类型
|
||||
* @param factoryName 工厂名称预留
|
||||
* @return
|
||||
*/
|
||||
public OrderImportHandler getOrderImportHandler(int type, String factoryName) {
|
||||
OrderImportTypeEnum importTypeEnum = OrderImportTypeEnum.match(type);
|
||||
// 没有传入工厂/厂商用default
|
||||
if (StringUtils.isEmpty(factoryName)) {
|
||||
factoryName = "default";
|
||||
}
|
||||
ServiceException typeNotSupportException = ServiceExceptionUtil.exception(ErrorCodeConstants.ORDER_IMPORT_TYPE_NOT_SUPPORT, type);
|
||||
switch (importTypeEnum) {
|
||||
case EXCEL:
|
||||
return Optional.ofNullable(getExcelHandler(factoryName)).orElseThrow(() -> typeNotSupportException);
|
||||
case JSON:
|
||||
return Optional.ofNullable(getJsonHandler(factoryName)).orElseThrow(() -> typeNotSupportException);
|
||||
case XML:
|
||||
return Optional.ofNullable(getXmlHandler(factoryName)).orElseThrow(() -> typeNotSupportException);
|
||||
case API:
|
||||
return Optional.ofNullable(getApiHandler(factoryName)).orElseThrow(() -> typeNotSupportException);
|
||||
default:
|
||||
throw typeNotSupportException;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取excel处理类
|
||||
*
|
||||
* @param factoryName
|
||||
* @return
|
||||
*/
|
||||
private OrderImportHandler getExcelHandler(String factoryName) {
|
||||
for (Map.Entry<String, AbstractExcelOrderImportHandler> entry : applicationContext.getBeansOfType(AbstractExcelOrderImportHandler.class).entrySet()) {
|
||||
AbstractExcelOrderImportHandler entryValue = entry.getValue();
|
||||
if (factoryName.equals(entryValue.getFactoryName())) {
|
||||
return entryValue;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取json处理类
|
||||
*
|
||||
* @param factoryName
|
||||
* @return
|
||||
*/
|
||||
private OrderImportHandler getJsonHandler(String factoryName) {
|
||||
for (Map.Entry<String, AbstractJsonOrderImportHandler> entry : applicationContext.getBeansOfType(AbstractJsonOrderImportHandler.class).entrySet()) {
|
||||
AbstractJsonOrderImportHandler entryValue = entry.getValue();
|
||||
if (factoryName.equals(entryValue.getFactoryName())) {
|
||||
return entryValue;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取xml处理类
|
||||
*
|
||||
* @param factoryName
|
||||
* @return
|
||||
*/
|
||||
private OrderImportHandler getXmlHandler(String factoryName) {
|
||||
for (Map.Entry<String, AbstractXmlOrderImportHandler> entry : applicationContext.getBeansOfType(AbstractXmlOrderImportHandler.class).entrySet()) {
|
||||
AbstractXmlOrderImportHandler entryValue = entry.getValue();
|
||||
if (factoryName.equals(entryValue.getFactoryName())) {
|
||||
return entryValue;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取api处理类
|
||||
*
|
||||
* @param factoryName
|
||||
* @return
|
||||
*/
|
||||
private OrderImportHandler getApiHandler(String factoryName) {
|
||||
for (Map.Entry<String, AbstractApiOrderImportHandler> entry : applicationContext.getBeansOfType(AbstractApiOrderImportHandler.class).entrySet()) {
|
||||
AbstractApiOrderImportHandler entryValue = entry.getValue();
|
||||
if (factoryName.equals(entryValue.getFactoryName())) {
|
||||
return entryValue;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.api;
|
||||
|
||||
import com.cf.imes.module.executor.service.orderImport.OrderImportHandler;
|
||||
|
||||
/**
|
||||
* 生产单api导入处理器抽象类
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:35
|
||||
*/
|
||||
public interface AbstractApiOrderImportHandler extends OrderImportHandler {
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.api;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderImportAsyncReqVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 默认api生产单导入处理器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 9:21
|
||||
*/
|
||||
@Service("defaultApiOrderImportHandler")
|
||||
@Slf4j
|
||||
public class DefaultApiOrderImportHandler implements AbstractApiOrderImportHandler {
|
||||
@Override
|
||||
public String getFactoryName() {
|
||||
return "default";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareAndConvert(OrderImportAsyncReqVO importAsyncReqVO, MultipartFile file) {
|
||||
// todo api 准备、转换前置数据
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.excel;
|
||||
|
||||
import com.cf.imes.module.executor.service.orderImport.OrderImportHandler;
|
||||
|
||||
/**
|
||||
* 生产单excel导入处理器抽象类
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:35
|
||||
*/
|
||||
public interface AbstractExcelOrderImportHandler extends OrderImportHandler {
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.excel;
|
||||
|
||||
import com.alibaba.excel.EasyExcelFactory;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.mq.rabbitmq.constant.RabbitMqConstants;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.redis.config.ChenfengCacheProperties;
|
||||
import com.cf.imes.framework.redis.constants.RedisKeyConstants;
|
||||
import com.cf.imes.framework.redis.util.RedisLockUtil;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderImportAsyncReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderImport.OrderImportTaskDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderImport.OrderImportTaskMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderImport.OrderImportTempDataMapper;
|
||||
import com.cf.imes.module.executor.enums.OrderImportStatusEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderImportTaskStatusEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderImportTypeEnum;
|
||||
import com.cf.imes.module.executor.service.order.OrderService;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.DefaultOrderImportExcelListener;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.core.MessageBuilder;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_FILE_ANALYZE_ERROR;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_ORGAN_LOCK_ERROR;
|
||||
|
||||
/**
|
||||
* 默认excel生产单导入处理器
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 9:21
|
||||
*/
|
||||
@Service("defaultExcelOrderImportHandler")
|
||||
@Slf4j
|
||||
public class DefaultExcelOrderImportHandler implements AbstractExcelOrderImportHandler {
|
||||
|
||||
@Resource
|
||||
private OrderImportTempDataMapper orderImportTempDataMapper;
|
||||
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@Resource
|
||||
private SnowFlakeGenerator snowFlakeGenerator;
|
||||
|
||||
@Resource
|
||||
private OrderImportTaskMapper orderImportTaskMapper;
|
||||
|
||||
@Resource
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Resource
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
@Resource
|
||||
private RedisLockUtil redisLockUtil;
|
||||
|
||||
@Resource
|
||||
private ChenfengCacheProperties chenfengCacheProperties;
|
||||
|
||||
@Override
|
||||
public String getFactoryName() {
|
||||
return "default";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void prepareAndConvert(OrderImportAsyncReqVO importAsyncReqVO, MultipartFile file) {
|
||||
// 创建任务
|
||||
Long taskId = createImportTask();
|
||||
String importLockKey = String.format(RedisKeyConstants.ORDER_IMPORT_LOCK_KEY, getUserOrganId());
|
||||
// 检查机构导入锁
|
||||
boolean lockResult = redisLockUtil.lock(importLockKey, String.valueOf(taskId), chenfengCacheProperties.getLockTimeout());
|
||||
if (!lockResult) {
|
||||
throw new ServiceException(ORDER_IMPORT_ORGAN_LOCK_ERROR);
|
||||
}
|
||||
DefaultOrderImportExcelListener excelListener =
|
||||
new DefaultOrderImportExcelListener(orderImportTempDataMapper, orderService, dictDataApi, snowFlakeGenerator, importAsyncReqVO.getOrderId(), taskId);
|
||||
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
// 读取excel
|
||||
EasyExcelFactory.read(inputStream, excelListener).headRowNumber(-1).sheet().doRead();
|
||||
} catch (ServiceException sev) {
|
||||
// 导入锁解锁
|
||||
redisLockUtil.unlock(importLockKey, taskId.toString());
|
||||
throw sev;
|
||||
} catch (Exception e) {
|
||||
log.error(ORDER_IMPORT_FILE_ANALYZE_ERROR.getMsg(), e);
|
||||
// 导入锁解锁
|
||||
redisLockUtil.unlock(importLockKey, taskId.toString());
|
||||
throw new ServiceException(ORDER_IMPORT_FILE_ANALYZE_ERROR);
|
||||
}
|
||||
|
||||
Message message = MessageBuilder
|
||||
.withBody(taskId.toString().getBytes())
|
||||
.setHeader("x-message-ttl", 60000) // 设置 TTL 为 60000 毫秒(60 秒)
|
||||
.build();
|
||||
//如果处于事务中,待事务提交成功了再执行后续操作,防止事务未提交完成导致消费端查不到数据
|
||||
if (TransactionSynchronizationManager.isActualTransactionActive()) {
|
||||
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
|
||||
@Override
|
||||
public void afterCommit() {
|
||||
// 数据库操作全部完成发送消息
|
||||
rabbitTemplate.convertAndSend(RabbitMqConstants.ORDER_IMPORT_DEFAULT_EXCEL_EXCHANGE, null, message);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 数据库操作全部完成发送消息
|
||||
rabbitTemplate.convertAndSend(RabbitMqConstants.ORDER_IMPORT_DEFAULT_EXCEL_EXCHANGE, null, message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建导入任务
|
||||
*
|
||||
* @return taskId
|
||||
*/
|
||||
private Long createImportTask() {
|
||||
// 创建导入任务
|
||||
OrderImportTaskDO orderImportTaskDO = OrderImportTaskDO.builder()
|
||||
.id((Long) snowFlakeGenerator.nextId(null))
|
||||
.type(OrderImportTypeEnum.EXCEL.getType())
|
||||
.importStatus(OrderImportStatusEnum.IMPORT_NOT_YET.getStatus())
|
||||
.status(OrderImportTaskStatusEnum.CREATE_NOT_CONSUME.getStatus())
|
||||
.build();
|
||||
orderImportTaskMapper.insert(orderImportTaskDO);
|
||||
return orderImportTaskDO.getId();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.json;
|
||||
|
||||
|
||||
import com.cf.imes.module.executor.service.orderImport.OrderImportHandler;
|
||||
|
||||
/**
|
||||
* 生产单json导入处理器抽象类
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:35
|
||||
*/
|
||||
public interface AbstractJsonOrderImportHandler extends OrderImportHandler {
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.json;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderImportAsyncReqVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 默认json生产单导入处理器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 9:21
|
||||
*/
|
||||
@Service("defaultJsonOrderImportHandler")
|
||||
@Slf4j
|
||||
public class DefaultJsonOrderImportHandler implements AbstractJsonOrderImportHandler {
|
||||
@Override
|
||||
public String getFactoryName() {
|
||||
return "default";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareAndConvert(OrderImportAsyncReqVO importAsyncReqVO, MultipartFile file) {
|
||||
// todo json 准备、转换前置数据
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.xml;
|
||||
|
||||
import com.cf.imes.module.executor.service.orderImport.OrderImportHandler;
|
||||
|
||||
/**
|
||||
* 生产单xml导入处理器抽象类
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/8 16:35
|
||||
*/
|
||||
public interface AbstractXmlOrderImportHandler extends OrderImportHandler {
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.service.orderImport.handler.xml;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderImportAsyncReqVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 9:21
|
||||
*/
|
||||
@Service("defaultXmlOrderImportHandler")
|
||||
@Slf4j
|
||||
public class DefaultXmlOrderImportHandler implements AbstractXmlOrderImportHandler {
|
||||
@Override
|
||||
public String getFactoryName() {
|
||||
return "default";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareAndConvert(OrderImportAsyncReqVO importAsyncReqVO, MultipartFile file) {
|
||||
// todo xml 准备、转换前置数据
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -20,6 +20,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||
@@ -49,7 +50,6 @@ import com.cf.imes.module.executor.enums.OrderItemType;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
import com.cf.imes.module.executor.service.plan.PlanService;
|
||||
import com.cf.imes.module.executor.util.elasticsearch.EsUtils;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.cf.imes.module.executor.util;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class MinuteCounter {
|
||||
private static final int MASK = 0x7FFFFFFF;
|
||||
private final AtomicInteger atom;
|
||||
|
||||
public MinuteCounter() {
|
||||
atom = new AtomicInteger(0);
|
||||
}
|
||||
|
||||
public final int incrementAndGet() {
|
||||
return atom.incrementAndGet() & MASK;
|
||||
}
|
||||
|
||||
public int get() {
|
||||
return atom.get() & MASK;
|
||||
}
|
||||
|
||||
public void set(int newValue) {
|
||||
atom.set(newValue & MASK);
|
||||
}
|
||||
|
||||
}
|
||||
-133
@@ -1,133 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin;
|
||||
|
||||
|
||||
import com.cf.imes.module.executor.util.MinuteCounter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @ClassName: SnowflakeIdWorker3rd
|
||||
* @Description:snowflake算法改进
|
||||
* @author: yonnie
|
||||
* @date: 2024/06/18 14:10:47
|
||||
* @version V1.0
|
||||
*
|
||||
* 将产生的Id类型更改为Integer 32bit <br>
|
||||
* 把时间戳的单位改为分钟,使用25bit的时间戳
|
||||
* 7bit作为自增值即 2^7 = 128
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SnowflakeIdWorker3rd {
|
||||
/** 初始时间 (2024-01-01: 1704038400) */
|
||||
// private final int twepoch = 28400640;// 1704038400000L/1000/60;
|
||||
private final int twepoch = 1704038400;
|
||||
/** 序列在id中占位数 */
|
||||
private final long sequenceBits = 7L;
|
||||
/** 时间截向左移7bit */
|
||||
private final long timestampLeftShift = sequenceBits;
|
||||
/** 生成序列的MASK (0x7F) */
|
||||
private final int sequenceMask = -1 ^ (-1 << sequenceBits);
|
||||
/** 分钟内序 (0~127) */
|
||||
private int sequence = 0;
|
||||
private int laterSequence = 0;
|
||||
/** 上次生成ID的时间戳 */
|
||||
private int lastTimestamp = -1;
|
||||
private final MinuteCounter counter = new MinuteCounter();
|
||||
/** 预支时间标志 */
|
||||
boolean isAdvance = false;
|
||||
|
||||
// ==============================Constructors=====================================
|
||||
|
||||
public SnowflakeIdWorker3rd() {
|
||||
// No Args Constructors
|
||||
}
|
||||
|
||||
// ==============================Test=============================================
|
||||
|
||||
/** 测试 */
|
||||
public static void main(String[] args) {
|
||||
SnowflakeIdWorker3rd idWorker = new SnowflakeIdWorker3rd();
|
||||
long obtainingTime = idWorker.obtainingTime();
|
||||
for (int i = 0; i < 10001; i++) {
|
||||
long id = idWorker.nextId();
|
||||
System.out.println(i + ": " + id + " " + obtainingTime + Long.toString(id).substring(2));
|
||||
}
|
||||
// long id = idWorker.nextId();
|
||||
// System.out.println(id);
|
||||
}
|
||||
|
||||
// ==============================Methods==========================================
|
||||
/**
|
||||
* 获取当前年月
|
||||
* @return null
|
||||
*/
|
||||
public static int obtainingTime() {
|
||||
LocalDate now = LocalDate.now();
|
||||
int year = now.getYear();
|
||||
String year_last_two_digits = String.valueOf(year).substring(2);
|
||||
int month = now.getMonthValue();
|
||||
String formatted_date = year_last_two_digits + String.format("%02d", month);
|
||||
return Integer.parseInt(formatted_date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得下一个ID (该方法是线程安全)
|
||||
*
|
||||
* @return SnowflakeId
|
||||
*/
|
||||
public synchronized int nextId() {
|
||||
int timestamp = timeGen();
|
||||
// 如果当前时间小于上一次ID生成的时间戳,说明系统时钟修改过
|
||||
if (timestamp < lastTimestamp) {
|
||||
throw new RuntimeException(String.format(
|
||||
"Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
|
||||
}
|
||||
|
||||
if (timestamp > counter.get()) {
|
||||
counter.set(timestamp);
|
||||
isAdvance = false;
|
||||
}
|
||||
|
||||
// 如果是同时间生成的,则进行分钟内序列
|
||||
if (lastTimestamp == timestamp || isAdvance) {
|
||||
if (!isAdvance) {
|
||||
sequence = (sequence + 1) & sequenceMask;
|
||||
}
|
||||
|
||||
// 分钟内自增列溢出
|
||||
if (sequence == 0) {
|
||||
// 预支下一分获得新的时间戳
|
||||
isAdvance = true;
|
||||
int laterTimestamp = counter.get();
|
||||
if (laterSequence == 0) {
|
||||
laterTimestamp = counter.incrementAndGet();
|
||||
}
|
||||
int nextId = ((laterTimestamp - twepoch) << timestampLeftShift) | laterSequence;
|
||||
laterSequence = (laterSequence + 1) & sequenceMask;
|
||||
return nextId;
|
||||
}
|
||||
} else { // 时间戳改变,分钟内序列置0
|
||||
sequence = 0;
|
||||
laterSequence = 0;
|
||||
}
|
||||
// 上次生成ID的时间截
|
||||
lastTimestamp = timestamp;
|
||||
// 移位并或运算拼成32位的ID
|
||||
return ((timestamp - twepoch) << timestampLeftShift) | sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回以分钟为单位的当前时
|
||||
*
|
||||
* @return 当前时间(分钟)
|
||||
*/
|
||||
protected int timeGen() {
|
||||
// String timestamp = String.valueOf(System.currentTimeMillis() / 1000 / 60);
|
||||
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
|
||||
return Integer.valueOf(timestamp);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;//packa
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRemark;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.dto.Point;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
@@ -14,7 +15,6 @@ import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.module.executor.enums.*;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.*;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
+721
@@ -0,0 +1,721 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
|
||||
import com.alibaba.excel.util.ListUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.framework.web.core.util.WebFrameworkUtils;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderImport.OrderImportTempDataDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderImport.OrderImportTempDataMapper;
|
||||
import com.cf.imes.module.executor.enums.CategoryEnum;
|
||||
import com.cf.imes.module.executor.enums.DataTypeEnum;
|
||||
import com.cf.imes.module.executor.enums.DictTypeConstants;
|
||||
import com.cf.imes.module.executor.enums.IsHavaeEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderImportConstants;
|
||||
import com.cf.imes.module.executor.enums.OrderImportTmpDataTypeEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
import com.cf.imes.module.executor.enums.QuarrelEnum;
|
||||
import com.cf.imes.module.executor.service.order.OrderService;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.ToolUtil;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_DETAIL_VALID_ERROR;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_ORDER_CUSTOMERNO_EXISTS;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_ORDER_FIELD_DATE_FORMAT_ERROR;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_ORDER_FIELD_EMPTY;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_ORDER_FIELD_LENGTH_ERROR;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_IMPORT_ORDER_FIELD_MOBILE_FORMAT_ERROR;
|
||||
|
||||
/**
|
||||
* 默认生产单excel导入监听器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:14
|
||||
*/
|
||||
@Slf4j
|
||||
public final class DefaultOrderImportExcelListener extends AnalysisEventListener<Map<Integer, String>> {
|
||||
/**
|
||||
* 每500条操作入库一次
|
||||
*/
|
||||
private static final int BATCH_COUNT = 500;
|
||||
private List<OrderImportTempDataDO> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||
|
||||
/**
|
||||
* 存放生产单orders信息
|
||||
*/
|
||||
private OrderDO orderDO = OrderDO.builder().build();
|
||||
|
||||
/**
|
||||
* 停止解析标志
|
||||
*/
|
||||
private boolean stopParsing = false;
|
||||
|
||||
private OrderImportTempDataMapper orderImportTempDataMapper;
|
||||
|
||||
private OrderService orderService;
|
||||
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
private SnowFlakeGenerator snowFlakeGenerator;
|
||||
|
||||
/**
|
||||
* 补板用
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 是否补板
|
||||
*/
|
||||
boolean addToExistsOrder;
|
||||
|
||||
/**
|
||||
* 导入任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
private int sort = 1;
|
||||
|
||||
private static final String NUMBER_TYPE_ERR = "数量类型错误";
|
||||
private static final String NOT_EMPTY = "不可为空";
|
||||
private static final String ACCORD_ENUM = "请按照提示词语选择填入";
|
||||
private static final String POSITIVE_ERR = "数据需为正数";
|
||||
private static final String NUMBER_LENGTH_ERR = "数据长度过长";
|
||||
|
||||
public DefaultOrderImportExcelListener(OrderImportTempDataMapper orderImportTempDataMapper, OrderService orderService, DictDataApi dictDataApi, SnowFlakeGenerator snowFlakeGenerator, Long orderId, Long taskId) {
|
||||
this.orderImportTempDataMapper = orderImportTempDataMapper;
|
||||
this.orderService = orderService;
|
||||
this.dictDataApi = dictDataApi;
|
||||
this.snowFlakeGenerator = snowFlakeGenerator;
|
||||
this.orderId = orderId;
|
||||
this.taskId = taskId;
|
||||
// 是否补板
|
||||
addToExistsOrder = ObjectUtil.isNotNull(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(Map<Integer, String> data, AnalysisContext context) {
|
||||
log.info("解析到一条数据: {}", JSON.toJSONString(data));
|
||||
|
||||
// 获取行号
|
||||
ReadRowHolder readRowHolder = context.readRowHolder();
|
||||
Integer rowIndex = readRowHolder.getRowIndex();
|
||||
|
||||
// 生产单信息在1-5行间
|
||||
boolean isOrderInfo = (rowIndex >= 0 && rowIndex <= 4);
|
||||
// 板材/配件数据从第8行开始
|
||||
boolean isPlate = rowIndex > 6;
|
||||
|
||||
// 标记结束,后续数据不再记录
|
||||
if (data.get(0) != null && data.get(0).equals("***")) {
|
||||
log.info("解析到结束标记 ***, 停止写入!");
|
||||
stopParsing = true;
|
||||
}
|
||||
|
||||
// 缓存生产单数据
|
||||
// 补板的时候不更新生产单数据也就不缓存excel上的基础信息
|
||||
if (!stopParsing && isOrderInfo && !addToExistsOrder) {
|
||||
// 校验生产单数据
|
||||
validOrderInfo(data, rowIndex);
|
||||
}
|
||||
|
||||
// 缓存板材/配件数据
|
||||
if (!stopParsing && isPlate) {
|
||||
data.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
||||
cachedDataList.add(checkData(setOrderPlateProperty(data)));
|
||||
}
|
||||
// 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
|
||||
if (cachedDataList.size() >= BATCH_COUNT) {
|
||||
saveData();
|
||||
// 存储完成清理 list
|
||||
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext context) {
|
||||
// 这里也要保存数据,确保最后遗留的数据也存储到数据库
|
||||
saveData();
|
||||
// 保存生产单数据
|
||||
saveOrderTempData();
|
||||
log.info("所有数据解析完成!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 板材数据保存临时表
|
||||
*/
|
||||
private void saveData() {
|
||||
log.info("{}条数据,开始保存临时板材数据!", cachedDataList.size());
|
||||
orderImportTempDataMapper.insertBatchSomeColumn(cachedDataList);
|
||||
log.info("excel导入临时板材数据保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产单数据保存临时表
|
||||
*/
|
||||
private void saveOrderTempData() {
|
||||
OrderImportTempDataDO orderInfoTempDataDO = OrderImportTempDataDO.builder()
|
||||
.id((Long) snowFlakeGenerator.nextId(null))
|
||||
.orderId(orderId)
|
||||
.taskId(taskId)
|
||||
.type(OrderImportTmpDataTypeEnum.ORDER.getType())
|
||||
.createTime(LocalDateTime.now())
|
||||
.sort(0)
|
||||
.build();
|
||||
// 非补板即新增生成单,记录基础信息
|
||||
if (!addToExistsOrder) {
|
||||
orderDO.setId(orderId);
|
||||
orderDO.setStatus(NumberUtil.compare(sort, 1) > 0 ? OrderStatusEnum.NEW_ORDER.getStatus() : OrderStatusEnum.EMPTY.getStatus());
|
||||
orderInfoTempDataDO.setDetail(JsonUtils.zipString(JSON.toJSONString(orderDO)));
|
||||
}
|
||||
orderImportTempDataMapper.insert(orderInfoTempDataDO);
|
||||
log.info("excel导入临时生产单数据保存成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生产单信息校验
|
||||
*
|
||||
* @param data 行数据
|
||||
* @param rowIndex 行号
|
||||
*/
|
||||
public void validOrderInfo(Map<Integer, String> data, Integer rowIndex) {
|
||||
// 左key
|
||||
String leftKey = data.get(0);
|
||||
// 左值
|
||||
String leftVal = data.get(1);
|
||||
// 右key
|
||||
String rightKey = data.get(19);
|
||||
// 右值
|
||||
String rightVal = data.get(20);
|
||||
// 左:自定义单号(非必填)、右:客户
|
||||
if (0 == rowIndex) {
|
||||
validOrderInfoLength(leftKey, leftVal, 32);
|
||||
validCustomOrderNo(leftKey, leftVal);
|
||||
validOrderInfoEmpty(rightKey, rightVal);
|
||||
validOrderInfoLength(rightKey, rightVal, 255);
|
||||
orderDO.setCustomOrderNo(leftVal);
|
||||
orderDO.setCustomer(rightVal);
|
||||
}
|
||||
// 左:经销商、右:客户地址
|
||||
if (1 == rowIndex) {
|
||||
validOrderInfoEmpty(rightKey, rightVal);
|
||||
validOrderInfoLength(rightKey, rightVal, 255);
|
||||
validOrderInfoEmpty(leftKey, leftVal);
|
||||
validOrderInfoLength(leftKey, leftVal, 255);
|
||||
orderDO.setDealer(leftVal);
|
||||
orderDO.setAddress(rightVal);
|
||||
}
|
||||
// 左:经销商电话(非必填)、右:客户电话
|
||||
if (2 == rowIndex) {
|
||||
validOrderInfoPhone(leftKey, leftVal);
|
||||
validOrderInfoEmpty(rightKey, rightVal);
|
||||
validOrderInfoPhone(rightKey, rightVal);
|
||||
orderDO.setDealerPhoneNumber(leftVal);
|
||||
orderDO.setPhoneNumber(rightVal);
|
||||
}
|
||||
// 左:业务员(非必填)、右:出货日期
|
||||
if (3 == rowIndex) {
|
||||
validOrderInfoLength(leftKey, leftVal, 64);
|
||||
validOrderInfoEmpty(rightKey, rightVal);
|
||||
LocalDate deliverDate = validOrderInfoDate(rightKey, rightVal);
|
||||
// 出货时间早于导入时间,自动延长30天
|
||||
if (deliverDate.isBefore(LocalDate.now())) {
|
||||
deliverDate = LocalDate.now().plus(30, ChronoUnit.DAYS);
|
||||
}
|
||||
orderDO.setSalesman(leftVal);
|
||||
orderDO.setDeliveryDate(deliverDate.atStartOfDay());
|
||||
}
|
||||
// 左:拆单员(非必填)、右:备注(非必填)
|
||||
if (4 == rowIndex) {
|
||||
validOrderInfoLength(leftKey, leftVal, 64);
|
||||
validOrderInfoLength(rightKey, rightVal, 255);
|
||||
orderDO.setSplitter(leftVal);
|
||||
orderDO.setRemark(rightVal);
|
||||
}
|
||||
orderDO.setDataType(DataTypeEnum.FILE_IMPORT.getStatus());
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
orderDO.setOrderDate(now);
|
||||
orderDO.setOrganId(OrganContextHolder.getOrganId());
|
||||
String loginUserName = WebFrameworkUtils.getLoginUserName();
|
||||
orderDO.setCreator(loginUserName);
|
||||
orderDO.setUpdater(loginUserName);
|
||||
orderDO.setCreateTime(now);
|
||||
orderDO.setUpdateTime(now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义单号校验
|
||||
*
|
||||
* @param key
|
||||
* @param val
|
||||
*/
|
||||
private void validCustomOrderNo(String key, String val) {
|
||||
if (StringUtils.isNotEmpty(val) && orderService.customOrderNoIsExists(val)) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_ORDER_CUSTOMERNO_EXISTS, key, val);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验空
|
||||
*
|
||||
* @param key
|
||||
* @param val
|
||||
*/
|
||||
private void validOrderInfoEmpty(String key, String val) {
|
||||
if (StringUtils.isEmpty(val)) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_ORDER_FIELD_EMPTY, key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验长度
|
||||
*
|
||||
* @param key
|
||||
* @param val
|
||||
* @param length
|
||||
*/
|
||||
private void validOrderInfoLength(String key, String val, int length) {
|
||||
if (StringUtils.isNotEmpty(val) && length < val.length()) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_ORDER_FIELD_LENGTH_ERROR, key, length);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验手机号格式
|
||||
*
|
||||
* @param key
|
||||
* @param val
|
||||
*/
|
||||
private void validOrderInfoPhone(String key, String val) {
|
||||
if (StringUtils.isNotEmpty(val) && Boolean.FALSE.equals(ToolUtil.validatePhoneNumber(val))) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_ORDER_FIELD_MOBILE_FORMAT_ERROR, key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验时间格式
|
||||
*
|
||||
* @param key
|
||||
* @param val
|
||||
*/
|
||||
private LocalDate validOrderInfoDate(String key, String val) {
|
||||
try {
|
||||
return LocalDateTimeUtil.parseDate(val, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
} catch (Exception e) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_ORDER_FIELD_DATE_FORMAT_ERROR, key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* excel解析成importvo
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
private OrderPlateImportExcelVO setOrderPlateProperty(Map<Integer, String> data) {
|
||||
OrderPlateImportExcelVO vo = new OrderPlateImportExcelVO();
|
||||
for (Map.Entry<Integer, String> entry : data.entrySet()) {
|
||||
Integer index = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
switch (index) {
|
||||
case 0:
|
||||
vo.setOrdinal(value);
|
||||
break;
|
||||
case 1:// 类型
|
||||
vo.setGoodType(value);
|
||||
break;
|
||||
case 2:// 物料编码
|
||||
vo.setGoodsId(value);
|
||||
break;
|
||||
case 3:// 商品名称
|
||||
vo.setGoodsName(value);
|
||||
break;
|
||||
case 4:// 材质
|
||||
vo.setMaterial(value);
|
||||
break;
|
||||
case 5:// 纹理
|
||||
vo.setWave(value);
|
||||
break;
|
||||
case 6:// 颜色
|
||||
vo.setColor(value);
|
||||
break;
|
||||
case 7:// 复合部件
|
||||
vo.setIsComposite(value);
|
||||
break;
|
||||
case 8:// 配件类型
|
||||
vo.setCategory(value);
|
||||
break;
|
||||
case 9:// 子类
|
||||
vo.setType(value);
|
||||
break;
|
||||
case 10:// 厂家
|
||||
vo.setFactory(value);
|
||||
break;
|
||||
case 11:// 品牌
|
||||
vo.setBrand(value);
|
||||
break;
|
||||
case 12:// 型号
|
||||
vo.setModel(value);
|
||||
break;
|
||||
case 13:// 板材/配件长
|
||||
vo.setGoodsHeight(value);
|
||||
break;
|
||||
case 14:// 板材/配件宽
|
||||
vo.setGoodsWidth(value);
|
||||
break;
|
||||
case 15:// 板材/配件厚
|
||||
vo.setGoodsThickness(value);
|
||||
break;
|
||||
case 16:// 规格
|
||||
vo.setSpec(value);
|
||||
break;
|
||||
case 17:// 单位
|
||||
vo.setUnit(value);
|
||||
break;
|
||||
case 18:// 数量
|
||||
vo.setGoodsNumber(value);
|
||||
break;
|
||||
case 19:// 房间
|
||||
vo.setRoomsName(value);
|
||||
break;
|
||||
case 20:// 柜体
|
||||
vo.setCabinetsName(value);
|
||||
break;
|
||||
case 21:// 加工组类型
|
||||
vo.setSynthesisTypeName(value);
|
||||
break;
|
||||
case 22:// 加工组名称
|
||||
vo.setCombinationName(value);
|
||||
break;
|
||||
case 23://板名称
|
||||
vo.setName(value);
|
||||
break;
|
||||
case 24:// 自定义板编号
|
||||
vo.setPlateNo(value);
|
||||
break;
|
||||
case 25:// 成品长
|
||||
vo.setHeight(value);
|
||||
break;
|
||||
case 26:// 成品宽
|
||||
vo.setWidth(value);
|
||||
break;
|
||||
case 27:// 拆单长
|
||||
vo.setSplitHeight(value);
|
||||
break;
|
||||
case 28:// 拆单宽
|
||||
vo.setSplitWidth(value);
|
||||
break;
|
||||
case 29:// 厚
|
||||
vo.setThickness(value);
|
||||
break;
|
||||
case 30:// 左封边
|
||||
vo.setSealLeft(value);
|
||||
break;
|
||||
case 31:// 右封边
|
||||
vo.setSealRight(value);
|
||||
break;
|
||||
case 32:// 上封边
|
||||
vo.setSealUp(value);
|
||||
break;
|
||||
case 33:// 下封边
|
||||
vo.setSealDown(value);
|
||||
break;
|
||||
case 34:// 排版面
|
||||
vo.setTypographicFace(value);
|
||||
break;
|
||||
case 35:// 纹路
|
||||
vo.setTexture(value);
|
||||
break;
|
||||
case 36:// 开门方向
|
||||
vo.setOpenDoorType(value);
|
||||
break;
|
||||
case 37://备注1
|
||||
vo.setRemark1(value);
|
||||
break;
|
||||
case 38://备注2
|
||||
vo.setRemark2(value);
|
||||
break;
|
||||
case 39://备注3
|
||||
vo.setRemark3(value);
|
||||
break;
|
||||
case 40://备注4
|
||||
vo.setRemark4(value);
|
||||
break;
|
||||
case 41://备注5
|
||||
vo.setRemark5(value);
|
||||
break;
|
||||
case 42://备注6
|
||||
vo.setRemark6(value);
|
||||
break;
|
||||
case 43://备注7
|
||||
vo.setRemark7(value);
|
||||
break;
|
||||
case 44://备注8
|
||||
vo.setRemark8(value);
|
||||
break;
|
||||
case 45://备注9
|
||||
vo.setRemark9(value);
|
||||
break;
|
||||
case 46://备注10
|
||||
vo.setRemark10(value);
|
||||
break;
|
||||
default:
|
||||
// 处理默认情况,可以选择忽略或者做其他处理
|
||||
break;
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
private OrderImportTempDataDO checkData(OrderPlateImportExcelVO vo) {
|
||||
// 全部需要值的字段
|
||||
// 检查非空 类型、数量
|
||||
isEmpty(vo.getGoodType(), "类型", 32);
|
||||
isEmpty(vo.getGoodsNumber(), "数量", 10000000);
|
||||
|
||||
// 检查商品物料编码或是商品名称、规格、材质、颜色不可全为空
|
||||
if (StringUtils.isEmpty(vo.getGoodsName()) || StringUtils.isEmpty(vo.getSpec())
|
||||
|| StringUtils.isEmpty(vo.getMaterial()) || StringUtils.isEmpty(vo.getColor()) || StringUtils.isEmpty(vo.getUnit())) {
|
||||
throw new ServiceException(10000, "商品商品名称、规格、材质、颜色、单位不可为空");
|
||||
}
|
||||
|
||||
|
||||
if (StringUtils.equals(vo.getGoodType(), "配件")) {
|
||||
// 复合部件必填
|
||||
isNotEmptyAndBack(vo.getIsComposite(), QuarrelEnum.class, "是否复合部件", 1); // 判断传入的值,是否符合字典中的枚举类
|
||||
// 配件类型必填
|
||||
isNotEmptyAndBack(vo.getCategory(), CategoryEnum.class, "配件类型", 32);
|
||||
// 配件长宽厚,存在判断是否可以转义
|
||||
isEmptyAndPositiveNumberSize(vo.getGoodsWidth(), Double.class, 5, 3, "配件宽");
|
||||
isEmptyAndPositiveNumberSize(vo.getGoodsHeight(), Double.class, 5, 3, "配件高");
|
||||
isEmptyAndPositiveNumberSize(vo.getGoodsThickness(), Double.class, 5, 3, "配件厚");
|
||||
// 配件类型为封边条的时候,需要填写配件宽厚
|
||||
if (StringUtils.equals(vo.getCategory(), CategoryEnum.EDGING.getValue())) { // 封边条必须有宽高
|
||||
isNotEmptyAndBack(vo.getGoodsWidth(), "封边条宽");
|
||||
isNotEmptyAndBack(vo.getGoodsThickness(), "封边条厚");
|
||||
}
|
||||
// 配件数量判断
|
||||
isEmptyAndPositiveNumber(vo.getGoodsNumber(), Double.class, "配件数量");
|
||||
}
|
||||
// 若商品类型为板材,需检查房间、柜体、板名称、成品长、成品宽、拆单长、拆单宽、厚、左封边、右封边、上封边、下封边、排版面、纹路、开门方向不能为空
|
||||
boolean isPlate = StringUtils.equals(vo.getGoodType(), "板材");
|
||||
if (isPlate) {
|
||||
checkPlate(vo);
|
||||
}
|
||||
|
||||
// 校验通过生成临时表实体
|
||||
OrderImportTempDataDO orderImportTempDataDO = OrderImportTempDataDO.builder()
|
||||
.id((Long) snowFlakeGenerator.nextId(null))
|
||||
.taskId(taskId)
|
||||
.orderId(orderId)
|
||||
.type(isPlate ? OrderImportTmpDataTypeEnum.PLATE.getType() : OrderImportTmpDataTypeEnum.PART.getType())
|
||||
.outerGoodsId(StringUtils.isNotEmpty(vo.getGoodsId()) ? vo.getGoodsId() : OrderImportConstants.DEFAULT_GOODS_ID)
|
||||
.goodsName(vo.getGoodsName())
|
||||
.material(vo.getMaterial())
|
||||
.color(vo.getColor())
|
||||
.wave(StringUtils.equals("有", vo.getWave()) ? "true" : "false")
|
||||
.width(vo.getGoodsWidth())
|
||||
.height(vo.getGoodsHeight())
|
||||
.thickness(vo.getGoodsThickness())
|
||||
.brand(vo.getBrand())
|
||||
.isComposite(vo.getIsComposite())
|
||||
.category(vo.getCategory())
|
||||
.subType(vo.getType())
|
||||
.factory(vo.getFactory())
|
||||
.spec(vo.getSpec())
|
||||
.model(vo.getModel())
|
||||
.unit(vo.getUnit())
|
||||
.roomName(StringUtils.isNotEmpty(vo.getRoomsName()) ? vo.getRoomsName() : OrderImportConstants.NOT_ASSIGNED)
|
||||
.bodyName(StringUtils.isNotEmpty(vo.getCabinetsName()) ? vo.getCabinetsName() : OrderImportConstants.NOT_ASSIGNED)
|
||||
.groupTypeName(vo.getSynthesisTypeName())
|
||||
.groupName(vo.getCombinationName())
|
||||
.detail(JsonUtils.zipString(JSON.toJSONString(vo)))
|
||||
.num(Double.parseDouble(vo.getGoodsNumber()))
|
||||
.createTime(LocalDateTime.now())
|
||||
.sort(sort++)
|
||||
.build();
|
||||
return orderImportTempDataDO;
|
||||
}
|
||||
|
||||
// 板材的数据以及长度的检验
|
||||
public void checkPlate(OrderPlateImportExcelVO vo) {
|
||||
// 数量类型判断
|
||||
isEmptyAndPositiveNumber(vo.getGoodsNumber(), Integer.class, "板材数量");
|
||||
// 板材纹理
|
||||
isNotEmptyAndBack(vo.getWave(), IsHavaeEnum.class, "板材纹理", 4);
|
||||
// 大板的长宽厚存在以及是否符合数个
|
||||
isNotEmptyAndBack(vo.getGoodsWidth(), "板材长度");
|
||||
isEmptyAndPositiveNumberSize(vo.getGoodsWidth(), Double.class, 5, 3, "板材长度");
|
||||
isNotEmptyAndBack(vo.getGoodsHeight(), "板材宽度");
|
||||
isEmptyAndPositiveNumberSize(vo.getGoodsHeight(), Double.class, 5, 3, "板材宽度");
|
||||
isNotEmptyAndBack(vo.getGoodsThickness(), "板材厚度");
|
||||
isEmptyAndPositiveNumberSize(vo.getGoodsThickness(), Double.class, 5, 3, "板材厚度");
|
||||
// 房间、柜体、板名称 不可以为空
|
||||
isEmpty(vo.getRoomsName(), "房间名称", 64);
|
||||
isEmpty(vo.getCabinetsName(), "柜体名称", 64);
|
||||
isEmpty(vo.getName(), "板材名称", 64);
|
||||
//成品长、成品宽、拆单长、拆单宽、厚、左封边、右封边、上封边、下封边 不能为空
|
||||
isNotEmptyAndBack(vo.getHeight(), "成品长度");
|
||||
isEmptyAndPositiveNumberSize(vo.getHeight(), Double.class, 5, 3, "成品长度");
|
||||
isNotEmptyAndBack(vo.getWidth(), "成品宽度");
|
||||
isEmptyAndPositiveNumberSize(vo.getWidth(), Double.class, 5, 3, "成品宽度");
|
||||
isNotEmptyAndBack(vo.getSplitHeight(), "拆单长度");
|
||||
isEmptyAndPositiveNumberSize(vo.getSplitHeight(), Double.class, 5, 3, "拆单长度");
|
||||
isNotEmptyAndBack(vo.getSplitWidth(), "拆单宽度");
|
||||
isEmptyAndPositiveNumberSize(vo.getSplitWidth(), Double.class, 5, 3, "拆单宽度");
|
||||
isNotEmptyAndBack(vo.getThickness(), "厚度");
|
||||
isEmptyAndPositiveNumberSize(vo.getThickness(), Double.class, 5, 3, "厚度");
|
||||
isNotEmptyAndBack(vo.getSealLeft(), "左封边");
|
||||
isEmptyAndPositiveNumberSize(vo.getSealLeft(), Double.class, 5, 3, "左封边");
|
||||
isNotEmptyAndBack(vo.getSealRight(), "右封边");
|
||||
isEmptyAndPositiveNumberSize(vo.getSealRight(), Double.class, 5, 3, "右封边");
|
||||
isNotEmptyAndBack(vo.getSealUp(), "上封边");
|
||||
isEmptyAndPositiveNumberSize(vo.getSealUp(), Double.class, 5, 3, "上封边");
|
||||
isNotEmptyAndBack(vo.getSealDown(), "下封边");
|
||||
isEmptyAndPositiveNumberSize(vo.getSealDown(), Double.class, 5, 3, "下封边");
|
||||
// 排版面、纹路、开门方向
|
||||
isNotEmptyAndDict(vo.getTypographicFace(), DictTypeConstants.TYPOGRAPHY_TYPE, "排版面");
|
||||
isNotEmptyAndDict(vo.getTexture(), DictTypeConstants.GRAIN_TYPE, "纹路");
|
||||
isNotEmptyAndDict(vo.getOpenDoorType(), DictTypeConstants.DOOR_OPENING_DIRECTIONS, "开门方向");
|
||||
|
||||
}
|
||||
|
||||
// 判断非空,字典值判断
|
||||
public void isNotEmptyAndDict(String value, String dictType, String errValue) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NOT_EMPTY);
|
||||
} else {
|
||||
DictDataRespDTO dictDataRespDTO = dictDataApi.parseDictData(dictType, value).getData();
|
||||
if (dictDataRespDTO == null) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + ACCORD_ENUM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 非空判断,错误填入
|
||||
private void isEmpty(String value, String errValue, int length) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NOT_EMPTY);
|
||||
} else {
|
||||
// 字符串长度检查
|
||||
int size = value.length();
|
||||
if (size > length) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NUMBER_LENGTH_ERR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 错误判断通用方法
|
||||
// 判断非零,错误返回;不为空时,判断是否符合枚举类
|
||||
private void isNotEmptyAndBack(String value, Class<? extends Enum<?>> enumClass, String errValue, int length) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NOT_EMPTY);
|
||||
} else {
|
||||
isEmptyAndSize(value, length, errValue);
|
||||
try {
|
||||
// 获取枚举类的所有值
|
||||
Enum<?>[] enums = enumClass.getEnumConstants();
|
||||
boolean isValid = false;
|
||||
for (Enum<?> enumValue : enums) {
|
||||
Field valueField = enumValue.getClass().getDeclaredField("value");
|
||||
valueField.setAccessible(true);
|
||||
String enumValueStr = (String) valueField.get(enumValue);
|
||||
if (enumValueStr.equals(value)) {
|
||||
isValid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isValid) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + ACCORD_ENUM);
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + ACCORD_ENUM);
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 非零判断,有值判断---判断数值类型,数值长度
|
||||
private void isEmptyAndPositiveNumberSize(String value, Class<?> targetType, Integer length, Integer decimalLength, String errValue) {
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
if (Boolean.TRUE.equals(ToolUtil.convertToType(value, targetType))) {
|
||||
if (Boolean.TRUE.equals(ToolUtil.checkNumber(value))) {
|
||||
if (!ToolUtil.checkPrecision(value, length, decimalLength)) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NUMBER_LENGTH_ERR);
|
||||
}
|
||||
} else {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + POSITIVE_ERR);
|
||||
}
|
||||
} else {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NUMBER_TYPE_ERR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 判断非零,错误返回
|
||||
private void isNotEmptyAndBack(String value, String errValue) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NOT_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
// 判断非空,有值判断字符串的长度
|
||||
private void isEmptyAndSize(String value, Integer length, String errValue) {
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
int size = value.length();
|
||||
if (size > length) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NUMBER_LENGTH_ERR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 判断非空,大于零判断
|
||||
public void isEmptyAndPositiveNumber(String value, Class<?> targetType, String errValue) {
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
if (Boolean.FALSE.equals(ToolUtil.convertToType(value, targetType))) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + NUMBER_TYPE_ERR);
|
||||
} else {
|
||||
if (Boolean.FALSE.equals(checkNumber(value))) {
|
||||
throw ServiceExceptionUtil.exception(ORDER_IMPORT_DETAIL_VALID_ERROR, errValue + "数量不能为0");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 数值正负判断
|
||||
public static Boolean checkNumber(String numberStr) {
|
||||
try {
|
||||
double number = Double.parseDouble(numberStr);
|
||||
// 进行正负判断
|
||||
if (number >= 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-5
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.util.fileConversion.admin.files.excel;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRemark;
|
||||
@@ -9,17 +10,12 @@ import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.module.executor.enums.OrderItemTypeEnum;
|
||||
import com.cf.imes.module.executor.service.customplateno.CustomPlateNoGenerateService;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.FieldConstants;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.PlateDetail;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import com.cf.imes.module.executor.enums.DictTypeConstants;
|
||||
|
||||
+1
-1
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRemark;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.dto.Point;
|
||||
@@ -17,7 +18,6 @@ import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.*;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO.*;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.orderImport.OrderImportTempDataMapper">
|
||||
<!-- <insert id="insertBatch" parameterType="java.util.List">-->
|
||||
<!-- INSERT INTO order_import_temp_data-->
|
||||
<!-- (id, organ_id, task_id, order_id, type, material, color, texture, width, length,thickness, brand,-->
|
||||
<!-- is_composite, category, sub_type, factory, spec, model, unit,creater, detail, create_time)-->
|
||||
<!-- VALUES-->
|
||||
<!-- <foreach collection="list" item="item" separator=",">-->
|
||||
<!-- (#{item.id}, #{item.organId}, #{item.taskId}, #{item.orderId}, #{item.type},#{item.material}, #{item.color}, #{item.texture}, #{item.width}, #{item.length},#{item.thickness}, #{item.brand},-->
|
||||
<!-- #{item.isComposite}, #{item.category},#{item.subType}, #{item.factory}, #{item.spec}, #{item.model}, #{item.unit},#{item.creater}, #{item.detail}, #{item.createTime})-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </insert>-->
|
||||
</mapper>
|
||||
@@ -180,6 +180,10 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -271,6 +275,10 @@
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-web</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
||||
+1
-1
@@ -9,6 +9,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||
import com.cf.imes.module.executor.api.plan.OrderPlanApi;
|
||||
import com.cf.imes.module.manage.controller.admin.pack.prePack.PackPlateList;
|
||||
@@ -29,7 +30,6 @@ import com.cf.imes.module.manage.dal.mysql.plate.OrderPlateMapper;
|
||||
import com.cf.imes.module.manage.dal.mysql.process.OrdersMapper;
|
||||
import com.cf.imes.module.manage.dal.mysql.query.OrderItemMapper;
|
||||
import com.cf.imes.module.manage.dal.mysql.query.OrderPartsMapper;
|
||||
import com.cf.imes.module.manage.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.system.api.setting.SettingApi;
|
||||
import com.cf.imes.module.system.api.setting.dto.PackageConfigDTO;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
|
||||
+2
-1
@@ -36,11 +36,12 @@ public class RemainPlateServiceImpl implements RemainPlateService {
|
||||
@Resource
|
||||
private RemainPlateMapper remainPlateMapper;
|
||||
|
||||
private static final Integer MAX_NUM = 999; // 余料单次最大条数
|
||||
@Override
|
||||
public Boolean createRemainPlate(RemainPlateSaveReqVO createReqVO) {
|
||||
List<RemainPlateDO> remainPlates = new ArrayList<>();
|
||||
// 限制新增数量不能超过999
|
||||
if (createReqVO.getCount() > 999) {
|
||||
if (createReqVO.getCount() > MAX_NUM) {
|
||||
throw exception(REMAIN_PLATE_COUNT_MAX);
|
||||
}
|
||||
// 插入
|
||||
|
||||
+7
-1
@@ -1,8 +1,14 @@
|
||||
package com.cf.imes.module.plan.enums;
|
||||
|
||||
import com.cf.imes.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* @author there
|
||||
* 生产计划服务错误码枚举 使用 1-005-000-000 段
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
public class ErrorCodeConstants {
|
||||
// ========== 生产单导入 1_005_000 ==========
|
||||
public static final ErrorCode ORDER_IMPORT_PLATE_GOODS_NOT_EXISTS = new ErrorCode(1_005_000_000, "{}小板数据不存在:{}");
|
||||
public static final ErrorCode ORDER_IMPORT_ORGANID_NOT_EXISTS = new ErrorCode(1_005_000_001, "不存在组织id,导入终止");
|
||||
public static final ErrorCode ORDER_IMPORT_FAIL = new ErrorCode(1_005_000_002, "导入失败");
|
||||
}
|
||||
|
||||
@@ -68,6 +68,23 @@
|
||||
<artifactId>cf-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-elasticsearch</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>jakarta.json</groupId>
|
||||
<artifactId>jakarta.json-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.json</groupId>
|
||||
<artifactId>jakarta.json-api</artifactId>
|
||||
<version>2.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-redis</artifactId>
|
||||
@@ -127,6 +144,21 @@
|
||||
<artifactId>cf-spring-boot-starter-file</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-prod-executor-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -138,6 +170,87 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<configuration>
|
||||
<layout>ZIP</layout>
|
||||
<includes>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-common</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-infra-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-prod-plan-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-system-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-banner</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-error-code</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-organ</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-excel</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-monitor</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-mybatis</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-redis</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-rpc</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-security</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-web</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-mq</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-elasticsearch</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-prod-executor-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||
</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -156,12 +269,12 @@
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- 将依赖放到target/lib目录下 -->
|
||||
<outputDirectory>target/lib</outputDirectory>
|
||||
<!-- 排除自身的代码包-->
|
||||
<excludeGroupIds>com.cf.imes</excludeGroupIds>
|
||||
</configuration>
|
||||
<!-- <configuration>-->
|
||||
<!-- <!– 将依赖放到target/lib目录下 –>-->
|
||||
<!-- <outputDirectory>target/lib</outputDirectory>-->
|
||||
<!-- <!– 排除自身的代码包–>-->
|
||||
<!-- <excludeGroupIds>com.cf.imes</excludeGroupIds>-->
|
||||
<!-- </configuration>-->
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.cf.imes.module.plan.controller.orderImport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Gqr
|
||||
* @since 2025/1/15 16:59
|
||||
*/
|
||||
@Schema(description = "管理后台 - 生产单导入临时数据 Request VO")
|
||||
@Data
|
||||
@Builder
|
||||
public class OrderImportTempDataReqVO {
|
||||
/**
|
||||
* 导入任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 临时数据类型,参考OrderImportTmpDataTypeEnum
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String goodsId;
|
||||
|
||||
/**
|
||||
* 是否做分页
|
||||
*/
|
||||
private boolean doPaging;
|
||||
|
||||
/**
|
||||
* 偏移量 (page - 1) * pageSize
|
||||
*/
|
||||
private int offset;
|
||||
|
||||
/**
|
||||
* 页大小
|
||||
*/
|
||||
private int size;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
private String roomName;
|
||||
|
||||
/**
|
||||
* 柜体名称
|
||||
*/
|
||||
private String bodyName;
|
||||
|
||||
/**
|
||||
* 加工组类型
|
||||
*/
|
||||
private String groupTypeName;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String groupName;
|
||||
}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package com.cf.imes.module.plan.controller.orderImport.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 生产单 Excel 导入 VO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问题
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class OrderPlateImportExcelVO {
|
||||
|
||||
@JsonIgnore
|
||||
private String ordinal;
|
||||
|
||||
@JsonIgnore
|
||||
private String goodType;
|
||||
|
||||
@JsonIgnore
|
||||
private String goodsId;
|
||||
|
||||
@JsonIgnore
|
||||
private Long goodId; // 商品id
|
||||
|
||||
@JsonIgnore
|
||||
private String goodsName;
|
||||
|
||||
@JsonIgnore
|
||||
private String material;
|
||||
|
||||
@JsonIgnore
|
||||
private String wave;
|
||||
|
||||
@JsonIgnore
|
||||
private String color;
|
||||
|
||||
@JsonIgnore
|
||||
private String isComposite;
|
||||
|
||||
@JsonIgnore
|
||||
private String category;
|
||||
|
||||
@JsonIgnore
|
||||
private String type;
|
||||
|
||||
@JsonIgnore
|
||||
private String factory;
|
||||
|
||||
@JsonIgnore
|
||||
private String brand;
|
||||
|
||||
@JsonIgnore
|
||||
private String model;
|
||||
|
||||
@JsonIgnore
|
||||
private String goodsHeight;
|
||||
|
||||
@JsonIgnore
|
||||
private String goodsWidth;
|
||||
|
||||
@JsonIgnore
|
||||
private String goodsThickness;
|
||||
|
||||
@JsonIgnore
|
||||
private String spec;
|
||||
|
||||
@JsonIgnore
|
||||
private String unit;
|
||||
|
||||
@NotNull
|
||||
@JsonIgnore
|
||||
private String goodsNumber;
|
||||
|
||||
@JsonIgnore
|
||||
private String roomsName;
|
||||
|
||||
@JsonIgnore
|
||||
private String cabinetsName;
|
||||
|
||||
@JsonIgnore
|
||||
private String synthesisTypeName; // 加工组类型的名称
|
||||
|
||||
@JsonIgnore
|
||||
private String combinationName;
|
||||
|
||||
@JsonIgnore
|
||||
private String name;
|
||||
|
||||
@JsonIgnore
|
||||
private String plateNo;
|
||||
|
||||
@JsonIgnore
|
||||
private String height;
|
||||
|
||||
@JsonIgnore
|
||||
private String width;
|
||||
|
||||
@JsonIgnore
|
||||
private String splitHeight;
|
||||
|
||||
@JsonIgnore
|
||||
private String splitWidth;
|
||||
|
||||
@JsonIgnore
|
||||
private String thickness;
|
||||
|
||||
@JsonIgnore
|
||||
private String sealLeft;
|
||||
|
||||
@JsonIgnore
|
||||
private String sealRight;
|
||||
|
||||
@JsonIgnore
|
||||
private String sealUp;
|
||||
|
||||
@JsonIgnore
|
||||
private String sealDown;
|
||||
|
||||
@JsonIgnore
|
||||
private String typographicFace;
|
||||
|
||||
@JsonIgnore
|
||||
private String texture;
|
||||
|
||||
@JsonIgnore
|
||||
private String openDoorType;
|
||||
|
||||
@JsonIgnore
|
||||
private String result;
|
||||
|
||||
private String remark1;
|
||||
|
||||
private String remark2;
|
||||
|
||||
private String remark3;
|
||||
|
||||
private String remark4;
|
||||
|
||||
private String remark5;
|
||||
|
||||
private String remark6;
|
||||
|
||||
private String remark7;
|
||||
|
||||
private String remark8;
|
||||
|
||||
private String remark9;
|
||||
|
||||
private String remark10;
|
||||
|
||||
private String remark;
|
||||
|
||||
@JsonIgnore
|
||||
private Double area; // 面积
|
||||
|
||||
// 备注转json数据
|
||||
public String remarkJSON() {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
// 设置实体类字段的值
|
||||
try {
|
||||
String json = objectMapper.writeValueAsString(this);
|
||||
return json;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.goods;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 生产单商品 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_goods")
|
||||
@KeySequence("order_goods_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GoodsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 设计端商品ID
|
||||
*/
|
||||
private String rawGoodsId;
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private String goodsId;
|
||||
/**
|
||||
* 排单 ID
|
||||
*/
|
||||
private Long planId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
/**
|
||||
* 材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板
|
||||
*/
|
||||
private String material;
|
||||
/**
|
||||
* 纹路 0 正纹 1 可翻转 2 反纹
|
||||
*/
|
||||
private Boolean texture;
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 背面颜色
|
||||
*/
|
||||
private String colorBlack;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private BigDecimal height;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Double price;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.cf.imes.framework.mybatis.core.type.CompressStringTypeHandler;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 生产单表 order_{N} DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName(value = "`orders`", autoResultMap = true)
|
||||
@KeySequence("order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 生产单号,主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
/**
|
||||
* 父单号
|
||||
*/
|
||||
private Long parentNo;
|
||||
/**
|
||||
* 源生产单号
|
||||
*/
|
||||
private String apiOrderId;
|
||||
/**
|
||||
* 生产单日期
|
||||
*/
|
||||
private LocalDateTime orderDate;
|
||||
/**
|
||||
* 交付日期
|
||||
*/
|
||||
private LocalDateTime deliveryDate;
|
||||
/**
|
||||
* 生产单的完成时间
|
||||
*/
|
||||
private LocalDateTime finishTime;
|
||||
/**
|
||||
* 生产单类型,1主单 2子单
|
||||
*/
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 生产单排序号
|
||||
*/
|
||||
private Integer orderSort;
|
||||
/**
|
||||
* 数据类型,0文件导入 1API 2数据源
|
||||
*/
|
||||
private Integer dataType;
|
||||
/**
|
||||
* 订单状态,0空订单1新单2已排单3生产中4生产完成
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 打包状态:0未打包1打包中2已打包
|
||||
*/
|
||||
private Integer packaged;
|
||||
/**
|
||||
* 自定义单号
|
||||
*/
|
||||
private String customOrderNo;
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
private String customer;
|
||||
/**
|
||||
* 客户地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 客户电话
|
||||
*/
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 经销商
|
||||
*/
|
||||
private String dealer;
|
||||
/**
|
||||
* 经销商电话
|
||||
*/
|
||||
private String dealerPhoneNumber;
|
||||
/**
|
||||
* 业务员
|
||||
*/
|
||||
private String salesman;
|
||||
/**
|
||||
* 拆单员
|
||||
*/
|
||||
private String splitter;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 自定义板编号配置id
|
||||
*/
|
||||
@TableField(value = "custom_plateno_config_id")
|
||||
private Long customPlatenoConfigId;
|
||||
|
||||
/**
|
||||
* 自定义板编号序号
|
||||
*/
|
||||
@TableField(value = "custom_plateno_seq", typeHandler = CompressStringTypeHandler.class)
|
||||
private String customPlatenoSeq;
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderBody;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 生产单柜体 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_body")
|
||||
@KeySequence("order_body_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderBodyDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 模块 ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 房间ID,后端生成
|
||||
*/
|
||||
private Long roomId;
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
private String roomName;
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 模块宽度
|
||||
*/
|
||||
private Double width;
|
||||
/**
|
||||
* 模块高度
|
||||
*/
|
||||
private Double height;
|
||||
/**
|
||||
* 模块深度
|
||||
*/
|
||||
private Double depth;
|
||||
/**
|
||||
* 模块复制数量
|
||||
*/
|
||||
private Integer multiNum;
|
||||
/**
|
||||
* 板材数量
|
||||
*/
|
||||
private Integer plateNum;
|
||||
/**
|
||||
* 异型数量
|
||||
*/
|
||||
private Integer unregularNum;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String filename;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderGroup;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 生产单加工组 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_group")
|
||||
@KeySequence("order_group_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderGroupDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 模块 ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 柜体ID,上表中ID
|
||||
*/
|
||||
private Long bodyId;
|
||||
/**
|
||||
* 加工组类型id,依据同一生产单的同一房间的同一柜体的相同加工组类型,由服务端生成
|
||||
*/
|
||||
private Long groupTypeId;
|
||||
/**
|
||||
* 加工组类型
|
||||
*/
|
||||
private String groupTypeName;
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 加工组宽度
|
||||
*/
|
||||
private Double width;
|
||||
/**
|
||||
* 加工组高度
|
||||
*/
|
||||
private Double height;
|
||||
/**
|
||||
* 加工组深度
|
||||
*/
|
||||
private Double depth;
|
||||
/**
|
||||
* 模块复制数量
|
||||
*/
|
||||
private Integer multiNum;
|
||||
/**
|
||||
* 板材数量
|
||||
*/
|
||||
private Integer plateNum;
|
||||
/**
|
||||
* 异型数量
|
||||
*/
|
||||
private Integer unregularNum;
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String filename;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderImport;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 生产单导入任务
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:30
|
||||
*/
|
||||
@TableName("order_import_task")
|
||||
@KeySequence("order_import_task_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderImportTaskDO extends BaseDO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
/**
|
||||
* 生产单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 导入类型,参考OrderImportTypeEnum
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 导入状态
|
||||
*/
|
||||
private Integer importStatus;
|
||||
|
||||
/**
|
||||
* 消费状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 导入结果0
|
||||
*/
|
||||
private String result;
|
||||
}
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderImport;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 生产单导入临时表
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:36
|
||||
*/
|
||||
@TableName("order_import_temp_data")
|
||||
@KeySequence("order_import_temp_data_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderImportTempDataDO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
/**
|
||||
* 导入任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 生产单id(补板用)
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String outerGoodsId;
|
||||
|
||||
/**
|
||||
* imes商品id
|
||||
*/
|
||||
private String innerGoodsId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
|
||||
/**
|
||||
* 材料
|
||||
*/
|
||||
private String material;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 纹路
|
||||
*/
|
||||
private String wave;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private String width;
|
||||
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private String thickness;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 是否复合部件
|
||||
*/
|
||||
@TableField("is_composite")
|
||||
private String isComposite;
|
||||
|
||||
/**
|
||||
* 配件主类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 配件子类型
|
||||
*/
|
||||
private String subType;
|
||||
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
private String roomName;
|
||||
|
||||
/**
|
||||
* 柜体名称
|
||||
*/
|
||||
private String bodyName;
|
||||
|
||||
/**
|
||||
* 加工组类型
|
||||
*/
|
||||
private String groupTypeName;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Double num;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creater;
|
||||
|
||||
/**
|
||||
* 导入数据明细
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private int sort;
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderImport;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Gqr
|
||||
* @since 2025/1/15 16:49
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderImportTempDataGoodsGroupDO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1853615166652757427L;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private int sortn;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
|
||||
/**
|
||||
* 材料
|
||||
*/
|
||||
private String material;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 纹路
|
||||
*/
|
||||
private String wave;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private String width;
|
||||
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private String thickness;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
|
||||
private String isComposite;
|
||||
|
||||
/**
|
||||
* 配件主类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 配件子类型
|
||||
*/
|
||||
private String subType;
|
||||
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
private String roomName;
|
||||
|
||||
/**
|
||||
* 柜体名称
|
||||
*/
|
||||
private String bodyName;
|
||||
|
||||
/**
|
||||
* 柜体板件数
|
||||
*/
|
||||
private int bodyPlateNum;
|
||||
|
||||
/**
|
||||
* 加工组类型
|
||||
*/
|
||||
private String groupTypeName;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 加工组板件数
|
||||
*/
|
||||
private int groupNameNum;
|
||||
|
||||
/**
|
||||
* 统计总数
|
||||
*/
|
||||
private int count;
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderImport;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Gqr
|
||||
* @since 2025/1/15 16:49
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderImportTempDataGoodsIdGroupDO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1853615166652757427L;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private int sortn;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String outerGoodsId;
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderItem;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 生产单明细表 order_item DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_item")
|
||||
@KeySequence("order_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderItemDO {
|
||||
|
||||
/**
|
||||
* 明细编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 明细类型,1 板材 2 五金/配件 3 其他 4 报价配件
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 房间 ID
|
||||
*/
|
||||
private Long roomId;
|
||||
/**
|
||||
* 柜体 ID
|
||||
*/
|
||||
private Long bodyId;
|
||||
/**
|
||||
* 排单 ID
|
||||
*/
|
||||
private Long planId;
|
||||
/**
|
||||
* 包裹 ID
|
||||
*/
|
||||
private Long packageId;
|
||||
/**
|
||||
* 加工组 ID
|
||||
*/
|
||||
private Long groupId;
|
||||
/**
|
||||
* 生产单板件id
|
||||
*/
|
||||
private Long plateId;
|
||||
/**
|
||||
* 五金配件id
|
||||
*/
|
||||
private Long partsId;
|
||||
/**
|
||||
* 部件数量
|
||||
*/
|
||||
private Double num;
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderParts;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 生产单配件表 order_parts_{N} DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_parts")
|
||||
@KeySequence("order_parts_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderPartsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 配件 ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String goodsId;
|
||||
/**
|
||||
* 配件名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String material;
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 配件子类
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private Double width;
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private Double length;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private Double thickness;
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
private String model;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
private String factory;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Double price;
|
||||
/**
|
||||
* 是否复合部件:0 否 1 是
|
||||
*/
|
||||
private Boolean isComposite;
|
||||
/**
|
||||
* 子配件ID列表,复合部件时记录子配件ID,半角逗号分隔
|
||||
*/
|
||||
private String subparts;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.orderParts;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 配件表 parts_{N} DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("parts")
|
||||
@KeySequence("parts_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PartsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 配件 ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
/**
|
||||
* 设计端商品ID
|
||||
*/
|
||||
private String goodsId;
|
||||
/**
|
||||
* 配件名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板
|
||||
*/
|
||||
private String material;
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 配件主类
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
private String model;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private Double width;
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private Double length;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private Double thickness;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
private String factory;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 是否复合部件:0 否 1 是
|
||||
*/
|
||||
private Boolean isComposite;
|
||||
/**
|
||||
* 子配件ID列表,复合部件时记录子配件ID,半角逗号分隔
|
||||
*/
|
||||
private String subparts;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.ordermodel;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.BasePosition;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.HoleDetail;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.ModelDetail;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.PartsInfo;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.PointDetail;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
* 生产单 小板的轮廓数据对象
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderModelDO extends ESDocument {
|
||||
/*@Schema(description = "组织id")
|
||||
private Long organId;*/
|
||||
@Schema(description = "生产单id")
|
||||
private Long orderId;
|
||||
@Schema(description = "小板id")
|
||||
private Long plateId;
|
||||
|
||||
@Schema(description = "大板的实际ID")
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "大板的分类ID")
|
||||
private Long plateGoodsId;
|
||||
|
||||
@Schema(description = "是否已优化")
|
||||
private Boolean isOptimized;
|
||||
|
||||
@Schema(description = "房间的基点坐标")
|
||||
private BasePosition roomBasePosition; // 板件基准点坐标
|
||||
@Schema(description = "柜体的基点坐标")
|
||||
private BasePosition bodyBasePosition; // 板件基准点坐标
|
||||
@Schema(description = "板件的基点坐标")
|
||||
private BasePosition plateBasePosition; // 板件基准点坐标
|
||||
|
||||
@Schema(description = "纹路 纹路(0正纹1可翻转2反纹)")
|
||||
private Integer texture;
|
||||
@Schema(description = "排版面 排钻类型(0正面1反面2随意面)")
|
||||
private Integer typographicFace;
|
||||
@Schema(description = "开门类型 0非门板,1左开,2右开,3上翻,4下翻")
|
||||
private Integer openDoorType; // 字典转换
|
||||
@Schema(description = "小板类型")
|
||||
private String boardType;
|
||||
|
||||
@Schema(description = "板件配件信息")
|
||||
private List<PartsInfo> partsInfos;
|
||||
|
||||
@Schema(description = "开料长")
|
||||
private BigDecimal splitLength;
|
||||
@Schema(description = "开料宽")
|
||||
private BigDecimal splitWidth;
|
||||
|
||||
|
||||
@Schema(description = "偏移量X")
|
||||
private BigDecimal offsetX;
|
||||
@Schema(description = "偏移量Y")
|
||||
private BigDecimal offsetY;
|
||||
|
||||
@Schema(description = "是否有二维刀路")
|
||||
private Boolean has2DModel;
|
||||
@Schema(description = "是否有三维刀路")
|
||||
private Boolean has3DModel;
|
||||
|
||||
@Schema(description = "点明细,表示小板外围轮廓的几个转折点(不含封边)")
|
||||
private List<PointDetail> pointDetail;
|
||||
@Schema(description = "原始点明细列表")
|
||||
private List<PointDetail> rawPointDetail;
|
||||
@Schema(description = "坯料点明细")
|
||||
private List<PointDetail> basePointDetail ; //坯料点明细
|
||||
@Schema(description = "holes数量集合 count=孔数量 countFaceA=正面垂直孔数量] countFaceB=反面垂直孔数量] countSide=水平侧孔数量] countSideL=左侧孔数量] countSideR=右侧孔数量 countSideU=上侧孔数量 countSideD=下侧孔数量 countBevelled=斜面孔数量 countLocking=偏心轮/锁定孔数量 countBuildIn=预埋件/插入孔数量 countHinge=铰链孔数量 countThrough=通孔(对穿孔)/挖穿孔数量]")
|
||||
private Map<String,Integer> holeCount;//孔类型数量集合
|
||||
@Schema(description = "孔明细列表")
|
||||
private List<HoleDetail> holeDetail;
|
||||
@Schema(description = "凹槽数量集合")
|
||||
private Map<String,Integer> contourCount;//凹槽数量集合
|
||||
@Schema(description = "造型明细(凹槽)")
|
||||
private List<ModelDetail> contourDetail;
|
||||
@Schema(description = "造型明细(孤岛,现在是xml数据格式添加)")
|
||||
private List<ModelDetail> sideDetail ; //造型明细(孤岛) sideDetail
|
||||
@Schema(description = "侧面孔明细列表")
|
||||
private List<HoleDetail> sideHoleDetail;
|
||||
|
||||
@Schema(description = "生产封边备注")
|
||||
private Map<String,String> sideRemark;// 封边备注
|
||||
@Schema(description = "板材扩展备注")
|
||||
private JSONObject plateExtraRemark;// 封边备注
|
||||
|
||||
@Schema(description = "扩展备注(包含铰链备注、订单板件流水号)")
|
||||
private String extraRemark; // 扩展备注(包含铰链备注、订单板件流水号)(板材明细中)
|
||||
@Schema(description = "特殊备注(Json字符串)")
|
||||
private String specialRemarkDei; // 特殊备注(Json字符串)
|
||||
@Schema(description = "拉手备注(Json字符串)")
|
||||
private String extraHandleRemark; // 拉手备注
|
||||
@Schema(description = "排钻备注(Json字符串)")
|
||||
private String drillsRemark; // 排钻备注(Json字符串)
|
||||
@Schema(description = "板其他备注(Json字符串)")
|
||||
private String infoRemark; // 板其他备注(Json字符串)
|
||||
@Schema(description = "板件备注(Json字符串)")
|
||||
private String remarkJsonDei; // 板件备注(Json字符串)
|
||||
|
||||
@Schema(description = "普通备注(板材数据中)")
|
||||
private String remarkJson; // 普通备注(板材数据中)
|
||||
@Schema(description = "特殊备注(板材数据中)")
|
||||
private String specialRemark; // 特殊备注(板材数据中)
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.ordermodel;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.BasePosition;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.HoleDetail;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.ModelDetail;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.PartsInfo;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.PointDetail;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderPlateList {
|
||||
|
||||
|
||||
@Schema(description = "小板id")
|
||||
private Long plateId;
|
||||
@Schema(description = "是否已优化")
|
||||
private Boolean isOptimized;
|
||||
@Schema(description = "房间的基点坐标")
|
||||
private BasePosition roomBasePosition; // 板件基准点坐标
|
||||
@Schema(description = "柜体的基点坐标")
|
||||
private BasePosition bodyBasePosition; // 板件基准点坐标
|
||||
@Schema(description = "板件的基点坐标")
|
||||
private BasePosition plateBasePosition; // 板件基准点坐标
|
||||
|
||||
@Schema(description = "纹路 纹路(0正纹1可翻转2反纹)")
|
||||
private Integer texture;
|
||||
@Schema(description = "排版面 排钻类型(0正面1反面2随意面)")
|
||||
private Integer typographicFace;
|
||||
@Schema(description = "开门类型 0非门板,1左开,2右开,3上翻,4下翻")
|
||||
private Integer openDoorType; // 字典转换
|
||||
@Schema(description = "小板类型")
|
||||
private String boardType;
|
||||
|
||||
@Schema(description = "板件配件信息")
|
||||
private List<PartsInfo> partsInfos;
|
||||
|
||||
@Schema(description = "开料长")
|
||||
private BigDecimal splitLength;
|
||||
@Schema(description = "开料宽")
|
||||
private BigDecimal splitWidth;
|
||||
|
||||
|
||||
@Schema(description = "偏移量X")
|
||||
private BigDecimal offsetX;
|
||||
@Schema(description = "偏移量Y")
|
||||
private BigDecimal offsetY;
|
||||
|
||||
@Schema(description = "是否有二维刀路")
|
||||
private Boolean has2DModel;
|
||||
@Schema(description = "是否有三维刀路")
|
||||
private Boolean has3DModel;
|
||||
|
||||
@Schema(description = "点明细,表示小板外围轮廓的几个转折点(不含封边)")
|
||||
private List<PointDetail> pointDetail;
|
||||
@Schema(description = "原始点明细列表")
|
||||
private List<PointDetail> rawPointDetail;
|
||||
@Schema(description = "坯料点明细")
|
||||
private List<PointDetail> basePointDetail ; //坯料点明细
|
||||
@Schema(description = "holes数量集合 count=孔数量 countFaceA=正面垂直孔数量] countFaceB=反面垂直孔数量] countSide=水平侧孔数量] countSideL=左侧孔数量] countSideR=右侧孔数量 countSideU=上侧孔数量 countSideD=下侧孔数量 countBevelled=斜面孔数量 countLocking=偏心轮/锁定孔数量 countBuildIn=预埋件/插入孔数量 countHinge=铰链孔数量 countThrough=通孔(对穿孔)/挖穿孔数量]")
|
||||
private Map<String,Integer> holeCount;//孔类型数量集合
|
||||
@Schema(description = "孔明细列表")
|
||||
private List<HoleDetail> holeDetail;
|
||||
@Schema(description = "凹槽数量集合")
|
||||
private Map<String,Integer> contourCount;//凹槽数量集合
|
||||
@Schema(description = "造型明细(凹槽)")
|
||||
private List<ModelDetail> contourDetail;
|
||||
@Schema(description = "造型明细(孤岛,现在是xml数据格式添加)")
|
||||
private List<ModelDetail> sideDetail ; //造型明细(孤岛) sideDetail
|
||||
@Schema(description = "侧面孔明细列表")
|
||||
private List<HoleDetail> sideHoleDetail;
|
||||
|
||||
@Schema(description = "生产封边备注")
|
||||
private Map<String,String> sideRemark;// 封边备注
|
||||
@Schema(description = "板材扩展备注")
|
||||
private JSONObject plateExtraRemark;// 封边备注
|
||||
|
||||
@Schema(description = "扩展备注(包含铰链备注、订单板件流水号)")
|
||||
private String extraRemark; // 扩展备注(包含铰链备注、订单板件流水号)(板材明细中)
|
||||
@Schema(description = "特殊备注(Json字符串)")
|
||||
private String specialRemarkDei; // 特殊备注(Json字符串)
|
||||
@Schema(description = "拉手备注(Json字符串)")
|
||||
private String extraHandleRemark; // 拉手备注
|
||||
@Schema(description = "排钻备注(Json字符串)")
|
||||
private String drillsRemark; // 排钻备注(Json字符串)
|
||||
@Schema(description = "板其他备注(Json字符串)")
|
||||
private String infoRemark; // 板其他备注(Json字符串)
|
||||
@Schema(description = "板件备注(Json字符串)")
|
||||
private String remarkJsonDei; // 板件备注(Json字符串)
|
||||
|
||||
@Schema(description = "普通备注(板材数据中)")
|
||||
private String remarkJson; // 普通备注(板材数据中)
|
||||
@Schema(description = "特殊备注(板材数据中)")
|
||||
private String specialRemark; // 特殊备注(板材数据中)
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.ordermodel;
|
||||
|
||||
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author 高级筛选数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderPlateModel extends ESDocument {
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "大板分类ID")
|
||||
private Long plateGoodsId;
|
||||
|
||||
@Schema(description = "大板实际ID")
|
||||
private String goodsId;
|
||||
|
||||
}
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.plate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 生产单板件 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_plate")
|
||||
@KeySequence("order_plate_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PlateDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 板件 ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 板名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 组织中唯一板编号
|
||||
*/
|
||||
private String plateNo;
|
||||
/**
|
||||
* 板类型,0 层板 1 立板 2 背板 3 自增板
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private Long goodsId;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private BigDecimal height;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
/**
|
||||
* 拆单宽度
|
||||
*/
|
||||
private BigDecimal splitWidth;
|
||||
/**
|
||||
* 拆单高度
|
||||
*/
|
||||
private BigDecimal splitHeight;
|
||||
/**
|
||||
* 拆单厚度
|
||||
*/
|
||||
private BigDecimal splitThickness;
|
||||
/**
|
||||
* 左封边厚度
|
||||
*/
|
||||
private BigDecimal sealLeft;
|
||||
/**
|
||||
* 右封边厚度
|
||||
*/
|
||||
private BigDecimal sealRight;
|
||||
/**
|
||||
* 上封边厚度
|
||||
*/
|
||||
private BigDecimal sealUp;
|
||||
/**
|
||||
* 下封边厚度
|
||||
*/
|
||||
private BigDecimal sealDown;
|
||||
/**
|
||||
* 面积
|
||||
*/
|
||||
private BigDecimal area;
|
||||
/**
|
||||
* 纹路类型,0 正纹 1 可翻转 2 反纹
|
||||
*/
|
||||
private Integer texture;
|
||||
/**
|
||||
* 孔面类型,0 正面 1 反面 2 侧面
|
||||
*/
|
||||
private Integer holeFace;
|
||||
/**
|
||||
* 排孔类型,0 正纹 1 反面 2 随意面
|
||||
*/
|
||||
private Integer holeArrange;
|
||||
/**
|
||||
* 异型孔数量
|
||||
*/
|
||||
private Integer unregularPointCount;
|
||||
/**
|
||||
* 正面孔数量
|
||||
*/
|
||||
private Integer frontHoleCount;
|
||||
/**
|
||||
* 背面孔数量
|
||||
*/
|
||||
private Integer backHoleCount;
|
||||
/**
|
||||
* 侧面孔数量
|
||||
*/
|
||||
private Integer sideHoleCount;
|
||||
/**
|
||||
* 正面造型量
|
||||
*/
|
||||
private Integer frontModelCount;
|
||||
/**
|
||||
* 背面造型量
|
||||
*/
|
||||
private Integer backModelCount;
|
||||
/**
|
||||
* 是否门板
|
||||
*/
|
||||
private Boolean isDoor;
|
||||
/**
|
||||
* 开门类型,0 无 1 左 2 右 3 上 4 下
|
||||
*/
|
||||
private Integer openDoorType;
|
||||
/**
|
||||
* 异型偏移 x
|
||||
*/
|
||||
private BigDecimal offsetX;
|
||||
/**
|
||||
* 异型偏移 y
|
||||
*/
|
||||
private BigDecimal offsetY;
|
||||
/**
|
||||
* 是否孤形对角
|
||||
*/
|
||||
private Boolean isArcAcross;
|
||||
/**
|
||||
* 模块类型 ID
|
||||
*/
|
||||
private Long moduleTypeId;
|
||||
/**
|
||||
* 是否异性
|
||||
*/
|
||||
private Boolean isSpecialShaped;
|
||||
/**
|
||||
* 是否造型
|
||||
*/
|
||||
private Boolean isSculpt;
|
||||
/**
|
||||
* 是否造型
|
||||
*/
|
||||
private Boolean isRowHole;
|
||||
/**
|
||||
* 是否优化
|
||||
*/
|
||||
private Boolean isOptimized;
|
||||
/**
|
||||
* 是否开料,0:未开料,1:开料中,2:已开料
|
||||
*/
|
||||
private Integer isCutted;
|
||||
/**
|
||||
* 排单过滤类型,1 有挖穿造型 2 有挖穿孔 4 有二维刀路 8 可叠
|
||||
*/
|
||||
private String filterType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否作废
|
||||
*/
|
||||
private Boolean isCancel;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
private String customPlateNo;
|
||||
|
||||
/**
|
||||
* 房间名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String roomName;
|
||||
|
||||
/**
|
||||
* 柜体名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String bodyName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private StringBuilder customPlateNoBuilder;
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.plate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 板材信息表 plate_N DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("plate")
|
||||
@KeySequence("plate_n_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PlateGoodDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 客户的商品编号
|
||||
*/
|
||||
private String goodsId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
/**
|
||||
* 材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板
|
||||
*/
|
||||
private String material;
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 背面颜色
|
||||
*/
|
||||
private String colorBlack;
|
||||
/**
|
||||
* 纹路
|
||||
*/
|
||||
private Boolean texture;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private Double width;
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private Double height;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private Double thickness;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
// private Double price;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package com.cf.imes.module.plan.dal.dataobject.rawgoods;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 生产单设计商品表 order_raw_goods_{N} DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_raw_goods")
|
||||
@KeySequence("order_raw_goods_n_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RawGoodsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 设计端商品编码
|
||||
*/
|
||||
private String rawGoodsId;
|
||||
/**
|
||||
* 设计端商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String material;
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 背面颜色
|
||||
*/
|
||||
private String colorBlack;
|
||||
/**
|
||||
* 纹路 0 正纹 1 可翻转 2 反纹
|
||||
*/
|
||||
private Boolean texture;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private Double thickness;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Double price;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 基准位置,用于画图
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BasePosition {
|
||||
private String basePoint;// 基准点
|
||||
|
||||
private Double basePointX;// 基准点X坐标
|
||||
|
||||
private Double basePointY;// 基准点Y坐标
|
||||
|
||||
private Double basePointZ;// 基准点Z坐标
|
||||
|
||||
private Double axisXrotate;// 绕X轴旋转角度
|
||||
|
||||
private Double axisYrotate;// 绕Y轴旋转角度
|
||||
|
||||
private Double axisZrotate;// 绕Z轴旋转角度
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 排钻类型数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DrillsInfo {
|
||||
|
||||
private String name; // 排钻名称
|
||||
|
||||
private String type; // 排钻类型名称
|
||||
|
||||
private String face; // 排钻朝向名称
|
||||
|
||||
private Double count; // 排钻数量
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 孔明细,板上的孔的明细
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HoleDetail {
|
||||
|
||||
@Schema(description = "孔ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "孔名称,用于类型相同的孔,进行分组区分,一组的孔名称相同")
|
||||
private String holeName;
|
||||
|
||||
@Schema(description = "打孔面(0正面, 1反面, 2侧面)")
|
||||
private Integer faceType;
|
||||
@Schema(description = "方向 0:其他(斜方向),1:上方向,2:右方向,3:下方向,4:左方向")
|
||||
private Integer direction;
|
||||
@Schema(description = "孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔)")
|
||||
private Integer holeType;
|
||||
|
||||
// xml无法转换数据
|
||||
@Schema(description = "[加工面——正面、反面、左侧面、右侧面、上侧面、下侧面、斜面]")
|
||||
private String faceTypeStr;
|
||||
@Schema(description = "[方向——向后Z-、向前Z+、向右X+、向左X-、向下Y-、向上Y+、斜O]")
|
||||
private String directionStr;
|
||||
@Schema(description = "孔类型——简单孔(恒定直径的孔(盲孔、通孔/穿孔、间断孔))、沉头孔(恒定直径孔连接直径较大的孔(柱形、锥形))、锥孔、螺纹孔]")
|
||||
private String holeTypeStr;
|
||||
|
||||
|
||||
@Schema(description = "孔的起点坐标")
|
||||
private Double startX;
|
||||
private Double startY;
|
||||
private Double startZ;
|
||||
|
||||
|
||||
@Schema(description = " 打孔的半径-孔半径")
|
||||
private Double radius;
|
||||
|
||||
|
||||
@Schema(description = "孔的终点坐标")
|
||||
private Double endX;
|
||||
private Double endY;
|
||||
private Double endZ;
|
||||
|
||||
@Schema(description = "深度")
|
||||
private Double depth;
|
||||
|
||||
// xml新增数据
|
||||
@Schema(description = " 沉头孔内直径")
|
||||
private Double diameterInner;
|
||||
|
||||
@Schema(description = " 沉头孔(台阶孔)深孔深度")
|
||||
private Double depthInner;
|
||||
|
||||
@Schema(description = " 孔组X坐标偏移")
|
||||
private Double groupXOffset;
|
||||
|
||||
@Schema(description = " 孔组Y坐标偏移")
|
||||
private Double groupYOffset;
|
||||
|
||||
@Schema(description = " 孔组Z坐标偏移")
|
||||
private Double groupZOffset;
|
||||
|
||||
@Schema(description = " 孔组数量")
|
||||
private Integer groupNumber;
|
||||
|
||||
@Schema(description = "刀号")
|
||||
private String toolNo;
|
||||
|
||||
@Schema(description = "刀名称")
|
||||
private String toolName;
|
||||
|
||||
@Schema(description = "刀具起点X轴旋转角度")
|
||||
private Double toolStartRotateX;
|
||||
|
||||
@Schema(description = "刀具起点Y轴旋转角度")
|
||||
private Double toolStartRotateY;
|
||||
|
||||
@Schema(description = "刀具起点Z轴旋转角度")
|
||||
private Double toolStartRotateZ;
|
||||
|
||||
@Schema(description = "刀具终点X轴旋转角度")
|
||||
private Double toolEndRotateX;
|
||||
|
||||
@Schema(description = "刀具终点Y轴旋转角度")
|
||||
private Double toolEndRotateY;
|
||||
|
||||
@Schema(description = "刀具终点Z轴旋转角度")
|
||||
private Double toolEndRotateZ;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
/**
|
||||
* 轮廓数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IContourData {
|
||||
|
||||
@Schema(description = "点集(二维向量(x,y,z))")
|
||||
private Point pts; //
|
||||
@Schema(description = "凸度(0直线段 >0逆时针方向 <0顺时针方向)")
|
||||
private Double buls; //
|
||||
@Schema(description = "起点圆弧半径(直线段为0)")
|
||||
private Double radius; //
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 板的造型生成刀路数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IOriginModelingData {
|
||||
|
||||
@Schema(description = "刀半径")
|
||||
private Double knifeRadius;
|
||||
|
||||
@Schema(description = "厚度")
|
||||
private Double thickness; // xml中没有
|
||||
@Schema(description = "方向")
|
||||
private Integer dir;
|
||||
|
||||
// xml中修改
|
||||
@Schema(description = "造型/凹槽(边缘)的刀路方向——内圈顺时针(最)外圈逆时针、内圈顺时针(最)外圈顺时针、内圈逆时针(最)外圈顺时针、内圈逆时针(最)外圈逆时针")
|
||||
private String direction;
|
||||
|
||||
@Schema(description = "轮廓,造型最外围的轮廓数据")
|
||||
private List<IContourData> outline;
|
||||
@Schema(description = "孤岛轮廓")
|
||||
private List<List<IContourData>> holes;
|
||||
|
||||
|
||||
@Schema(description = "槽加长")
|
||||
private Double addLen;
|
||||
@Schema(description = "槽加宽")
|
||||
private Double addWidth;
|
||||
@Schema(description = "槽加深")
|
||||
private Double addDepth;
|
||||
|
||||
// ============ 启用 api =============
|
||||
// @Schema(description = "造型点列表")
|
||||
// private List<PointList> pointList;
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 造型明细
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "管理后台 - 造型信息")
|
||||
public class ModelDetail {
|
||||
|
||||
@Schema(description = "造型ID")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "刀路ID")
|
||||
private Integer lineID;
|
||||
|
||||
@Schema(description = "内部孤岛ID集合")
|
||||
private String[] subIDs;
|
||||
|
||||
@Schema(description = "类型——矩形槽Rectangle、路径槽Path、内铣槽internalMilling、折返路径槽turnbackPath")
|
||||
private String type; // 目前只在xml中
|
||||
|
||||
@Schema(description = "根据是否为正面,face有不同的含义")
|
||||
private Integer faceType;
|
||||
|
||||
// xml更新
|
||||
@Schema(description = "加工面——正面、反面、左侧面、右侧面、上侧面、下侧面、斜面")
|
||||
private String grooveFace; // 目前只在xml中
|
||||
|
||||
@Schema(description = "造型长度")
|
||||
private Double width;
|
||||
@Schema(description = "造型宽度")
|
||||
private Double length;
|
||||
@Schema(description = "造型深度")
|
||||
private Double depth;
|
||||
|
||||
@Schema(description = "圆角半径")
|
||||
private Double round; // 目前只在xml中
|
||||
|
||||
@Schema(description = "刀路冗余量(偏移重叠量)")
|
||||
private Double redundance; // 目前只在xml中
|
||||
@Schema(description = "角度(二维刀路V型刀提角/清角用)")
|
||||
private Double tangentAngle; // 目前只在xml中
|
||||
|
||||
// @Schema(description = "造型数量")
|
||||
// private Integer count;
|
||||
|
||||
@Schema(description = "造像使用刀具名称")
|
||||
private String knifeName;
|
||||
@Schema(description = "刀号")
|
||||
private String toolNo;
|
||||
@Schema(description = "刀半径")
|
||||
private Double knifeRadius;
|
||||
|
||||
|
||||
@Schema(description = "造型数据")
|
||||
private IOriginModelingData originModeling;
|
||||
|
||||
@Schema(description = "造型点列表")
|
||||
private List<PointList> pointList;
|
||||
|
||||
@Schema(description = "造型偏移量列表-模块偏移数据")
|
||||
private List<OffSetList> offSetList;
|
||||
|
||||
|
||||
// xml新增
|
||||
@Schema(description = "加工模式/方式——由内向外、由外向内")
|
||||
private String mode;
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 偏移量列表 模块偏移数据
|
||||
* 在有用到二维刀路的时候,需要这个数据
|
||||
* 注:1、有用到type之类需要转换类型的诗句,将type全部存原有的值,然后在接口这一块,通过字典进行进行转换
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class OffSetList {
|
||||
|
||||
@Schema(description = "偏移刀路ID")
|
||||
private String id;
|
||||
|
||||
// 刀路的偏移值
|
||||
@Schema(description = "刀路的偏倚值")
|
||||
private Double value;
|
||||
@Schema(description = "下刀的深度")
|
||||
private Double depth;
|
||||
@Schema(description = "角度")
|
||||
private Double angle;
|
||||
|
||||
// 二维刀路的属性
|
||||
@Schema(description = "二维刀路的属性-刀的名称")
|
||||
private String name;
|
||||
@Schema(description = "二维刀路的属性-刀的半径")
|
||||
private Double radius; // api中为直径
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class OrderGoodsPlateIds {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
private Long orderId;
|
||||
|
||||
|
||||
private String actualGoodsId;
|
||||
|
||||
|
||||
private Long goodsId;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单配件 备注信息")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderPartsRemark extends ESDocument {
|
||||
|
||||
@Schema(description = "配件 ID")
|
||||
private Long partsId;
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "额外规格")
|
||||
private String specExtras;
|
||||
|
||||
@Schema(description = "门板组件铰链备注")
|
||||
private String doorRemark;
|
||||
|
||||
@Schema(description = "门板组件拉手备注")
|
||||
private String hingeRemark;
|
||||
|
||||
@Schema(description = "特殊备注(Json字符串)")
|
||||
private String specialRemark;
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 配件基本信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PartsInfo {
|
||||
|
||||
private Long id; // 配件标识
|
||||
private String name; // 配件名称
|
||||
|
||||
// 单个配件的数量
|
||||
private Double partNum;
|
||||
|
||||
// 配件数量单位
|
||||
private String unit;
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CAD板件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PlateDetail {
|
||||
// 组织id
|
||||
private Long organId;
|
||||
// 生产单id
|
||||
private Long orderId;
|
||||
// 板名称
|
||||
private String name;
|
||||
// 板id
|
||||
private Long plateId;
|
||||
// 设计板编号
|
||||
private String plateNo;
|
||||
// 设计板编号
|
||||
private String customPlateNo;
|
||||
|
||||
private Integer texture; //纹路 纹路(0正纹1可翻转2反纹)
|
||||
private Integer typographicFace; //排版面 排钻类型(0正面1反面2随意面)
|
||||
private Integer openDoorType; //开门类型 0非门板,1左开,2右开,3上翻,4下翻 字典转换
|
||||
private String boardType; // 小板类型
|
||||
|
||||
|
||||
// 板件所属信息
|
||||
private String roomsName; //房间名称
|
||||
private String roomNo; // 房间号
|
||||
private String bodyName; //柜体名
|
||||
private String bodyNo; // 柜体号
|
||||
private String groupName; //加工组号
|
||||
private String groupNo; // 加工组名称
|
||||
// 柜体 长 宽 深
|
||||
private Double width;
|
||||
private Double height;
|
||||
private Double depth;
|
||||
|
||||
// 柜体成倍拆单的倍数
|
||||
private Integer multiNum;
|
||||
|
||||
|
||||
// 板材所属加工组
|
||||
private String group;// 板件加工组Group的名称,可以有多个
|
||||
// 加工组具体信息
|
||||
// private List<Group> groupList;
|
||||
|
||||
// 成品长宽、面积
|
||||
private BigDecimal plateWidth;
|
||||
private BigDecimal plateLength;
|
||||
private BigDecimal acreage;
|
||||
|
||||
// 开料长宽、面积
|
||||
private BigDecimal splitLength;
|
||||
private BigDecimal splitWidth;
|
||||
private BigDecimal sealAcreage;
|
||||
|
||||
// 是否异形
|
||||
private Boolean isUnRegular;
|
||||
// 封边,用于矩形
|
||||
private BigDecimal sealLeft;
|
||||
private BigDecimal sealRight;
|
||||
private BigDecimal sealUp;
|
||||
private BigDecimal sealDown;
|
||||
|
||||
|
||||
// 偏移量
|
||||
private BigDecimal offsetX;
|
||||
private BigDecimal offsetY;
|
||||
private Boolean isHXDJX; // 是否弧形地脚
|
||||
|
||||
// 大板基本信息
|
||||
// private BoardInfo boardInfo;
|
||||
// 配件基本信息
|
||||
private List<PartsInfo> partsInfos; // xml中有,估计之后不需要
|
||||
// 排钻类型
|
||||
private List<DrillsInfo> drillsInfos; // api中有
|
||||
|
||||
private Double throughHoleCount; // 挖孔的孔数
|
||||
private Double throughModelCount; // 挖穿的造型数
|
||||
|
||||
private Boolean has2DModel; // 是否有二维刀路
|
||||
private Boolean has3DModel; // 是否有三维刀路
|
||||
|
||||
// 轮廓数据、造型数据
|
||||
private BasePosition roomBasePosition; // 板件基准点坐标
|
||||
private BasePosition bodyBasePosition; // 柜体基准点坐标
|
||||
private BasePosition plateBasePosition; // 板件基准点坐标
|
||||
private List<PointDetail> pointDetail; //点明细,表示小板外围轮廓的几个转折点(不含封边)
|
||||
private List<PointDetail> rawPointDetail; //原始点明细(含封边)
|
||||
private List<PointDetail> basePointDetail; //坯料点明细 (xml中特有,现可以不用)
|
||||
|
||||
private Map<String, Integer> holeCount;//孔类型数量集合 (xml中特有----孔类型,对应的数量)
|
||||
private List<HoleDetail> holeDetail; //孔明细,表示板上的孔
|
||||
private Map<String, Integer> contourCount;//凹槽数量集合 (xml中特有----槽所在板面的对应数量)
|
||||
private List<ModelDetail> contourDetail; //造型明细(xml中为凹槽,将孤岛的信息放入槽中)
|
||||
private List<ModelDetail> sideDetail; //造型明细(侧面)
|
||||
|
||||
private List<HoleDetail> sideHoleDetail;//侧面孔明细
|
||||
|
||||
// 备注
|
||||
private Map<String, String> plateRemark;// 板件备注 (生产数据接口中)(不用)
|
||||
private Map<String, String> sideRemark;// 板边备注
|
||||
private JSONObject plateExtraRemark;// 板材扩展备注 (不含板件的备注)
|
||||
|
||||
private String extraRemark; // 扩展备注(包含铰链备注、订单板件流水号)(板材明细中)
|
||||
private String specialRemarkDei; // 特殊备注(Json字符串)
|
||||
private String extraHandleRemark; // 拉手备注
|
||||
private String drillsRemark; // 排钻备注(Json字符串)
|
||||
private String infoRemark; // 板其他备注(Json字符串)
|
||||
private String remarkJsonDei; // 板件备注(Json字符串)
|
||||
|
||||
private String remarkJson; // 普通备注(板材数据中)
|
||||
private String specialRemark; // 特殊备注(板材数据中)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Point {
|
||||
private Double x;
|
||||
private Double y;
|
||||
private Double z;
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 点明细 , 表示小板外围轮廓的几个转折点
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class PointDetail {
|
||||
|
||||
@Schema(description = "点id")
|
||||
private String id;
|
||||
// 点的位置信息
|
||||
@Schema(description = "点的位置信息")
|
||||
private Double pointX;
|
||||
private Double pointY;
|
||||
@Schema(description = "曲线-凸度")
|
||||
private Double curve;
|
||||
@Schema(description = "边圆弧半径(直线段为0)")
|
||||
private Double radius;
|
||||
|
||||
// 点的封边尺寸
|
||||
@Schema(description = "点的封边尺寸,封边尺寸,封边的厚度,长同边长")
|
||||
private BigDecimal sealSize;
|
||||
|
||||
@Schema(description = "加工工艺")
|
||||
private String process;
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 点列表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class PointList {
|
||||
|
||||
@Schema(description = "纹路Id")
|
||||
private Integer lineId;
|
||||
@Schema(description = "点Id")
|
||||
private Integer pointId;
|
||||
|
||||
|
||||
@Schema(description = "点的位置信息")
|
||||
private Double pointX;
|
||||
private Double pointY;
|
||||
private Double pointZ;
|
||||
private Double radius;
|
||||
|
||||
@Schema(description = "曲线")
|
||||
private Double curve;
|
||||
@Schema(description = "曲线深度")
|
||||
private Double depth;
|
||||
@Schema(description = "起点圆弧半径(直线段为0)")
|
||||
private Double holeRadius;
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.cf.imes.module.plan.dal.mysql.goods;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.injector.BaseBatchMapper;
|
||||
import com.cf.imes.module.plan.dal.dataobject.goods.GoodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产单商品 Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface GoodsMapper extends BaseBatchMapper<GoodsDO> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.cf.imes.module.plan.dal.mysql.order;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.plan.dal.dataobject.order.OrderDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产单表 order_{N} Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.cf.imes.module.plan.dal.mysql.orderBody;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.injector.BaseBatchMapper;
|
||||
import com.cf.imes.module.plan.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产单柜体 Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderBodyMapper extends BaseBatchMapper<OrderBodyDO> {
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.cf.imes.module.plan.dal.mysql.orderGroup;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.injector.BaseBatchMapper;
|
||||
import com.cf.imes.module.plan.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
/**
|
||||
* 生产单加工组 Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderGroupMapper extends BaseBatchMapper<OrderGroupDO> {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.cf.imes.module.plan.dal.mysql.orderImport;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cf.imes.module.plan.dal.dataobject.orderImport.OrderImportTaskDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产单导入任务 Mapper
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderImportTaskMapper extends BaseMapper<OrderImportTaskDO> {
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
package com.cf.imes.module.plan.dal.mysql.orderImport;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.plan.controller.orderImport.vo.OrderImportTempDataReqVO;
|
||||
import com.cf.imes.module.plan.dal.dataobject.orderImport.OrderImportTempDataDO;
|
||||
import com.cf.imes.module.plan.dal.dataobject.orderImport.OrderImportTempDataGoodsGroupDO;
|
||||
import com.cf.imes.module.plan.dal.dataobject.orderImport.OrderImportTempDataGoodsIdGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产单导入临时表 Mapper
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/1/9 11:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderImportTempDataMapper extends BaseMapperX<OrderImportTempDataDO> {
|
||||
/**
|
||||
* 基于物料编码分组的总数查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
int selectCountGoodsIdGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于物料编码的分组查询(可分页)
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataGoodsIdGroupDO> selectGoodsIdGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于商品名称、材料、纹理、颜色、规格、商品高、商品宽、商品厚、品牌分组的商品总数查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
int selectCountPlateGoodsGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于商品名称、材料、纹理、颜色、规格、商品高、商品宽、商品厚、品牌的商品分组查询(可分页)
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataGoodsGroupDO> selectPlateGoodsGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于商品名称、材料、复合部件、配件类型、配件子类、厂家、型号、规格、、商品高、商品宽、商品厚、单位、品牌分组的配件总数查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
int selectCountPartGoodsGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于商品名称、材料、复合部件、配件类型、配件子类、厂家、型号、规格、、商品高、商品宽、商品厚、单位、品牌的配件分组查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataGoodsGroupDO> selectPartGoodsGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于房间名的分组总数查询
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
int selectCountRoomGroup(@Param("taskId") Long taskId);
|
||||
|
||||
/**
|
||||
* 基于房间名的分组查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataGoodsGroupDO> selectRoomGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于房间名下柜体名的分组总数查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
int selectCountBodyGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于房间名下柜体名的分组查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataGoodsGroupDO> selectBodyGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于房间名、柜体名下的加工组类型名称分组总数查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
int selectCountGroupTypeNameGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于房间名、柜体名下的加工组类型名称分组查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataGoodsGroupDO> selectGroupTypeNameGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于房间名、柜体名、加工组类型名称下的加工组名称分组总数查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
int selectCountGroupNameGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 基于房间名、柜体名、加工组类型名称下的加工组名称分组查询
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataGoodsGroupDO> selectGroupNameGroup(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 查询房间名、柜体名、加工组类型名称、加工组名称下的总数
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
int selectCountGroupName(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 查询房间名、柜体名、加工组类型名称、加工组名称下的临时数据列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataDO> selectGroupNameList(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 查询配件商品id下的临时数据列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderImportTempDataDO> selectPartList(@Param("reqVO") OrderImportTempDataReqVO reqVO);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user