mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 13:22: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 "{}";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.manage.api.plate;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.manage.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 多组织")
|
||||
public interface PlateApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/plate";
|
||||
|
||||
@GetMapping(PREFIX +"/get")
|
||||
@Operation(summary = "获得板材信息表")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
CommonResult<Boolean> getPlate(@RequestParam("id") Long id);
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.manage.api.plate;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.manage.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.manage.service.plate.PlateService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
public class PlateServiceImpl implements PlateApi{
|
||||
|
||||
@Resource
|
||||
private PlateService plateService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> getPlate(Long id) {
|
||||
PlateDO plateDO = plateService.getPlate(id);
|
||||
if (plateDO == null) {
|
||||
return success(false);
|
||||
}
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
-2
@@ -4,8 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.manage.controller.admin.plate.vo.plate.PlateImportExcelVO;
|
||||
import com.cf.imes.module.manage.controller.admin.plate.vo.plate.PlateImportRespVO;
|
||||
import com.cf.imes.module.manage.controller.admin.plate.vo.plate.PlatePageReqVO;
|
||||
|
||||
+3
@@ -223,5 +223,8 @@ public interface ErrorCodeConstants {
|
||||
//=========== 柜体信息 1-002-035-000 ============
|
||||
ErrorCode ORDER_GROUP_NOT_EXISTS = new ErrorCode(1_002_036_001, "加工组信息不存在");
|
||||
|
||||
//=========== 应用信息 1-002-037-000 ============
|
||||
ErrorCode APPLICATION_NOT_EXISTS = new ErrorCode(1_002_037_001, "应用信息不存在");
|
||||
ErrorCode APPLICATION_LOGIN_USER_DISABLED = new ErrorCode(1_002_037_001, "应用登陆失败");
|
||||
|
||||
}
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.cf.imes.module.system.controller.admin.application;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.auth.ApplicationLoginRespVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.application.ApplicationDO;
|
||||
import com.cf.imes.module.system.service.application.ApplicationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 应用注册信息")
|
||||
@RestController
|
||||
@RequestMapping("/system/application")
|
||||
@Validated
|
||||
public class ApplicationController {
|
||||
|
||||
@Resource
|
||||
private ApplicationService applicationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新建应用注册")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:create')")
|
||||
public CommonResult<Integer> createApplication(@Valid @RequestBody ApplicationSaveReqVO createReqVO) {
|
||||
return success(applicationService.createApplication(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新应用注册")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:update')")
|
||||
public CommonResult<Boolean> updateApplication(@Valid @RequestBody ApplicationSaveReqVO updateReqVO) {
|
||||
applicationService.updateApplication(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除应用注册")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:application:delete')")
|
||||
public CommonResult<Boolean> deleteApplication(@RequestParam("id") Long id) {
|
||||
applicationService.deleteApplication(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得应用注册")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:query')")
|
||||
public CommonResult<ApplicationRespVO> getApplication(@RequestParam("id") Long id) {
|
||||
ApplicationDO applicationDO = applicationService.getApplication(id);
|
||||
return success(BeanUtils.toBean(applicationDO, ApplicationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得应用注册分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:query')")
|
||||
public CommonResult<PageResult<ApplicationRespVO>> getApplicationPage(@Valid ApplicationPageReqVO pageReqVO) {
|
||||
PageResult<ApplicationDO> pageResult = applicationService.getApplicationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ApplicationRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/appLogin")
|
||||
@Operation(summary = "应用登陆")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:create')")
|
||||
public CommonResult<ApplicationLoginRespVO> loginApplication(@Valid @RequestBody ApplicationRespVO applicationRespVO) {
|
||||
return success(applicationService.loginApplication(applicationRespVO));
|
||||
}
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.application;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 应用注册表分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApplicationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "应用标识", example = "okk")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "应用密钥", example = "121gfrsg5sb4gs")
|
||||
private String appKey;
|
||||
|
||||
@Schema(description = "服务器IP列表", example = "0.0.0.0")
|
||||
private String serverIp;
|
||||
|
||||
@Schema(description = "应用简称")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "应用名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用主体")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "状态: 0停用,1正常")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.application;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 应用注册表 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ApplicationRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
@ExcelProperty("主键")
|
||||
private int id;
|
||||
|
||||
@Schema(description = "应用标识", example = "okk")
|
||||
@ExcelProperty("应用标识")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "应用密钥", example = "121gfrsg5sb4gs")
|
||||
@ExcelProperty("应用密钥")
|
||||
private String appKey;
|
||||
|
||||
@Schema(description = "服务器IP列表", example = "0.0.0.0")
|
||||
@ExcelProperty("服务器IP列表")
|
||||
private String serverIp;
|
||||
|
||||
@Schema(description = "应用简称")
|
||||
@ExcelProperty("应用简称")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "应用名")
|
||||
@ExcelProperty("应用名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用主体")
|
||||
@ExcelProperty("应用主体")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "状态: 0停用,1正常")
|
||||
@ExcelProperty("状态")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.application;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 应用注册表新增/修改 Request VO")
|
||||
@Data
|
||||
public class ApplicationSaveReqVO{
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "应用标识", example = "okk")
|
||||
@NotNull(message = "应用标识不能为空")
|
||||
private String appId;
|
||||
|
||||
// @Schema(description = "应用密钥", example = "121gfrsg5sb4gs")
|
||||
// @NotNull(message = "应用密钥不能为空")
|
||||
// private String appKey;
|
||||
|
||||
// private String appSecret;
|
||||
|
||||
@Schema(description = "服务器IP列表", example = "0.0.0.0")
|
||||
@NotNull(message = "服务器IP列表不能为空")
|
||||
private String serverIp;
|
||||
|
||||
@Schema(description = "应用简称")
|
||||
@NotNull(message = "应用简称不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "应用名")
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用主体")
|
||||
@NotNull(message = "应用主体不能为空")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "状态: 0停用,1正常")
|
||||
@NotNull(message = "不能为空")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.auth;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 应用登录 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ApplicationLoginRespVO {
|
||||
|
||||
@Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Integer appId;
|
||||
|
||||
@Schema(description = "访问令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "happy")
|
||||
private String accessToken;
|
||||
|
||||
@Schema(description = "刷新令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "nice")
|
||||
private String refreshToken;
|
||||
|
||||
@Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime expiresTime;
|
||||
|
||||
}
|
||||
-2
@@ -5,7 +5,6 @@ import javax.validation.Valid;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -103,5 +102,4 @@ public class ProcessController {
|
||||
List<ProcessDO> processUser = processService.getAllProcess();
|
||||
return success(BeanUtils.toBean(processUser, ProcessDO.class));
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -5,6 +5,7 @@ import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
@@ -175,4 +176,11 @@ public class UserController {
|
||||
return success(userService.importUserList(list, updateSupport));
|
||||
}
|
||||
|
||||
@GetMapping("/list-terms-simple")
|
||||
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
|
||||
@Parameter(name = "name", description = "用户名称", required = false, example = "晨丰")
|
||||
public CommonResult<List<UserRespVO>> getSimpleUserList(@RequestParam(value = "name", required = false) String name) {
|
||||
List<AdminUserDO> list = userService.getUserListByTerms(CommonStatusEnum.ENABLE.getStatus() , name);
|
||||
return success(BeanUtils.toBean(list, UserRespVO.class));
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.system.controller.admin.user.vo.user;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 用户信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class UserTermsReqVO extends UserRespVO{
|
||||
|
||||
/**
|
||||
* 拼音首字母
|
||||
*/
|
||||
private String pyFirstChar;
|
||||
/**
|
||||
* 全拼
|
||||
*/
|
||||
private String pyAll;
|
||||
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.cf.imes.module.system.dal.dataobject.application;
|
||||
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 应用信息 process DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("application")
|
||||
@KeySequence("application_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ApplicationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 应用 ID
|
||||
*/
|
||||
@TableId
|
||||
private int id;
|
||||
/**
|
||||
* 应用标识
|
||||
*/
|
||||
private String appId;
|
||||
/**
|
||||
* 应用密钥
|
||||
*/
|
||||
private String appKey;
|
||||
/**
|
||||
* 应用私钥
|
||||
*/
|
||||
private String appSecret;
|
||||
/**
|
||||
* 服务器IP列表
|
||||
*/
|
||||
private String serverIp;
|
||||
/**
|
||||
* 应用简称
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 应用名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 应用主体
|
||||
*/
|
||||
private String company;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.cf.imes.module.system.dal.mysql.application;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationPageReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.application.ApplicationDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 应用信息表 process Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface ApplicationMapper extends BaseMapperX<ApplicationDO> {
|
||||
|
||||
default PageResult<ApplicationDO> selectPage(ApplicationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ApplicationDO>()
|
||||
.likeIfPresent(ApplicationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ApplicationDO::getAppId, reqVO.getAppId())
|
||||
.eqIfPresent(ApplicationDO::getAppKey, reqVO.getAppKey())
|
||||
.eqIfPresent(ApplicationDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(ApplicationDO::getServerIp, reqVO.getServerIp())
|
||||
.eqIfPresent(ApplicationDO::getCompany, reqVO.getCompany())
|
||||
.eqIfPresent(ApplicationDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ApplicationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ApplicationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ApplicationDO::getId));
|
||||
}
|
||||
|
||||
default ApplicationDO selectByAppId(String appId) {
|
||||
return selectOne(ApplicationDO::getAppId, appId);
|
||||
}
|
||||
}
|
||||
+3
-17
@@ -1,11 +1,13 @@
|
||||
package com.cf.imes.module.system.dal.mysql.process;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.system.controller.admin.process.vo.process.ProcessPageReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.process.ProcessDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -35,23 +37,7 @@ public interface ProcessMapper extends BaseMapperX<ProcessDO> {
|
||||
.orderByDesc(ProcessDO::getId));
|
||||
}
|
||||
|
||||
// default PageResult<ProcessPageReqVO> selectPage(ProcessPageReqVO reqVO) {
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<ProcessPageReqVO>()
|
||||
// .likeIfPresent(ProcessPageReqVO::getName, reqVO.getName())
|
||||
// .eqIfPresent(ProcessPageReqVO::getPieceRate, reqVO.getPieceRate())
|
||||
// .eqIfPresent(ProcessPageReqVO::getPieceType, reqVO.getPieceType())
|
||||
// .eqIfPresent(ProcessPageReqVO::getType, reqVO.getType())
|
||||
// .eqIfPresent(ProcessPageReqVO::getIsCustom, reqVO.getIsCustom())
|
||||
// .eqIfPresent(ProcessPageReqVO::getIsDealer, reqVO.getIsDealer())
|
||||
// .eqIfPresent(ProcessPageReqVO::getSort, reqVO.getSort())
|
||||
// .eqIfPresent(ProcessPageReqVO::getHourCapacity, reqVO.getHourCapacity())
|
||||
// .eqIfPresent(ProcessPageReqVO::getUnit, reqVO.getUnit())
|
||||
// .eqIfPresent(ProcessPageReqVO::getIsEnabled, reqVO.getIsEnabled())
|
||||
// .betweenIfPresent(ProcessPageReqVO::getPrepareTime, reqVO.getPrepareTime())
|
||||
// .eqIfPresent(ProcessPageReqVO::getDescription, reqVO.getDescription())
|
||||
// .betweenIfPresent(ProcessPageReqVO::getCreateTime, reqVO.getCreateTime())
|
||||
// .orderByDesc(ProcessPageReqVO::getId));
|
||||
// }
|
||||
IPage<ProcessDO> selectProcessPage(@Param("page") IPage<ProcessDO> page , @Param("page") ProcessPageReqVO reqVO);
|
||||
|
||||
default List<ProcessDO> selectAll() {
|
||||
return selectList(new LambdaQueryWrapperX<ProcessDO>()
|
||||
|
||||
+11
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.dal.mysql.user;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@@ -69,4 +70,14 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectList(AdminUserDO::getDeptId, deptIds);
|
||||
}
|
||||
|
||||
default List<AdminUserDO> selectListByTerms(Integer status, String namePyAll,String namePyFirstChar,String name) {
|
||||
return selectList(new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.eqIfPresent(AdminUserDO::getStatus, status)
|
||||
.likeIfPresent(AdminUserDO::getNickname, name)
|
||||
.or(StrUtil.isNotBlank(name))
|
||||
.likeIfPresent(AdminUserDO::getPinyinFull, namePyAll)
|
||||
.or(StrUtil.isNotBlank(namePyAll))
|
||||
.likeIfPresent(AdminUserDO::getPinyinInitial, namePyFirstChar)
|
||||
.orderByDesc(AdminUserDO::getId));
|
||||
}
|
||||
}
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.cf.imes.module.system.service.application;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.auth.ApplicationLoginRespVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.application.ApplicationDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
public interface ApplicationService {
|
||||
|
||||
/**
|
||||
* 创建应用信息表 application
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createApplication(@Valid ApplicationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新应用信息表 application
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateApplication(@Valid ApplicationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除应用信息表 application
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteApplication(Long id);
|
||||
|
||||
/**
|
||||
* 获得应用信息表 application
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工序信息表 application
|
||||
*/
|
||||
ApplicationDO getApplication(Long id);
|
||||
|
||||
/**
|
||||
* 获得应用信息表 application
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工序信息表 application
|
||||
*/
|
||||
PageResult<ApplicationDO> getApplicationPage(ApplicationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得所有应用信息表 application
|
||||
*
|
||||
* @return 工序信息表 application
|
||||
*/
|
||||
List<ApplicationDO> getAllApplication();
|
||||
|
||||
/**
|
||||
* 应用登陆
|
||||
* @param reqVO: 登陆信息
|
||||
* @return 登录结果
|
||||
*/
|
||||
ApplicationLoginRespVO loginApplication(@Valid ApplicationRespVO reqVO);
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
package com.cf.imes.module.system.service.application;
|
||||
|
||||
import com.cf.imes.framework.common.exception.ServerException;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.monitor.TracerUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.common.util.servlet.ServletUtils;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.system.api.logger.dto.LoginLogCreateReqDTO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.auth.ApplicationLoginRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.auth.vo.AuthLoginRespVO;
|
||||
import com.cf.imes.module.system.convert.auth.AuthConvert;
|
||||
import com.cf.imes.module.system.dal.dataobject.application.ApplicationDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.organ.OrganizationDO;
|
||||
import com.cf.imes.module.system.dal.mysql.application.ApplicationMapper;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import com.cf.imes.module.system.enums.logger.LoginLogTypeEnum;
|
||||
import com.cf.imes.module.system.enums.logger.LoginResultEnum;
|
||||
import com.cf.imes.module.system.enums.oauth2.OAuth2ClientConstants;
|
||||
import com.cf.imes.module.system.service.oauth2.OAuth2TokenService;
|
||||
import com.cf.imes.module.system.util.rsa.AsymmetricAlgorithmUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.APPLICATION_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 应用信息表 application Service 实现类
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ApplicationServiceImpl implements ApplicationService{
|
||||
|
||||
@Resource
|
||||
private ApplicationMapper applicationMapper;
|
||||
|
||||
@Resource
|
||||
private OAuth2TokenService oauth2TokenService;
|
||||
|
||||
@Override
|
||||
public Integer createApplication(ApplicationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
LinkedList<String> priKeyAndPubKey = AsymmetricAlgorithmUtil.getPriKeyAndPubKey();
|
||||
String privateKey = priKeyAndPubKey.get(0);
|
||||
String publicKey = priKeyAndPubKey.get(1);
|
||||
String appKey = AsymmetricAlgorithmUtil.encryptByPublic(createReqVO.getAppId(), publicKey);
|
||||
// 公钥加密,私钥解密
|
||||
ApplicationDO applicationDO = BeanUtils.toBean(createReqVO, ApplicationDO.class)
|
||||
.setAppKey(appKey).setAppSecret(privateKey);
|
||||
applicationMapper.insert(applicationDO);
|
||||
// 返回
|
||||
return applicationDO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateApplication(ApplicationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateApplicationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ApplicationDO updateObj = BeanUtils.toBean(updateReqVO, ApplicationDO.class);
|
||||
applicationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteApplication(Long id) {
|
||||
// 校验存在
|
||||
validateApplicationExists(id);
|
||||
// 删除
|
||||
applicationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateApplicationExists(Long id) {
|
||||
if (applicationMapper.selectById(id) == null) {
|
||||
throw exception(APPLICATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationDO getApplication(Long id) {
|
||||
return applicationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ApplicationDO> getApplicationPage(ApplicationPageReqVO pageReqVO) {
|
||||
return applicationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApplicationDO> getAllApplication() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationLoginRespVO loginApplication(ApplicationRespVO reqVO) {
|
||||
ApplicationDO app = applicationMapper.selectByAppId(reqVO.getAppId());
|
||||
if (Objects.isNull(app)) {
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.APPLICATION_NOT_EXISTS);
|
||||
}
|
||||
// 公钥加密,私钥解密
|
||||
String appId = AsymmetricAlgorithmUtil.encryptByPublic(reqVO.getAppKey(), app.getAppSecret());
|
||||
if (!appId.equals(app.getAppId())) {
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.APPLICATION_LOGIN_USER_DISABLED);
|
||||
}
|
||||
// 创建 Token 令牌,记录登录日志
|
||||
return BeanUtils.toBean(createTokenAfterLoginSuccess(app.getId(), app.getAppId(), LoginLogTypeEnum.LOGIN_USERNAME), ApplicationLoginRespVO.class).setAppId(app.getId());
|
||||
}
|
||||
|
||||
private AuthLoginRespVO createTokenAfterLoginSuccess(Integer userId, String username, LoginLogTypeEnum logType) {
|
||||
// Long organId = OrganContextHolder.getOrganId();
|
||||
// OrganizationDO organ = organService.getOrgan(organId);
|
||||
// if(Objects.isNull(organ)) {
|
||||
// throw new ServerException(10023,"组织不存在");
|
||||
// }
|
||||
// 创建访问令牌
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.createAccessToken(
|
||||
1L,
|
||||
null,
|
||||
OAuth2ClientConstants.CLIENT_ID_DEFAULT,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
// 构建返回结果
|
||||
return AuthConvert.INSTANCE.convert(accessTokenDO);
|
||||
}
|
||||
|
||||
}
|
||||
+5
-25
@@ -1,6 +1,8 @@
|
||||
package com.cf.imes.module.system.service.process;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.util.pinyin.PinYinUtils;
|
||||
import com.cf.imes.module.system.controller.admin.process.vo.process.*;
|
||||
import com.cf.imes.module.system.controller.admin.process.vo.processUser.ProcessAndUserSaveReqVO;
|
||||
@@ -142,31 +144,9 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessRespVO> getProcessPageAll(ProcessPageReqVO pageReqVO) {
|
||||
PageResult<ProcessDO> processList = processMapper.selectPage(pageReqVO);
|
||||
PageResult<ProcessRespVO> processRespVOPageResult = new PageResult<ProcessRespVO>();
|
||||
|
||||
processRespVOPageResult.setTotal(processList.getTotal());
|
||||
processList.getList().forEach(processDO -> {
|
||||
ProcessRespVO processRespVO = BeanUtils.toBean(processDO, ProcessRespVO.class);
|
||||
StringBuilder userIdBuilder = new StringBuilder();
|
||||
List<ProcessUserDO> userIdListsByProcessId = processUserService.getProcessUser(processDO.getId());
|
||||
if (userIdListsByProcessId != null) {
|
||||
for (ProcessUserDO processUser : userIdListsByProcessId) {
|
||||
if (processUser != null && processUser.getUserId() != null) {
|
||||
if (adminUserService.getUser(processUser.getUserId()) != null) {
|
||||
userIdBuilder.append(",").append(processUser.getUserId());
|
||||
}
|
||||
if (pageReqVO.getUserId() != null && pageReqVO.getUserId().equals("")) {
|
||||
if (processUser.getUserId().equals(pageReqVO.getUserId()))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
processRespVO.setUsers(userIdBuilder.length() > 0 ? userIdBuilder.substring(1) : "");
|
||||
processRespVOPageResult.getList().add(processRespVO);
|
||||
});
|
||||
return processRespVOPageResult;
|
||||
PageDTO<ProcessDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<ProcessDO> processRespVOPageResult = processMapper.selectProcessPage(page,BeanUtils.toBean(pageReqVO, ProcessPageReqVO.class));
|
||||
return new PageResult<ProcessRespVO>(BeanUtils.toBean(processRespVOPageResult.getRecords(), ProcessRespVO.class), processRespVOPageResult.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
@@ -207,4 +207,13 @@ public interface AdminUserService {
|
||||
*/
|
||||
boolean isPasswordMatch(String rawPassword, String encodedPassword);
|
||||
|
||||
/**
|
||||
* 获得指定状态和名称的用户们
|
||||
*
|
||||
* @param status 状态
|
||||
* @param name 用户名称
|
||||
* @return 用户们
|
||||
*/
|
||||
List<AdminUserDO> getUserListByTerms(Integer status , String name);
|
||||
|
||||
}
|
||||
|
||||
+11
@@ -475,6 +475,17 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
return passwordEncoder.matches(rawPassword, encodedPassword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserDO> getUserListByTerms(Integer status, String name) {
|
||||
String namePyFirstChar = "";
|
||||
String namePyAll = "";
|
||||
if(StrUtil.isNotBlank(name)) {
|
||||
namePyFirstChar = PinYinUtils.convertToPinyin(name);
|
||||
namePyAll = PinYinUtils.convertToPinyin(name).replaceAll(" ", "");
|
||||
}
|
||||
return userMapper.selectListByTerms(status, namePyAll, namePyFirstChar, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对密码进行加密
|
||||
*
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?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.system.dal.mysql.process.ProcessMapper">
|
||||
<select id="selectProcessPage" resultType="com.cf.imes.module.system.dal.dataobject.process.ProcessDO">
|
||||
select
|
||||
p.id,
|
||||
p.organ_id,
|
||||
p.name,
|
||||
p.piece_rate,
|
||||
p.piece_type,
|
||||
p.type,
|
||||
p.is_custom,
|
||||
p.is_dealer,
|
||||
p.hour_capacity,
|
||||
p.sort,
|
||||
p.unit,
|
||||
p.is_enabled,
|
||||
p.prepare_time,
|
||||
p.description,
|
||||
p.creator,
|
||||
p.create_time,
|
||||
p.updater,
|
||||
p.update_time,
|
||||
p.deleted
|
||||
from process p
|
||||
<where>
|
||||
|
||||
<if test="page.userId != null and page.userId != '' ">
|
||||
and p.id in (select process_id from process_user where user_id = #{page.userId})
|
||||
</if>
|
||||
<if test="page.name != null and page.name != '' ">
|
||||
and p.name like concat('%', #{page.name}, '%')
|
||||
</if>
|
||||
<if test="page.isEnabled != null">
|
||||
and p.is_enabled = #{page.isEnabled}
|
||||
</if>
|
||||
<if test="page.type != null">
|
||||
and p.type = #{page.type}
|
||||
</if>
|
||||
<if test="page.pieceType != null">
|
||||
and p.piece_type = #{page.pieceType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user