mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 21:32:07 +08:00
detail修改
This commit is contained in:
@@ -151,6 +151,14 @@
|
||||
<groupId>uk.co.jemos.podam</groupId>
|
||||
<artifactId>podam</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- JSON -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class GoodsController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "对应生产单商品")
|
||||
@PreAuthorize("@ss.hasPermission('executor:goods:create')")
|
||||
public CommonResult<List<Long>> createGoods(@Valid @RequestBody Set<GoodsSaveReqVO> createReqVOS) {
|
||||
public CommonResult<Boolean> createGoods(@Valid @RequestBody List<GoodsSaveReqVO> createReqVOS) {
|
||||
return success(goodsService.createCorrespondsGoods(createReqVOS));
|
||||
}
|
||||
|
||||
|
||||
-13
@@ -15,55 +15,42 @@ public class GoodsSaveReqVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12114")
|
||||
@NotNull(message = "生产单号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "设计端商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "832")
|
||||
@NotEmpty(message = "设计端商品ID不能为空")
|
||||
private Long rawGoodsId;
|
||||
|
||||
@Schema(description = "商品 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "243")
|
||||
@NotEmpty(message = "商品 ID不能为空")
|
||||
private Long goodsId;
|
||||
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
|
||||
@NotEmpty(message = "商品名称不能为空")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板不能为空")
|
||||
private String material;
|
||||
|
||||
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "颜色不能为空")
|
||||
private String color;
|
||||
|
||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "宽度不能为空")
|
||||
private BigDecimal width;
|
||||
|
||||
@Schema(description = "高度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "高度不能为空")
|
||||
private BigDecimal height;
|
||||
|
||||
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "厚度不能为空")
|
||||
private BigDecimal thickness;
|
||||
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "7305")
|
||||
@NotNull(message = "价格不能为空")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "品牌不能为空")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "规格不能为空")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
|
||||
@NotEmpty(message = "备注不能为空")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+46
-15
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.controller.admin.order;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import com.cf.imes.module.executor.service.order.OrderInputProcessor;
|
||||
import com.cf.imes.module.executor.util.FileTypeChangeUtil;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
@@ -62,6 +63,9 @@ public class OrderController {
|
||||
@Resource
|
||||
private FileTypeChangeUtil fileTypeChangeUtil;
|
||||
|
||||
@Resource
|
||||
private OrderInputProcessor orderInputProcessor;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OrderController.class);
|
||||
|
||||
@PostMapping("/create")
|
||||
@@ -202,12 +206,15 @@ public class OrderController {
|
||||
} else if (createReqVO.getDataType() == 3) {//Excel
|
||||
// 文件数据读取
|
||||
list = fileTypeChangeUtil.fileDataChange(file);
|
||||
if (list == null || list.size() == 0) {
|
||||
orderImportRespVO.getFailureOrder().put("生产单导入错误", String.valueOf(fileTypeChangeUtil.getValue()));
|
||||
}
|
||||
}
|
||||
OrderImportRespVO respVO = orderService.importOrderList(list , id , orderImportRespVO);
|
||||
return success(respVO);
|
||||
if (list == null || list.size() == 0) {
|
||||
orderImportRespVO.getFailureOrder().put("生产单导入错误", String.valueOf(fileTypeChangeUtil.getValue()));
|
||||
return success(orderImportRespVO);
|
||||
}
|
||||
// OrderImportRespVO respVO = orderService.importOrderList(list , id , orderImportRespVO);
|
||||
orderInputProcessor.input(list , id);
|
||||
return success(orderImportRespVO);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,17 +286,41 @@ public class OrderController {
|
||||
return success(BeanUtils.toBean(orderService.getBody(orderId), OrderBodyRespVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* api获取数据接口(用户从其他应用点击数据传输,首先进行用户数据验证【用户传入token,本生产系统获得token之后,调用erp接口,进行用户账号数据
|
||||
* 获取,获取的数据进行本系统的登陆,获取本系统的token】,然后进行数据推送【redis首先缓存数据,生成唯一数据标识符,返回给应用用户】,再用户进入
|
||||
* 本系统的生产单新增页面,进行新增生产单数据的传入(有问题)
|
||||
* 调用本系统的接口,进行数据传输,
|
||||
* 传输成功之后,返回数据给用户,用户进行数据查看,
|
||||
*/
|
||||
|
||||
@GetMapping("api-import")
|
||||
@Operation(summary = "api调用传入设计数据")
|
||||
@Parameters({
|
||||
@Parameter(name = "body", description = "api传输数据", required = true)
|
||||
// ,
|
||||
// @Parameter(name = "isAddPlate", description = "是否为生产单新增板材", example = "false"),
|
||||
// @Parameter(name = "upload", description = "是 更新、否 新建", example = "false"),
|
||||
// @Parameter(name = "orderSaveReqVO", description = "生产单新增参数", required = true)
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:import')")
|
||||
public CommonResult<OrderImportRespVO> apiImport(@RequestPart("data") String data
|
||||
// ,
|
||||
// @RequestParam(value = "isAddPlate", required = false, defaultValue = "false") Boolean isAddPlate,
|
||||
// @RequestParam(value = "upload", required = false, defaultValue = "false") Boolean upload,
|
||||
// @RequestPart("orderSaveReqVO") OrderSaveReqVO createReqVO
|
||||
) {
|
||||
OrderImportRespVO orderImportRespVO = OrderImportRespVO.builder().createOrder(new ArrayList<>())
|
||||
.updateOrder(new ArrayList<>()).failureOrder(new LinkedHashMap<>()).build();
|
||||
|
||||
// OrderImportRespVO respVO = orderService.importOrderList(list , id , orderImportRespVO);
|
||||
// json转换
|
||||
// List<Detail> list = fileDataChangeUtil.fileDataChange(data);
|
||||
// orderInputProcessor.input(list , 1L);
|
||||
System.out.println("webcad数据: " + data);
|
||||
return success(orderImportRespVO);
|
||||
|
||||
|
||||
// 测试
|
||||
// @PostMapping("importTest")
|
||||
// public void readExcel(@RequestPart("file") MultipartFile file) {
|
||||
// OrderExcelUtil.read(file, OrderPlateImportExcelVO.class, t -> {
|
||||
// // 模拟service中业务异常
|
||||
// if (t.getOrdinal() < 0) {
|
||||
// throw new LyException.Normal("学号必须以\"No.\"开头");
|
||||
// }
|
||||
// },7);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.managePlate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 板材信息表 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 ManagePlateDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 客户的商品编号
|
||||
*/
|
||||
private String goodsId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
/**
|
||||
* 材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板
|
||||
*/
|
||||
private String material;
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private BigDecimal height;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Double price;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.managePlate;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.managePlate.ManagePlateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 板材信息表 plate_{N} Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface ManagePlateMapper extends BaseMapperX<ManagePlateDO> {
|
||||
|
||||
}
|
||||
+2
-1
@@ -13,6 +13,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
* @author there
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class, DictDataApi.class, FileApi.class, ProcessGroupApi.class, FileApi.class, DataSourceApi.class})
|
||||
@EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class, DictDataApi.class,
|
||||
FileApi.class, ProcessGroupApi.class, FileApi.class, DataSourceApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public interface GoodsService {
|
||||
* @param createReqVOS 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
List<Long> createCorrespondsGoods(@Valid Set<GoodsSaveReqVO> createReqVOS);
|
||||
Boolean createCorrespondsGoods(@Valid List<GoodsSaveReqVO> createReqVOS);
|
||||
|
||||
/**
|
||||
* 更新生产单商品
|
||||
|
||||
+23
-10
@@ -1,8 +1,12 @@
|
||||
package com.cf.imes.module.executor.service.goods;
|
||||
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.managePlate.ManagePlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.managePlate.ManagePlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.service.plate.PlateService;
|
||||
import com.cf.imes.module.executor.service.rawgoods.RawGoodsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -36,26 +40,35 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
@Resource
|
||||
private RawGoodsService rawGoodsService;
|
||||
|
||||
@Autowired
|
||||
private ManagePlateMapper plateMapper;
|
||||
|
||||
@Resource
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Override
|
||||
public List<Long> createCorrespondsGoods(Set<GoodsSaveReqVO> createReqVOS) {
|
||||
public Boolean createCorrespondsGoods(List<GoodsSaveReqVO> createReqVOS) {
|
||||
List<Long> longs = new ArrayList<>();
|
||||
// 校验生产单是否存在
|
||||
if (orderMapper.selectOne(OrderDO::getId, createReqVOS.get(0).getOrderId()) == null) {
|
||||
throw exception(GOODS_NOT_EXISTS);
|
||||
}
|
||||
createReqVOS.forEach(createReqVO -> {
|
||||
// 校验商品是否存在
|
||||
if (plateService.getPlate(createReqVO.getGoodsId()) == null) {
|
||||
if (plateMapper.selectOne(ManagePlateDO::getId, createReqVO.getGoodsId()) == null) {
|
||||
throw exception(PLATE_NOT_EXISTS);
|
||||
}
|
||||
// 校验
|
||||
if (rawGoodsService.getRawGoods(createReqVO.getRawGoodsId()) == null) {
|
||||
throw exception(RAW_GOODS_NOT_EXISTS);
|
||||
}
|
||||
// 插入
|
||||
GoodsDO goods = BeanUtils.toBean(createReqVO, GoodsDO.class);
|
||||
goodsMapper.insert(goods);
|
||||
// 修改order_plate中的对应关系
|
||||
// plateService.updatePlateByRawGoodsId(createReqVO.getRawGoodsId(), goods.getId(), createReqVO.getOrderId());
|
||||
longs.add(goods.getId());
|
||||
});
|
||||
// 一次性插入数据库
|
||||
goodsMapper.insertBatch(BeanUtils.toBean(createReqVOS, GoodsDO.class));
|
||||
// 修改order_plate
|
||||
plateService.updatePlateByRawGoodsId(createReqVOS);
|
||||
// 返回
|
||||
return longs;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-4
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.service.plate;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -82,10 +83,8 @@ public interface PlateService {
|
||||
PageResult<PlateRespVO> getPlatePageByTerms(PlateTermsPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* @param rawGoodsIds: 未对应之前的板材id
|
||||
* @param goodsId: 对应之后的板材id
|
||||
* @param orderIds: 生产单id
|
||||
* @param createReqVOS
|
||||
* @return void
|
||||
*/
|
||||
void updatePlateByRawGoodsId(Set<Long> rawGoodsIds, Long goodsId , Set<Long> orderIds);
|
||||
void updatePlateByRawGoodsId(List<GoodsSaveReqVO> createReqVOS);
|
||||
}
|
||||
+14
-4
@@ -2,10 +2,12 @@ package com.cf.imes.module.executor.service.plate;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
@@ -117,10 +119,18 @@ public class PlateServiceImpl implements PlateService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePlateByRawGoodsId(Set<Long> rawGoodsIds, Long goodsId, Set<Long> orderIds) {
|
||||
// 校验存在
|
||||
// validatePlateExists(orderId);
|
||||
// plateMapper.update(null, new LambdaQueryWrapper<PlateDO>().eq(PlateDO::getRawGoodsId, rawGoodsId).set(PlateDO::getGoodsId, goodsId));
|
||||
public void updatePlateByRawGoodsId(List<GoodsSaveReqVO> createReqVOS) {
|
||||
// 根据生产单id和goods_id查到数据,再更新goods_id
|
||||
createReqVOS.forEach(createReqVO -> {
|
||||
// plateMapper.update(null,
|
||||
// new LambdaQueryWrapper<PlateDO>()
|
||||
// .eq(PlateDO::getGoodsId, createReqVO.getRawGoodsId())
|
||||
// .eq(PlateDO::getOrderId, createReqVO.getOrderId())
|
||||
// .set(PlateDO::getGoodsId, createReqVO.getGoodsId()
|
||||
// );
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ public interface FileTypeChangeUtil {
|
||||
// 文件数据格式转换
|
||||
List<Detail> fileDataChange(MultipartFile file) throws IOException;
|
||||
// List<Detail>转json,并且文件压缩存储
|
||||
void fileDataChangeToJson(List<Detail> detailList , Long orderId) throws IOException;
|
||||
void fileDataChangeToJson(List<Detail> detailList , Long orderId) throws IOException;
|
||||
|
||||
// Api数据格式转换
|
||||
|
||||
|
||||
+48
-33
@@ -1,13 +1,12 @@
|
||||
package com.cf.imes.module.executor.util;
|
||||
|
||||
import com.cf.imes.module.executor.util.deviseData.HoleDetail;
|
||||
import com.cf.imes.module.executor.util.deviseData.ModelDetail;
|
||||
import com.cf.imes.module.executor.util.deviseData.PointDetail;
|
||||
import com.cf.imes.module.executor.util.deviseData.other.*;
|
||||
import com.cf.imes.module.executor.util.deviseData.*;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.Inflater;
|
||||
@@ -114,42 +113,58 @@ public class ZLibUtils {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
GoodDetail goodDetail = new GoodDetail();
|
||||
// GoodDetail goodDetail = new GoodDetail();
|
||||
|
||||
ModelDetail[] modelDetail = {new ModelDetail()}; //造型明细
|
||||
PointDetail[] pointDetail = {new PointDetail()}; //点明细
|
||||
HoleDetail[] holeDetail = {new HoleDetail()}; //孔明细
|
||||
PointDetail[] orgPointDetail = {new PointDetail()}; //原始点明细
|
||||
ModelDetail[] sideModelDetail = {new ModelDetail()}; //侧面造型明细
|
||||
HoleDetail[] sideHoleDetail= {new HoleDetail()};//侧面孔明细
|
||||
List<ModelDetail> modelDetail = new ArrayList<>();
|
||||
modelDetail.add(new ModelDetail());
|
||||
// ModelDetail modelDetail = new ModelDetail(); //造型明细
|
||||
// modelDetail.setModelId(1);
|
||||
List<PointDetail> pointDetail = new ArrayList<>(); //点明细
|
||||
pointDetail.add(new PointDetail());
|
||||
List<HoleDetail> holeDetail = new ArrayList<>(); //孔明细
|
||||
holeDetail.add(new HoleDetail());
|
||||
List<PointDetail> orgPointDetail = new ArrayList<>(); //原始点明细
|
||||
orgPointDetail.add(new PointDetail());
|
||||
List<ModelDetail> sideModelDetail = new ArrayList<>(); //侧面造型明细
|
||||
sideModelDetail.add(new ModelDetail());
|
||||
List<HoleDetail> sideHoleDetail= new ArrayList<>();//侧面孔明细
|
||||
sideHoleDetail.add(new HoleDetail());
|
||||
|
||||
PlateDetail plateDetail = new PlateDetail();
|
||||
plateDetail.setGoodDetail(goodDetail);
|
||||
plateDetail.setModelDetail(modelDetail);
|
||||
plateDetail.setPointDetail(pointDetail);
|
||||
plateDetail.setSideHoleDetail(sideHoleDetail);
|
||||
plateDetail.setSideModelDetail(sideModelDetail);
|
||||
plateDetail.setHoleDetail(holeDetail);
|
||||
plateDetail.setOrgPointDetail(orgPointDetail);
|
||||
|
||||
PartDetail partDetail = new PartDetail();
|
||||
PartDetail[] partDetailList = {partDetail,partDetail};
|
||||
PlateDetail[] plateDetailList = {plateDetail,plateDetail};
|
||||
CabinetsDetail cabinetsDetail = new CabinetsDetail();
|
||||
cabinetsDetail.setPlateDetail(plateDetailList);
|
||||
cabinetsDetail.setPartsDetail(partDetailList);
|
||||
RoomDetail roomDetail = new RoomDetail();
|
||||
CabinetsDetail[] cabinetsDetailList = {cabinetsDetail,cabinetsDetail};
|
||||
roomDetail.setCabinetsDetail(cabinetsDetailList);
|
||||
Detail detail = new Detail();
|
||||
RoomDetail[] roomDetailList = {roomDetail,roomDetail};
|
||||
detail.setRoomDetail(roomDetailList);
|
||||
Detail[] detailList = {detail,detail};
|
||||
// PlateDetail plateDetail = new PlateDetail();
|
||||
// plateDetail.setGoodDetail(goodDetail);
|
||||
IBoardProdInfo iBoardProdInfo = new IBoardProdInfo();
|
||||
detail.setIBoardProdInfo(iBoardProdInfo);
|
||||
detail.setContourDetail(modelDetail);
|
||||
detail.setPointDetail(pointDetail);
|
||||
// detail.setHoleDetail(holeDetail);
|
||||
detail.setRawPointDetail(orgPointDetail);
|
||||
detail.setSideModelDetail(sideModelDetail);
|
||||
detail.setSideHoleDetail(sideHoleDetail);
|
||||
|
||||
// PartDetail partDetail = new PartDetail();
|
||||
// PartDetail[] partDetailList = {partDetail,partDetail};
|
||||
// PlateDetail[] plateDetailList = {plateDetail,plateDetail};
|
||||
// CabinetsDetail cabinetsDetail = new CabinetsDetail();
|
||||
// cabinetsDetail.setPlateDetail(plateDetailList);
|
||||
// cabinetsDetail.setPartsDetail(partDetailList);
|
||||
// RoomDetail roomDetail = new RoomDetail();
|
||||
// CabinetsDetail[] cabinetsDetailList = {cabinetsDetail,cabinetsDetail};
|
||||
// roomDetail.setCabinetsDetail(cabinetsDetailList);
|
||||
// Detail detail = new Detail();
|
||||
// RoomDetail[] roomDetailList = {roomDetail,roomDetail};
|
||||
// detail.setRoomDetail(roomDetailList);
|
||||
// Detail[] detailList = {detail,detail};
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String detailListJson = objectMapper.writeValueAsString(detailList);
|
||||
String detailListJson = objectMapper.writeValueAsString(detail);
|
||||
System.out.println(
|
||||
detailListJson
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//测试字节数组
|
||||
// System.err.println("字节压缩/解压缩测试");
|
||||
// String inputStr = "snowolf@zlex.org;dongliang@zlex.org;zlex.dongliang@zlex.org";
|
||||
|
||||
+11
-11
@@ -17,16 +17,16 @@ import lombok.experimental.Accessors;
|
||||
public class HoleDetail {
|
||||
|
||||
private Integer holeId; //孔ID
|
||||
private Integer holeType;// 孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔)
|
||||
private Integer faceType; // 孔面类型(0正面, 1反面, 2侧面)
|
||||
private Integer pointX;
|
||||
private Integer pointY;
|
||||
private Integer pointZ;
|
||||
private Integer radius; //孔半径
|
||||
private Integer depth; //孔深度
|
||||
private Integer endPoint; //孔末端点
|
||||
private Integer pointX2;
|
||||
private Integer pointY2;
|
||||
private Integer angle; //角度
|
||||
private float holeType;// 孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔)
|
||||
private float faceType; // 孔面类型(0正面, 1反面, 2侧面)
|
||||
private float pointX;
|
||||
private float pointY;
|
||||
private float pointZ;
|
||||
private float radius; //孔半径
|
||||
private float depth; //孔深度
|
||||
private float endPoint; //孔末端点
|
||||
private float pointX2;
|
||||
private float pointY2;
|
||||
private float angle; //角度
|
||||
|
||||
}
|
||||
|
||||
+16
-15
@@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 板件属性信息
|
||||
@@ -50,26 +51,26 @@ public class IBoardProdInfo {
|
||||
private int openDoorType; //开门类型 0非门板,1左开,2右开,3上翻,4下翻
|
||||
private Boolean isRect; //是否为矩形
|
||||
|
||||
private Integer splitHeight; //开料长
|
||||
private Integer splitWidth; //开料宽
|
||||
private Integer splitThickness; //开料厚度
|
||||
private float splitHeight; //开料长
|
||||
private float splitWidth; //开料宽
|
||||
private float splitThickness; //开料厚度
|
||||
|
||||
private Integer decomposeHeight; //拆单长
|
||||
private Integer decomposeWidth; //拆单宽
|
||||
private Integer decomposeThickness; //拆单厚度
|
||||
private float decomposeHeight; //拆单长
|
||||
private float decomposeWidth; //拆单宽
|
||||
private float decomposeThickness; //拆单厚度
|
||||
|
||||
private BigDecimal height; //成品长
|
||||
private BigDecimal width; //成品宽
|
||||
private float height; //成品长
|
||||
private float width; //成品宽
|
||||
// private BigDecimal thickness; //成品厚度和开料的厚度相同
|
||||
|
||||
private Integer edgeHeight; //外封边长
|
||||
private Integer edgeWidth; //外封边宽
|
||||
private Integer edgeThickness; //外封边厚度
|
||||
private float edgeHeight; //外封边长
|
||||
private float edgeWidth; //外封边宽
|
||||
private float edgeThickness; //外封边厚度
|
||||
|
||||
private BigDecimal sealLeft; //左封边
|
||||
private BigDecimal sealRight; //右封边
|
||||
private BigDecimal sealUp; //上封边
|
||||
private BigDecimal sealDown; //下封边
|
||||
private float sealLeft; //左封边
|
||||
private float sealRight; //右封边
|
||||
private float sealUp; //上封边
|
||||
private float sealDown; //下封边
|
||||
|
||||
private String remark; //备注
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,5 +20,5 @@ import java.util.List;
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IContourData {
|
||||
private List<Point> pts; //点集(二维向量(x,y))
|
||||
private Integer[] buls; //凸度(0直线段 >0逆时针方向 <0顺时针方向)
|
||||
private float[] buls; //凸度(0直线段 >0逆时针方向 <0顺时针方向)
|
||||
}
|
||||
|
||||
+5
-5
@@ -26,15 +26,15 @@ public class IOriginModelingData {
|
||||
@Schema(description = "孔轮廓")
|
||||
private List<IContourData> holes;
|
||||
@Schema(description ="厚度" )
|
||||
private Integer thickness;
|
||||
private float thickness;
|
||||
@Schema(description = "0正面、1反面、2侧面")
|
||||
private Integer dir;
|
||||
@Schema(description = "刀半径")
|
||||
private Integer knifeRadius;
|
||||
private float knifeRadius;
|
||||
@Schema(description = "槽加长")
|
||||
private Integer addLen;
|
||||
private float addLen;
|
||||
@Schema(description = "槽加宽")
|
||||
private Integer addWidth;
|
||||
private float addWidth;
|
||||
@Schema(description = "槽加深")
|
||||
private Integer addDepth;
|
||||
private float addDepth;
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ public class ModelDetail {//去除order_module_extra
|
||||
private Integer lineID; //纹路ID
|
||||
private Integer typographicFace; //排版面 0正面, 1反面, 2侧面
|
||||
private String knifeName; //刀具名称
|
||||
private Integer knifeRadius; //刀半径
|
||||
private Integer depth; //深度
|
||||
private float knifeRadius; //刀半径
|
||||
private float depth; //深度
|
||||
private IOriginModelingData originModeling; //造型数据
|
||||
private List<PointList> pointList; //点列表
|
||||
private List<OffSetList> offSetList; //偏移量列表 //模块偏移数据
|
||||
|
||||
+4
-4
@@ -18,8 +18,8 @@ public class OffSetList {
|
||||
|
||||
private String name; //名称
|
||||
private Integer faceType;// 面向类型(0正面, 1反面, 2侧面)
|
||||
private Integer value; //值
|
||||
private Integer radius;//半径
|
||||
private Integer deep;//深度
|
||||
private Integer angle;//角度
|
||||
private float value; //值
|
||||
private float radius;//半径
|
||||
private float deep;//深度
|
||||
private float angle;//角度
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ import java.math.BigDecimal;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PlateModuleExtra {
|
||||
private BigDecimal width;
|
||||
private BigDecimal height;
|
||||
private float width;
|
||||
private float height;
|
||||
private Double thickness;
|
||||
private String groupType;
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,8 +16,8 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class PointDetail {
|
||||
private Integer pointId;
|
||||
private Integer pointX;
|
||||
private Integer pointY;
|
||||
private Integer curve;//曲线
|
||||
private Integer SealSize;//封边尺寸
|
||||
private float pointX;
|
||||
private float pointY;
|
||||
private float curve;//曲线
|
||||
private float SealSize;//封边尺寸
|
||||
}
|
||||
|
||||
+5
-5
@@ -17,9 +17,9 @@ import lombok.experimental.Accessors;
|
||||
public class PointList {
|
||||
private Integer lineId;//纹路Id
|
||||
private Integer pointId;//点Id
|
||||
private Integer pointX;
|
||||
private Integer pointY;
|
||||
private Integer radius;
|
||||
private Integer depth;
|
||||
private Integer curve;
|
||||
private float pointX;
|
||||
private float pointY;
|
||||
private float radius;
|
||||
private float depth;
|
||||
private float curve;
|
||||
}
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.dataTwo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 板件基本信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class IBoardProdInfo {
|
||||
|
||||
// 商品信息
|
||||
private String goodsId; // 商品编码
|
||||
private String goodsName; //商品名称
|
||||
private int goodType; //商品类型,用于筛选是板材还是配件类,可传入文字(需做转换)
|
||||
private String material; //材质
|
||||
private String color; //颜色
|
||||
private String factory; //商品生产厂商
|
||||
private String brand; //商品品牌
|
||||
private String model; //商品型号
|
||||
private String spec; //商品规格
|
||||
private Double thickness;//规格-板厚 板厚,成品和开料都是一样的
|
||||
private String unit; //商品单位
|
||||
|
||||
// 当有板件时就有板件信息
|
||||
private float goodsNumber; //产品数量为特殊处理,板件和配件都有数量
|
||||
|
||||
|
||||
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.dataTwo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CAD板件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PlateDetail {
|
||||
|
||||
// 板件所属信息
|
||||
private String roomsName; //房间名称
|
||||
private String cabinetsName; //柜体名
|
||||
// 柜体 长 宽 深
|
||||
private Double width;
|
||||
private Double height;
|
||||
private Double depth;
|
||||
|
||||
// 柜体成倍拆单的倍数
|
||||
private Integer multiNum;
|
||||
|
||||
// 板材所属加工组
|
||||
private List<String> synthesis;// 板件加工组Group的名称,可以有多个
|
||||
private String synthesisName;// 加工组中Group中每个小加工组的名称
|
||||
|
||||
|
||||
private Map<String,String> remark;
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
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 HolesInfo {
|
||||
|
||||
private Long id;
|
||||
private int holeType;
|
||||
private int faceType;
|
||||
private Double startPointX;
|
||||
private Double startPointY;
|
||||
private Double startPointZ;
|
||||
private Double radius;
|
||||
private Double depth;
|
||||
private String endPoint;
|
||||
private Double endPointX;
|
||||
private Double endPointY;
|
||||
private Double endPointZ;
|
||||
private Double angle;
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 轮廓数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IContourData {
|
||||
private ArrayList<Point> pts; //点集(二维向量(x,y))
|
||||
private Integer[] buls; //凸度(0直线段 >0逆时针方向 <0顺时针方向)
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
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 IOriginModel {
|
||||
|
||||
private IContourData outLine;
|
||||
private IContourData[] holes;
|
||||
private Double depth; //数据厚度
|
||||
private Double modelType; //造型类型
|
||||
private Double knifeRadius;
|
||||
private Double addLen;
|
||||
private Double addWidth;
|
||||
private Double addDepth;
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 板件 造型 包含信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class ModeInfo {
|
||||
|
||||
private Long id;
|
||||
private int lineType;
|
||||
private int faceType;
|
||||
private String KnifeName;
|
||||
private String KnifeRadius;
|
||||
private Double depth;
|
||||
private ArrayList<ModelPoint> pointList;
|
||||
private ArrayList<ModelOffSet> offSetList;
|
||||
private IOriginModel originModel;
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
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 ModelOffSet {
|
||||
|
||||
private String name;
|
||||
private int faceType;
|
||||
private Double value;
|
||||
private Double radius;
|
||||
private Double depth;
|
||||
private Double angle;
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
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 ModelPoint {
|
||||
|
||||
private Long LineId;
|
||||
private int faceType;
|
||||
private Double value;
|
||||
private Double pointX;
|
||||
private Double pointY;
|
||||
private Double radius;
|
||||
private Double Angle;
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
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 PartInfo {
|
||||
|
||||
private String goodsId;
|
||||
private String goodsName;
|
||||
private int goodType;
|
||||
private String goodTypeName;
|
||||
private String factory;
|
||||
private String brand;
|
||||
private String model;
|
||||
private String spec;
|
||||
private String unit;
|
||||
private String color;
|
||||
private String material; //材质
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
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 PlateInfo {
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.jsonDetial;
|
||||
|
||||
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 PointInfo {
|
||||
|
||||
private Long id; //点标识
|
||||
private Double pointX;
|
||||
private Double pointY;
|
||||
private Double curve;
|
||||
private Double sealSize;
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.other;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* CAD组合板件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class CabinetsDetail {
|
||||
|
||||
private String name;//组合名称
|
||||
private Long id;// 组合id 组合类别
|
||||
private PlateDetail[] plateDetail;
|
||||
private PartDetail[] partsDetail;
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.other;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* CAD模块板件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class Detail {
|
||||
|
||||
private String name;
|
||||
private Long id;
|
||||
private RoomDetail[] roomDetail;
|
||||
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.other;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* CAD板件材料信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class GoodDetail {
|
||||
|
||||
private String goodsId;
|
||||
private String goodsName;
|
||||
private int goodType;
|
||||
private String factory;
|
||||
private String brand;
|
||||
private String model;
|
||||
private String spec;
|
||||
private String unit;
|
||||
private String color;
|
||||
private String material; //材质
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.other;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* CAD板件配件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class PartDetail {
|
||||
|
||||
private String goodsId;
|
||||
private String goodsName;
|
||||
private int goodType;
|
||||
private String goodTypeName;
|
||||
private String factory;
|
||||
private String brand;
|
||||
private String model;
|
||||
private String spec;
|
||||
private String unit;
|
||||
private String color;
|
||||
private String material; //材质
|
||||
}
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.other;
|
||||
|
||||
import com.cf.imes.module.executor.util.deviseData.HoleDetail;
|
||||
import com.cf.imes.module.executor.util.deviseData.ModelDetail;
|
||||
import com.cf.imes.module.executor.util.deviseData.PointDetail;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* CAD板件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class PlateDetail {
|
||||
|
||||
private GoodDetail goodDetail;//板材详情
|
||||
private Long plateId; //板件Id
|
||||
private String plateNo;//板件自定义编号
|
||||
private String name; //板件名称
|
||||
private Double number;
|
||||
|
||||
private ModelDetail[] modelDetail ; //造型明细
|
||||
private PointDetail[] pointDetail ; //点明细
|
||||
private HoleDetail[] holeDetail ; //孔明细
|
||||
private PointDetail[] orgPointDetail ; //原始点明细
|
||||
private ModelDetail[] sideModelDetail ; //侧面造型明细
|
||||
private HoleDetail[] sideHoleDetail;//侧面孔明细
|
||||
|
||||
|
||||
|
||||
private Integer texture; //纹路 纹路(0正纹1可翻转2反纹)
|
||||
private int typographicFace; //排版面 排钻类型(0正面1反面2随意面)
|
||||
private int openDoorType; //开门类型 0非门板,1左开,2右开,3上翻,4下翻
|
||||
private Boolean isRect; //是否为矩形
|
||||
|
||||
private Integer splitHeight; //开料长
|
||||
private Integer splitWidth; //开料宽
|
||||
private Integer splitThickness; //开料厚度
|
||||
|
||||
private Integer decomposeHeight; //拆单长
|
||||
private Integer decomposeWidth; //拆单宽
|
||||
private Integer decomposeThickness; //拆单厚度
|
||||
|
||||
private Integer finishedHeight; //成品长
|
||||
private Integer finishedWidth; //成品宽
|
||||
private Integer finishedThickness; //成品厚度
|
||||
|
||||
private Integer edgeHeight; //外封边长
|
||||
private Integer edgeWidth; //外封边宽
|
||||
private Integer edgeThickness; //外封边厚度
|
||||
|
||||
private BigDecimal sealLeft; //封边左
|
||||
private BigDecimal sealRight;//封边右
|
||||
private BigDecimal sealUp;//封边上
|
||||
private BigDecimal sealDown;//封边下
|
||||
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.other;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* CAD柜体板件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class RoomDetail {
|
||||
|
||||
private String name;//柜体名称
|
||||
private Long id;// 柜体id
|
||||
private CabinetsDetail[] cabinetsDetail;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
|
||||
|
||||
import com.cf.imes.module.executor.util.FileTypeChangeUtil;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实现数据格式转换
|
||||
*/
|
||||
public interface ApiTypeChangeRealize extends FileTypeChangeUtil {
|
||||
default List<Detail> apiDataChange(String data) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel;
|
||||
|
||||
import com.alibaba.excel.exception.ExcelRuntimeException;
|
||||
|
||||
|
||||
public class ExcelDataContentException extends ExcelRuntimeException {
|
||||
}
|
||||
+5
-1
@@ -66,7 +66,11 @@ public final class ExcelListener<T> extends AnalysisEventListener<T> {
|
||||
excelDataConvertException.getColumnIndex() + 1, excelDataConvertException.getCellData());
|
||||
value = value + String.valueOf(new RuntimeException("第" + (excelDataConvertException.getRowIndex() + 1) + "行" +
|
||||
",第" + (excelDataConvertException.getColumnIndex() + 1) + "列读取错误")) ;
|
||||
System.out.println(datas.get(datas.size() - 1));;
|
||||
}
|
||||
if (exception instanceof RuntimeException) {
|
||||
RuntimeException runtimeException = (RuntimeException) exception;
|
||||
log.error("读取异常:{}", runtimeException.getMessage());
|
||||
value = value + runtimeException.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-28
@@ -44,34 +44,34 @@ public class FileTypeChangeRealize implements FileTypeChangeUtil {
|
||||
List<OrderPlateImportExcelVO> orderPlateImportExcelVOS = OrderExcelUtil.read(file, OrderPlateImportExcelVO.class);
|
||||
System.out.println(orderPlateImportExcelVOS);
|
||||
|
||||
if (orderPlateImportExcelVOS == null || orderPlateImportExcelVOS.isEmpty()) {
|
||||
return details;
|
||||
}
|
||||
|
||||
StringBuilder value = new StringBuilder();
|
||||
|
||||
|
||||
for (OrderPlateImportExcelVO orderPlateImportExcelVO : orderPlateImportExcelVOS) {
|
||||
orderPlateImportExcelVO.setRemark(orderPlateImportExcelVO.remarkJSON());
|
||||
if(dictDataApi.getDictData(DictTypeConstants.SYNTHESIS_TYPE,String.valueOf(orderPlateImportExcelVO.getSynthesis())).getData() != null){
|
||||
String synthesisTypeName = dictDataApi.getDictData(DictTypeConstants.SYNTHESIS_TYPE,String.valueOf(orderPlateImportExcelVO.getSynthesis())).getData().getLabel();
|
||||
orderPlateImportExcelVO.setSynthesisTypeName(synthesisTypeName);
|
||||
}
|
||||
handleOrderPlateImportExcelVO(orderPlateImportExcelVO, value);
|
||||
if(flag){
|
||||
Detail detail = Detail.builder()
|
||||
.iBoardProdInfo(BeanUtils.toBean(orderPlateImportExcelVO, IBoardProdInfo.class))
|
||||
.build();
|
||||
details.add(detail);
|
||||
}else {
|
||||
details = null;
|
||||
System.out.println(value.toString());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return details;
|
||||
// return null;
|
||||
// if (orderPlateImportExcelVOS == null || orderPlateImportExcelVOS.isEmpty()) {
|
||||
// return details;
|
||||
// }
|
||||
//
|
||||
// StringBuilder value = new StringBuilder();
|
||||
//
|
||||
//
|
||||
// for (OrderPlateImportExcelVO orderPlateImportExcelVO : orderPlateImportExcelVOS) {
|
||||
// orderPlateImportExcelVO.setRemark(orderPlateImportExcelVO.remarkJSON());
|
||||
// if(dictDataApi.getDictData(DictTypeConstants.SYNTHESIS_TYPE,String.valueOf(orderPlateImportExcelVO.getSynthesis())).getData() != null){
|
||||
// String synthesisTypeName = dictDataApi.getDictData(DictTypeConstants.SYNTHESIS_TYPE,String.valueOf(orderPlateImportExcelVO.getSynthesis())).getData().getLabel();
|
||||
// orderPlateImportExcelVO.setSynthesisTypeName(synthesisTypeName);
|
||||
// }
|
||||
// handleOrderPlateImportExcelVO(orderPlateImportExcelVO, value);
|
||||
// if(flag){
|
||||
// Detail detail = Detail.builder()
|
||||
// .iBoardProdInfo(BeanUtils.toBean(orderPlateImportExcelVO, IBoardProdInfo.class))
|
||||
// .build();
|
||||
// details.add(detail);
|
||||
// }else {
|
||||
// details = null;
|
||||
// System.out.println(value.toString());
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return details;
|
||||
return null;
|
||||
}
|
||||
|
||||
private void handleOrderPlateImportExcelVO(OrderPlateImportExcelVO orderPlateImportExcelVO, StringBuilder value) {
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel.excelPoi;
|
||||
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @author sunnyzyq
|
||||
* @date 2021/12/17
|
||||
*/
|
||||
public class ExcelClassField {
|
||||
|
||||
/** 字段名称 */
|
||||
private String fieldName;
|
||||
|
||||
/** 表头名称 */
|
||||
private String name;
|
||||
|
||||
/** 映射关系 */
|
||||
private LinkedHashMap<String, String> kvMap;
|
||||
|
||||
/** 示例值 */
|
||||
private Object example;
|
||||
|
||||
/** 排序 */
|
||||
private int sort;
|
||||
|
||||
/** 是否为注解字段:0-否,1-是 */
|
||||
private int hasAnnotation;
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, String> getKvMap() {
|
||||
return kvMap;
|
||||
}
|
||||
|
||||
public void setKvMap(LinkedHashMap<String, String> kvMap) {
|
||||
this.kvMap = kvMap;
|
||||
}
|
||||
|
||||
public Object getExample() {
|
||||
return example;
|
||||
}
|
||||
|
||||
public void setExample(Object example) {
|
||||
this.example = example;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getHasAnnotation() {
|
||||
return hasAnnotation;
|
||||
}
|
||||
|
||||
public void setHasAnnotation(int hasAnnotation) {
|
||||
this.hasAnnotation = hasAnnotation;
|
||||
}
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel.excelPoi;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author sunnyzyq
|
||||
* @date 2021/12/17
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ExcelExport {
|
||||
|
||||
/** 字段名称 */
|
||||
String value();
|
||||
|
||||
/** 导出排序先后: 数字越小越靠前(默认按Java类字段顺序导出) */
|
||||
int sort() default 0;
|
||||
|
||||
/** 导出映射,格式如:0-未知;1-男;2-女 */
|
||||
String kv() default "";
|
||||
|
||||
/** 导出模板示例值(有值的话,直接取该值,不做映射) */
|
||||
String example() default "";
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel.excelPoi;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author sunnyzyq
|
||||
* @date 2021/12/17
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ExcelImport {
|
||||
|
||||
/** 字段名称 */
|
||||
String value();
|
||||
|
||||
/** 导出映射,格式如:0-未知;1-男;2-女 */
|
||||
String kv() default "";
|
||||
|
||||
/** 是否为必填字段(默认为非必填) */
|
||||
boolean required() default false;
|
||||
|
||||
/** 最大长度(默认255) */
|
||||
int maxLength() default 255;
|
||||
|
||||
/** 导入唯一性验证(多个字段则取联合验证) */
|
||||
boolean unique() default false;
|
||||
|
||||
}
|
||||
+1005
File diff suppressed because it is too large
Load Diff
+221
@@ -0,0 +1,221 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel.excelPoi;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.cf.imes.framework.excel.core.annotations.DictFormat;
|
||||
import com.cf.imes.framework.excel.core.convert.DictConvert;
|
||||
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
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;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 生产单 Excel 导入 VO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class OrderImportVO {
|
||||
|
||||
// 行号
|
||||
private Integer rowNum;
|
||||
|
||||
// 行数据
|
||||
private String rowData;
|
||||
|
||||
// 错误提示信息
|
||||
private String rowTips;
|
||||
|
||||
@ExcelProperty(value = "序号")
|
||||
@JsonIgnore
|
||||
private int ordinal;
|
||||
|
||||
@ExcelProperty(value = "类型", converter = DictConvert.class)
|
||||
@JsonIgnore
|
||||
@DictFormat(DictTypeConstants.PRODUCT_TYPE)
|
||||
@ExcelImport(value = "类型", required = true)
|
||||
private int goodType;
|
||||
|
||||
@ExcelProperty(value = "物料编码")
|
||||
@JsonIgnore
|
||||
private String goodsId;
|
||||
|
||||
@ExcelProperty(value = "商品名称")
|
||||
@JsonIgnore
|
||||
private String goodsName;
|
||||
|
||||
@ExcelProperty(value = "材质")
|
||||
@JsonIgnore
|
||||
private String material;
|
||||
|
||||
@ExcelProperty(value = "颜色")
|
||||
@JsonIgnore
|
||||
private String color;
|
||||
|
||||
@ExcelProperty(value = "厂家")
|
||||
@JsonIgnore
|
||||
private String factory;
|
||||
|
||||
@ExcelProperty(value = "品牌")
|
||||
@JsonIgnore
|
||||
private String brand;
|
||||
|
||||
@ExcelProperty(value = "型号")
|
||||
@JsonIgnore
|
||||
private String model;
|
||||
|
||||
@ExcelProperty(value = "规格")
|
||||
@JsonIgnore
|
||||
private String spec;
|
||||
|
||||
@ExcelProperty(value = "单位")
|
||||
@JsonIgnore
|
||||
private String unit;
|
||||
|
||||
@ExcelProperty(value = "数量")
|
||||
@JsonIgnore
|
||||
@NotNull
|
||||
private Double goodsNumber;
|
||||
|
||||
@ExcelProperty(value = "房间")
|
||||
@JsonIgnore
|
||||
private String roomsName;
|
||||
|
||||
@ExcelProperty(value = "柜体")
|
||||
@JsonIgnore
|
||||
private String cabinetsName;
|
||||
|
||||
@ExcelProperty(value = "板名称")
|
||||
@JsonIgnore
|
||||
private String name;
|
||||
|
||||
@ExcelProperty(value = "板号")
|
||||
@JsonIgnore
|
||||
private String plateNo;
|
||||
|
||||
@ExcelProperty(value = "成品长")
|
||||
@JsonIgnore
|
||||
private BigDecimal height;
|
||||
|
||||
@ExcelProperty(value = "成品宽")
|
||||
@JsonIgnore
|
||||
private BigDecimal width;
|
||||
|
||||
@ExcelProperty(value = "开料长")
|
||||
@JsonIgnore
|
||||
private BigDecimal splitHeight;
|
||||
|
||||
@ExcelProperty(value = "开料宽")
|
||||
@JsonIgnore
|
||||
private BigDecimal splitWidth;
|
||||
|
||||
@ExcelProperty(value = "厚")
|
||||
@JsonIgnore
|
||||
private BigDecimal splitThickness;
|
||||
|
||||
@ExcelProperty(value = "左封边")
|
||||
@JsonIgnore
|
||||
private BigDecimal sealLeft;
|
||||
|
||||
@ExcelProperty(value = "右封边")
|
||||
@JsonIgnore
|
||||
private BigDecimal sealRight;
|
||||
|
||||
@ExcelProperty(value = "上封边")
|
||||
@JsonIgnore
|
||||
private BigDecimal sealUp;
|
||||
|
||||
@ExcelProperty(value = "下封边")
|
||||
@JsonIgnore
|
||||
private BigDecimal sealDown;
|
||||
|
||||
@ExcelProperty(value = "组合类型", converter = DictConvert.class)
|
||||
@JsonIgnore
|
||||
@DictFormat(DictTypeConstants.SYNTHESIS_TYPE)
|
||||
private int synthesis;
|
||||
|
||||
@JsonIgnore
|
||||
private String synthesisTypeName;//组合类型的名称
|
||||
|
||||
@ExcelProperty(value = "组合名称")
|
||||
@JsonIgnore
|
||||
private String combinationName;
|
||||
|
||||
@ExcelProperty(value = "排版面", converter = DictConvert.class)
|
||||
@JsonIgnore
|
||||
@DictFormat(DictTypeConstants.YPOGRAPHY_TYPE)
|
||||
private int typographicFace;
|
||||
|
||||
@ExcelProperty(value = "纹路", converter = DictConvert.class)
|
||||
@JsonIgnore
|
||||
@DictFormat(DictTypeConstants.GRAIN_TYPE)
|
||||
private int texture;
|
||||
|
||||
@ExcelProperty(value = "开门方向", converter = DictConvert.class)
|
||||
@JsonIgnore
|
||||
@DictFormat(DictTypeConstants.DOOR_OPENING_DIRECTIONS)
|
||||
private int openDoorType;
|
||||
|
||||
@ExcelProperty(value = "上传结果")
|
||||
@JsonIgnore
|
||||
private String result;
|
||||
|
||||
@ExcelProperty(value = "备注1")
|
||||
private String remark1;
|
||||
|
||||
@ExcelProperty(value = "备注2")
|
||||
private String remark2;
|
||||
|
||||
@ExcelProperty(value = "备注3")
|
||||
private String remark3;
|
||||
|
||||
@ExcelProperty(value = "备注4")
|
||||
private String remark4;
|
||||
|
||||
@ExcelProperty(value = "备注5")
|
||||
private String remark5;
|
||||
|
||||
@ExcelProperty(value = "备注6")
|
||||
private String remark6;
|
||||
|
||||
@ExcelProperty(value = "备注7")
|
||||
private String remark7;
|
||||
|
||||
@ExcelProperty(value = "备注8")
|
||||
private String remark8;
|
||||
|
||||
@ExcelProperty(value = "备注9")
|
||||
private String remark9;
|
||||
|
||||
@ExcelProperty(value = "备注10")
|
||||
private String remark10;
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
@JsonIgnore
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
//备注转json数据
|
||||
public String remarkJSON() {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
// 设置实体类字段的值
|
||||
try {
|
||||
String json = objectMapper.writeValueAsString(this);
|
||||
return json;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user