1、报表接口入参检查完善;2、executor-api、report-api相互依赖移除;

This commit is contained in:
gaoqr
2024-10-16 17:10:25 +08:00
parent 4ceb952bf0
commit de0ec350bd
32 changed files with 189 additions and 1074 deletions
@@ -1,26 +0,0 @@
package com.cf.imes.module.executor.api.datasource;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.executor.api.datasource.dto.OrderDTO;
import com.cf.imes.module.executor.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;
/**
* @author Gqr
* @since 2024/7/22 17:56
*/
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 订单报表数据源")
public interface OrderDatasourceApi {
String PREFIX = ApiConstants.PREFIX + "/order";
@GetMapping(PREFIX +"/info")
@Operation(summary = "获取生产单信息")
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
CommonResult<OrderDTO> getOrderInfo(@RequestParam("orderId") Long orderId);
}
@@ -1,33 +0,0 @@
package com.cf.imes.module.executor.api.datasource;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.executor.api.datasource.dto.PartGoodsRespDTO;
import com.cf.imes.module.executor.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;
import java.util.List;
/**
* @author Gqr
* @since 2024/7/30 9:22
*/
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 配件报表数据源")
public interface OrderPartDatasourceApi {
String PREFIX = ApiConstants.PREFIX + "/order-part";
@GetMapping(PREFIX + "/detail")
@Operation(summary = "配件明细")
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
CommonResult<List<PartGoodsRespDTO>> selectPartDetail(@RequestParam("orderId") Long orderId);
@GetMapping(PREFIX + "/summary")
@Operation(summary = "配件汇总")
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
CommonResult<List<PartGoodsRespDTO>> selectPartAll(@RequestParam("orderId") Long orderId);
}
@@ -1,33 +0,0 @@
package com.cf.imes.module.executor.api.datasource;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.executor.api.datasource.dto.PlateGoodsRespDTO;
import com.cf.imes.module.executor.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;
import java.util.List;
/**
* @author Gqr
* @since 2024/7/19 12:00
*/
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 板材报表数据源")
public interface OrderPlateDatasourceApi {
String PREFIX = ApiConstants.PREFIX + "/order-plate";
@GetMapping(PREFIX + "/summary")
@Operation(summary = "板材汇总")
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
CommonResult<List<PlateGoodsRespDTO>> selectPlateGoodsListSummary(@RequestParam("orderId") Long orderId);
@GetMapping(PREFIX + "/detail")
@Operation(summary = "板材明细")
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
CommonResult<List<PlateGoodsRespDTO>> selectPlateGoodsList(@RequestParam("orderId") Long orderId);
}
@@ -1,78 +0,0 @@
package com.cf.imes.module.executor.api.datasource.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author Gqr
* @since 2024/7/22 17:54
*/
@Schema(description = "管理后台 - 生产单表 RPC Response DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderDTO implements Serializable {
@Serial
private static final long serialVersionUID = 3574973837176279383L;
@Schema(description = "生产单号")
private Long id;
@Schema(description = "父单号")
private Long parentNo;
@Schema(description = "源生产单号")
private String apiOrderId;
@Schema(description = "生产单日期", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime orderDate;
@Schema(description = "交付日期", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime deliveryDate;
@Schema(description = "生产单类型,1主单 2子单", example = "1")
private Integer orderType;
@Schema(description = "生产单排序号")
private Integer orderSort;
@Schema(description = "CAD数据类型,1CAD 2WebCAD 3Excel", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer dataType;
@Schema(description = "订单状态,订单状态,0空订单1新单2生产中3生产完成", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status;
@Schema(description = "自定义单号")
private String customOrderNo;
@Schema(description = "客户", requiredMode = Schema.RequiredMode.REQUIRED)
private String customer;
@Schema(description = "客户地址", requiredMode = Schema.RequiredMode.REQUIRED)
private String address;
@Schema(description = "客户电话", requiredMode = Schema.RequiredMode.REQUIRED)
private String phoneNumber;
@Schema(description = "经销商", requiredMode = Schema.RequiredMode.REQUIRED)
private String dealer;
@Schema(description = "经销商电话", requiredMode = Schema.RequiredMode.REQUIRED)
private String dealerPhoneNumber;
@Schema(description = "业务员")
private String salesman;
@Schema(description = "拆单员")
private String splitter;
@Schema(description = "备注", example = "你猜")
private String remark;
}
@@ -1,80 +0,0 @@
package com.cf.imes.module.executor.api.datasource.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "管理后台 - 配件对应板材信息 Resp DTO")
public class PartGoodsRespDTO {
@Schema(description = "柜体号", example = "11087")
private Long bodyId;
@Schema(description = "柜体名称", example = "11087")
private String bodyName;
@Schema(description = "房间号", example = "11087")
private Long roomId;
@Schema(description = "房间名称", example = "11087")
private String roomName;
@Schema(description = "配件 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29347")
private Long id;
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
private Long orderId;
@Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1195")
private String goodsId;
@Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
private String name;
@Schema(description = "材质", requiredMode = Schema.RequiredMode.REQUIRED)
private String material;
@Schema(description = "配件类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
private String type;
@Schema(description = "型号", requiredMode = Schema.RequiredMode.REQUIRED)
private String model;
@Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED)
private String spec;
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
private String brand;
@Schema(description = "厂家", requiredMode = Schema.RequiredMode.REQUIRED)
private String factory;
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
private String unit;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "29507")
private Double price;
@Schema(description = "是否复合部件:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean isComposite;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "29507")
private Double num;
@Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "29507")
private Double totalPrice;
}
@@ -1,179 +0,0 @@
package com.cf.imes.module.executor.api.datasource.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "管理后台 - 板件对应板材信息 Response DTO")
public class PlateGoodsRespDTO {
@Schema(description = "柜体号", example = "11087")
private Long bodyId;
@Schema(description = "柜体名称", example = "11087")
private String bodyName;
@Schema(description = "房间号", example = "11087")
private Long roomId;
@Schema(description = "房间名称", example = "11087")
private String roomName;
@Schema(description = "板id", example = "11087")
private Long id;
@Schema(description = "板数量", example = "11087")
private Integer count = 1;
@Schema(description = "生产单号", example = "11087")
private Long orderId;
@Schema(description = "板名称", example = "晨丰")
private String name;
@Schema(description = "自定义板编号,设计有板编号,则保留设计板编号;设计没有且在机台设置中设置了自定义板编号规则,则按规则自动生成")
private String plateNo;
@Schema(description = "板类型,0 层板 1 立板 2 背板", example = "1")
private Integer type;
@Schema(description = "商品 ID", example = "14195")
private String goodsId;
@Schema(description = "商品名称", example = "西西")
private String goodsName;
@Schema(description = "商品材质", example = "颗粒板")
private String material;
@Schema(description = "商品颜色", example = "白色")
private String color;
@Schema(description = "商品宽度", example = "14195")
private BigDecimal goodsWidth;
@Schema(description = "商品高度", example = "14195")
private BigDecimal goodsHeight;
@Schema(description = "商品厚度", example = "14195")
private BigDecimal goodsThickness;
@Schema(description = "商品价格", example = "14195")
private BigDecimal price;
@Schema(description = "商品品牌", example = "柏柏")
private String brand;
@Schema(description = "商品规格", example = "14195*21")
private String spec;
@Schema(description = "宽度")
private BigDecimal width;
@Schema(description = "高度")
private BigDecimal height;
@Schema(description = "厚度")
private BigDecimal thickness;
@Schema(description = "拆单宽度")
private BigDecimal splitWidth;
@Schema(description = "拆单高度")
private BigDecimal splitHeight;
@Schema(description = "拆单厚度")
private BigDecimal splitThickness;
@Schema(description = "左封边厚度")
private BigDecimal sealLeft;
@Schema(description = "右封边厚度")
private BigDecimal sealRight;
@Schema(description = "上封边厚度")
private BigDecimal sealUp;
@Schema(description = "下封边厚度")
private BigDecimal sealDown;
@Schema(description = "面积")
private BigDecimal area;
@Schema(description = "纹路类型,0 正纹 1 可翻转 2 反纹")
private Integer texture;
@Schema(description = "孔面类型,0 正面 1 反面 2 侧面")
private Integer holeFace;
@Schema(description = "排孔类型,0 正纹 1 反面 2 随意面")
private Integer holeArrange;
@Schema(description = "异型孔数量", example = "28477")
private Short unregularPointCount;
@Schema(description = "正面孔数量", example = "20823")
private Short frontHoleCount;
@Schema(description = "背面孔数量", example = "3441")
private Short backHoleCount;
@Schema(description = "侧面孔数量", example = "25509")
private Short sideHoleCount;
@Schema(description = "正面造型量", example = "31547")
private Short frontModelCount;
@Schema(description = "背面造型量", example = "26725")
private Short backModelCount;
@Schema(description = "是否门板")
private Boolean isDoor;
@Schema(description = "开门类型,0 无 1 左 2 右 3 上 4 下", example = "2")
private Integer openDoorType;
@Schema(description = "异型偏移 x")
private Double offsetX;
@Schema(description = "异型偏移 y")
private Double offsetY;
@Schema(description = "是否孤形对角")
private Boolean isArcAcross;
@Schema(description = "是否异形")
private Boolean isSpecialShaped;
@Schema(description = "是否造型")
private Boolean isSculpt;
@Schema(description = "模块类型 ID", example = "12800")
private Long moduleTypeId;
@Schema(description = "排单过滤类型,1 有挖穿造型 2 有挖穿孔 4 有二维刀路 8 可叠", example = "1")
private String filterType;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "是否作废")
private Boolean isCancel;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}
@@ -151,11 +151,6 @@
<groupId>uk.co.jemos.podam</groupId>
<artifactId>podam</artifactId>
</dependency>
<dependency>
<groupId>com.cf.imes</groupId>
<artifactId>cf-module-report-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- JSON -->
<dependency>
@@ -188,10 +183,6 @@
<groupId>com.cf.imes</groupId>
<artifactId>cf-module-prod-executor-api</artifactId>
</include>
<include>
<groupId>com.cf.imes</groupId>
<artifactId>cf-module-report-api</artifactId>
</include>
<include>
<groupId>com.cf.imes</groupId>
<artifactId>cf-module-system-api</artifactId>
@@ -1,32 +0,0 @@
package com.cf.imes.module.executor.api.datasource;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
import com.cf.imes.module.executor.api.datasource.dto.OrderDTO;
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author Gqr
* @since 2024/7/22 17:57
*/
@RestController // 提供 RESTful API 接口,给 Feign 调用
@Validated
public class OrderDatasourceApiImpl implements OrderDatasourceApi {
@Resource
private OrderMapper orderMapper;
@Override
public CommonResult<OrderDTO> getOrderInfo(Long orderId) {
// 查询生产单
OrderDO orderDO = orderMapper.selectOrderOne(orderId, OrganContextHolder.getOrganId());
OrderDTO orderDTO = BeanUtils.toBean(orderDO, OrderDTO.class);
return CommonResult.success(orderDTO);
}
}
@@ -1,42 +0,0 @@
package com.cf.imes.module.executor.api.datasource;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
import com.cf.imes.module.executor.api.datasource.dto.PartGoodsRespDTO;
import com.cf.imes.module.executor.controller.admin.orderParts.vo.PartGoodsRespVO;
import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper;
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author Gqr
* @since 2024/7/30 9:21
*/
@RestController // 提供 RESTful API 接口,给 Feign 调用
@Validated
public class OrderPartDatasourceApiImpl implements OrderPartDatasourceApi {
@Resource
private OrderPartsMapper orderPartsMapper;
@Override
public CommonResult<List<PartGoodsRespDTO>> selectPartDetail(Long orderId) {
Integer notDeletedStatus = OrderDeletedEnum.NOT_DELETED.getStatus();
// 查询明细列表
List<PartGoodsRespVO> partGoodsRespVOS = orderPartsMapper.selectPartDetail(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId(), notDeletedStatus);
return CommonResult.success(BeanUtils.toBean(partGoodsRespVOS, PartGoodsRespDTO.class));
}
@Override
public CommonResult<List<PartGoodsRespDTO>> selectPartAll(Long orderId) {
Integer notDeletedStatus = OrderDeletedEnum.NOT_DELETED.getStatus();
// 查询明细列表
List<PartGoodsRespVO> partGoodsRespVOS = orderPartsMapper.selectPartAll(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId(), notDeletedStatus);
return CommonResult.success(BeanUtils.toBean(partGoodsRespVOS, PartGoodsRespDTO.class));
}
}
@@ -1,42 +0,0 @@
package com.cf.imes.module.executor.api.datasource;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
import com.cf.imes.module.executor.api.datasource.dto.PlateGoodsRespDTO;
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO;
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author Gqr
* @since 2024/7/19 14:26
*/
@RestController // 提供 RESTful API 接口,给 Feign 调用
@Validated
public class OrderPlateDatasourceApiImpl implements OrderPlateDatasourceApi {
@Resource
private PlateMapper plateMapper;
@Override
public CommonResult<List<PlateGoodsRespDTO>> selectPlateGoodsListSummary(Long orderId) {
// 查询分组统计
Integer notDeletedStatus = OrderDeletedEnum.NOT_DELETED.getStatus();
List<PlateGoodsRespVO> plateGoodsRespVOS = plateMapper.selectPlateGoodsListSummary(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId(), notDeletedStatus);
return CommonResult.success(BeanUtils.toBean(plateGoodsRespVOS, PlateGoodsRespDTO.class));
}
@Override
public CommonResult<List<PlateGoodsRespDTO>> selectPlateGoodsList(Long orderId) {
// 查询分组列表
Integer notDeletedStatus = OrderDeletedEnum.NOT_DELETED.getStatus();
List<PlateGoodsRespVO> plateGoodsRespVOS = plateMapper.selectPlateGoodsList(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId(), notDeletedStatus);
return CommonResult.success(BeanUtils.toBean(plateGoodsRespVOS, PlateGoodsRespDTO.class));
}
}
@@ -1,7 +1,6 @@
package com.cf.imes.module.executor.framework.rpc.config;
import com.cf.imes.module.infra.api.file.FileApi;
import com.cf.imes.module.report.api.template.ReportTemplateApi;
import com.cf.imes.module.system.api.application.ApplicationApi;
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
import com.cf.imes.module.system.api.machine.MachineApi;
@@ -18,6 +17,6 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration(proxyBeanMethods = false)
@EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class, DictDataApi.class,AdminUserApi.class,
FileApi.class, ProcessGroupApi.class, FileApi.class, DataSourceApi.class, ApplicationApi.class, ProcessApi.class, ReportTemplateApi.class, OrganApi.class})
FileApi.class, ProcessGroupApi.class, FileApi.class, DataSourceApi.class, ApplicationApi.class, ProcessApi.class, OrganApi.class})
public class RpcConfiguration {
}