mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 12:52:07 +08:00
生产单新增逻辑
This commit is contained in:
Binary file not shown.
+5
-1
@@ -19,7 +19,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode GOODS_NOT_EXISTS = new ErrorCode(1_001_108_000, "生产单商品不存在");
|
||||
|
||||
// ========== 生产单 TODO 补充编号 ==========
|
||||
ErrorCode ORDER_NOT_EXISTS = new ErrorCode(1_001_109_000, "生产单不存在");
|
||||
ErrorCode ORDER_NOT_EXISTS = new ErrorCode(1_001_109_000, "存在生产单不存在");
|
||||
|
||||
// ========== 生产单 TODO 补充编号 ==========
|
||||
ErrorCode MODULE_NOT_EXISTS = new ErrorCode(1_001_110_000, "模块不存在");
|
||||
@@ -45,4 +45,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode SALESMAN_ORDER_NOT_EXISTS = new ErrorCode(1_001_118_000, "业务员不存在");
|
||||
ErrorCode SPLITTER_ORDER_NOT_EXISTS = new ErrorCode(1_001_119_000, "拆单员不存在");
|
||||
ErrorCode ORDER_PROCESS_NOT_EXISTS = new ErrorCode(1_001_119_000, "工序组不存在");
|
||||
ErrorCode ORDER_PROCESS_EXISTS = new ErrorCode(1_001_119_000, "该生产单工序组已经存在");
|
||||
ErrorCode PROCESS_GROUP_NOT_EXISTS = new ErrorCode(1_002_029_000, "工序组不存在");
|
||||
ErrorCode ORDER_BODY_NOT_EXISTS = new ErrorCode(1_002_029_000, "此生产单中柜体并不存在不存在");
|
||||
ErrorCode RAW_GOODS_NOT_EXISTS = new ErrorCode(1_002_029_000, "生产单中未用到此板材");
|
||||
}
|
||||
|
||||
@@ -125,6 +125,10 @@
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
|
||||
+11
-22
@@ -1,5 +1,7 @@
|
||||
package com.cf.imes.module.executor.controller.admin.goods;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -29,7 +31,7 @@ import com.cf.imes.module.executor.controller.admin.goods.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.service.goods.GoodsService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产单商品")
|
||||
@Tag(name = "管理后台 - 生产单商品对应")
|
||||
@RestController
|
||||
@RequestMapping("/executor/goods")
|
||||
@Validated
|
||||
@@ -38,15 +40,16 @@ public class GoodsController {
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
|
||||
// 新建生产单新板材商品对应
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单商品")
|
||||
@Operation(summary = "对应生产单商品")
|
||||
@PreAuthorize("@ss.hasPermission('executor:goods:create')")
|
||||
public CommonResult<Long> createGoods(@Valid @RequestBody GoodsSaveReqVO createReqVO) {
|
||||
return success(goodsService.createGoods(createReqVO));
|
||||
public CommonResult<List<Long>> createGoods(@Valid @RequestBody Set<GoodsSaveReqVO> createReqVOS) {
|
||||
return success(goodsService.createCorrespondsGoods(createReqVOS));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产单商品")
|
||||
@Operation(summary = "修改对应生产单商品")
|
||||
@PreAuthorize("@ss.hasPermission('executor:goods:update')")
|
||||
public CommonResult<Boolean> updateGoods(@Valid @RequestBody GoodsSaveReqVO updateReqVO) {
|
||||
goodsService.updateGoods(updateReqVO);
|
||||
@@ -54,7 +57,7 @@ public class GoodsController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产单商品")
|
||||
@Operation(summary = "删除对应生产单商品")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:goods:delete')")
|
||||
public CommonResult<Boolean> deleteGoods(@RequestParam("id") Long id) {
|
||||
@@ -63,7 +66,7 @@ public class GoodsController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产单商品")
|
||||
@Operation(summary = "获得对应生产单商品")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:goods:query')")
|
||||
public CommonResult<GoodsRespVO> getGoods(@RequestParam("id") Long id) {
|
||||
@@ -72,24 +75,10 @@ public class GoodsController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单商品分页")
|
||||
@Operation(summary = "获得对应生产单商品分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:goods:query')")
|
||||
public CommonResult<PageResult<GoodsRespVO>> getGoodsPage(@Valid GoodsPageReqVO pageReqVO) {
|
||||
PageResult<GoodsDO> pageResult = goodsService.getGoodsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, GoodsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单商品 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('executor:goods:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportGoodsExcel(@Valid GoodsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<GoodsDO> list = goodsService.getGoodsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产单商品.xls", "数据", GoodsRespVO.class,
|
||||
BeanUtils.toBean(list, GoodsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
+14
-9
@@ -1,6 +1,8 @@
|
||||
package com.cf.imes.module.executor.controller.admin.goods.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
@@ -15,13 +17,16 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
@ToString(callSuper = true)
|
||||
public class GoodsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
@Schema(description = "生产单号", example = "12114")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "商品 ID", example = "18975")
|
||||
private String goodsId;
|
||||
@Schema(description = "设计端商品ID", example = "832")
|
||||
private Long rawGoodsId;
|
||||
|
||||
@Schema(description = "商品 ID", example = "王五")
|
||||
@Schema(description = "商品 ID", example = "243")
|
||||
private Long goodsId;
|
||||
|
||||
@Schema(description = "商品名称", example = "晨丰")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板")
|
||||
@@ -31,16 +36,16 @@ public class GoodsPageReqVO extends PageParam {
|
||||
private String color;
|
||||
|
||||
@Schema(description = "宽度")
|
||||
private Double width;
|
||||
private BigDecimal width;
|
||||
|
||||
@Schema(description = "高度")
|
||||
private Double height;
|
||||
private BigDecimal height;
|
||||
|
||||
@Schema(description = "厚度")
|
||||
private Double thickness;
|
||||
private BigDecimal thickness;
|
||||
|
||||
@Schema(description = "价格", example = "21231")
|
||||
private Double price;
|
||||
@Schema(description = "价格", example = "7305")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
+17
-11
@@ -2,6 +2,8 @@ package com.cf.imes.module.executor.controller.admin.goods.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -13,19 +15,23 @@ import com.alibaba.excel.annotation.*;
|
||||
@ExcelIgnoreUnannotated
|
||||
public class GoodsRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26190")
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12114")
|
||||
@ExcelProperty("生产单号")
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "商品 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18975")
|
||||
@Schema(description = "设计端商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "832")
|
||||
@ExcelProperty("设计端商品ID")
|
||||
private Long rawGoodsId;
|
||||
|
||||
@Schema(description = "商品 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "243")
|
||||
@ExcelProperty("商品 ID")
|
||||
private String goodsId;
|
||||
private Long goodsId;
|
||||
|
||||
@Schema(description = "商品 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
|
||||
@ExcelProperty("商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@@ -39,19 +45,19 @@ public class GoodsRespVO {
|
||||
|
||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("宽度")
|
||||
private Double width;
|
||||
private BigDecimal width;
|
||||
|
||||
@Schema(description = "高度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("高度")
|
||||
private Double height;
|
||||
private BigDecimal height;
|
||||
|
||||
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("厚度")
|
||||
private Double thickness;
|
||||
private BigDecimal thickness;
|
||||
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "21231")
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "7305")
|
||||
@ExcelProperty("价格")
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("品牌")
|
||||
|
||||
+18
-12
@@ -2,6 +2,8 @@ package com.cf.imes.module.executor.controller.admin.goods.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -9,18 +11,22 @@ import javax.validation.constraints.*;
|
||||
@Data
|
||||
public class GoodsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26190")
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12114")
|
||||
@NotNull(message = "生产单号不能为空")
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "商品 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18975")
|
||||
@NotNull(message = "商品 ID不能为空")
|
||||
private String goodsId;
|
||||
@Schema(description = "设计端商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "832")
|
||||
@NotEmpty(message = "设计端商品ID不能为空")
|
||||
private Long rawGoodsId;
|
||||
|
||||
@Schema(description = "商品 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@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;
|
||||
|
||||
@@ -34,19 +40,19 @@ public class GoodsSaveReqVO {
|
||||
|
||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "宽度不能为空")
|
||||
private Double width;
|
||||
private BigDecimal width;
|
||||
|
||||
@Schema(description = "高度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "高度不能为空")
|
||||
private Double height;
|
||||
private BigDecimal height;
|
||||
|
||||
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "厚度不能为空")
|
||||
private Double thickness;
|
||||
private BigDecimal thickness;
|
||||
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "21231")
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "7305")
|
||||
@NotNull(message = "价格不能为空")
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "品牌不能为空")
|
||||
|
||||
-95
@@ -1,95 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.moduleitem;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.moduleitem.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.moduleitem.ModuleItemDO;
|
||||
import com.cf.imes.module.executor.service.moduleitem.ModuleItemService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产单模块明细")
|
||||
@RestController
|
||||
@RequestMapping("/executor/module-item")
|
||||
@Validated
|
||||
public class ModuleItemController {
|
||||
|
||||
@Resource
|
||||
private ModuleItemService moduleItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单模块明细")
|
||||
@PreAuthorize("@ss.hasPermission('executor:module-item:create')")
|
||||
public CommonResult<Long> createModuleItem(@Valid @RequestBody ModuleItemSaveReqVO createReqVO) {
|
||||
return success(moduleItemService.createModuleItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产单模块明细")
|
||||
@PreAuthorize("@ss.hasPermission('executor:module-item:update')")
|
||||
public CommonResult<Boolean> updateModuleItem(@Valid @RequestBody ModuleItemSaveReqVO updateReqVO) {
|
||||
moduleItemService.updateModuleItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产单模块明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:module-item:delete')")
|
||||
public CommonResult<Boolean> deleteModuleItem(@RequestParam("id") Long id) {
|
||||
moduleItemService.deleteModuleItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产单模块明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:module-item:query')")
|
||||
public CommonResult<ModuleItemRespVO> getModuleItem(@RequestParam("id") Long id) {
|
||||
ModuleItemDO moduleItem = moduleItemService.getModuleItem(id);
|
||||
return success(BeanUtils.toBean(moduleItem, ModuleItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单模块明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:module-item:query')")
|
||||
public CommonResult<PageResult<ModuleItemRespVO>> getModuleItemPage(@Valid ModuleItemPageReqVO pageReqVO) {
|
||||
PageResult<ModuleItemDO> pageResult = moduleItemService.getModuleItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ModuleItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单模块明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('executor:module-item:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportModuleItemExcel(@Valid ModuleItemPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ModuleItemDO> list = moduleItemService.getModuleItemPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产单模块明细.xls", "数据", ModuleItemRespVO.class,
|
||||
BeanUtils.toBean(list, ModuleItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.moduleitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单模块明细分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ModuleItemPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "房间 ID", example = "1469")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "柜体 ID", example = "3460")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "模块类型 ID", example = "15993")
|
||||
private Long typeId;
|
||||
|
||||
@Schema(description = "模块 ID", example = "13998")
|
||||
private Long moduleId;
|
||||
|
||||
@Schema(description = "明细 ID", example = "11426")
|
||||
private Long itemId;
|
||||
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.moduleitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单模块明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ModuleItemRespVO {
|
||||
|
||||
@Schema(description = "记录 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15563")
|
||||
@ExcelProperty("记录 ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产单号")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "房间 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1469")
|
||||
@ExcelProperty("房间 ID")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "柜体 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3460")
|
||||
@ExcelProperty("柜体 ID")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "模块类型 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15993")
|
||||
@ExcelProperty("模块类型 ID")
|
||||
private Long typeId;
|
||||
|
||||
@Schema(description = "模块 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13998")
|
||||
@ExcelProperty("模块 ID")
|
||||
private Long moduleId;
|
||||
|
||||
@Schema(description = "明细 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11426")
|
||||
@ExcelProperty("明细 ID")
|
||||
private Long itemId;
|
||||
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.moduleitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单模块明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class ModuleItemSaveReqVO {
|
||||
|
||||
@Schema(description = "记录 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15563")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号不能为空")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "房间 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1469")
|
||||
@NotNull(message = "房间 ID不能为空")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "柜体 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3460")
|
||||
@NotNull(message = "柜体 ID不能为空")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "模块类型 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15993")
|
||||
@NotNull(message = "模块类型 ID不能为空")
|
||||
private Long typeId;
|
||||
|
||||
@Schema(description = "模块 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13998")
|
||||
@NotNull(message = "模块 ID不能为空")
|
||||
private Long moduleId;
|
||||
|
||||
@Schema(description = "明细 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11426")
|
||||
@NotNull(message = "明细 ID不能为空")
|
||||
private Long itemId;
|
||||
|
||||
}
|
||||
+114
-30
@@ -1,8 +1,10 @@
|
||||
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.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
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.util.FileTypeChangeUtil;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -48,7 +50,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 生产单表 order_{N}")
|
||||
@Tag(name = "管理后台 - 生产单表")
|
||||
@RestController
|
||||
@RequestMapping("/executor/order")
|
||||
@Validated
|
||||
@@ -57,17 +59,20 @@ public class OrderController {
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@Resource
|
||||
private FileTypeChangeUtil fileTypeChangeUtil;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OrderController.class);
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单表 order_{N}")
|
||||
@Operation(summary = "创建生产单")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:create')")
|
||||
public CommonResult<Long> createOrder(@Valid @RequestBody OrderSaveReqVO createReqVO) {
|
||||
return success(orderService.createOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产单表 order_{N}")
|
||||
@Operation(summary = "更新生产单")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:update')")
|
||||
public CommonResult<Boolean> updateOrder(@Valid @RequestBody OrderSaveReqVO updateReqVO) {
|
||||
orderService.updateOrder(updateReqVO);
|
||||
@@ -75,16 +80,16 @@ public class OrderController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产单表 order_{N}")
|
||||
@Operation(summary = "删除生产单")
|
||||
@Parameter(name = "orderIds", description = "生产单id组", required = true, example = "1,2")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:delete')")
|
||||
public CommonResult<Boolean> deleteOrder(@RequestParam("postIds") Collection<Long> orderIds) {
|
||||
public CommonResult<Boolean> deleteOrder(@RequestParam("orderIds") Collection<Long> orderIds) {
|
||||
orderService.deleteOrder(orderIds);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产单表 order_{N}")
|
||||
@Operation(summary = "获得生产单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
public CommonResult<OrderRespVO> getOrder(@RequestParam("id") Long id) {
|
||||
@@ -93,7 +98,7 @@ public class OrderController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单表 order_{N}分页")
|
||||
@Operation(summary = "获得生产单分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
public CommonResult<PageResult<OrderRespVO>> getOrderPage(@Valid OrderPageReqVO pageReqVO) {
|
||||
PageResult<OrderDO> pageResult = orderService.getOrderPage(pageReqVO);
|
||||
@@ -101,7 +106,7 @@ public class OrderController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单表 order_{N} Excel")
|
||||
@Operation(summary = "导出生产单Excel")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportOrderExcel(@Valid OrderPageReqVO pageReqVO,
|
||||
@@ -157,19 +162,56 @@ public class OrderController {
|
||||
@Parameters({
|
||||
@Parameter(name = "file", description = "Excel 文件", required = true),
|
||||
@Parameter(name = "isAddPlate", description = "是否为生产单新增板材", example = "false"),
|
||||
@Parameter(name = "upload", description = "是否只上传表头,默认为只上传表头", example = "false")
|
||||
@Parameter(name = "upload", description = "是 更新、否 新建", example = "false"),
|
||||
@Parameter(name = "orderSaveReqVO", description = "生产单新增参数", required = true)
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:import')")
|
||||
public CommonResult<OrderImportRespVO> importExcel(@RequestPart("file") MultipartFile file,
|
||||
@RequestParam(value = "isAddPlate", required = false, defaultValue = "false") Boolean isAddPlate,
|
||||
@RequestParam(value = "upload", required = false, defaultValue = "false") Boolean upload,
|
||||
@RequestPart("orderSaveReqVO") OrderSaveReqVO createReqVO) throws IOException {
|
||||
OrderImportRespVO orderImportRespVO = OrderImportRespVO.builder().createOrder(new ArrayList<>())
|
||||
.updateOrder(new ArrayList<>()).failureOrder(new LinkedHashMap<>()).build();
|
||||
|
||||
OrderImportRespVO orderImportRespVO = orderService.importOrderList(upload, file, createReqVO, isAddPlate);
|
||||
return success(orderImportRespVO);
|
||||
// 判断是否更新板材
|
||||
if(!isAddPlate){//不需要添加板材
|
||||
if(upload){
|
||||
orderService.updateOrder(createReqVO);//更新
|
||||
orderImportRespVO.getUpdateOrder().add(createReqVO.getId()+"单独更新生产单成功");
|
||||
}else {
|
||||
Long id = orderService.createOrder(createReqVO);//新建
|
||||
orderImportRespVO.getCreateOrder().add(id + "单独新增生产单成功");
|
||||
}
|
||||
return success(orderImportRespVO);
|
||||
}else {
|
||||
Long id = 0L;
|
||||
if (upload) {
|
||||
orderService.updateOrder(createReqVO);//更新
|
||||
id = createReqVO.getId();
|
||||
orderImportRespVO.getUpdateOrder().add(id + "新增生产单成功");
|
||||
} else {
|
||||
id = orderService.createOrder(createReqVO);//新建
|
||||
orderImportRespVO.getCreateOrder().add(id + "新增生产单成功");
|
||||
}
|
||||
// 解析导入文件,生成统一格式
|
||||
List<Detail> list = new ArrayList<>();
|
||||
if (createReqVO.getDataType() == 1) {//CAD
|
||||
|
||||
} else if (createReqVO.getDataType() == 2) {//WebCAD
|
||||
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
// 清理生产单
|
||||
// 清理生产单
|
||||
@DeleteMapping("/clean")
|
||||
@Operation(summary = "清理生产单")
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
|
||||
@@ -179,7 +221,7 @@ public class OrderController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// 获取当前条件下所有生产单信息
|
||||
// 获取当前条件下所有生产单信息
|
||||
@GetMapping("/allOrder")
|
||||
@Operation(summary = "获得所有生产单")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
@@ -187,25 +229,67 @@ public class OrderController {
|
||||
List<OrderDO> pageResult = orderService.getAllOrderCheck(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, OrderRespVO.class));
|
||||
}
|
||||
// 生产单增加工序
|
||||
@PostMapping("/addOrderProcess")
|
||||
@Operation(summary = "生产单增加工序")
|
||||
|
||||
// 获得 房间和柜体 信息
|
||||
@GetMapping("/get-room")
|
||||
@Operation(summary = "获得房间——柜体 基本信息")
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
public CommonResult<Map<Long, List<OrderBodyRespVO>>> getRoom(@RequestParam("orderId") Long orderId) {
|
||||
Map<Long, List<OrderBodyRespVO>> orderBodyMap = orderService.getOrderBody(orderId);
|
||||
return success(orderBodyMap);
|
||||
}
|
||||
|
||||
|
||||
// 获得模组 —— 模块信息
|
||||
@GetMapping("/get-moduleDetails")
|
||||
@Operation(summary = "获得模组——模块信息")
|
||||
@Parameters({
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024"),
|
||||
@Parameter(name = "processGroupId", description = "工序组编号", required = true, example = "1024")
|
||||
@Parameter(name = "orderId", description = "生产单编号", example = "1024"),
|
||||
@Parameter(name = "roomId", description = "房间编号", example = "1024"),
|
||||
@Parameter(name = "bodyId", description = "柜体编号", example = "1024")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
public CommonResult<Boolean> addOrderProcess(@RequestParam("orderId")Long orderId,
|
||||
@RequestParam("processGroupId")Long processGroupId) {
|
||||
orderService.addOrderProcess(orderId , processGroupId);
|
||||
public CommonResult<List<OrderModuleExtraDO>> getModule(@RequestParam("orderId") Long orderId,
|
||||
@RequestParam(value = "roomId", required = false) Long roomId,
|
||||
@RequestParam(value = "bodyId", required = false) Long bodyId) {
|
||||
List<OrderModuleExtraDO> moduleDOList = orderService.getModule(orderId ,roomId ,bodyId);
|
||||
return success(moduleDOList);
|
||||
}
|
||||
|
||||
// 删除柜体
|
||||
@DeleteMapping("/delete-body")
|
||||
@Operation(summary = "删除柜体")
|
||||
@Parameters({
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024"),
|
||||
@Parameter(name = "bodyIds", description = "柜体编号集合", required = true, example = "1,2")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:delete')")
|
||||
public CommonResult<Boolean> deleteBody(@RequestParam("orderId")Long orderId , @RequestParam("bodyIds")Set<Long> bodyIds){
|
||||
orderService.deleteBodyByOrder(orderId,bodyIds);
|
||||
return success(true);
|
||||
}
|
||||
// 获得当前生产单的工序信息
|
||||
// @GetMapping("/getOrderProcess")
|
||||
// @Operation(summary = "生产单获取工序信息")
|
||||
// @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
// public CommonResult<List<OrderProcessRespVO>> getOrderProcess(@RequestParam("orderId")Long orderId) {
|
||||
// return success(BeanUtils.toBean(orderService.getOrderProcess(orderId), OrderProcessRespVO.class));
|
||||
|
||||
// 柜体数据获取,需要加上柜体的属性
|
||||
@GetMapping("/get-body")
|
||||
@Operation(summary = "生产单柜体数据获取")
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
public CommonResult<List<OrderBodyRespVO>> getBody(@RequestParam("orderId")Long orderId){
|
||||
return success(BeanUtils.toBean(orderService.getBody(orderId), OrderBodyRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 测试
|
||||
// @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);
|
||||
// }
|
||||
|
||||
}
|
||||
-4
@@ -3,10 +3,6 @@ package com.cf.imes.module.executor.controller.admin.order.vo.order;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package com.cf.imes.module.executor.controller.admin.order.vo.product;
|
||||
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单柜体 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OrderBodyRespVO {
|
||||
|
||||
@Schema(description = "模块 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30562")
|
||||
@ExcelProperty("模块 ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11075")
|
||||
@ExcelProperty("生产单号")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "房间ID,后端生成", requiredMode = Schema.RequiredMode.REQUIRED, example = "26936")
|
||||
@ExcelProperty("房间ID,后端生成")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "房间名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("房间名称")
|
||||
private String roomName;
|
||||
|
||||
@Schema(description = "模块名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
|
||||
@ExcelProperty("模块名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模块宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模块宽度")
|
||||
private Double width;
|
||||
|
||||
@Schema(description = "模块高度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模块高度")
|
||||
private Double height;
|
||||
|
||||
@Schema(description = "模块深度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模块深度")
|
||||
private Double depth;
|
||||
|
||||
@Schema(description = "模块复制数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模块复制数量")
|
||||
private Short multiNum;
|
||||
|
||||
@Schema(description = "板材数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("板材数量")
|
||||
private Short plateNum;
|
||||
|
||||
@Schema(description = "异型数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("异型数量")
|
||||
private Short unregularNum;
|
||||
|
||||
// @Schema(description = "生产单详情内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @ExcelProperty("生产单详情内容")
|
||||
// private List<OrderItemDO> orderItemDOS;
|
||||
|
||||
@Schema(description = "文件名", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
|
||||
@ExcelProperty("文件名")
|
||||
private String filename;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.controller.admin.order.vo.product;
|
||||
|
||||
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 ProductRespVO {
|
||||
|
||||
// private Long orderId;
|
||||
private Long roomId;
|
||||
private String roomName;
|
||||
private Long bodyId;
|
||||
private String bodyName;
|
||||
private Long groupId;
|
||||
private Long groupTypeId;
|
||||
private String groupTypeName;
|
||||
private int goodType;
|
||||
private String goodName;
|
||||
private String units;
|
||||
private Double num;
|
||||
}
|
||||
-95
@@ -1,95 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.orderModuleExtra;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.orderModuleExtra.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import com.cf.imes.module.executor.service.orderModuleExtra.OrderModuleExtraService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产单模块扩充属性表 order_module_extra_N")
|
||||
@RestController
|
||||
@RequestMapping("/executor/order-module-extra")
|
||||
@Validated
|
||||
public class OrderModuleExtraController {
|
||||
|
||||
@Resource
|
||||
private OrderModuleExtraService orderModuleExtraService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单模块扩充属性表 order_module_extra_N")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-module-extra:create')")
|
||||
public CommonResult<Long> createOrderModuleExtra(@Valid @RequestBody OrderModuleExtraSaveReqVO createReqVO) {
|
||||
return success(orderModuleExtraService.createOrderModuleExtra(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产单模块扩充属性表 order_module_extra_N")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-module-extra:update')")
|
||||
public CommonResult<Boolean> updateOrderModuleExtra(@Valid @RequestBody OrderModuleExtraSaveReqVO updateReqVO) {
|
||||
orderModuleExtraService.updateOrderModuleExtra(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产单模块扩充属性表 order_module_extra_N")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-module-extra:delete')")
|
||||
public CommonResult<Boolean> deleteOrderModuleExtra(@RequestParam("id") Long id) {
|
||||
orderModuleExtraService.deleteOrderModuleExtra(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产单模块扩充属性表 order_module_extra_N")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-module-extra:query')")
|
||||
public CommonResult<OrderModuleExtraRespVO> getOrderModuleExtra(@RequestParam("id") Long id) {
|
||||
OrderModuleExtraDO orderModuleExtra = orderModuleExtraService.getOrderModuleExtra(id);
|
||||
return success(BeanUtils.toBean(orderModuleExtra, OrderModuleExtraRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单模块扩充属性表 order_module_extra_N分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-module-extra:query')")
|
||||
public CommonResult<PageResult<OrderModuleExtraRespVO>> getOrderModuleExtraPage(@Valid OrderModuleExtraPageReqVO pageReqVO) {
|
||||
PageResult<OrderModuleExtraDO> pageResult = orderModuleExtraService.getOrderModuleExtraPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, OrderModuleExtraRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单模块扩充属性表 order_module_extra_N Excel")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-module-extra:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportOrderModuleExtraExcel(@Valid OrderModuleExtraPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OrderModuleExtraDO> list = orderModuleExtraService.getOrderModuleExtraPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产单模块扩充属性表 order_module_extra_N.xls", "数据", OrderModuleExtraRespVO.class,
|
||||
BeanUtils.toBean(list, OrderModuleExtraRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.orderModuleExtra.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单模块扩充属性表 order_module_extra_N分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OrderModuleExtraPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "房间 ID", example = "273")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "柜体 ID", example = "1826")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "属性类型:1 板材铰链备注, 2 五金分类, 3 五金尺寸, 4 板材特殊备注, 5 排钻规格, 6 门板组件铰链备注, 7 板材排钻备注, 8 板材额外信息备注, 9 板材自定义编号, 10 门板拉手备注, 11 门板组件拉手备注, 12 五金特殊备注", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "属性数据")
|
||||
private String extraData;
|
||||
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.orderModuleExtra.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单模块扩充属性表 order_module_extra_N Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OrderModuleExtraRespVO {
|
||||
|
||||
@Schema(description = "属性 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17407")
|
||||
@ExcelProperty("属性 ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产单号")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "房间 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "273")
|
||||
@ExcelProperty("房间 ID")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "柜体 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1826")
|
||||
@ExcelProperty("柜体 ID")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "属性类型:1 板材铰链备注, 2 五金分类, 3 五金尺寸, 4 板材特殊备注, 5 排钻规格, 6 门板组件铰链备注, 7 板材排钻备注, 8 板材额外信息备注, 9 板材自定义编号, 10 门板拉手备注, 11 门板组件拉手备注, 12 五金特殊备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("属性类型:1 板材铰链备注, 2 五金分类, 3 五金尺寸, 4 板材特殊备注, 5 排钻规格, 6 门板组件铰链备注, 7 板材排钻备注, 8 板材额外信息备注, 9 板材自定义编号, 10 门板拉手备注, 11 门板组件拉手备注, 12 五金特殊备注")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "属性数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("属性数据")
|
||||
private String extraData;
|
||||
|
||||
}
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.orderModuleExtra.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单模块扩充属性表 order_module_extra_N新增/修改 Request VO")
|
||||
@Data
|
||||
public class OrderModuleExtraSaveReqVO {
|
||||
|
||||
@Schema(description = "属性 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17407")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号不能为空")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "房间 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "273")
|
||||
@NotNull(message = "房间 ID不能为空")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "柜体 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1826")
|
||||
@NotNull(message = "柜体 ID不能为空")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "属性类型:1 板材铰链备注, 2 五金分类, 3 五金尺寸, 4 板材特殊备注, 5 排钻规格, 6 门板组件铰链备注, 7 板材排钻备注, 8 板材额外信息备注, 9 板材自定义编号, 10 门板拉手备注, 11 门板组件拉手备注, 12 五金特殊备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "属性类型:1 板材铰链备注, 2 五金分类, 3 五金尺寸, 4 板材特殊备注, 5 排钻规格, 6 门板组件铰链备注, 7 板材排钻备注, 8 板材额外信息备注, 9 板材自定义编号, 10 门板拉手备注, 11 门板组件拉手备注, 12 五金特殊备注不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "属性数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "属性数据不能为空")
|
||||
private String extraData;
|
||||
|
||||
}
|
||||
+17
-7
@@ -1,5 +1,7 @@
|
||||
package com.cf.imes.module.executor.controller.admin.orderParts;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateTermsPageReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -29,7 +31,7 @@ import com.cf.imes.module.executor.controller.admin.orderParts.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.service.orderParts.OrderPartsService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产单配件表 order_parts_{N}")
|
||||
@Tag(name = "管理后台 - 生产单配件表")
|
||||
@RestController
|
||||
@RequestMapping("/executor/order-parts")
|
||||
@Validated
|
||||
@@ -39,14 +41,14 @@ public class OrderPartsController {
|
||||
private OrderPartsService orderPartsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单配件表 order_parts_{N}")
|
||||
@Operation(summary = "创建生产单配件")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-parts:create')")
|
||||
public CommonResult<Long> createOrderParts(@Valid @RequestBody OrderPartsSaveReqVO createReqVO) {
|
||||
return success(orderPartsService.createOrderParts(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产单配件表 order_parts_{N}")
|
||||
@Operation(summary = "更新生产单配件")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-parts:update')")
|
||||
public CommonResult<Boolean> updateOrderParts(@Valid @RequestBody OrderPartsSaveReqVO updateReqVO) {
|
||||
orderPartsService.updateOrderParts(updateReqVO);
|
||||
@@ -54,7 +56,7 @@ public class OrderPartsController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产单配件表 order_parts_{N}")
|
||||
@Operation(summary = "删除生产单配件")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-parts:delete')")
|
||||
public CommonResult<Boolean> deleteOrderParts(@RequestParam("id") Long id) {
|
||||
@@ -63,7 +65,7 @@ public class OrderPartsController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产单配件表 order_parts_{N}")
|
||||
@Operation(summary = "获得生产单配件")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-parts:query')")
|
||||
public CommonResult<OrderPartsRespVO> getOrderParts(@RequestParam("id") Long id) {
|
||||
@@ -72,7 +74,7 @@ public class OrderPartsController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单配件表 order_parts_{N}分页")
|
||||
@Operation(summary = "获得生产单配件分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-parts:query')")
|
||||
public CommonResult<PageResult<OrderPartsRespVO>> getOrderPartsPage(@Valid OrderPartsPageReqVO pageReqVO) {
|
||||
PageResult<OrderPartsDO> pageResult = orderPartsService.getOrderPartsPage(pageReqVO);
|
||||
@@ -80,7 +82,7 @@ public class OrderPartsController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单配件表 order_parts_{N} Excel")
|
||||
@Operation(summary = "导出生产单配件 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order-parts:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportOrderPartsExcel(@Valid OrderPartsPageReqVO pageReqVO,
|
||||
@@ -92,4 +94,12 @@ public class OrderPartsController {
|
||||
BeanUtils.toBean(list, OrderPartsRespVO.class));
|
||||
}
|
||||
|
||||
// 批量查询有生产单号id、房间id,柜体id的板材
|
||||
@GetMapping("getPartsByOrderId")
|
||||
@Operation(summary = "批量查询有生产单号id、房间id,柜体id的板材")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:getPlatesByOrderId')")
|
||||
public CommonResult<PageResult<OrderPartsRespVO>> getPPartsByOrderId(@Valid PlateTermsPageReqVO pageVO) {
|
||||
return success(orderPartsService.getPartsPageByTerms(pageVO));
|
||||
}
|
||||
|
||||
}
|
||||
+4
@@ -73,4 +73,8 @@ public class OrderPartsRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "29507")
|
||||
@ExcelProperty("数量")
|
||||
private Double num;
|
||||
|
||||
}
|
||||
+8
-1
@@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
@@ -101,4 +100,12 @@ public class PlateController {
|
||||
plateService.deletePlates(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// 批量查询有生产单号id、房间id,柜体id的板材
|
||||
@GetMapping("getPlatesByOrderId")
|
||||
@Operation(summary = "批量查询有生产单号id、房间id,柜体id的板材")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:getPlatesByOrderId')")
|
||||
public CommonResult<PageResult<PlateRespVO>> getPlatesByOrderId(@Valid PlateTermsPageReqVO pageVO) {
|
||||
return success(plateService.getPlatePageByTerms(pageVO));
|
||||
}
|
||||
}
|
||||
+5
@@ -158,4 +158,9 @@ public class PlateRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "板材颜色")
|
||||
private String color;
|
||||
|
||||
@Schema(description = "板材材质")
|
||||
private String material;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author:
|
||||
* @date: 2024/3/29 14:29
|
||||
*/
|
||||
@Data
|
||||
public class PlateTermsPageReqVO extends PageParam {
|
||||
@Schema(description = "生产单Id")
|
||||
@NotNull(message = "生产单不能为空")
|
||||
private Long orderId;
|
||||
@Schema(description = "房间Id")
|
||||
private Long roomId;
|
||||
@Schema(description = "柜体Id")
|
||||
private Long bodyId;
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.cf.imes.module.executor.controller.admin.processStep;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.processStep.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.processStep.ProcessStepDO;
|
||||
import com.cf.imes.module.executor.service.processStep.ProcessStepService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产单工序步骤")
|
||||
@RestController
|
||||
@RequestMapping("/executor/process-step")
|
||||
@Validated
|
||||
public class ProcessStepController {
|
||||
|
||||
@Resource
|
||||
private ProcessStepService processStepService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单工序步骤")
|
||||
@PreAuthorize("@ss.hasPermission('executor:process-step:create')")
|
||||
public CommonResult<Long> createProcessStep(@Valid @RequestBody ProcessStepSaveReqVO createReqVO) {
|
||||
return success(processStepService.createProcessStep(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产单工序步骤")
|
||||
@PreAuthorize("@ss.hasPermission('executor:process-step:update')")
|
||||
public CommonResult<Boolean> updateProcessStep(@Valid @RequestBody ProcessStepSaveReqVO updateReqVO) {
|
||||
processStepService.updateProcessStep(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产单工序步骤")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:process-step:delete')")
|
||||
public CommonResult<Boolean> deleteProcessStep(@RequestParam("id") Long id) {
|
||||
processStepService.deleteProcessStep(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产单工序步骤")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:process-step:query')")
|
||||
public CommonResult<ProcessStepRespVO> getProcessStep(@RequestParam("id") Long id) {
|
||||
ProcessStepDO processStep = processStepService.getProcessStep(id);
|
||||
return success(BeanUtils.toBean(processStep, ProcessStepRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单工序步骤分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:process-step:query')")
|
||||
public CommonResult<PageResult<ProcessStepRespVO>> getProcessStepPage(@Valid ProcessStepPageReqVO pageReqVO) {
|
||||
PageResult<ProcessStepDO> pageResult = processStepService.getProcessStepPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProcessStepRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.cf.imes.module.executor.controller.admin.processStep.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
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 ProcessStepPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "完成时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] finishTime;
|
||||
|
||||
@Schema(description = "工序状态,0未加工,1已加工", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "加工类型,0全部加工,1开料,2部件加工,3异形封边,4分堆,5打包,6出库,7组件加工,8板材", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "计件工资")
|
||||
private Double pieceRate;
|
||||
|
||||
@Schema(description = "计件工资类型,1数量,2长度,3平方,4宽,5高,6体积,7生产单金额百分比", example = "1")
|
||||
private Integer pieceType;
|
||||
|
||||
@Schema(description = "排序优先级")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "工序名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工序 ID", example = "20663")
|
||||
private Long processinfoId;
|
||||
|
||||
@Schema(description = "生产单工序 ID", example = "9384")
|
||||
private Long orderProcessId;
|
||||
|
||||
@Schema(description = "计划日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] scheduleDate;
|
||||
|
||||
@Schema(description = "工序处理时长")
|
||||
private Double duration;
|
||||
|
||||
@Schema(description = "工序负责人")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "工序处理日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] processDate;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.cf.imes.module.executor.controller.admin.processStep.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单工序步骤 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProcessStepRespVO {
|
||||
|
||||
@Schema(description = "步骤 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16284")
|
||||
@ExcelProperty("步骤 ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产单号")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("完成时间")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
@Schema(description = "工序状态,0未加工,1已加工", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("工序状态,0未加工,1已加工")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "加工类型,0全部加工,1开料,2部件加工,3异形封边,4分堆,5打包,6出库,7组件加工,8板材", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("加工类型,0全部加工,1开料,2部件加工,3异形封边,4分堆,5打包,6出库,7组件加工,8板材")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "计件工资", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计件工资")
|
||||
private Double pieceRate;
|
||||
|
||||
@Schema(description = "计件工资类型,1数量,2长度,3平方,4宽,5高,6体积,7生产单金额百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("计件工资类型,1数量,2长度,3平方,4宽,5高,6体积,7生产单金额百分比")
|
||||
private Integer pieceType;
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("排序优先级")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "工序名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("工序名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20663")
|
||||
@ExcelProperty("工序 ID")
|
||||
private Long processinfoId;
|
||||
|
||||
@Schema(description = "生产单工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9384")
|
||||
@ExcelProperty("生产单工序 ID")
|
||||
private Long orderProcessId;
|
||||
|
||||
@Schema(description = "计划日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计划日期")
|
||||
private LocalDateTime scheduleDate;
|
||||
|
||||
@Schema(description = "工序处理时长", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工序处理时长")
|
||||
private Double duration;
|
||||
|
||||
@Schema(description = "工序负责人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工序负责人")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "工序处理日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工序处理日期")
|
||||
private LocalDateTime processDate;
|
||||
|
||||
@Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.cf.imes.module.executor.controller.admin.processStep.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单工序步骤新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProcessStepSaveReqVO {
|
||||
|
||||
@Schema(description = "步骤 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16284")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号不能为空")
|
||||
private Long orderNo;
|
||||
|
||||
@Schema(description = "完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "完成时间不能为空")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
@Schema(description = "工序状态,0未加工,1已加工", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "工序状态,0未加工,1已加工不能为空")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "加工类型,0全部加工,1开料,2部件加工,3异形封边,4分堆,5打包,6出库,7组件加工,8板材", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "加工类型,0全部加工,1开料,2部件加工,3异形封边,4分堆,5打包,6出库,7组件加工,8板材不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "计件工资", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "计件工资不能为空")
|
||||
private Double pieceRate;
|
||||
|
||||
@Schema(description = "计件工资类型,1数量,2长度,3平方,4宽,5高,6体积,7生产单金额百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "计件工资类型,1数量,2长度,3平方,4宽,5高,6体积,7生产单金额百分比不能为空")
|
||||
private Integer pieceType;
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排序优先级不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "工序名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "工序名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20663")
|
||||
@NotNull(message = "工序 ID不能为空")
|
||||
private Long processinfoId;
|
||||
|
||||
@Schema(description = "生产单工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9384")
|
||||
@NotNull(message = "生产单工序 ID不能为空")
|
||||
private Long orderProcessId;
|
||||
|
||||
@Schema(description = "计划日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "计划日期不能为空")
|
||||
private LocalDateTime scheduleDate;
|
||||
|
||||
@Schema(description = "工序处理时长", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "工序处理时长不能为空")
|
||||
private Double duration;
|
||||
|
||||
@Schema(description = "工序负责人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "工序负责人不能为空")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "工序处理日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "工序处理日期不能为空")
|
||||
private LocalDateTime processDate;
|
||||
|
||||
}
|
||||
+17
-26
@@ -1,5 +1,9 @@
|
||||
package com.cf.imes.module.executor.controller.admin.rawgoods;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -8,13 +12,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
@@ -22,14 +22,10 @@ import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.module.executor.service.rawgoods.RawGoodsService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产单设计商品表 order_raw_goods_{N}")
|
||||
@Tag(name = "管理后台 - 生产单设计商品")
|
||||
@RestController
|
||||
@RequestMapping("/executor/raw-goods")
|
||||
@Validated
|
||||
@@ -39,14 +35,14 @@ public class RawGoodsController {
|
||||
private RawGoodsService rawGoodsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单设计商品表 order_raw_goods_{N}")
|
||||
@Operation(summary = "创建生产单原设计商品")
|
||||
@PreAuthorize("@ss.hasPermission('executor:raw-goods:create')")
|
||||
public CommonResult<Long> createRawGoods(@Valid @RequestBody RawGoodsSaveReqVO createReqVO) {
|
||||
return success(rawGoodsService.createRawGoods(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产单设计商品表 order_raw_goods_{N}")
|
||||
@Operation(summary = "更新生产单原设计商品")
|
||||
@PreAuthorize("@ss.hasPermission('executor:raw-goods:update')")
|
||||
public CommonResult<Boolean> updateRawGoods(@Valid @RequestBody RawGoodsSaveReqVO updateReqVO) {
|
||||
rawGoodsService.updateRawGoods(updateReqVO);
|
||||
@@ -54,7 +50,7 @@ public class RawGoodsController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产单设计商品表 order_raw_goods_{N}")
|
||||
@Operation(summary = "删除生产单原设计商品")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:raw-goods:delete')")
|
||||
public CommonResult<Boolean> deleteRawGoods(@RequestParam("id") Long id) {
|
||||
@@ -63,7 +59,7 @@ public class RawGoodsController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产单设计商品表 order_raw_goods_{N}")
|
||||
@Operation(summary = "获得生产单原设计商品")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:raw-goods:query')")
|
||||
public CommonResult<RawGoodsRespVO> getRawGoods(@RequestParam("id") Long id) {
|
||||
@@ -72,24 +68,19 @@ public class RawGoodsController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单设计商品表 order_raw_goods_{N}分页")
|
||||
@Operation(summary = "获得生产单原设计商品分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:raw-goods:query')")
|
||||
public CommonResult<PageResult<RawGoodsRespVO>> getRawGoodsPage(@Valid RawGoodsPageReqVO pageReqVO) {
|
||||
PageResult<RawGoodsDO> pageResult = rawGoodsService.getRawGoodsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RawGoodsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单设计商品表 order_raw_goods_{N} Excel")
|
||||
@PreAuthorize("@ss.hasPermission('executor:raw-goods:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportRawGoodsExcel(@Valid RawGoodsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RawGoodsDO> list = rawGoodsService.getRawGoodsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产单设计商品表 order_raw_goods_{N}.xls", "数据", RawGoodsRespVO.class,
|
||||
BeanUtils.toBean(list, RawGoodsRespVO.class));
|
||||
@GetMapping("/getByOrder")
|
||||
@Operation(summary = "获得生产单原设计商品")
|
||||
@Parameter(name = "orderId", description = "生产单号", required = true, example = "1776888013545013248")
|
||||
@PreAuthorize("@ss.hasPermission('executor:raw-goods:query')")
|
||||
public CommonResult<List<RawGoodsRespVO>> getRawGoodsByOrder(@RequestParam("orderId") Long orderId) {
|
||||
List<RawGoodsDO> rawGoods = rawGoodsService.getRawGoodsByOrder(orderId);
|
||||
return success(BeanUtils.toBean(rawGoods, RawGoodsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -18,7 +18,7 @@ public class RawGoodsSaveReqVO {
|
||||
|
||||
@Schema(description = "设计端商品编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "28930")
|
||||
@NotEmpty(message = "设计端商品编码不能为空")
|
||||
private String rawGoodsId;
|
||||
private String rawGoodsNo;
|
||||
|
||||
@Schema(description = "设计端商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "设计端商品名称不能为空")
|
||||
|
||||
+5
-1
@@ -33,10 +33,14 @@ public class GoodsDO extends BaseDO {
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 设计端商品ID
|
||||
*/
|
||||
private Long rawGoodsId;
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private String goodsId;
|
||||
private Long goodsId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
|
||||
+4
-4
@@ -40,10 +40,6 @@ public class OrderItemDO {
|
||||
* 柜体 ID
|
||||
*/
|
||||
private Long bodyId;
|
||||
/**
|
||||
* 数据 ID
|
||||
*/
|
||||
private Long dataId;
|
||||
/**
|
||||
* 排单 ID
|
||||
*/
|
||||
@@ -52,6 +48,10 @@ public class OrderItemDO {
|
||||
* 包裹 ID
|
||||
*/
|
||||
private Long packageId;
|
||||
/**
|
||||
* 加工组 ID
|
||||
*/
|
||||
private Long groupId;
|
||||
/**
|
||||
* 生产单板件id
|
||||
*/
|
||||
|
||||
+8
-5
@@ -10,15 +10,14 @@ import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_module_extra_n")
|
||||
@KeySequence("order_module_extra_n_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@TableName("order_module_extra")
|
||||
@KeySequence("order_module_extra_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderModuleExtraDO extends BaseDO {
|
||||
public class OrderModuleExtraDO{
|
||||
|
||||
/**
|
||||
* 属性 ID
|
||||
@@ -28,7 +27,7 @@ public class OrderModuleExtraDO extends BaseDO {
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
/**
|
||||
* 房间 ID
|
||||
*/
|
||||
@@ -45,5 +44,9 @@ public class OrderModuleExtraDO extends BaseDO {
|
||||
* 属性数据
|
||||
*/
|
||||
private String extraData;
|
||||
/**
|
||||
* 组织数据
|
||||
*/
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.processStep;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 生产单工序步骤 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_process_step")
|
||||
@KeySequence("order_process_step_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProcessStepDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 步骤 ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderNo;
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
private LocalDateTime finishTime;
|
||||
/**
|
||||
* 工序状态,0未加工,1已加工
|
||||
*/
|
||||
private Boolean status;
|
||||
/**
|
||||
* 加工类型,0全部加工,1开料,2部件加工,3异形封边,4分堆,5打包,6出库,7组件加工,8板材
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 计件工资
|
||||
*/
|
||||
private Double pieceRate;
|
||||
/**
|
||||
* 计件工资类型,1数量,2长度,3平方,4宽,5高,6体积,7生产单金额百分比
|
||||
*/
|
||||
private Integer pieceType;
|
||||
/**
|
||||
* 排序优先级
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 工序 ID
|
||||
*/
|
||||
private Long processinfoId;
|
||||
/**
|
||||
* 生产单工序 ID
|
||||
*/
|
||||
private Long orderProcessId;
|
||||
/**
|
||||
* 计划日期
|
||||
*/
|
||||
private LocalDateTime scheduleDate;
|
||||
/**
|
||||
* 工序处理时长
|
||||
*/
|
||||
private Double duration;
|
||||
/**
|
||||
* 工序负责人
|
||||
*/
|
||||
private String manager;
|
||||
/**
|
||||
* 工序处理日期
|
||||
*/
|
||||
private LocalDateTime processDate;
|
||||
|
||||
}
|
||||
+1
@@ -20,6 +20,7 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
default PageResult<GoodsDO> selectPage(GoodsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eqIfPresent(GoodsDO::getOrderId, reqVO.getOrderId())
|
||||
.eqIfPresent(GoodsDO::getRawGoodsId, reqVO.getRawGoodsId())
|
||||
.eqIfPresent(GoodsDO::getGoodsId, reqVO.getGoodsId())
|
||||
.likeIfPresent(GoodsDO::getGoodsName, reqVO.getGoodsName())
|
||||
.eqIfPresent(GoodsDO::getMaterial, reqVO.getMaterial())
|
||||
|
||||
-16
@@ -1,13 +1,8 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.moduleitem;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.executor.dal.dataobject.moduleitem.ModuleItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.moduleitem.vo.*;
|
||||
|
||||
/**
|
||||
* 生产单模块明细 Mapper
|
||||
@@ -17,15 +12,4 @@ import com.cf.imes.module.executor.controller.admin.moduleitem.vo.*;
|
||||
@Mapper
|
||||
public interface ModuleItemMapper extends BaseMapperX<ModuleItemDO> {
|
||||
|
||||
default PageResult<ModuleItemDO> selectPage(ModuleItemPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ModuleItemDO>()
|
||||
.eqIfPresent(ModuleItemDO::getOrderNo, reqVO.getOrderNo())
|
||||
.eqIfPresent(ModuleItemDO::getRoomId, reqVO.getRoomId())
|
||||
.eqIfPresent(ModuleItemDO::getBodyId, reqVO.getBodyId())
|
||||
.eqIfPresent(ModuleItemDO::getTypeId, reqVO.getTypeId())
|
||||
.eqIfPresent(ModuleItemDO::getModuleId, reqVO.getModuleId())
|
||||
.eqIfPresent(ModuleItemDO::getItemId, reqVO.getItemId())
|
||||
.orderByDesc(ModuleItemDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -5,6 +5,8 @@ import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 生产单柜体 Mapper
|
||||
*
|
||||
@@ -15,4 +17,5 @@ public interface OrderBodyMapper extends BaseMapperX<OrderBodyDO> {
|
||||
|
||||
int updatePlateNumById(@Param("orderId") Long orderId, @Param("plateNum") Double plateNum);
|
||||
|
||||
int deleteAllByOrderId(@Param("orderId") Long orderId, @Param("bodyId") Long bodyId);
|
||||
}
|
||||
+5
-4
@@ -1,12 +1,12 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.orderItem;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产单明细表 order_item Mapper
|
||||
@@ -16,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
|
||||
List<OrderItemDO> selectExtraById(@Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId);
|
||||
|
||||
}
|
||||
+7
-19
@@ -1,30 +1,18 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.orderModuleExtra;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.orderModuleExtra.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 生产单模块扩充属性表 order_module_extra_N Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderModuleExtraMapper extends BaseMapperX<OrderModuleExtraDO> {
|
||||
|
||||
default PageResult<OrderModuleExtraDO> selectPage(OrderModuleExtraPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OrderModuleExtraDO>()
|
||||
.eqIfPresent(OrderModuleExtraDO::getOrderNo, reqVO.getOrderNo())
|
||||
.eqIfPresent(OrderModuleExtraDO::getRoomId, reqVO.getRoomId())
|
||||
.eqIfPresent(OrderModuleExtraDO::getBodyId, reqVO.getBodyId())
|
||||
.eqIfPresent(OrderModuleExtraDO::getType, reqVO.getType())
|
||||
.eqIfPresent(OrderModuleExtraDO::getExtraData, reqVO.getExtraData())
|
||||
.orderByDesc(OrderModuleExtraDO::getId));
|
||||
}
|
||||
|
||||
int insertOne(@Param("orderModuleExtraDO")OrderModuleExtraDO orderModuleExtraDO);
|
||||
|
||||
List<OrderModuleExtraDO> selectExtraById(@Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId);
|
||||
}
|
||||
+6
@@ -2,14 +2,17 @@ package com.cf.imes.module.executor.dal.mysql.orderParts;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
@@ -55,4 +58,7 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
|
||||
System.err.println("OrderPartsImportRespVO " + respVO);
|
||||
return respVO;
|
||||
}
|
||||
|
||||
IPage<OrderPartsRespVO> selectProductList(@Param("page") IPage<OrderPartsRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId);
|
||||
|
||||
}
|
||||
+1
-6
@@ -13,16 +13,10 @@ import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* 生产单板件 Mapper
|
||||
@@ -93,4 +87,5 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
IPage<PlateRespVO> selectProductList(@Param("page") IPage<PlateRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId);
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.processStep;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.executor.dal.dataobject.processStep.ProcessStepDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.processStep.vo.*;
|
||||
|
||||
/**
|
||||
* 生产单工序步骤 Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessStepMapper extends BaseMapperX<ProcessStepDO> {
|
||||
|
||||
default PageResult<ProcessStepDO> selectPage(ProcessStepPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessStepDO>()
|
||||
.eqIfPresent(ProcessStepDO::getOrderNo, reqVO.getOrderNo())
|
||||
.betweenIfPresent(ProcessStepDO::getFinishTime, reqVO.getFinishTime())
|
||||
.eqIfPresent(ProcessStepDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ProcessStepDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ProcessStepDO::getPieceRate, reqVO.getPieceRate())
|
||||
.eqIfPresent(ProcessStepDO::getPieceType, reqVO.getPieceType())
|
||||
.eqIfPresent(ProcessStepDO::getSort, reqVO.getSort())
|
||||
.likeIfPresent(ProcessStepDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ProcessStepDO::getProcessinfoId, reqVO.getProcessinfoId())
|
||||
.eqIfPresent(ProcessStepDO::getOrderProcessId, reqVO.getOrderProcessId())
|
||||
.betweenIfPresent(ProcessStepDO::getScheduleDate, reqVO.getScheduleDate())
|
||||
.eqIfPresent(ProcessStepDO::getDuration, reqVO.getDuration())
|
||||
.eqIfPresent(ProcessStepDO::getManager, reqVO.getManager())
|
||||
.betweenIfPresent(ProcessStepDO::getProcessDate, reqVO.getProcessDate())
|
||||
.betweenIfPresent(ProcessStepDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProcessStepDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
+4
-5
@@ -2,17 +2,15 @@ package com.cf.imes.module.executor.dal.mysql.rawgoods;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsSaveReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.*;
|
||||
|
||||
/**
|
||||
* 生产单设计商品表 order_raw_goods_{N} Mapper
|
||||
@@ -43,6 +41,7 @@ public interface RawGoodsMapper extends BaseMapperX<RawGoodsDO> {
|
||||
importRawGoods.forEach(rawGoodsSaveReqVO -> {
|
||||
try{
|
||||
insert(BeanUtils.toBean(rawGoodsSaveReqVO, RawGoodsDO.class));
|
||||
Long id = rawGoodsSaveReqVO.getId();
|
||||
respVO.getCreateRawGoods().add(rawGoodsSaveReqVO.getGoodsName());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.framework.rpc.config;
|
||||
|
||||
import com.cf.imes.module.infra.api.file.FileApi;
|
||||
import com.cf.imes.module.system.api.machine.MachineApi;
|
||||
import com.cf.imes.module.system.api.process.ProcessGroupApi;
|
||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
@@ -11,6 +12,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* @author there
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class, DictDataApi.class, FileApi.class})
|
||||
@EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class, DictDataApi.class, FileApi.class, ProcessGroupApi.class, FileApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
||||
+8
-2
@@ -17,10 +17,10 @@ public interface GoodsService {
|
||||
/**
|
||||
* 创建生产单商品
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @param createReqVOS 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createGoods(@Valid GoodsSaveReqVO createReqVO);
|
||||
List<Long> createCorrespondsGoods(@Valid Set<GoodsSaveReqVO> createReqVOS);
|
||||
|
||||
/**
|
||||
* 更新生产单商品
|
||||
@@ -52,4 +52,10 @@ public interface GoodsService {
|
||||
*/
|
||||
PageResult<GoodsDO> getGoodsPage(GoodsPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 板材对应
|
||||
* @param createReqVOS: 对应板材信息
|
||||
* @return void
|
||||
*/
|
||||
void getCounterpartNewGoods(Set<GoodsSaveReqVO> createReqVOS);
|
||||
}
|
||||
+35
-7
@@ -1,15 +1,16 @@
|
||||
package com.cf.imes.module.executor.service.goods;
|
||||
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.service.plate.PlateService;
|
||||
import com.cf.imes.module.executor.service.rawgoods.RawGoodsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||
@@ -29,13 +30,32 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
@Resource
|
||||
private GoodsMapper goodsMapper;
|
||||
|
||||
@Resource
|
||||
private PlateService plateService;
|
||||
|
||||
@Resource
|
||||
private RawGoodsService rawGoodsService;
|
||||
|
||||
@Override
|
||||
public Long createGoods(GoodsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
GoodsDO goods = BeanUtils.toBean(createReqVO, GoodsDO.class);
|
||||
goodsMapper.insert(goods);
|
||||
public List<Long> createCorrespondsGoods(Set<GoodsSaveReqVO> createReqVOS) {
|
||||
List<Long> longs = new ArrayList<>();
|
||||
createReqVOS.forEach(createReqVO -> {
|
||||
// 校验商品是否存在
|
||||
if (plateService.getPlate(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());
|
||||
});
|
||||
// 返回
|
||||
return goods.getId();
|
||||
return longs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,4 +91,12 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
return goodsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCounterpartNewGoods(Set<GoodsSaveReqVO> createReqVOS) {
|
||||
// 校验存在
|
||||
createReqVOS.forEach(createReqVO -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
package com.cf.imes.module.executor.service.moduleitem;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.cf.imes.module.executor.controller.admin.moduleitem.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.moduleitem.ModuleItemDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产单模块明细 Service 接口
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
public interface ModuleItemService {
|
||||
|
||||
/**
|
||||
* 创建生产单模块明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createModuleItem(@Valid ModuleItemSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生产单模块明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateModuleItem(@Valid ModuleItemSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生产单模块明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteModuleItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单模块明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 生产单模块明细
|
||||
*/
|
||||
ModuleItemDO getModuleItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单模块明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生产单模块明细分页
|
||||
*/
|
||||
PageResult<ModuleItemDO> getModuleItemPage(ModuleItemPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
package com.cf.imes.module.executor.service.moduleitem;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.cf.imes.module.executor.controller.admin.moduleitem.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.moduleitem.ModuleItemDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.cf.imes.module.executor.dal.mysql.moduleitem.ModuleItemMapper;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 生产单模块明细 Service 实现类
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ModuleItemServiceImpl implements ModuleItemService {
|
||||
|
||||
@Resource
|
||||
private ModuleItemMapper moduleItemMapper;
|
||||
|
||||
@Override
|
||||
public Long createModuleItem(ModuleItemSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ModuleItemDO moduleItem = BeanUtils.toBean(createReqVO, ModuleItemDO.class);
|
||||
moduleItemMapper.insert(moduleItem);
|
||||
// 返回
|
||||
return moduleItem.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateModuleItem(ModuleItemSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateModuleItemExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ModuleItemDO updateObj = BeanUtils.toBean(updateReqVO, ModuleItemDO.class);
|
||||
moduleItemMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteModuleItem(Long id) {
|
||||
// 校验存在
|
||||
validateModuleItemExists(id);
|
||||
// 删除
|
||||
moduleItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateModuleItemExists(Long id) {
|
||||
if (moduleItemMapper.selectById(id) == null) {
|
||||
throw exception(MODULE_ITEM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleItemDO getModuleItem(Long id) {
|
||||
return moduleItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ModuleItemDO> getModuleItemPage(ModuleItemPageReqVO pageReqVO) {
|
||||
return moduleItemMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
+37
-14
@@ -3,15 +3,19 @@ package com.cf.imes.module.executor.service.order;
|
||||
import javax.validation.*;
|
||||
|
||||
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.controller.admin.order.vo.product.ProductRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 生产单表 order_{N} Service 接口
|
||||
@@ -60,14 +64,12 @@ public interface OrderService {
|
||||
|
||||
/**
|
||||
* 批量导入生产单
|
||||
*
|
||||
* @param upload 是否只上传表头,默认为只上传表头
|
||||
* @param file 文件内容
|
||||
* @param createReqVO 生产单信息
|
||||
* @param isAddPlate 是否为生产单新增板材
|
||||
* list 数据转换之后
|
||||
* id 生产单id
|
||||
* orderImportRespVO 返回数据
|
||||
* @return OrderImportRespVO
|
||||
*/
|
||||
OrderImportRespVO importOrderList(Boolean upload, MultipartFile file, OrderSaveReqVO createReqVO ,Boolean isAddPlate) throws IOException;
|
||||
OrderImportRespVO importOrderList(List<Detail> list , Long id , OrderImportRespVO orderImportRespVO) throws IOException;
|
||||
|
||||
/**
|
||||
* 清除生产单表 order_{N}
|
||||
@@ -83,11 +85,32 @@ public interface OrderService {
|
||||
List<OrderDO> getAllOrderCheck(OrderPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* @param orderId:
|
||||
* @param processGroupId:
|
||||
* @return void
|
||||
* @author Administrator
|
||||
* @date 2024/3/26
|
||||
* @param orderId: 生产单Id
|
||||
* @return Map<Long, List<OrderBodyDO>>
|
||||
*/
|
||||
void addOrderProcess(Long orderId , Long processGroupId);
|
||||
Map<Long, List<OrderBodyRespVO>> getOrderBody(Long orderId);
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单id
|
||||
* @param roomId: 房间id
|
||||
* @param bodyId: 柜体id
|
||||
* @return List<ProductRespVO>
|
||||
*/
|
||||
List<OrderModuleExtraDO> getModule(Long orderId, Long roomId , Long bodyId);
|
||||
|
||||
/**
|
||||
* 删除柜体
|
||||
* @param orderId: 生产单id
|
||||
* @param bodyIds: 柜体id
|
||||
*/
|
||||
void deleteBodyByOrder(Long orderId , Collection<Long> bodyIds);
|
||||
|
||||
/**
|
||||
* @param orderId:
|
||||
* @return Object
|
||||
* @author Administrator
|
||||
* @date 2024/3/30
|
||||
*/
|
||||
List<OrderBodyDO> getBody(Long orderId);
|
||||
|
||||
}
|
||||
+137
-99
@@ -1,29 +1,33 @@
|
||||
package com.cf.imes.module.executor.service.order;
|
||||
|
||||
import cn.smallbun.screw.core.util.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
import com.cf.imes.framework.datapermission.core.util.DataPermissionUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.ProductRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderGroup.OrderGroupMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderModuleExtra.OrderModuleExtraMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
|
||||
import com.cf.imes.module.executor.util.FileTypeChangeUtil;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import com.cf.imes.module.executor.util.deviseData.IBoardProdInfo;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderExcelUtil;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
|
||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -40,6 +44,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
@@ -90,12 +95,14 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private OrderModuleExtraMapper orderModuleExtraMapper;
|
||||
|
||||
@Resource
|
||||
private FileTypeChangeUtil fileTypeChangeUtil;
|
||||
|
||||
private static final int DEFAULT_DAYS_TO_ADD = 30;
|
||||
|
||||
|
||||
@Override
|
||||
public Long createOrder(OrderSaveReqVO createReqVO) {
|
||||
//校验手机号是否合法
|
||||
@@ -149,137 +156,155 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public OrderImportRespVO importOrderList(Boolean upload, MultipartFile file, OrderSaveReqVO createReqVO, Boolean isAddPlate) throws IOException {
|
||||
OrderImportRespVO orderImportRespVO = OrderImportRespVO.builder().createOrder(new ArrayList<>())
|
||||
.updateOrder(new ArrayList<>()).failureOrder(new LinkedHashMap<>()).build();
|
||||
// List<IBoardProdInfo> list = new ArrayList<>();
|
||||
List<Detail> list = new ArrayList<>();
|
||||
if (createReqVO.getDataType() == 1) {//CAD
|
||||
return orderImportRespVO;
|
||||
} else if (createReqVO.getDataType() == 2) {//WebCAD
|
||||
return orderImportRespVO;
|
||||
} else if (createReqVO.getDataType() == 3) {//Excel
|
||||
// 文件数据读取
|
||||
List<Detail> iboardProdInfoList = fileTypeChangeUtil.fileDataChange(file);
|
||||
if (iboardProdInfoList == null || iboardProdInfoList.size() == 0) {
|
||||
orderImportRespVO.getFailureOrder().put("生产单导入错误", String.valueOf(fileTypeChangeUtil.getValue()));
|
||||
return orderImportRespVO;
|
||||
public OrderImportRespVO importOrderList(List<Detail> list , Long id , OrderImportRespVO orderImportRespVO) throws IOException {
|
||||
// 导入数据区分板材 配件
|
||||
HashMap<String, List<Detail>> map = classifyGoods(list);
|
||||
// 将相同条件的元素归为一个集合
|
||||
Map<List<Object>, List<Detail>> groupedMap = map.get("plate").stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
p -> Arrays.asList(p.getIBoardProdInfo().getGoodsId(),
|
||||
p.getIBoardProdInfo().getGoodsName(),
|
||||
p.getIBoardProdInfo().getMaterial(),
|
||||
p.getIBoardProdInfo().getColor(),
|
||||
p.getIBoardProdInfo().getSpec(),
|
||||
p.getIBoardProdInfo().getThickness()),
|
||||
Collectors.toList()
|
||||
));
|
||||
groupedMap.forEach((key, value) -> {
|
||||
if(value.get(0).getIBoardProdInfo().getThickness() == null){
|
||||
// 获取板材厚度
|
||||
Pattern pattern = Pattern.compile("\\d+×\\d+×(\\d+)");
|
||||
Matcher matcher = pattern.matcher(value.get(0).getIBoardProdInfo().getSpec());
|
||||
if (matcher.matches()) {
|
||||
String number = matcher.group(1);
|
||||
number = number.trim();
|
||||
value.get(0).getIBoardProdInfo().setThickness(Double.valueOf(number));
|
||||
}
|
||||
}
|
||||
for (Detail detail : iboardProdInfoList) {
|
||||
list.add(detail);
|
||||
// list.add(detail.getIBoardProdInfo());
|
||||
// 板材信息合集,添加生产单id,添加生产单板材设计端商品编码,板材信息写入order_raw_goods
|
||||
RawGoodsDO rawGoodsDO = BeanUtils.toBean(value.get(0).getIBoardProdInfo(), RawGoodsDO.class).setOrderId(id)
|
||||
.setRawGoodsId(value.get(0).getIBoardProdInfo().getGoodsId());
|
||||
rawGoodsMapper.insert(rawGoodsDO);
|
||||
Long rawGoodId = rawGoodsDO.getId();
|
||||
// 赋值给板件未对应前order_raw_goods的id
|
||||
for (Detail reqVO : value) {
|
||||
reqVO.getIBoardProdInfo().setRawGoodsId(rawGoodId);
|
||||
}
|
||||
}
|
||||
Long id;
|
||||
// 判断是否为为生产单添加板材
|
||||
if (!isAddPlate) {//只是添加板材
|
||||
// 判断是否只新建生产单
|
||||
id = createOrder(createReqVO);
|
||||
if (upload) {
|
||||
orderImportRespVO.getCreateOrder().add(String.valueOf(id));
|
||||
return orderImportRespVO;
|
||||
}
|
||||
} else {
|
||||
validateOrderExists(createReqVO.getId());
|
||||
id = createReqVO.getId();
|
||||
}
|
||||
// 根据字段筛选出重复数据
|
||||
List<Detail> duplicateOrder = list.stream()
|
||||
.collect(
|
||||
Collectors.toMap(
|
||||
p -> Arrays.asList(p.getIBoardProdInfo().getGoodsId(), p.getIBoardProdInfo().getGoodsName(),
|
||||
p.getIBoardProdInfo().getMaterial(), p.getIBoardProdInfo().getColor(), p.getIBoardProdInfo().getSpec()),
|
||||
p -> p,
|
||||
(existing, replacement) -> existing
|
||||
)
|
||||
)
|
||||
.values().stream()
|
||||
.collect(Collectors.toList());
|
||||
// 数据分类
|
||||
HashMap<String, List<Detail>> map = classifyGoods(duplicateOrder);
|
||||
// 板材信息合集,添加生产单id,板材信息写入order_raw_goods
|
||||
List<RawGoodsSaveReqVO> rawGoodsSaveReqVOList = collectImportRawPlate(map.get("plate"), id);
|
||||
RawGoodsImportRespVO respRawGoods = rawGoodsMapper.importRawGoodsList(rawGoodsSaveReqVOList);
|
||||
orderImportRespVO.getFailureOrder().putAll(respRawGoods.getFailureRawGoods());
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 小板信息写入 、配件信息写入
|
||||
Map<String, List<Detail>> groupedRooms = list.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
order -> order.getIBoardProdInfo().getRoomsName() != null ? order.getIBoardProdInfo().getRoomsName() : " ",
|
||||
Collectors.toList()
|
||||
));
|
||||
// 根据房间分类
|
||||
groupedRooms.forEach((roomName, listRoom) -> {
|
||||
System.out.println("OrderPlateImportExcelVO with roomName " + roomName + ":");
|
||||
Long roomId = (Long) snowFlakeGenerator.nextId(null);
|
||||
Map<String, List<Detail>> groupedCabinetsName = listRoom.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
order -> order.getIBoardProdInfo().getCabinetsName() != null ? order.getIBoardProdInfo().getCabinetsName() : " ",
|
||||
Collectors.toList()
|
||||
));
|
||||
// 根据柜体名分类
|
||||
groupedCabinetsName.forEach((cabinetName, listCabinet) -> {
|
||||
System.out.println("OrderPlateImportExcelVO with cabinetName " + cabinetName + ":");
|
||||
final Double[] plateCountByCabinetName = {0.0};
|
||||
// 插入柜体表数据
|
||||
OrderBodyDO orderBodyDO = OrderBodyDO.builder().orderId(id).roomId(roomId)
|
||||
.roomName(roomName).name(cabinetName).build();
|
||||
.roomName(roomName).name(cabinetName).build(); //没有获取柜体的长宽高
|
||||
orderBodyMapper.insert(orderBodyDO);
|
||||
Long bodyId = orderBodyDO.getId();
|
||||
Map<String, List<Detail>> groupedSynthesis = listCabinet.stream()
|
||||
|
||||
Map<String, List<Detail>> groupedSynthesis = listCabinet.stream()//根据组合类型
|
||||
.collect(Collectors.groupingBy(
|
||||
order -> order.getIBoardProdInfo().getSynthesis() != null ? order.getIBoardProdInfo().getSynthesis() : " ",
|
||||
order -> Optional.ofNullable(order.getIBoardProdInfo().getSynthesis())
|
||||
.map(Object::toString)
|
||||
.orElse(" "),
|
||||
Collectors.toList()
|
||||
));
|
||||
groupedSynthesis.forEach((synthesis, listSynthesis) -> {
|
||||
System.out.println("OrderPlateImportExcelVO with synthesis " + synthesis + ":");
|
||||
Long synthesisId = (Long) snowFlakeGenerator.nextId(null);
|
||||
|
||||
List<ProductRespVO> productRespVOS = new ArrayList<>();
|
||||
// 根据组合类别分类
|
||||
groupedSynthesis.forEach((synthesis, listSynthesis) -> {//根据组合类别
|
||||
|
||||
Map<String, List<Detail>> groupedCombinationName = listSynthesis.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
order -> order.getIBoardProdInfo().getCombinationName() != null ? order.getIBoardProdInfo().getCombinationName() : " ",
|
||||
Collectors.toList()
|
||||
));
|
||||
groupedCombinationName.forEach((combinationName, listCombination) -> {//组合名称
|
||||
// 根据组合名称分类
|
||||
groupedCombinationName.forEach((combinationName, listCombinationName) -> {
|
||||
// 板数量
|
||||
final Double[] plateCountByCombination = {0.0};
|
||||
OrderGroupDO orderGroupDO = OrderGroupDO.builder().orderId(id).bodyId(bodyId)
|
||||
.groupId(synthesisId).groupType(synthesis).name(combinationName).build();
|
||||
// 插入group表
|
||||
.groupId(Long.valueOf(synthesis)).groupType(listCombinationName.get(0).getIBoardProdInfo().getSynthesisTypeName()).name(combinationName).build();
|
||||
|
||||
orderGroupMapper.insert(orderGroupDO);
|
||||
Long groupId = orderGroupDO.getId();
|
||||
listCombination.forEach(plateOrParts -> {
|
||||
System.out.println("OrderPlateImportExcelVO with combinationName " + combinationName + ":");
|
||||
|
||||
listCombinationName.forEach(plateOrParts -> {
|
||||
|
||||
plateCountByCombination[0] = plateCountByCombination[0] + plateOrParts.getIBoardProdInfo().getGoodsNumber();
|
||||
if (plateOrParts.getIBoardProdInfo().getGoodType()== 1) {
|
||||
//板材
|
||||
for (int i = 0; i < plateOrParts.getIBoardProdInfo().getGoodsNumber(); i++) {
|
||||
PlateDO plateDO = BeanUtils.toBean(plateOrParts, PlateDO.class).setOrderId(id).setGoodsId("");
|
||||
PlateDO plateDO = BeanUtils.toBean(plateOrParts.getIBoardProdInfo(), PlateDO.class).setOrderId(id).setGoodsId(String.valueOf(plateOrParts.getIBoardProdInfo().getRawGoodsId()))
|
||||
.setThickness(BigDecimal.valueOf(plateOrParts.getIBoardProdInfo().getSplitThickness()));
|
||||
|
||||
plateMapper.insert(plateDO);
|
||||
productRespVOS.add(new ProductRespVO().setRoomId(roomId).setRoomName(roomName).setBodyId(bodyId).setBodyName(cabinetName)
|
||||
.setGroupId(groupId).setGroupTypeId(orderGroupDO.getGroupId()).setGroupTypeName(orderGroupDO.getName())
|
||||
.setGoodType(1).setGoodName(plateDO.getName()).setUnits("片").setNum(1.0));
|
||||
Long plateId = plateDO.getId();
|
||||
orderImportRespVO.getCreateOrder().add(plateDO.getId() + "板材存入生成id");
|
||||
|
||||
OrderItemDO orderItemDO = OrderItemDO.builder().orderId(id).type(1)
|
||||
.roomId(roomId).bodyId(bodyId).dataId(plateId).plateId(plateId)
|
||||
.num(1.0).build();
|
||||
.roomId(roomId).bodyId(bodyId).plateId(plateId)
|
||||
.num(1.0).groupId(groupId).build();
|
||||
orderItemMapper.insert(orderItemDO);
|
||||
// 写入Detail中的IBoardProdInfo
|
||||
plateOrParts.setPlateId(plateId);
|
||||
plateOrParts.getIBoardProdInfo().setPlateId(plateId);
|
||||
}
|
||||
} else {
|
||||
}else {
|
||||
//配件
|
||||
OrderPartsDO orderPartsDO = BeanUtils.toBean(plateOrParts, OrderPartsDO.class).
|
||||
OrderPartsDO orderPartsDO = BeanUtils.toBean(plateOrParts.getIBoardProdInfo(), OrderPartsDO.class).
|
||||
setName(plateOrParts.getIBoardProdInfo().getGoodsName()).setType(plateOrParts.getIBoardProdInfo().getGoodType()).setOrderId(id);
|
||||
orderPartsMapper.insert(orderPartsDO);
|
||||
orderImportRespVO.getCreateOrder().add(orderPartsDO.getId() + "配件存入生成id");
|
||||
OrderItemDO orderItemDO = OrderItemDO.builder().orderId(id).type(Integer.valueOf(plateOrParts.getIBoardProdInfo().getGoodType()))
|
||||
.roomId(roomId).bodyId(bodyId).dataId(orderPartsDO.getId()).partsId(orderPartsDO.getId())
|
||||
.roomId(roomId).bodyId(bodyId).partsId(orderPartsDO.getId()).groupId(groupId)
|
||||
.num(Double.valueOf(plateOrParts.getIBoardProdInfo().getGoodsNumber())).build();
|
||||
orderItemMapper.insert(orderItemDO);
|
||||
productRespVOS.add(new ProductRespVO().setRoomId(roomId).setRoomName(roomName).setBodyId(bodyId).setBodyName(cabinetName)
|
||||
.setGroupId(groupId).setGroupTypeId(orderGroupDO.getGroupId()).setGroupTypeName(orderGroupDO.getName())
|
||||
.setGoodType(1).setGoodName(orderPartsDO.getName()).setUnits(orderPartsDO.getUnit()).setNum(orderItemDO.getNum()));
|
||||
}
|
||||
|
||||
});
|
||||
// 修改group中的板件数量
|
||||
orderGroupMapper.updatePlateNumById(groupId, plateCountByCombination[0]);
|
||||
plateCountByCabinetName[0] = plateCountByCabinetName[0] + plateCountByCombination[0];
|
||||
});
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
String detailListJson = objectMapper.writeValueAsString(productRespVOS);
|
||||
OrderModuleExtraDO orderModuleExtraDO = OrderModuleExtraDO.builder().orderId(id).roomId(roomId).id((Long) snowFlakeGenerator.nextId(null))
|
||||
.bodyId(bodyId).type(listCabinet.get(0).getIBoardProdInfo().getGoodType()).extraData(detailListJson).build();
|
||||
orderModuleExtraMapper.insert(orderModuleExtraDO);
|
||||
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
orderBodyMapper.updatePlateNumById(bodyId, plateCountByCabinetName[0]);
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
fileTypeChangeUtil.fileDataChangeToJson(list , id);
|
||||
fileTypeChangeUtil.fileDataChangeToJson(list, id);
|
||||
return orderImportRespVO;
|
||||
}
|
||||
|
||||
@@ -292,6 +317,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
orderBodyMapper.delete(new LambdaQueryWrapper<OrderBodyDO>().eq(OrderBodyDO::getOrderId, orderId));
|
||||
orderItemMapper.delete(new LambdaQueryWrapper<OrderItemDO>().eq(OrderItemDO::getOrderId, orderId));
|
||||
orderGroupMapper.delete(new LambdaQueryWrapper<OrderGroupDO>().eq(OrderGroupDO::getOrderId, orderId));
|
||||
orderModuleExtraMapper.delete(new LambdaQueryWrapper<OrderModuleExtraDO>().eq(OrderModuleExtraDO::getOrderId, orderId));
|
||||
rawGoodsMapper.delete(new LambdaQueryWrapper<RawGoodsDO>().eq(RawGoodsDO::getOrderId, orderId));
|
||||
orderPartsMapper.delete(new LambdaQueryWrapper<OrderPartsDO>().eq(OrderPartsDO::getOrderId, orderId));
|
||||
plateMapper.delete(new LambdaQueryWrapper<PlateDO>().eq(PlateDO::getOrderId, orderId));
|
||||
@@ -303,46 +329,58 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOrderProcess(Long orderId, Long processGroupId) {
|
||||
|
||||
public Map<Long, List<OrderBodyRespVO>> getOrderBody(Long orderId) {
|
||||
// 校验存在
|
||||
validateOrderExists(orderId);
|
||||
List<OrderBodyRespVO> orderBodyRespVOList = BeanUtils.toBean(orderBodyMapper.selectList(new LambdaQueryWrapper<OrderBodyDO>().eq(OrderBodyDO::getOrderId, orderId)), OrderBodyRespVO.class);
|
||||
Map<Long, List<OrderBodyRespVO>> groupedByRoomId = orderBodyRespVOList.stream()
|
||||
.collect(Collectors.groupingBy(OrderBodyRespVO::getRoomId));
|
||||
return groupedByRoomId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderModuleExtraDO> getModule(Long orderId, Long roomId, Long bodyId) {
|
||||
List<OrderModuleExtraDO> orderModuleExtraDOS = orderModuleExtraMapper.selectExtraById(orderId, roomId, bodyId);
|
||||
return orderModuleExtraDOS;
|
||||
}
|
||||
|
||||
// 板材信息收集
|
||||
private List<RawGoodsSaveReqVO> collectImportRawPlate(List<Detail> list, Long id) {
|
||||
List<RawGoodsSaveReqVO> rawGoodsDOList = new ArrayList<>();
|
||||
|
||||
for (Detail detail : list) {
|
||||
RawGoodsSaveReqVO rawGoodsSaveReqVO = BeanUtils.toBean(detail.getIBoardProdInfo(), RawGoodsSaveReqVO.class);
|
||||
rawGoodsSaveReqVO.setOrderId(id);
|
||||
rawGoodsSaveReqVO.setRawGoodsId(detail.getIBoardProdInfo().getGoodsId());
|
||||
// 创建 Pattern 对象
|
||||
Pattern pattern = Pattern.compile(".*?[^\\d]+(\\d+).*");
|
||||
Matcher matcher = pattern.matcher(detail.getIBoardProdInfo().getSpec());
|
||||
if (matcher.matches()) {
|
||||
String number = matcher.group(1);
|
||||
// 去除空格
|
||||
number = number.trim();
|
||||
rawGoodsSaveReqVO.setThickness(Double.valueOf(number));
|
||||
}
|
||||
rawGoodsDOList.add(rawGoodsSaveReqVO);
|
||||
@Override
|
||||
public void deleteBodyByOrder(Long orderId, Collection<Long> bodyIds) {
|
||||
validateOrderExists(orderId);
|
||||
if (CollectionUtils.isNotEmpty(bodyIds)) {
|
||||
bodyIds.forEach(bodyId -> {
|
||||
// 校验存在
|
||||
validateOrderBodyExists(orderId, bodyId);
|
||||
// 删除
|
||||
orderBodyMapper.deleteAllByOrderId(orderId, bodyId);
|
||||
});
|
||||
}
|
||||
return rawGoodsDOList;
|
||||
}
|
||||
|
||||
//对数据进行分类
|
||||
@Override
|
||||
public List<OrderBodyDO> getBody(Long orderId) {
|
||||
return orderBodyMapper.selectList(new LambdaQueryWrapper<OrderBodyDO>().eq(OrderBodyDO::getOrderId, orderId));
|
||||
}
|
||||
|
||||
private void validateOrderBodyExists(Long orderId, Long bodyId) {
|
||||
if (orderBodyMapper.selectCount(new LambdaQueryWrapper<OrderBodyDO>().eq(OrderBodyDO::getOrderId, orderId).eq(OrderBodyDO::getId, bodyId)) == 0) {
|
||||
throw exception(ORDER_BODY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
// 对数据进行分类
|
||||
private HashMap<String, List<Detail>> classifyGoods(List<Detail> list) {
|
||||
HashMap<String, List<Detail>> map = new HashMap<>();
|
||||
List<Detail> plateLists = new ArrayList<>();
|
||||
List<Detail> partsLists = new ArrayList<>();
|
||||
for (Detail detail : list) {
|
||||
//判断是板材还是配件
|
||||
if (detail.getIBoardProdInfo().getGoodType()== 1) {
|
||||
if (detail.getIBoardProdInfo().getGoodType() == 1) {
|
||||
plateLists.add(detail);
|
||||
} else {
|
||||
partsLists.add(detail);
|
||||
}
|
||||
// orderPlateImportExcelVO.setRemark(orderPlateImportExcelVO.remarkJSON());
|
||||
// detail.getIBoardProdInfo().setRemark(orderPlateImportExcelVO.remarkJSON());
|
||||
}
|
||||
map.put("plate", plateLists);
|
||||
map.put("parts", partsLists);
|
||||
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
package com.cf.imes.module.executor.service.orderModuleExtra;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.cf.imes.module.executor.controller.admin.orderModuleExtra.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产单模块扩充属性表 order_module_extra_N Service 接口
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
public interface OrderModuleExtraService {
|
||||
|
||||
/**
|
||||
* 创建生产单模块扩充属性表 order_module_extra_N
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createOrderModuleExtra(@Valid OrderModuleExtraSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生产单模块扩充属性表 order_module_extra_N
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOrderModuleExtra(@Valid OrderModuleExtraSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生产单模块扩充属性表 order_module_extra_N
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteOrderModuleExtra(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单模块扩充属性表 order_module_extra_N
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 生产单模块扩充属性表 order_module_extra_N
|
||||
*/
|
||||
OrderModuleExtraDO getOrderModuleExtra(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单模块扩充属性表 order_module_extra_N分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生产单模块扩充属性表 order_module_extra_N分页
|
||||
*/
|
||||
PageResult<OrderModuleExtraDO> getOrderModuleExtraPage(OrderModuleExtraPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
package com.cf.imes.module.executor.service.orderModuleExtra;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.cf.imes.module.executor.controller.admin.orderModuleExtra.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.cf.imes.module.executor.dal.mysql.orderModuleExtra.OrderModuleExtraMapper;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 生产单模块扩充属性表 order_module_extra_N Service 实现类
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OrderModuleExtraServiceImpl implements OrderModuleExtraService {
|
||||
|
||||
@Resource
|
||||
private OrderModuleExtraMapper orderModuleExtraMapper;
|
||||
|
||||
@Override
|
||||
public Long createOrderModuleExtra(OrderModuleExtraSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
OrderModuleExtraDO orderModuleExtra = BeanUtils.toBean(createReqVO, OrderModuleExtraDO.class);
|
||||
orderModuleExtraMapper.insert(orderModuleExtra);
|
||||
// 返回
|
||||
return orderModuleExtra.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrderModuleExtra(OrderModuleExtraSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateOrderModuleExtraExists(updateReqVO.getId());
|
||||
// 更新
|
||||
OrderModuleExtraDO updateObj = BeanUtils.toBean(updateReqVO, OrderModuleExtraDO.class);
|
||||
orderModuleExtraMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrderModuleExtra(Long id) {
|
||||
// 校验存在
|
||||
validateOrderModuleExtraExists(id);
|
||||
// 删除
|
||||
orderModuleExtraMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateOrderModuleExtraExists(Long id) {
|
||||
if (orderModuleExtraMapper.selectById(id) == null) {
|
||||
throw exception(ORDER_MODULE_EXTRA_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderModuleExtraDO getOrderModuleExtra(Long id) {
|
||||
return orderModuleExtraMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderModuleExtraDO> getOrderModuleExtraPage(OrderModuleExtraPageReqVO pageReqVO) {
|
||||
return orderModuleExtraMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -3,6 +3,8 @@ package com.cf.imes.module.executor.service.orderParts;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateTermsPageReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
@@ -60,4 +62,11 @@ public interface OrderPartsService {
|
||||
* @return 导入结果
|
||||
*/
|
||||
OrderPartsImportRespVO importOrderPartsList(List<OrderPartsSaveReqVO> importOrderParts, Long orderId);
|
||||
|
||||
/**
|
||||
* @param pageReqVO:
|
||||
* @return PageResult<PlateDO>
|
||||
*/
|
||||
PageResult<OrderPartsRespVO> getPartsPageByTerms(PlateTermsPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
+11
@@ -1,10 +1,14 @@
|
||||
package com.cf.imes.module.executor.service.orderParts;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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.framework.datapermission.core.util.DataPermissionUtils;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateTermsPageReqVO;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -101,4 +105,11 @@ public class OrderPartsServiceImpl implements OrderPartsService {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderPartsRespVO> getPartsPageByTerms(PlateTermsPageReqVO pageReqVO) {
|
||||
PageDTO<OrderPartsRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrderPartsRespVO> pageRes = orderPartsMapper.selectProductList(page, pageReqVO.getOrderId(), pageReqVO.getRoomId(), pageReqVO.getBodyId());
|
||||
return new PageResult<OrderPartsRespVO>(pageRes.getRecords(), pageRes.getTotal());
|
||||
}
|
||||
|
||||
}
|
||||
+14
-3
@@ -4,11 +4,8 @@ import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产单板件 Service 接口
|
||||
@@ -77,4 +74,18 @@ public interface PlateService {
|
||||
* @return List<PlateDO>
|
||||
*/
|
||||
List<PlateDO> getPlatesByOrderId(Long orderId);
|
||||
|
||||
/**
|
||||
* @param pageReqVO:
|
||||
* @return PageResult<PlateDO>
|
||||
*/
|
||||
PageResult<PlateRespVO> getPlatePageByTerms(PlateTermsPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* @param rawGoodsIds: 未对应之前的板材id
|
||||
* @param goodsId: 对应之后的板材id
|
||||
* @param orderIds: 生产单id
|
||||
* @return void
|
||||
*/
|
||||
void updatePlateByRawGoodsId(Set<Long> rawGoodsIds, Long goodsId , Set<Long> orderIds);
|
||||
}
|
||||
+16
-5
@@ -2,12 +2,11 @@ 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.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.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -17,13 +16,11 @@ import java.util.*;
|
||||
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;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.PLATE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@@ -112,5 +109,19 @@ public class PlateServiceImpl implements PlateService {
|
||||
return plates;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PlateRespVO> getPlatePageByTerms(PlateTermsPageReqVO pageReqVO) {
|
||||
PageDTO<PlateRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<PlateRespVO> pageRes = plateMapper.selectProductList(page, pageReqVO.getOrderId(), pageReqVO.getRoomId(), pageReqVO.getBodyId());
|
||||
return new PageResult<PlateRespVO>(pageRes.getRecords(), pageRes.getTotal());
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+2
-5
@@ -1,11 +1,8 @@
|
||||
package com.cf.imes.module.executor.service.process;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.cf.imes.module.executor.controller.admin.process.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.process.OrderProcessDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产单工序 Service 接口
|
||||
@@ -39,9 +36,9 @@ public interface OrderProcessService {
|
||||
/**
|
||||
* 获得生产单工序
|
||||
*
|
||||
* @param id 编号
|
||||
* @param orderId 生产单编号
|
||||
* @return 生产单工序
|
||||
*/
|
||||
OrderProcessDO getOrderProcess(Long id);
|
||||
OrderProcessDO getOrderProcess(Long orderId);
|
||||
|
||||
}
|
||||
+27
-2
@@ -1,5 +1,7 @@
|
||||
package com.cf.imes.module.executor.service.process;
|
||||
|
||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.system.api.process.ProcessGroupApi;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -26,8 +28,26 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
@Resource
|
||||
private OrderProcessMapper orderProcessMapper;
|
||||
|
||||
@Resource
|
||||
private ProcessGroupApi processGroupApi;
|
||||
|
||||
@Resource
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Override
|
||||
public Long createOrderProcess(OrderProcessSaveReqVO createReqVO) {
|
||||
// 校验生产单存在
|
||||
if (orderMapper.selectById(createReqVO.getOrderId()) == null) {
|
||||
throw exception(ORDER_NOT_EXISTS);
|
||||
}
|
||||
// 校验工序组存在
|
||||
if (!processGroupApi.getProcessGroup(createReqVO.getGroupId())){
|
||||
throw exception(PROCESS_GROUP_NOT_EXISTS);
|
||||
}
|
||||
// 校验是否已经存在该生产单对应的工序组
|
||||
if (orderProcessMapper.selectOne(OrderProcessDO::getOrderId, createReqVO.getOrderId()) != null) {
|
||||
throw exception(ORDER_PROCESS_EXISTS);
|
||||
}
|
||||
// 插入
|
||||
OrderProcessDO orderProcess = BeanUtils.toBean(createReqVO, OrderProcessDO.class);
|
||||
orderProcessMapper.insert(orderProcess);
|
||||
@@ -58,9 +78,14 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
}
|
||||
}
|
||||
|
||||
// 通过生产单Id和工序id查询是否存在
|
||||
private OrderProcessDO validateOrderProcessExists(Long orderId, Long groupId) {
|
||||
return orderProcessMapper.selectOne("order_id", orderId, "group_id", groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderProcessDO getOrderProcess(Long id) {
|
||||
return orderProcessMapper.selectOne("id", id);
|
||||
public OrderProcessDO getOrderProcess(Long orderId) {
|
||||
return orderProcessMapper.selectOne("order_id", orderId);
|
||||
}
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.cf.imes.module.executor.service.processStep;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.cf.imes.module.executor.controller.admin.processStep.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.processStep.ProcessStepDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产单工序步骤 Service 接口
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
public interface ProcessStepService {
|
||||
|
||||
/**
|
||||
* 创建生产单工序步骤
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProcessStep(@Valid ProcessStepSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生产单工序步骤
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProcessStep(@Valid ProcessStepSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生产单工序步骤
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProcessStep(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单工序步骤
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 生产单工序步骤
|
||||
*/
|
||||
ProcessStepDO getProcessStep(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单工序步骤分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生产单工序步骤分页
|
||||
*/
|
||||
PageResult<ProcessStepDO> getProcessStepPage(ProcessStepPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.cf.imes.module.executor.service.processStep;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.cf.imes.module.executor.controller.admin.processStep.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.processStep.ProcessStepDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.cf.imes.module.executor.dal.mysql.processStep.ProcessStepMapper;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 生产单工序步骤 Service 实现类
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ProcessStepServiceImpl implements ProcessStepService {
|
||||
|
||||
@Resource
|
||||
private ProcessStepMapper processStepMapper;
|
||||
|
||||
@Override
|
||||
public Long createProcessStep(ProcessStepSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProcessStepDO processStep = BeanUtils.toBean(createReqVO, ProcessStepDO.class);
|
||||
processStepMapper.insert(processStep);
|
||||
// 返回
|
||||
return processStep.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcessStep(ProcessStepSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProcessStepExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProcessStepDO updateObj = BeanUtils.toBean(updateReqVO, ProcessStepDO.class);
|
||||
processStepMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessStep(Long id) {
|
||||
// 校验存在
|
||||
validateProcessStepExists(id);
|
||||
// 删除
|
||||
processStepMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProcessStepExists(Long id) {
|
||||
if (processStepMapper.selectById(id) == null) {
|
||||
// throw exception(PROCESS_STEP_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessStepDO getProcessStep(Long id) {
|
||||
return processStepMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessStepDO> getProcessStepPage(ProcessStepPageReqVO pageReqVO) {
|
||||
return processStepMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
+11
-4
@@ -3,12 +3,11 @@ package com.cf.imes.module.executor.service.rawgoods;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产单设计商品表 order_raw_goods_{N} Service 接口
|
||||
@@ -64,4 +63,12 @@ public interface RawGoodsService {
|
||||
*/
|
||||
RawGoodsImportRespVO importRawGoodsList(List<RawGoodsSaveReqVO> importRawGoods, Long orderId);
|
||||
|
||||
/**
|
||||
* 获得生产单设计商品表 order_raw_goods_{N}
|
||||
*
|
||||
* @param orderId 编号
|
||||
* @return 生产单设计商品表 order_raw_goods_{N}
|
||||
*/
|
||||
List<RawGoodsDO> getRawGoodsByOrder(Long orderId);
|
||||
|
||||
}
|
||||
+9
-7
@@ -3,10 +3,9 @@ package com.cf.imes.module.executor.service.rawgoods;
|
||||
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.datapermission.core.util.DataPermissionUtils;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsImportRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsImportRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.RawGoodsSaveReqVO;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
@@ -14,16 +13,14 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.cf.imes.module.executor.controller.admin.rawgoods.vo.*;
|
||||
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.RAW_GOODS_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@@ -100,4 +97,9 @@ public class RawGoodsServiceImpl implements RawGoodsService {
|
||||
});
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RawGoodsDO> getRawGoodsByOrder(Long orderId) {
|
||||
return rawGoodsMapper.selectList(RawGoodsDO::getOrderId, orderId);
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -4,6 +4,7 @@ import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -15,7 +16,7 @@ public interface FileTypeChangeUtil {
|
||||
// 文件数据格式转换
|
||||
List<Detail> fileDataChange(MultipartFile file) throws IOException;
|
||||
// List<Detail>转json,并且文件压缩存储
|
||||
void fileDataChangeToJson(List<Detail> detailList , Long orderId) throws JsonProcessingException;
|
||||
void fileDataChangeToJson(List<Detail> detailList , Long orderId) throws IOException;
|
||||
|
||||
// Api数据格式转换
|
||||
|
||||
|
||||
+83
-41
@@ -1,5 +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.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
@@ -106,48 +113,83 @@ public class ZLibUtils {
|
||||
return o.toByteArray();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
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()};//侧面孔明细
|
||||
|
||||
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};
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String detailListJson = objectMapper.writeValueAsString(detailList);
|
||||
System.out.println(
|
||||
detailListJson
|
||||
);
|
||||
//测试字节数组
|
||||
System.err.println("字节压缩/解压缩测试");
|
||||
String inputStr = "snowolf@zlex.org;dongliang@zlex.org;zlex.dongliang@zlex.org";
|
||||
System.err.println("输入字符串:\t" + inputStr);
|
||||
byte[] input = inputStr.getBytes();
|
||||
System.err.println("输入字节长度:\t" + input.length);
|
||||
|
||||
byte[] data = ZLibUtils.compress(input);
|
||||
System.err.println("压缩后字节长度:\t" + data.length);
|
||||
|
||||
byte[] output = ZLibUtils.decompress(data);
|
||||
System.err.println("解压缩后字节长度:\t" + output.length);
|
||||
String outputStr = new String(output);
|
||||
System.err.println("输出字符串:\t" + outputStr);
|
||||
|
||||
//测试文件
|
||||
String filename = "zlib";
|
||||
File file = new File(filename);
|
||||
System.err.println("文件压缩/解压缩测试");
|
||||
try {
|
||||
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
ZLibUtils.compress(input, fos);
|
||||
fos.close();
|
||||
System.err.println("压缩后字节长度:\t" + file.length());
|
||||
} catch (Exception e) {
|
||||
System.err.println("错误:\t" + e.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
output = ZLibUtils.decompress(fis);
|
||||
fis.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("错误:\t" + e.getMessage());
|
||||
}
|
||||
System.err.println("解压缩后字节长度:\t" + output.length);
|
||||
outputStr = new String(output);
|
||||
System.err.println("输出字符串:\t" + outputStr);
|
||||
// System.err.println("字节压缩/解压缩测试");
|
||||
// String inputStr = "snowolf@zlex.org;dongliang@zlex.org;zlex.dongliang@zlex.org";
|
||||
// System.err.println("输入字符串:\t" + inputStr);
|
||||
// byte[] input = inputStr.getBytes();
|
||||
// System.err.println("输入字节长度:\t" + input.length);
|
||||
//
|
||||
// byte[] data = ZLibUtils.compress(input);
|
||||
// System.err.println("压缩后字节长度:\t" + data.length);
|
||||
//
|
||||
// byte[] output = ZLibUtils.decompress(data);
|
||||
// System.err.println("解压缩后字节长度:\t" + output.length);
|
||||
// String outputStr = new String(output);
|
||||
// System.err.println("输出字符串:\t" + outputStr);
|
||||
//
|
||||
// //测试文件
|
||||
// String filename = "zlib";
|
||||
// File file = new File(filename);
|
||||
// System.err.println("文件压缩/解压缩测试");
|
||||
// try {
|
||||
//
|
||||
// FileOutputStream fos = new FileOutputStream(file);
|
||||
// ZLibUtils.compress(input, fos);
|
||||
// fos.close();
|
||||
// System.err.println("压缩后字节长度:\t" + file.length());
|
||||
// } catch (Exception e) {
|
||||
// System.err.println("错误:\t" + e.getMessage());
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// FileInputStream fis = new FileInputStream(file);
|
||||
// output = ZLibUtils.decompress(fis);
|
||||
// fis.close();
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// System.err.println("错误:\t" + e.getMessage());
|
||||
// }
|
||||
// System.err.println("解压缩后字节长度:\t" + output.length);
|
||||
// outputStr = new String(output);
|
||||
// System.err.println("输出字符串:\t" + outputStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class Detail {
|
||||
|
||||
private String orderId ; //生产单id
|
||||
private IBoardProdInfo iBoardProdInfo; //板件属性信息
|
||||
private Long plateId ; //板材id
|
||||
private IBoardProdInfo iBoardProdInfo; //板件基本属性信息
|
||||
private ModelDetail modelDetail ; //模块明细
|
||||
private PointDetail pointDetail ; //点明细
|
||||
private HoleDetail holeDetail ; //孔明细
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
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 IBoardPardInfo {
|
||||
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; //材质
|
||||
|
||||
}
|
||||
+17
-12
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -18,7 +19,7 @@ import java.math.BigDecimal;
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IBoardProdInfo {
|
||||
|
||||
private String goodsId;
|
||||
private String goodsId; // 物料编码
|
||||
private String goodsName;
|
||||
private int goodType;
|
||||
private String factory;
|
||||
@@ -26,8 +27,8 @@ public class IBoardProdInfo {
|
||||
private String model;
|
||||
private String spec;
|
||||
private String unit;
|
||||
private Double goodsNumber;
|
||||
private String plateNo;
|
||||
private Double goodsNumber;//数量
|
||||
private String plateNo;//自定义板号
|
||||
private Long plateId; //板件Id
|
||||
private String name; //板件名称
|
||||
private String roomsName; //房间名称
|
||||
@@ -38,6 +39,9 @@ public class IBoardProdInfo {
|
||||
private int typographicFace; //排版面 排钻类型(0正面1反面2随意面)
|
||||
private int openDoorType; //开门类型 0非门板,1左开,2右开,3上翻,4下翻
|
||||
private Boolean isRect; //是否为矩形
|
||||
private Double thickness;//规格-板厚
|
||||
private Long rawGoodsId;//未对应商品Id
|
||||
|
||||
|
||||
private Integer splitHeight; //开料长
|
||||
private Integer splitWidth; //开料宽
|
||||
@@ -47,21 +51,22 @@ public class IBoardProdInfo {
|
||||
private Integer decomposeWidth; //拆单宽
|
||||
private Integer decomposeThickness; //拆单厚度
|
||||
|
||||
private Integer finishedHeight; //成品长
|
||||
private Integer finishedWidth; //成品宽
|
||||
private Integer finishedThickness; //成品厚度
|
||||
private BigDecimal height; //成品长
|
||||
private BigDecimal width; //成品宽
|
||||
// private BigDecimal thickness; //成品厚度和开料的厚度相同
|
||||
|
||||
private Integer edgeHeight; //外封边长
|
||||
private Integer edgeWidth; //外封边宽
|
||||
private Integer edgeThickness; //外封边厚度
|
||||
|
||||
private BigDecimal sealLeft;
|
||||
private BigDecimal sealRight;
|
||||
private BigDecimal sealUp;
|
||||
private BigDecimal sealDown;
|
||||
private BigDecimal sealLeft; //左封边
|
||||
private BigDecimal sealRight; //右封边
|
||||
private BigDecimal sealUp; //上封边
|
||||
private BigDecimal sealDown; //下封边
|
||||
|
||||
private String synthesis;
|
||||
private String combinationName;
|
||||
private int synthesis; //组合类型
|
||||
private String synthesisTypeName; //组合类型的名称
|
||||
private String combinationName; //组合名称
|
||||
|
||||
private String remark; //备注
|
||||
}
|
||||
|
||||
+6
-5
@@ -9,22 +9,23 @@ import lombok.experimental.Accessors;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模块明细
|
||||
* 造型明细
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class ModelDetail {
|
||||
public class ModelDetail {//去除order_module_extra
|
||||
|
||||
private Integer modelId; //模块ID
|
||||
private Integer modelId; //造型ID
|
||||
private Integer lineID; //纹路ID
|
||||
private Integer typographicFace; //排版面 0正面, 1反面, 2侧面
|
||||
private String knifeName; //刀具名称
|
||||
private Integer knifeRadius; //刀半径
|
||||
private Integer depth; //深度
|
||||
private Integer multiNum; //柜体复制数
|
||||
private IOriginModelingData originModeling; //造型数据
|
||||
private List<PointList> pointList; //点列表
|
||||
private List<OffSetList> offSetList; //偏移量列表 //模块偏移数据
|
||||
private PointList[] pointList; //点列表
|
||||
private OffSetList[] offSetList; //偏移量列表 //模块偏移数据
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
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
@@ -0,0 +1,23 @@
|
||||
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
@@ -0,0 +1,27 @@
|
||||
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
@@ -0,0 +1,30 @@
|
||||
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
@@ -0,0 +1,25 @@
|
||||
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
@@ -0,0 +1,26 @@
|
||||
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
@@ -0,0 +1,30 @@
|
||||
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
@@ -0,0 +1,18 @@
|
||||
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
@@ -0,0 +1,24 @@
|
||||
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
@@ -0,0 +1,23 @@
|
||||
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
@@ -0,0 +1,23 @@
|
||||
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
@@ -0,0 +1,29 @@
|
||||
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
@@ -0,0 +1,30 @@
|
||||
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
@@ -0,0 +1,65 @@
|
||||
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
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
+3
@@ -6,6 +6,7 @@ import com.alibaba.excel.exception.ExcelDataConvertException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -23,6 +24,7 @@ public final class ExcelListener<T> extends AnalysisEventListener<T> {
|
||||
private String value = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 每解析一行都会回调invoke()方法
|
||||
*
|
||||
@@ -64,6 +66,7 @@ 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));;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+24
-11
@@ -1,18 +1,21 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.executor.util.FileTypeChangeUtil;
|
||||
import com.cf.imes.module.executor.util.ZLibUtils;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import com.cf.imes.module.executor.util.deviseData.IBoardProdInfo;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.cf.imes.module.infra.api.file.FileApi;
|
||||
import com.cf.imes.module.infra.api.file.dto.FileCreateReqDTO;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -28,10 +31,18 @@ public class FileTypeChangeRealize implements FileTypeChangeUtil {
|
||||
private String valueErr = "";
|
||||
|
||||
private Boolean flag = true;
|
||||
|
||||
@Resource
|
||||
private FileApi fileApi;
|
||||
|
||||
@Resource
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
@Override
|
||||
public List<Detail> fileDataChange(MultipartFile file) throws IOException {
|
||||
List<Detail> details = new ArrayList<>();
|
||||
List<OrderPlateImportExcelVO> orderPlateImportExcelVOS = OrderExcelUtil.read(file, OrderPlateImportExcelVO.class);
|
||||
System.out.println(orderPlateImportExcelVOS);
|
||||
|
||||
if (orderPlateImportExcelVOS == null || orderPlateImportExcelVOS.isEmpty()) {
|
||||
return details;
|
||||
@@ -41,6 +52,11 @@ public class FileTypeChangeRealize implements FileTypeChangeUtil {
|
||||
|
||||
|
||||
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()
|
||||
@@ -55,6 +71,7 @@ public class FileTypeChangeRealize implements FileTypeChangeUtil {
|
||||
|
||||
}
|
||||
return details;
|
||||
// return null;
|
||||
}
|
||||
|
||||
private void handleOrderPlateImportExcelVO(OrderPlateImportExcelVO orderPlateImportExcelVO, StringBuilder value) {
|
||||
@@ -86,22 +103,18 @@ public class FileTypeChangeRealize implements FileTypeChangeUtil {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDataChangeToJson(List<Detail> detailList , Long orderId) throws JsonProcessingException {
|
||||
public void fileDataChangeToJson(List<Detail> detailList , Long orderId) throws IOException {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String detailListJson = objectMapper.writeValueAsString(detailList);
|
||||
// List<Detail> convertedDetailList = objectMapper.readValue(detailListJson, new TypeReference<List<Detail>>() {});
|
||||
byte[] jsonData = detailListJson.getBytes();
|
||||
|
||||
// 使用 Zlib 压缩算法进行压缩
|
||||
byte[] compressedData = ZLibUtils.compress(jsonData);
|
||||
|
||||
// 将压缩后的数据写入文件
|
||||
try (FileOutputStream fos = new FileOutputStream(orderId + ".zlib")) {
|
||||
fos.write(compressedData);
|
||||
System.out.println("Data compressed and saved to compressed_data.zlib");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO().setName(orderId + ".json")
|
||||
.setContent(compressedData);
|
||||
CommonResult<String> pathNew = fileApi.createFile(fileCreateReqDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-5
@@ -1,15 +1,15 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class OrderExcelUtil extends ExcelUtils {
|
||||
@Slf4j
|
||||
public class OrderExcelUtil{
|
||||
private static String value;
|
||||
|
||||
public static <T> List<T> read(MultipartFile file, Class<T> head) throws IOException {
|
||||
@@ -45,4 +45,5 @@ public class OrderExcelUtil extends ExcelUtils {
|
||||
err.put("readErr", value);
|
||||
return err;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-12
@@ -130,9 +130,13 @@ public class OrderPlateImportExcelVO {
|
||||
@JsonIgnore
|
||||
private BigDecimal sealDown;
|
||||
|
||||
@ExcelProperty(value = "组合类型")
|
||||
@ExcelProperty(value = "组合类型", converter = DictConvert.class)
|
||||
@JsonIgnore
|
||||
private String synthesis;
|
||||
@DictFormat(DictTypeConstants.SYNTHESIS_TYPE)
|
||||
private int synthesis;
|
||||
|
||||
@JsonIgnore
|
||||
private String synthesisTypeName;//组合类型的名称
|
||||
|
||||
@ExcelProperty(value = "组合名称")
|
||||
@JsonIgnore
|
||||
@@ -153,6 +157,10 @@ public class OrderPlateImportExcelVO {
|
||||
@DictFormat(DictTypeConstants.DOOR_OPENING_DIRECTIONS)
|
||||
private int openDoorType;
|
||||
|
||||
@ExcelProperty(value = "上传结果")
|
||||
@JsonIgnore
|
||||
private String result;
|
||||
|
||||
@ExcelProperty(value = "备注1")
|
||||
private String remark1;
|
||||
|
||||
@@ -185,10 +193,8 @@ public class OrderPlateImportExcelVO {
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
@JsonIgnore
|
||||
private String remark = remarkJSON();
|
||||
private String remark;
|
||||
|
||||
@JsonIgnore
|
||||
private Long id;//生产单Id
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isValidParts() {
|
||||
@@ -211,13 +217,6 @@ public class OrderPlateImportExcelVO {
|
||||
return value != null && !value.trim().isEmpty();
|
||||
}
|
||||
|
||||
private String isSynthesis(String value) {
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
return "柜体";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
//备注转json数据
|
||||
public String remarkJSON() {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
+10
@@ -6,4 +6,14 @@
|
||||
update `order_body` set plate_num = #{plateNum} where id = #{orderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAllByOrderId">
|
||||
DELETE order_parts, order_module_extra, order_plate, order_item, order_group, order_body
|
||||
FROM order_body
|
||||
LEFT JOIN order_group ON order_group.body_id = order_body.id
|
||||
LEFT JOIN order_item ON order_item.body_id = order_body.id
|
||||
LEFT JOIN order_plate ON order_plate.id = order_item.plate_id
|
||||
LEFT JOIN order_parts ON order_parts.id = order_item.parts_id
|
||||
LEFT JOIN order_module_extra ON order_module_extra.body_id = order_body.id
|
||||
WHERE order_body.id = #{bodyId} AND order_body.order_id = #{orderId};
|
||||
</delete>
|
||||
</mapper>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper">
|
||||
|
||||
<select id="selectExtraById" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO">
|
||||
SELECT id, order_id, organ_id, room_id, body_id, type, extra_data
|
||||
FROM order_module_extra
|
||||
WHERE id = #{id}
|
||||
<if test="orderId != null">
|
||||
AND order_id = #{orderId}
|
||||
</if>
|
||||
<if test="roomId != null">
|
||||
AND room_id = #{roomId}
|
||||
</if>
|
||||
<if test="bodyId != null">
|
||||
AND body_id = #{bodyId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.orderModuleExtra.OrderModuleExtraMapper">
|
||||
|
||||
<insert id="insertOne" parameterType="com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO">
|
||||
INSERT INTO order_module_extra (id, order_id, organ_id, room_id, body_id, type, extra_data)
|
||||
VALUES (#{orderModuleExtraDO.id}, #{orderModuleExtraDO.orderId}, #{orderModuleExtraDO.organId}, #{orderModuleExtraDO.roomId}, #{orderModuleExtraDO.bodyId}, #{orderModuleExtraDO.type}, #{orderModuleExtraDO.extraData})
|
||||
</insert>
|
||||
|
||||
<select id="selectExtraById" resultType="com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO">
|
||||
SELECT id, order_id, organ_id, room_id, body_id, type, extra_data
|
||||
FROM order_module_extra
|
||||
WHERE order_id = #{orderId}
|
||||
<if test="roomId != null">
|
||||
AND room_id = #{roomId}
|
||||
</if>
|
||||
<if test="bodyId != null">
|
||||
AND body_id = #{bodyId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper">
|
||||
|
||||
<select id="selectProductList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
|
||||
SELECT a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
|
||||
a.unit, a.price, a.is_composite, a.remark, b.num
|
||||
FROM order_parts a
|
||||
LEFT JOIN order_item b ON a.id = b.parts_id
|
||||
WHERE b.order_id = #{orderId}
|
||||
AND (#{roomId} IS NULL OR b.room_id = #{roomId})
|
||||
AND (#{bodyId} IS NULL OR b.body_id = #{bodyId})
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+14
@@ -40,4 +40,18 @@
|
||||
group by a.id
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectProductList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO">
|
||||
SELECT a.id, a.plate_no, a.height, a.thickness, a.width, a.name, a.area, a.seal_left, a.seal_right,
|
||||
a.seal_up, a.seal_down, a.texture, a.hole_face, a.hole_arrange, a.unregular_point_count, a.front_hole_count, a.back_hole_count,
|
||||
a.side_hole_count, a.front_model_count, a.back_model_count, a.remark, c.material, c.color
|
||||
FROM order_plate a
|
||||
LEFT JOIN order_goods c ON a.goods_id = c.goods_id AND a.order_id = c.order_id
|
||||
LEFT JOIN order_item b ON a.id = b.plate_id
|
||||
WHERE b.order_id = #{orderId}
|
||||
AND (#{roomId} IS NULL OR b.room_id = #{roomId})
|
||||
AND (#{bodyId} IS NULL OR b.body_id = #{bodyId})
|
||||
GROUP BY a.id, c.material, c.color;
|
||||
</select>
|
||||
</mapper>
|
||||
+2
-2
@@ -45,8 +45,8 @@ public class PlateImportExcelVO {
|
||||
@ExcelProperty("厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
// @ExcelProperty("价格")
|
||||
// private Double price;
|
||||
@ExcelProperty("价格")
|
||||
private Double price;
|
||||
|
||||
@ExcelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
+2
-2
@@ -38,8 +38,8 @@ public class PlatePageReqVO extends PageParam {
|
||||
@Schema(description = "厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
// @Schema(description = "价格", example = "3380")
|
||||
// private Double price;
|
||||
@Schema(description = "价格", example = "3380")
|
||||
private Double price;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
+3
-3
@@ -47,9 +47,9 @@ public class PlateRespVO {
|
||||
@ExcelProperty("厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
// @Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
|
||||
// @ExcelProperty("价格")
|
||||
// private Double price;
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
|
||||
@ExcelProperty("价格")
|
||||
private Double price;
|
||||
|
||||
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("品牌")
|
||||
|
||||
+3
-3
@@ -41,9 +41,9 @@ public class PlateSaveReqVO {
|
||||
@NotNull(message = "厚度不能为空")
|
||||
private BigDecimal thickness;
|
||||
|
||||
// @Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
|
||||
// @NotNull(message = "价格不能为空")
|
||||
// private Double price;
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
|
||||
@NotNull(message = "价格不能为空")
|
||||
private Double price;
|
||||
|
||||
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "品牌不能为空")
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class PlateDO extends BaseDO {
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
// private Double price;
|
||||
private Double price;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
.eqIfPresent(PlateDO::getBrand, reqVO.getBrand())
|
||||
.eqIfPresent(PlateDO::getSpec, reqVO.getSpec())
|
||||
.eqIfPresent(PlateDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
|
||||
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PlateDO::getId));
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.system.api.process;
|
||||
|
||||
import com.cf.imes.module.system.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 ProcessGroupApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/process-group";
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "工序组是否存在")
|
||||
@Parameter(name = "groupId", description = "工序组编号", required = true, example = "1024")
|
||||
Boolean getProcessGroup(@RequestParam("groupId") Long groupId);
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.system.api.process.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "RPC 服务 - ProcessGroup 工序 Response DTO")
|
||||
@Data
|
||||
public class ProcessListReqDTO {
|
||||
@Schema(description = "工序组 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10725")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工序组名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "是否默认工序组:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean isDefault;
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Short sort;
|
||||
|
||||
@Schema(description = "明细,工序 ID 逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String items;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "工序列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<ProcessRespDTO> lists;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user