mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
+7
-2
@@ -21,8 +21,13 @@ import java.util.List;
|
||||
public interface OrderPlateDatasourceApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/order-plate";
|
||||
|
||||
@GetMapping(PREFIX + "/summary/byPlate")
|
||||
@Operation(summary = "按板材汇总板材数据")
|
||||
@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);
|
||||
}
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
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
-1
@@ -154,7 +154,7 @@ public class PlateGoodsRespDTO {
|
||||
@Schema(description = "是否孤形对角")
|
||||
private Boolean isArcAcross;
|
||||
|
||||
@Schema(description = "是否异性")
|
||||
@Schema(description = "是否异形")
|
||||
private Boolean isSpecialShaped;
|
||||
|
||||
@Schema(description = "是否造型")
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
/**
|
||||
* 板材开门类型枚举
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/7/29 9:58
|
||||
*/
|
||||
public enum OrderPlateOpenDoorTypeEnum {
|
||||
NO(0, "无"),
|
||||
LEFT(1, "左"),
|
||||
RIGHT(2, "右"),
|
||||
UP(3, "上"),
|
||||
DOWN(4, "下");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
OrderPlateOpenDoorTypeEnum(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static String getDescFromCode(int code) {
|
||||
for (OrderPlateOpenDoorTypeEnum orderPlateOpenDoorTypeEnum : OrderPlateOpenDoorTypeEnum.values()) {
|
||||
if (orderPlateOpenDoorTypeEnum.getCode() == code) {
|
||||
return orderPlateOpenDoorTypeEnum.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
+8
@@ -31,4 +31,12 @@ public class OrderPlateDatasourceApiImpl implements OrderPlateDatasourceApi {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -357,7 +357,6 @@
|
||||
left join order_goods ogs on op.goods_id = ogs.id
|
||||
left join order_item its on op.id = its.plate_id
|
||||
left join order_body bdy on bdy.id = its.body_id
|
||||
left join order_goods gods on gods.id = op.goods_id
|
||||
where op.order_id = #{orderId}
|
||||
and op.organ_id = #{organId}
|
||||
and op.deleted = #{deleted}
|
||||
@@ -385,7 +384,6 @@
|
||||
left join order_goods ogs on op.goods_id = ogs.id
|
||||
left join order_item its on op.id = its.plate_id
|
||||
left join order_body bdy on bdy.id = its.body_id
|
||||
left join order_goods gods on gods.id = op.goods_id
|
||||
where op.order_id = #{orderId}
|
||||
and op.organ_id = #{organId}
|
||||
and op.deleted = #{deleted}
|
||||
|
||||
Reference in New Issue
Block a user