mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
生产单管理更新还原等接口
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DataTypeEnum {
|
||||
|
||||
FILE_IMPORT(0, "文件导入"),
|
||||
API_IMPORT(1, "API导入"),
|
||||
SOURCE_IMPORT(2, "数据源导入");
|
||||
|
||||
private final Integer status;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.status .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(DataTypeEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.status .equals(this.getStatus()) ;
|
||||
}
|
||||
}
|
||||
+5
@@ -20,6 +20,10 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 生产单 TODO 补充编号 ==========
|
||||
ErrorCode ORDER_NOT_EXISTS = new ErrorCode(1_001_109_000, "生产单不存在");
|
||||
ErrorCode ORDER_IS_EMPTY = new ErrorCode(1_001_109_000, "生产单为空单,清空无效");
|
||||
ErrorCode ORDER_NOT_NEW_ORDER = new ErrorCode(1_001_109_000, "生产单不为新单,清空无效");
|
||||
ErrorCode ORDER_NOT_CANCEL = new ErrorCode(1_001_109_000, "生产单已排单,作废无效");
|
||||
ErrorCode ORDER_CANCEL = new ErrorCode(1_001_109_000, "生产单未作废,还原无效");
|
||||
|
||||
// ========== 生产单 TODO 补充编号 ==========
|
||||
ErrorCode MODULE_NOT_EXISTS = new ErrorCode(1_001_110_000, "模块不存在");
|
||||
@@ -62,4 +66,5 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode FILE_UPLOAD_ERR = new ErrorCode(1_002_029_012, "文件内容为空");
|
||||
|
||||
ErrorCode SOURCE_NOT_EXITS_ERROR = new ErrorCode(1_002_029_013, "源数据查询失败");
|
||||
ErrorCode ORDER_CAN_NOT_DELETE = new ErrorCode(1_002_029_013, "存在状态不符合强制删除的生产单,禁止删除");
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderDeletedEnum {
|
||||
|
||||
DELETED(1, "删除"),
|
||||
NOT_DELETED(0, "不删除");
|
||||
|
||||
private final Integer status;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.status .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(OrderDeletedEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.status .equals(this.getStatus()) ;
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderItemTypeEnum {
|
||||
|
||||
PLATE_ITEM(1, "板材明细"),
|
||||
PARTS_ITEM(2, "配件明细"),
|
||||
OTHER_ITEM(2, "其他明细");
|
||||
|
||||
private final Integer status;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.status .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(OrderItemTypeEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.status .equals(this.getStatus()) ;
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -6,10 +6,12 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderStatusEnum {
|
||||
EMPTY(0, "空生产单"),
|
||||
|
||||
EMPTY(0, "默认"),
|
||||
NEW_ORDER(1, "新单"),
|
||||
IN_PRODUCTION(2, "生产中"),
|
||||
FINISH_PRODUCTION(3, "生产完成");
|
||||
NO_SORT(2, "未排单"),
|
||||
IN_PRODUCTION(3, "生产中"),
|
||||
FINISH_PRODUCTION(4, "生产完成");
|
||||
|
||||
private final Integer status;
|
||||
private String description;
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderTypeEnum {
|
||||
|
||||
MAIN_ORDER(1, "主单"),
|
||||
SUBORDER(2, "子单");
|
||||
|
||||
private final Integer status;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.status .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(OrderTypeEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.status .equals(this.getStatus()) ;
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.executor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ProcessTypeEnum {
|
||||
|
||||
TYPE_ZERO(0, "全部加工"),
|
||||
TYPE_ONE(1, "开料"),
|
||||
TYPE_TWO(2, "部件加工"),
|
||||
TYPE_THREE(3, "异形封边"),
|
||||
TYPE_FOUR(4, "分堆"),
|
||||
TYPE_FIVE(5, "打包"),
|
||||
TYPE_SIX(6, "出库"),
|
||||
TYPE_SEVEN(7, "组件加工"),
|
||||
TYPE_EIGHT(8, "板材");
|
||||
|
||||
private final Integer status;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.status .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(ProcessTypeEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.status .equals(this.getStatus()) ;
|
||||
}
|
||||
}
|
||||
+46
-61
@@ -12,7 +12,6 @@ import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiTypeR
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelReadUtil;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -76,7 +75,6 @@ public class OrderController {
|
||||
@Resource
|
||||
private ApiTypeRealize apiTypeRealize;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OrderController.class);
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产单")
|
||||
@@ -93,12 +91,34 @@ public class OrderController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除(作废)生产单")
|
||||
@Parameter(name = "orderIds", description = "生产单id组", required = true, example = "1,2")
|
||||
// 删除柜体
|
||||
@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> deleteOrder(@RequestParam("orderIds") Collection<Long> orderIds) {
|
||||
orderService.deleteOrder(orderIds);
|
||||
public CommonResult<Boolean> deleteBody(@RequestParam("orderId") Long orderId, @RequestParam("bodyIds") Set<Long> bodyIds) {
|
||||
orderService.deleteBodyByOrder(orderId, bodyIds);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "作废")
|
||||
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:delete')")
|
||||
public CommonResult<Boolean> deleteOrder(@RequestParam("orderId") Long orderId) {
|
||||
orderService.deleteOrder(orderId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/restore")
|
||||
@Operation(summary = "还原")
|
||||
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:restore')")
|
||||
public CommonResult<Boolean> restoreOrder(@RequestParam("orderId") Long orderId) {
|
||||
orderService.restoreOrder(orderId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -126,16 +146,6 @@ public class OrderController {
|
||||
orderService.exportTemplate(response, value);
|
||||
}
|
||||
|
||||
// 清理生产单
|
||||
@GetMapping("/clean")
|
||||
@Operation(summary = "清理生产单")
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:delete')")
|
||||
public CommonResult<Boolean> cleanOrder(@RequestParam("orderId") Long orderId) {
|
||||
orderService.cleanOrder(orderId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-room")
|
||||
@Operation(summary = "生产单详情-房间和柜体id")
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
|
||||
@@ -160,14 +170,16 @@ public class OrderController {
|
||||
@Parameter(name = "orderId", description = "生产单编号", example = "1024"),
|
||||
@Parameter(name = "roomId", description = "房间编号", example = "1024"),
|
||||
@Parameter(name = "bodyId", description = "柜体编号", example = "1024"),
|
||||
@Parameter(name = "groupId", description = "加工组编号", example = "1024")
|
||||
@Parameter(name = "groupId", description = "加工组编号", example = "1024"),
|
||||
@Parameter(name = "groupName", description = "加工组名称", example = "弧形")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
public CommonResult<List<OrderPlatesDetailReqVO>> platesDetails(@RequestParam("orderId") Long orderId,
|
||||
@RequestParam(value = "roomId", required = false) Long roomId,
|
||||
@RequestParam(value = "bodyId", required = false) Long bodyId,
|
||||
@RequestParam(value = "groupId", required = false) Long groupId) {
|
||||
List<OrderPlatesDetailReqVO> moduleDOList = orderService.getPlatesDetail(orderId, roomId, bodyId,groupId);
|
||||
@RequestParam(value = "groupId", required = false) Long groupId,
|
||||
@RequestParam(value = "groupName", required = false) String groupName) {
|
||||
List<OrderPlatesDetailReqVO> moduleDOList = orderService.getPlatesDetail(orderId, roomId, bodyId,groupId,groupName);
|
||||
return success(moduleDOList);
|
||||
}
|
||||
|
||||
@@ -176,29 +188,18 @@ public class OrderController {
|
||||
@Parameters({
|
||||
@Parameter(name = "orderId", description = "生产单编号", example = "1024"),
|
||||
@Parameter(name = "roomId", description = "房间编号", example = "1024"),
|
||||
@Parameter(name = "bodyId", description = "柜体编号", example = "1024")
|
||||
@Parameter(name = "bodyId", description = "柜体编号", example = "1024"),
|
||||
@Parameter(name = "name", description = "配件名称", example = "1024")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
public CommonResult<List<OrderPartsRespVO>> partsDetails(@RequestParam("orderId") Long orderId,
|
||||
@RequestParam(value = "roomId", required = false) Long roomId,
|
||||
@RequestParam(value = "bodyId", required = false) Long bodyId) {
|
||||
List<OrderPartsRespVO> moduleDOList = orderService.getPartsDetail(orderId, roomId, bodyId);
|
||||
@RequestParam(value = "bodyId", required = false) Long bodyId,
|
||||
@RequestParam(value = "name", required = false) String name) {
|
||||
List<OrderPartsRespVO> moduleDOList = orderService.getPartsDetail(orderId, roomId, bodyId, name);
|
||||
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("/get-body")
|
||||
@Operation(summary = "生产单柜体数据获取")
|
||||
@@ -230,14 +231,8 @@ public class OrderController {
|
||||
dataGoods, // 商品信息
|
||||
plate, // 板件信息
|
||||
dataModule,// 加工组信息
|
||||
block); // 板材数据
|
||||
// System.out.println(" dataPlates" + dataPlates + "/n"
|
||||
// + " dataParts" + dataParts + "/n"
|
||||
// + " dataBody" + dataBody + "/n"
|
||||
// + " dataGoods" + dataGoods + "/n"
|
||||
// + " plate" + plate + "/n"
|
||||
// + " dataModule" + dataModule + "/n"
|
||||
// + " block" + block);
|
||||
block,// 板材数据
|
||||
orderNo); // 原始板编号
|
||||
return success(orderService.importApiData(listMap));
|
||||
}
|
||||
|
||||
@@ -302,26 +297,16 @@ public class OrderController {
|
||||
return success(orderService.importTemplate(file,type));
|
||||
}
|
||||
|
||||
@GetMapping("/printingZip")
|
||||
@Operation(summary = "打印/导出(多文件)")
|
||||
@Parameter(name = "type", description = "文件类型", required = true, example = "0")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void getOrderPrintingZip(@Valid OrderPageReqVO pageReqVO,
|
||||
@RequestParam("type") String type,
|
||||
HttpServletResponse response) throws IOException {
|
||||
orderService.getPrintDataZip(pageReqVO,type,response);
|
||||
}
|
||||
|
||||
@GetMapping("/printing")
|
||||
@Operation(summary = "打印/导出(单文件)")
|
||||
@Operation(summary = "打印/导出 数据文件")
|
||||
@Parameter(name = "type", description = "文件类型", required = true, example = "0")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:query')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void getOrderPrinting(
|
||||
// @RequestParam("orderId") Long orderId,
|
||||
@RequestParam("type") String type,
|
||||
HttpServletResponse response) throws IOException {
|
||||
orderService.getPrintData(1797937673478864896L,type,response);
|
||||
public CommonResult<Map<String, Object>> getOrderPrintData(
|
||||
@RequestParam("orderId") Long orderId,
|
||||
@RequestParam("type") String type,
|
||||
HttpServletResponse response) {
|
||||
|
||||
return success(orderService.getPrintDataMap(orderId,type,response));
|
||||
}
|
||||
}
|
||||
+1
@@ -76,6 +76,7 @@ public class OrderPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "是否作废", example = "0")
|
||||
private Boolean deleted;
|
||||
|
||||
private Long organId;
|
||||
|
||||
+2
-4
@@ -15,8 +15,7 @@ public class OrderSaveReqVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "父单号不能为空,无父单时为0")
|
||||
@Schema(description = "父单号")
|
||||
private Long parentNo;
|
||||
|
||||
@Schema(description = "生产单日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -27,8 +26,7 @@ public class OrderSaveReqVO {
|
||||
@NotNull(message = "交付日期不能为空")
|
||||
private LocalDateTime deliveryDate;
|
||||
|
||||
@Schema(description = "生产单类型,1主单 2子单", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "生产单类型,1主单 2子单不能为空")
|
||||
@Schema(description = "生产单类型,1主单 2子单", example = "1")
|
||||
private Boolean orderType;
|
||||
|
||||
@Schema(description = "生产单排序号")
|
||||
|
||||
-2
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
@@ -10,7 +9,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.*;
|
||||
|
||||
+3
-2
@@ -98,7 +98,7 @@ public class PlateController {
|
||||
// 批量删除小板
|
||||
@DeleteMapping("deletePlenty")
|
||||
@Operation(summary = "批量删除小板")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:deletePlenty')")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:delete')")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deletePlates(@RequestBody Set<Long> ids) {
|
||||
plateService.deletePlates(ids);
|
||||
@@ -108,7 +108,7 @@ public class PlateController {
|
||||
// 批量查询有生产单号id、房间id,柜体id的板材
|
||||
@GetMapping("getPlatesByOrderId")
|
||||
@Operation(summary = "批量查询有生产单号id、房间id,柜体id的板材")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:getPlatesByOrderId')")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:query')")
|
||||
public CommonResult<PageResult<PlateRespVO>> getPlatesByOrderId(@Valid PlateTermsPageReqVO pageVO) {
|
||||
return success(plateService.getPlatePageByTerms(pageVO));
|
||||
}
|
||||
@@ -116,6 +116,7 @@ public class PlateController {
|
||||
@GetMapping("/getPlateModelByBodyId")
|
||||
@Operation(summary = "根据柜体id列表查询小板的造型")
|
||||
@Parameter(name = "bodyIds", description = "柜体id列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:query')")
|
||||
public CommonResult<List<BodyPlateDetailVO>> getPlateModelByPlateId(@Valid @RequestParam @NotEmpty List<Long> bodyIds) {
|
||||
return success(plateService.getPlateModelByPlateId(bodyIds));
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class ProcessStepPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "完成时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class ProcessStepRespVO {
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产单号")
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("完成时间")
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ public class ProcessStepSaveReqVO {
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号不能为空")
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "完成时间不能为空")
|
||||
|
||||
+4
@@ -89,5 +89,9 @@ public class GoodsDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+2
-2
@@ -11,7 +11,7 @@ import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_module_item_n")
|
||||
@TableName("order_module_item")
|
||||
@KeySequence("order_module_item_n_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -32,7 +32,7 @@ public class ModuleItemDO extends BaseDO {
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
/**
|
||||
* 房间 ID
|
||||
*/
|
||||
|
||||
+4
-1
@@ -78,5 +78,8 @@ public class OrderBodyDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
}
|
||||
+4
@@ -82,5 +82,9 @@ public class OrderGroupDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+4
-5
@@ -1,11 +1,6 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.orderParts;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.type.JsonLongSetTypeHandler;
|
||||
import com.cf.imes.framework.organ.core.db.OrganBaseDO;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
@@ -83,5 +78,9 @@ public class OrderPartsDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+4
@@ -186,5 +186,9 @@ public class PlateDO extends BaseDO {
|
||||
* 是否作废
|
||||
*/
|
||||
private Boolean isCancel;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+4
@@ -55,5 +55,9 @@ public class OrderProcessDO extends BaseDO {
|
||||
* 下一工序 ID
|
||||
*/
|
||||
private Long nextStepId;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+4
@@ -90,5 +90,9 @@ public class ProcessStepDO extends BaseDO {
|
||||
* 工序处理日期
|
||||
*/
|
||||
private LocalDateTime processDate;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+4
@@ -71,5 +71,9 @@ public class RawGoodsDO extends BaseDO {
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
+13
@@ -2,11 +2,13 @@ package com.cf.imes.module.executor.dal.mysql.goods;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.controller.admin.plan.vo.GoodsReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -44,4 +46,15 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
|
||||
List<GoodsReqVO> selectGoodsListByOrderIds(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
|
||||
// 单个修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<GoodsDO> wrapper = new LambdaUpdateWrapper<GoodsDO>()
|
||||
.set(GoodsDO::getDeleted, deleted)
|
||||
.eq(GoodsDO::getOrderId, id)
|
||||
.eq(GoodsDO::getOrganId, organId);
|
||||
if (deleted == 0)
|
||||
wrapper.eq(GoodsDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
}
|
||||
+27
-49
@@ -11,11 +11,10 @@ import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -46,8 +45,8 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
.eqIfPresent(OrderDO::getSalesman, reqVO.getSalesman())
|
||||
.eqIfPresent(OrderDO::getSplitter, reqVO.getSplitter())
|
||||
.eqIfPresent(OrderDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(OrderDO::getDeleted, 0)
|
||||
.eqIfPresent(OrderDO::getOrganId, reqVO.getOrganId())
|
||||
.eqIfPresent(OrderDO::getDeleted, reqVO.getDeleted())
|
||||
.betweenIfPresent(OrderDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(OrderDO::getId));
|
||||
}
|
||||
@@ -55,58 +54,18 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
|
||||
IPage<OrderRespVOCopy> selectOrderPage(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
|
||||
default List<OrderDO> selectOrderCheck(OrderPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<OrderDO> wrapper = new MPJLambdaWrapper<OrderDO>()
|
||||
.eqIfExists(OrderDO::getParentNo, reqVO.getParentNo())
|
||||
.eqIfExists(OrderDO::getOrderType, reqVO.getOrderType())
|
||||
.eqIfExists(OrderDO::getOrderSort, reqVO.getOrderSort())
|
||||
.eqIfExists(OrderDO::getDataType, reqVO.getDataType())
|
||||
.eqIfExists(OrderDO::getStatus, reqVO.getStatus())
|
||||
.eqIfExists(OrderDO::getCustomOrderNo, reqVO.getCustomOrderNo())
|
||||
.eqIfExists(OrderDO::getCustomer, reqVO.getCustomer())
|
||||
.eqIfExists(OrderDO::getAddress, reqVO.getAddress())
|
||||
.eqIfExists(OrderDO::getPhoneNumber, reqVO.getPhoneNumber())
|
||||
.eqIfExists(OrderDO::getDealer, reqVO.getDealer())
|
||||
.eqIfExists(OrderDO::getDealerPhoneNumber, reqVO.getDealerPhoneNumber())
|
||||
.eqIfExists(OrderDO::getSalesman, reqVO.getSalesman())
|
||||
.eqIfExists(OrderDO::getSplitter, reqVO.getSplitter())
|
||||
.eqIfExists(OrderDO::getRemark, reqVO.getRemark())
|
||||
.eqIfExists(OrderDO::getDeleted, reqVO.getDeleted())
|
||||
.orderByDesc(OrderDO::getId);
|
||||
if (reqVO.getDeliveryDate() != null && reqVO.getDeliveryDate().length == 2) {
|
||||
LocalDateTime startTime = reqVO.getDeliveryDate()[0];
|
||||
LocalDateTime endTime = reqVO.getDeliveryDate()[1];
|
||||
|
||||
if (startTime != null) {
|
||||
wrapper.between(OrderDO::getDeliveryDate, startTime, endTime);
|
||||
}
|
||||
}
|
||||
if (reqVO.getCreateTime() != null && reqVO.getCreateTime().length == 2) {
|
||||
LocalDateTime startTime = reqVO.getCreateTime()[0];
|
||||
LocalDateTime endTime = reqVO.getCreateTime()[1];
|
||||
|
||||
if (startTime != null) {
|
||||
wrapper.between(OrderDO::getCreateTime, startTime, endTime);
|
||||
}
|
||||
}
|
||||
return selectList(wrapper);
|
||||
}
|
||||
|
||||
Map<String, Object> selectDynamicSqlString(@Param("sqlStr") String sqlStr);
|
||||
|
||||
default Long selectCountByOrderNo(@Param("CustomOrderNo") String CustomOrderNo) {
|
||||
return selectCount(new LambdaQueryWrapper<OrderDO>().eq(OrderDO::getCustomOrderNo, CustomOrderNo));
|
||||
}
|
||||
|
||||
// 条件查找生产单
|
||||
// 查找生产单
|
||||
default List<OrderDO> selectOrder(Long id,Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<OrderDO>()
|
||||
.eqIfPresent(OrderDO::getId, id)
|
||||
.eqIfPresent(OrderDO::getOrganId, organId)
|
||||
.eq(OrderDO::getDeleted, 0));
|
||||
.eqIfPresent(OrderDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
// 修改生产单状态
|
||||
// 修改生产单状态 单个
|
||||
default int updateOrderStatus(Long id, Integer status,Long organId) {
|
||||
return update(new LambdaUpdateWrapper<OrderDO>()
|
||||
.set(OrderDO::getStatus, status)
|
||||
@@ -114,13 +73,32 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
.eq(OrderDO::getDeleted, 0)
|
||||
.eq(OrderDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
// 查询单个生产单
|
||||
default OrderDO selectOrderOne(Long id,Long organId) {
|
||||
return selectOne(new LambdaQueryWrapper<OrderDO>()
|
||||
.select(OrderDO::getStatus)
|
||||
.eq(OrderDO::getId, id)
|
||||
.eq(OrderDO::getDeleted, 0)
|
||||
.eq(OrderDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
// 删除状态为条件,查询生产单
|
||||
default OrderDO selectOrderOne(Long id,Long organId,Integer deleted) {
|
||||
return selectOne(new LambdaQueryWrapper<OrderDO>()
|
||||
.eq(OrderDO::getId, id)
|
||||
.eq(OrderDO::getOrganId, organId)
|
||||
.eq(OrderDO::getDeleted, deleted));
|
||||
}
|
||||
// 批量查询生产单
|
||||
default List<OrderDO> selectOrderList(Collection<Long> ids, Long organId) {
|
||||
return selectList(new LambdaQueryWrapper<OrderDO>()
|
||||
.in(OrderDO::getId, ids)
|
||||
.eq(OrderDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
// 修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted,Long organId) {
|
||||
return update(new LambdaUpdateWrapper<OrderDO>()
|
||||
.set(OrderDO::getDeleted, deleted)
|
||||
.eq(OrderDO::getId, id)
|
||||
.eq(OrderDO::getOrganId, organId));
|
||||
}
|
||||
}
|
||||
|
||||
+38
-1
@@ -1,12 +1,18 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.orderBody;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderModuleRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -21,7 +27,38 @@ public interface OrderBodyMapper extends BaseMapperX<OrderBodyDO> {
|
||||
|
||||
int deleteAllByOrderId(@Param("orderId") Long orderId, @Param("bodyId") Long bodyId);
|
||||
|
||||
List<OrderModuleRespVO> selectModuleByOrderId(@Param("orderId") Long orderId);
|
||||
List<OrderModuleRespVO> selectModuleByOrderId(@Param("orderId") Long orderId,
|
||||
@Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
|
||||
List<OrderBodyDO> getOrderBodyByOrderId(@Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||
|
||||
// 单个修改删除状态 by orderID
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<OrderBodyDO> wrapper = new LambdaUpdateWrapper<OrderBodyDO>()
|
||||
.set(OrderBodyDO::getDeleted, deleted)
|
||||
.eq(OrderBodyDO::getOrderId, id)
|
||||
.eq(OrderBodyDO::getOrganId, organId);
|
||||
|
||||
if (deleted == 0)
|
||||
wrapper.eq(OrderBodyDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
|
||||
// 单个修改删除状态 by id
|
||||
default int updateDeletedById(Long id, Integer deleted, Long organId) {
|
||||
return update(new LambdaUpdateWrapper<OrderBodyDO>()
|
||||
.set(OrderBodyDO::getDeleted, deleted)
|
||||
.eq(OrderBodyDO::getId, id)
|
||||
.eq(OrderBodyDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
// 控制是否删除,进行查询
|
||||
default List<OrderBodyDO> selectList(Long orderId, Integer deleted, Long organId) {
|
||||
return selectList(new LambdaUpdateWrapper<OrderBodyDO>()
|
||||
.eq(OrderBodyDO::getOrderId, orderId)
|
||||
.eq(OrderBodyDO::getDeleted, deleted)
|
||||
.eq(OrderBodyDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
}
|
||||
+22
@@ -1,11 +1,15 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.orderGroup;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -21,4 +25,22 @@ public interface OrderGroupMapper extends BaseMapperX<OrderGroupDO> {
|
||||
// 生产单中包含的加工组
|
||||
List<OrderGroupDO> getOrderGroupByOrderId(@Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||
|
||||
// 单个修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<OrderGroupDO> wrapper = new LambdaUpdateWrapper<OrderGroupDO>()
|
||||
.set(OrderGroupDO::getDeleted, deleted)
|
||||
.eq(OrderGroupDO::getId, id)
|
||||
.eq(OrderGroupDO::getOrganId, organId);
|
||||
if (deleted == 0)
|
||||
wrapper.eq(OrderGroupDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
|
||||
// 单个修改删除状态 by bodyId
|
||||
default int updateDeletedById(Long id, Integer deleted, Long organId) {
|
||||
return update(new LambdaUpdateWrapper<OrderGroupDO>()
|
||||
.set(OrderGroupDO::getDeleted, deleted)
|
||||
.eq(OrderGroupDO::getBodyId, id)
|
||||
.eq(OrderGroupDO::getOrganId, organId));
|
||||
}
|
||||
}
|
||||
+10
-3
@@ -26,12 +26,19 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
|
||||
List<PlateRespVO> selectPlatesDetailByOrderId(@Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId , @Param("groupId")Long groupId);
|
||||
List<PlateRespVO> selectPlatesDetailByOrderId(@Param("orderId")Long orderId, @Param("roomId")Long roomId ,
|
||||
@Param("bodyId")Long bodyId , @Param("groupId")Long groupId ,
|
||||
@Param("groupName")String groupName, @Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
|
||||
List<OrderPartsRespVO> selectPartsDetailByOrderId(@Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId );
|
||||
List<OrderPartsRespVO> selectPartsDetailByOrderId(@Param("orderId")Long orderId, @Param("roomId")Long roomId ,
|
||||
@Param("bodyId")Long bodyId , @Param("name")String name,
|
||||
@Param("organId") Long organId, @Param("deleted") Integer deleted);
|
||||
|
||||
|
||||
List<OrderPlatesDetailRespVO> selectPartsByOrderId(@Param("orderId") Long orderId);
|
||||
List<OrderPlatesDetailRespVO> selectPartsByOrderId(@Param("orderId") Long orderId,
|
||||
@Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
|
||||
|
||||
List<PlateRespVO> selectPlateList(PlateDetailReqVO reqVO);
|
||||
|
||||
+16
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.dal.mysql.orderParts;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -10,6 +11,7 @@ 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.PlateGoodsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
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.*;
|
||||
@@ -65,4 +67,18 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
|
||||
List<PartGoodsRespVO> selectPartDetail(@Param("orderId") Long orderId, @Param("organId") Long organId);// 配件明细
|
||||
|
||||
List<PartGoodsRespVO> selectPartAll(@Param("orderId") Long orderId, @Param("organId") Long organId);// 配件汇总
|
||||
|
||||
|
||||
// 单个修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<OrderPartsDO> wrapper = new LambdaUpdateWrapper<OrderPartsDO>()
|
||||
.set(OrderPartsDO::getDeleted, deleted)
|
||||
.eq(OrderPartsDO::getOrderId, id)
|
||||
.eq(OrderPartsDO::getOrganId, organId);
|
||||
if (deleted == 0)
|
||||
wrapper.eq(OrderPartsDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
|
||||
void updateDeletedById(@Param("bodyId") Long bodyId, @Param("deleted") Integer deleted, @Param("organId") Long organId);
|
||||
}
|
||||
+9
@@ -1,6 +1,8 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.plate;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -12,5 +14,12 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface PlateGoodMapper extends BaseMapperX<PlateGoodDO> {
|
||||
|
||||
// 查询单个生产单中信息
|
||||
default PlateGoodDO selectGoodOne(Long id, Long organId) {
|
||||
return selectOne(new LambdaQueryWrapper<PlateGoodDO>()
|
||||
.eq(PlateGoodDO::getGoodsId, id)
|
||||
.eq(PlateGoodDO::getDeleted, 0)
|
||||
.eq(PlateGoodDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-18
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.dal.mysql.plate;
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
@@ -11,6 +12,8 @@ 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.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
@@ -69,23 +72,6 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
|
||||
List<PlateParam> selectPlateList(Long planId);
|
||||
|
||||
default PlateImportRespVO importPlateList(List<PlateSaveReqVO> importPlates , Long orderId) {
|
||||
PlateImportRespVO respVO = PlateImportRespVO.builder().createPlates(new ArrayList<PlateSaveReqVO>())
|
||||
.updatePlates(new ArrayList<>()).failurePlates(new LinkedHashMap<>()).build();
|
||||
importPlates.forEach(plateSaveReqVO -> {
|
||||
try {
|
||||
PlateDO plateDO = BeanUtils.toBean(plateSaveReqVO, PlateDO.class).setOrderId(orderId);
|
||||
insert(plateDO);
|
||||
plateSaveReqVO.setId(plateDO.getId());
|
||||
respVO.getCreatePlates().add(plateSaveReqVO);
|
||||
} catch (ServiceException ex) {
|
||||
respVO.getFailurePlates().put(plateSaveReqVO.getName(), ex.getMessage());
|
||||
}
|
||||
});
|
||||
System.err.println("PlateImportRespVO " + respVO);
|
||||
return respVO;
|
||||
}
|
||||
|
||||
IPage<PlateRespVO> selectProductList(@Param("page") IPage<PlateRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId);
|
||||
|
||||
Set<Long> selectBatchOrderIdsAndGoodsIds(@Param("itemList") List<PlanSaveReqVO.Item> itemList);
|
||||
@@ -98,6 +84,21 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
List<PlateDetialRespVO> selectPlateDetialListByIds(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
|
||||
List<PlateGoodsRespVO> selectPlateGoodsList(@Param("orderId") Long orderId, @Param("organId") Long organId); // 明细
|
||||
|
||||
List<PlateGoodsRespVO> selectPlateGoodsList(@Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||
List<PlateGoodsRespVO> selectPlateGoodsListSummary(@Param("orderId") Long orderId, @Param("organId") Long organId); // 汇总
|
||||
|
||||
|
||||
// 单个修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<PlateDO> wrapper = new LambdaUpdateWrapper<PlateDO>()
|
||||
.set(PlateDO::getDeleted, deleted)
|
||||
.eq(PlateDO::getOrderId, id)
|
||||
.eq(PlateDO::getOrganId, organId);
|
||||
if (deleted == 0)
|
||||
wrapper.eq(PlateDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
|
||||
void updateDeletedById(@Param("bodyId") Long bodyId, @Param("deleted") Integer deleted, @Param("organId") Long organId);
|
||||
}
|
||||
+16
-1
@@ -1,11 +1,14 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.process;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.process.OrderProcessDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 生产单工序 Mapper
|
||||
*
|
||||
@@ -21,4 +24,16 @@ public interface OrderProcessMapper extends BaseMapperX<OrderProcessDO> {
|
||||
.eq(OrderProcessDO::getOrganId, organId)
|
||||
.eq(OrderProcessDO::getDeleted, 0)) > 0;
|
||||
}
|
||||
|
||||
// 批量修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<OrderProcessDO> wrapper = new LambdaUpdateWrapper<OrderProcessDO>()
|
||||
.set(OrderProcessDO::getDeleted, deleted)
|
||||
.eq(OrderProcessDO::getOrderId, id)
|
||||
.eq(OrderProcessDO::getOrganId, organId);
|
||||
|
||||
if (deleted == 0)
|
||||
wrapper.eq(OrderProcessDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
}
|
||||
+14
-1
@@ -2,9 +2,11 @@ package com.cf.imes.module.executor.dal.mysql.processStep;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.process.OrderProcessDO;
|
||||
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.*;
|
||||
@@ -19,7 +21,7 @@ public interface ProcessStepMapper extends BaseMapperX<ProcessStepDO> {
|
||||
|
||||
default PageResult<ProcessStepDO> selectPage(ProcessStepPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessStepDO>()
|
||||
.eqIfPresent(ProcessStepDO::getOrderId, reqVO.getOrderNo())
|
||||
.eqIfPresent(ProcessStepDO::getOrderId, reqVO.getOrderId())
|
||||
.betweenIfPresent(ProcessStepDO::getFinishTime, reqVO.getFinishTime())
|
||||
.eqIfPresent(ProcessStepDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ProcessStepDO::getType, reqVO.getType())
|
||||
@@ -37,4 +39,15 @@ public interface ProcessStepMapper extends BaseMapperX<ProcessStepDO> {
|
||||
.orderByDesc(ProcessStepDO::getId));
|
||||
}
|
||||
|
||||
|
||||
// 批量修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<ProcessStepDO> wrapper = new LambdaUpdateWrapper<ProcessStepDO>()
|
||||
.set(ProcessStepDO::getDeleted, deleted)
|
||||
.eq(ProcessStepDO::getOrderId, id)
|
||||
.eq(ProcessStepDO::getOrganId, organId);
|
||||
if (deleted == 0)
|
||||
wrapper.eq(ProcessStepDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
}
|
||||
+11
-15
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.dal.mysql.rawgoods;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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;
|
||||
@@ -9,6 +10,7 @@ import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
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.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -35,21 +37,15 @@ public interface RawGoodsMapper extends BaseMapperX<RawGoodsDO> {
|
||||
.orderByDesc(RawGoodsDO::getId));
|
||||
}
|
||||
|
||||
default RawGoodsImportRespVO importRawGoodsList(List<RawGoodsSaveReqVO> importRawGoods) {
|
||||
RawGoodsImportRespVO respVO = RawGoodsImportRespVO.builder().createRawGoods(new ArrayList<>())
|
||||
.updateRawGoods(new ArrayList<>()).failureRawGoods(new LinkedHashMap<>()).build();
|
||||
importRawGoods.forEach(rawGoodsSaveReqVO -> {
|
||||
try{
|
||||
insert(BeanUtils.toBean(rawGoodsSaveReqVO, RawGoodsDO.class));
|
||||
Long id = rawGoodsSaveReqVO.getId();
|
||||
respVO.getCreateRawGoods().add(rawGoodsSaveReqVO.getGoodsName());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
respVO.getFailureRawGoods().put(rawGoodsSaveReqVO.getGoodsName(), e.getMessage());
|
||||
}
|
||||
|
||||
});
|
||||
System.err.println("RawGoodsImportRespVO " + respVO);
|
||||
return respVO;
|
||||
// 单个修改删除状态
|
||||
default int updateOrderDeleted(Long id, Integer deleted, Long organId) {
|
||||
LambdaUpdateWrapper<RawGoodsDO> wrapper = new LambdaUpdateWrapper<RawGoodsDO>()
|
||||
.set(RawGoodsDO::getDeleted, deleted)
|
||||
.eq(RawGoodsDO::getOrderId, id)
|
||||
.eq(RawGoodsDO::getOrganId, organId);
|
||||
if (deleted == 0)
|
||||
wrapper.eq(RawGoodsDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
}
|
||||
+10
-3
@@ -1,13 +1,16 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.remainplaten;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.OptimizeRemainPlate;
|
||||
import com.cf.imes.module.executor.controller.admin.remainplate.vo.RemainPlatePageReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.processStep.ProcessStepDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.remainplaten.RemainPlateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@@ -36,14 +39,18 @@ public interface RemainPlateMapper extends BaseMapperX<RemainPlateDO> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default List<RemainPlateDO> selectByPlanId(Long planId, Long userOrganId) {
|
||||
return selectList( new LambdaQueryWrapperX<RemainPlateDO>()
|
||||
.eq(RemainPlateDO::getPlanId, planId)
|
||||
.eq(RemainPlateDO::getOrganId, userOrganId));
|
||||
}
|
||||
|
||||
|
||||
// 批量修改删除状态
|
||||
default int updateOrderDeleted(Collection<Long> ids, Integer deleted, Long organId) {
|
||||
return update(new LambdaUpdateWrapper<RemainPlateDO>()
|
||||
.set(RemainPlateDO::getDeleted, deleted)
|
||||
.in(RemainPlateDO::getId, ids)
|
||||
.eq(RemainPlateDO::getOrganId, organId));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ public class OrderInputProcessor {
|
||||
* @param orderModuleExtraDOS
|
||||
* @param itemDOS
|
||||
*/
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long batchInsert(Collection<RawGoodsDO> rawGoodsDOS, Collection<OrderBodyDO> orderBodyDOS,
|
||||
Collection<OrderGroupDO> orderGroupDOS, Collection<OrderPartsDO> orderPartsDOS,
|
||||
Collection<PlateDO> plateDOS, Collection<OrderModuleExtraDO> orderModuleExtraDOS,
|
||||
|
||||
+14
-25
@@ -45,11 +45,18 @@ public interface OrderService {
|
||||
void updateOrder(@Valid OrderSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生产单表 order_{N}
|
||||
* 作废生产单表 order_{N}
|
||||
*
|
||||
* @param orderIds 编号组
|
||||
* @param orderId 编号组
|
||||
*/
|
||||
void deleteOrder(Collection<Long> orderIds);
|
||||
void deleteOrder(Long orderId);
|
||||
|
||||
/**
|
||||
* 还原生产单表 order_{N}
|
||||
*
|
||||
* @param orderId 编号组
|
||||
*/
|
||||
void restoreOrder(Long orderId);
|
||||
|
||||
/**
|
||||
* 获得生产单表 order_{N}
|
||||
@@ -57,7 +64,7 @@ public interface OrderService {
|
||||
* @param id 编号
|
||||
* @return 生产单表 order_{N}
|
||||
*/
|
||||
OrderDO getOrder(Long id);
|
||||
OrderDO getOrder(Long id );
|
||||
|
||||
/**
|
||||
* 获得生产单表 order_{N}分页
|
||||
@@ -67,19 +74,6 @@ public interface OrderService {
|
||||
*/
|
||||
PageResult<OrderDO> getOrderPage(OrderPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 清除生产单表 order_{N}
|
||||
* 清除还没有清除生产单与工序相关、生产单与模块相关、生产单与包裹、余料、补板、相关
|
||||
* @param orderId 编号
|
||||
*/
|
||||
void cleanOrder(Long orderId);
|
||||
|
||||
/**
|
||||
* @param pageReqVO: 查询信息
|
||||
* @return List<OrderDO>
|
||||
*/
|
||||
List<OrderDO> getAllOrderCheck(OrderPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单Id
|
||||
* @return List<OrderBodyRespVO>
|
||||
@@ -99,7 +93,7 @@ public interface OrderService {
|
||||
* @return List<OrderPlatesDetailReqVO>
|
||||
* 需要修改返回值
|
||||
*/
|
||||
List<OrderPlatesDetailReqVO> getPlatesDetail(Long orderId, Long roomId , Long bodyId , Long groupId);
|
||||
List<OrderPlatesDetailReqVO> getPlatesDetail(Long orderId, Long roomId , Long bodyId , Long groupId, String groupName);
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单id
|
||||
@@ -108,7 +102,7 @@ public interface OrderService {
|
||||
* @return List<OrderPartsRespVO>
|
||||
* 需要修改返回值
|
||||
*/
|
||||
List<OrderPartsRespVO> getPartsDetail(Long orderId, Long roomId , Long bodyId);
|
||||
List<OrderPartsRespVO> getPartsDetail(Long orderId, Long roomId , Long bodyId , String name);
|
||||
|
||||
/**
|
||||
* 删除柜体
|
||||
@@ -154,15 +148,10 @@ public interface OrderService {
|
||||
*/
|
||||
void exportTemplate(HttpServletResponse response, String value);
|
||||
|
||||
/**
|
||||
* 打印/导出数据获取 (多文件)
|
||||
*/
|
||||
void getPrintDataZip(OrderPageReqVO orderPageReqVO, String type,HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 打印/导出数据获取 (单文件)
|
||||
*/
|
||||
void getPrintData(Long orderId, String type,HttpServletResponse response) throws IOException;
|
||||
Map<String, Object> getPrintDataMap(Long orderId, String type,HttpServletResponse response) ;
|
||||
|
||||
default String getSavePath() {
|
||||
ApplicationHome applicationHome = new ApplicationHome(this.getClass());
|
||||
|
||||
+132
-239
File diff suppressed because one or more lines are too long
+11
-10
@@ -11,6 +11,8 @@ 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.processStep.ProcessStepMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.processStepItem.ProcessStepItemMapper;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
import com.cf.imes.module.executor.enums.ProcessTypeEnum;
|
||||
import com.cf.imes.module.system.api.process.ProcessGroupApi;
|
||||
import com.cf.imes.module.system.api.process.dto.ProcessListReqDTO;
|
||||
import com.cf.imes.module.system.api.process.dto.ProcessRespDTO;
|
||||
@@ -68,8 +70,10 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
@Resource
|
||||
private OrderBodyMapper orderBodyMapper;
|
||||
|
||||
private static Integer INDEX = 0;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createOrderProcess(OrderProcessSaveReqVO createReqVO) {
|
||||
// 当生产不为删除时,校验生产单存在
|
||||
if (orderMapper.selectOrder(createReqVO.getOrderId(), SecurityFrameworkUtils.getLoginUser().getOrganId()).isEmpty()) {
|
||||
@@ -93,15 +97,14 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
// 需要获取工序组的具体信息,以及工序组中工序的信息,然后将工序组中工序的信息插入到生产单工序步骤表中
|
||||
ProcessListReqDTO processListReqDTO = processGroupApi.getProcessGroupDetail(createReqVO.getGroupId());
|
||||
|
||||
|
||||
processListReqDTO.getLists().forEach(processRespDTO -> {
|
||||
Long processStepDOId = (Long) identifierGenerator.nextId(null);
|
||||
ProcessStepDO processStepDO = BeanUtils.toBean(processRespDTO, ProcessStepDO.class).setId(processStepDOId).setOrderId(createReqVO.getOrderId())
|
||||
.setStatus(false).setProcessinfoId(processRespDTO.getId()).setOrderProcessId(orderProcess.getId())
|
||||
// .setId((Long) identifierGenerator.nextId(null)).setScheduleDate(LocalDateTime.now()).setProcessDate(LocalDateTime.now()).setFinishTime(LocalDateTime.now())
|
||||
;// 计划日期没有填写
|
||||
.setStatus(false).setProcessinfoId(processRespDTO.getId()).setOrderProcessId(orderProcess.getId()).setFinishTime(null).setSort(INDEX++);// 计划日期没有填写
|
||||
processStepDOS.add(processStepDO);
|
||||
// 生产单中是否存在加工组,若存在加工组,需要逐条加工组信息写入到生产单工序步骤表
|
||||
if (processRespDTO.getType() == 7) {
|
||||
if (processRespDTO.getType() == ProcessTypeEnum.TYPE_SEVEN.getStatus()) {
|
||||
List<OrderGroupDO> orderGroupDOS = orderGroupMapper.getOrderGroupByOrderId(createReqVO.getOrderId(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
if (orderGroupDOS.size() != 0) { // 有加工组
|
||||
for (int i = 0; i < orderGroupDOS.size(); i++) {
|
||||
@@ -113,7 +116,6 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
.groupName(processListReqDTO.getName())
|
||||
.bodyId(orderGroupDOS.get(i).getBodyId())
|
||||
.groupId(orderGroupDOS.get(i).getId())
|
||||
// .dataId(0L)
|
||||
.build();// 查模块id,柜体id,加工组id
|
||||
orderProcessStepItemDOS.add(orderProcessStepItemDO);
|
||||
}
|
||||
@@ -126,18 +128,17 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
.processStepId(processStepDOId)
|
||||
.orderProcessId(orderProcessId)
|
||||
.status(false)
|
||||
.groupName(processListReqDTO.getName())
|
||||
.groupName(orderBodyDOS.get(i).getName())
|
||||
.bodyId(orderBodyDOS.get(i).getId())
|
||||
.groupId(0L)
|
||||
// .dataId(0L)
|
||||
.build();// 查模块id,柜体id,加工组id
|
||||
orderProcessStepItemDOS.add(orderProcessStepItemDO);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
INDEX = 0;
|
||||
// 修改生产单的状态
|
||||
orderMapper.updateOrderStatus(createReqVO.getOrderId(), 2, SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
orderMapper.updateOrderStatus(createReqVO.getOrderId(), OrderStatusEnum.NO_SORT.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
// 批量插入
|
||||
orderProcessMapper.insert(orderProcess.setNextStepId(processListReqDTO.getLists().get(0).getId()).setStatus(false));
|
||||
processStepMapper.insertBatch(processStepDOS);
|
||||
|
||||
+41
-33
@@ -11,6 +11,7 @@ import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
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.enums.*;
|
||||
import com.cf.imes.module.executor.util.deviseData.dataTwo.*;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -41,6 +42,10 @@ public class ApiTypeRealize {
|
||||
|
||||
private Integer groupNum = 0;
|
||||
|
||||
private final static Integer X = 0;
|
||||
private final static Integer Y = 1;
|
||||
private final static Integer Z = 2;
|
||||
|
||||
/**
|
||||
* @param dataPlates: 板件生产信息
|
||||
* @param dataParts: 配件信息
|
||||
@@ -55,7 +60,7 @@ public class ApiTypeRealize {
|
||||
public Map<String, List<?>> apiPlateDataChange(JSONObject dataPlates, JSONObject dataParts
|
||||
, JSONObject dataBody, JSONObject dataGoods
|
||||
, JSONObject plates, JSONObject dataModule
|
||||
, JSONObject dataBlocks) {
|
||||
, JSONObject dataBlocks, String orderNo) {
|
||||
|
||||
Map<String, List<?>> map = new HashMap<>();
|
||||
|
||||
@@ -63,7 +68,7 @@ public class ApiTypeRealize {
|
||||
Long orderId = (Long) identifierGenerator.nextId(null);
|
||||
|
||||
// 生产单数据
|
||||
OrderDO orderDO = orderInfoChange(dataPlates, orderId);
|
||||
OrderDO orderDO = orderInfoChange(dataPlates, orderId, orderNo);
|
||||
List<OrderDO> order = new ArrayList<>();
|
||||
order.add(orderDO);
|
||||
// 商品信息数据 信息以全
|
||||
@@ -193,7 +198,7 @@ public class ApiTypeRealize {
|
||||
* @author Administrator
|
||||
* @date 2024/4/30
|
||||
*/
|
||||
public OrderDO orderInfoChange(JSONObject dataPlates, Long orderId) {
|
||||
public OrderDO orderInfoChange(JSONObject dataPlates, Long orderId, String orderNo) {
|
||||
// 获取 Orders 字段对应的数组
|
||||
JSONObject order = dataPlates.getJSONArray("Orders").getJSONObject(0);
|
||||
|
||||
@@ -204,16 +209,17 @@ public class ApiTypeRealize {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDate orderDate = LocalDate.parse(order.getString("SaleDate"), formatter);
|
||||
LocalDate deliveryDate = LocalDate.parse(order.getString("DeliveryDate"), formatter);
|
||||
String orderRemark = "[" + orderNo + "]; ";
|
||||
|
||||
OrderDO orderDO = OrderDO.builder()
|
||||
.id(orderId)
|
||||
.parentNo(0L)
|
||||
.orderDate(orderDate.atStartOfDay())
|
||||
.deliveryDate(deliveryDate.atStartOfDay())
|
||||
.orderType(1)
|
||||
.orderSort(0)
|
||||
.dataType(2)
|
||||
.status(1)
|
||||
.orderType(OrderTypeEnum.MAIN_ORDER.getStatus())
|
||||
// .orderSort(0)
|
||||
.dataType(DataTypeEnum.API_IMPORT.getStatus())
|
||||
.status(OrderStatusEnum.NEW_ORDER.getStatus())
|
||||
.customOrderNo(order.getString("CustomOrderNo"))
|
||||
.customer(order.getString("Consigee"))
|
||||
.address(order.getString("ConsigeeAddress"))
|
||||
@@ -222,7 +228,7 @@ public class ApiTypeRealize {
|
||||
.dealerPhoneNumber("无")
|
||||
.salesman(order.getString("SalePerson"))
|
||||
.splitter("无")
|
||||
.remark(order.getString("Remark"))
|
||||
.remark(orderRemark + order.getString("Remark"))
|
||||
.build();
|
||||
return orderDO;
|
||||
}
|
||||
@@ -402,7 +408,7 @@ public class ApiTypeRealize {
|
||||
OrderItemDO item = OrderItemDO.builder()
|
||||
.id((Long) identifierGenerator.nextId(null))
|
||||
.orderId(orderId)
|
||||
.type(2)
|
||||
.type(OrderItemTypeEnum.PARTS_ITEM.getStatus())
|
||||
.roomId(bodyInfos.get(parts.getInteger("BoxID")).getRoomId())
|
||||
.bodyId(bodyInfos.get(parts.getInteger("BoxID")).getId())
|
||||
.planId(0L)
|
||||
@@ -466,9 +472,11 @@ public class ApiTypeRealize {
|
||||
.sealDown(BigDecimal.valueOf(plate.getDouble("SealedDown")))
|
||||
.area(plateDetail.get(plate.getInteger("BlockNo")).getSealAcreage())
|
||||
.texture(plateDetail.get(plate.getInteger("BlockNo")).getTexture())
|
||||
.holeFace(0)
|
||||
.holeArrange(0)
|
||||
.unregularPointCount(0)
|
||||
|
||||
.holeFace(plateDetail.get(plate.getInteger("BlockNo")).getTypographicFace()) // 孔面类型
|
||||
.holeArrange(0) // 排孔类型 值无实际含义,默认初始化值
|
||||
.unregularPointCount(0)// 异形孔个数 值无实际含义,默认初始化值
|
||||
|
||||
.frontHoleCount(plate.getInteger("FrontHoleCount"))
|
||||
.sideHoleCount(plate.getInteger("BackHoleCount"))
|
||||
.sideHoleCount(plate.getInteger("SideHoleCount"))
|
||||
@@ -490,7 +498,7 @@ public class ApiTypeRealize {
|
||||
OrderItemDO itemPlate = OrderItemDO.builder()
|
||||
.id((Long) identifierGenerator.nextId(null))
|
||||
.orderId(orderId)
|
||||
.type(1)
|
||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
||||
.roomId(bodyInfos.get(plate.getInteger("BoxID")).getRoomId())
|
||||
.bodyId(bodyInfos.get(plate.getInteger("BoxID")).getId())
|
||||
.planId(0L)
|
||||
@@ -614,10 +622,10 @@ public class ApiTypeRealize {
|
||||
.openDoorType(Integer.valueOf(block.getString("OpenDoorType")))
|
||||
.offsetX(block.getBigDecimal("OffsetX"))
|
||||
.offsetY(block.getBigDecimal("OffsetY"))
|
||||
.pointDetail(getPointDetail(block, 1))
|
||||
.rawPointDetail(getPointDetail(block, 2))
|
||||
.holeDetail(getHoleDetail(block, 1))
|
||||
.sideHoleDetail(getHoleDetail(block, 2))
|
||||
.pointDetail(getPointDetail(block, true))
|
||||
.rawPointDetail(getPointDetail(block, false))
|
||||
.holeDetail(getHoleDetail(block, true))
|
||||
.sideHoleDetail(getHoleDetail(block, false))
|
||||
.contourDetail(getModelDetail(block))
|
||||
// 排钻类型
|
||||
.drillsInfos(getDrillsInfo(block))
|
||||
@@ -650,11 +658,11 @@ public class ApiTypeRealize {
|
||||
}
|
||||
|
||||
|
||||
// 异形板的开料轮廓 (type 为1,不含封边;其他为,含封边)
|
||||
private List<PointDetail> getPointDetail(JSONObject block, Integer type) {
|
||||
// 异形板的开料轮廓 (type 为true,不含封边;其他为,含封边)
|
||||
private List<PointDetail> getPointDetail(JSONObject block, Boolean type) {
|
||||
List<PointDetail> pointDetailList = new ArrayList<>();
|
||||
|
||||
if (type == 1) { // 不含封边
|
||||
if (type) { // 不含封边
|
||||
if (block.getJSONArray("Points") != null && !block.getJSONArray("Points").isEmpty()) {
|
||||
for (int i = 0; i < block.getJSONArray("Points").size(); i++) {
|
||||
JSONObject point = block.getJSONArray("Points").getJSONObject(i);
|
||||
@@ -682,10 +690,10 @@ public class ApiTypeRealize {
|
||||
return pointDetailList;
|
||||
}
|
||||
|
||||
// 孔明细板数据解析 (type 为1,正面;2,侧面)
|
||||
private List<HoleDetail> getHoleDetail(JSONObject block, Integer type) {
|
||||
// 孔明细板数据解析 (type 为true,正面;false,侧面)
|
||||
private List<HoleDetail> getHoleDetail(JSONObject block, Boolean type) {
|
||||
List<HoleDetail> holeDetails = new ArrayList<>();
|
||||
if (type == 1) { // 1,正面
|
||||
if (type) { // 1,正面
|
||||
if (block.getJSONArray("Holes") != null && !block.getJSONArray("Holes").isEmpty()) {
|
||||
for (int i = 0; i < block.getJSONArray("Holes").size(); i++) {
|
||||
JSONObject hole = block.getJSONArray("Holes").getJSONObject(i);
|
||||
@@ -706,12 +714,12 @@ public class ApiTypeRealize {
|
||||
String[] endPoints = splitAndTrim(hole.getString("EndPoint"));
|
||||
try {
|
||||
holeDetails.add(HoleDetail.builder()
|
||||
.startX(Double.valueOf(startPoints[0]))
|
||||
.startY(Double.valueOf(startPoints[1]))
|
||||
.startZ(Double.valueOf(startPoints[2]))
|
||||
.endX(Double.valueOf(endPoints[0]))
|
||||
.endY(Double.valueOf(endPoints[1]))
|
||||
.endZ(Double.valueOf(endPoints[2]))
|
||||
.startX(Double.valueOf(startPoints[X]))
|
||||
.startY(Double.valueOf(startPoints[Y]))
|
||||
.startZ(Double.valueOf(startPoints[Z]))
|
||||
.endX(Double.valueOf(endPoints[X]))
|
||||
.endY(Double.valueOf(endPoints[Y]))
|
||||
.endZ(Double.valueOf(endPoints[Z]))
|
||||
.faceType(2)
|
||||
.direction(hole.getInteger("Direction"))
|
||||
.radius(Double.valueOf(hole.getString("Diameter")) / 2)
|
||||
@@ -742,9 +750,9 @@ public class ApiTypeRealize {
|
||||
JSONObject point = model.getJSONArray("Points").getJSONObject(j);
|
||||
String[] points = splitAndTrim(point.getString("Pos"));
|
||||
pointLists.add(PointList.builder()
|
||||
.pointX(Double.valueOf(points[0]))
|
||||
.pointY(Double.valueOf(points[1]))
|
||||
.pointZ(Double.valueOf(points[2]))
|
||||
.pointX(Double.valueOf(points[X]))
|
||||
.pointY(Double.valueOf(points[Y]))
|
||||
.pointZ(Double.valueOf(points[Z]))
|
||||
.curve(Double.valueOf(point.getString("Curve")))
|
||||
.build());
|
||||
}
|
||||
@@ -795,7 +803,7 @@ public class ApiTypeRealize {
|
||||
return drillsInfos;
|
||||
}
|
||||
|
||||
// String[] 以逗号分割,去空格
|
||||
// String[] 以逗号分割,去空格 得到包含X Y Z三位坐标的数组(顺序包含)
|
||||
public String[] splitAndTrim(String str) {
|
||||
String[] strs = str.split(",");
|
||||
for (int i = 0; i < strs.length; i++) {
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
//package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
|
||||
//
|
||||
//import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
//import org.springframework.context.annotation.ComponentScan;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
//import org.springframework.scheduling.annotation.EnableAsync;
|
||||
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
//
|
||||
//import java.util.concurrent.Executor;
|
||||
//import java.util.concurrent.ThreadPoolExecutor;
|
||||
//
|
||||
///**
|
||||
// * @Description: 配置类实现AsyncConfigurer接口,并重写getAsyncExecutor方法,并返回一个ThreadPoolTaskExecutor,
|
||||
// * 这样我们就获得一个基于线程池TaskExecutor
|
||||
// * 利用@EnableAsync注解开启异步任务支持
|
||||
// * @ClassName: MultiThreadingConfig
|
||||
// * @Author: xiaolege
|
||||
// */
|
||||
//@Configuration
|
||||
//@ComponentScan("com.cf.imes.module.executor.service.order")
|
||||
//@EnableAsync
|
||||
//public class MultiThreadingConfig implements AsyncConfigurer {
|
||||
//
|
||||
// @Override
|
||||
// public Executor getAsyncExecutor() {
|
||||
// ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
|
||||
// //最小线程数
|
||||
// taskExecutor.setCorePoolSize(5);
|
||||
// //最大线程数
|
||||
// taskExecutor.setMaxPoolSize(10);
|
||||
// //等待队列
|
||||
// taskExecutor.setQueueCapacity(50);
|
||||
// taskExecutor.setKeepAliveSeconds(600);
|
||||
// //设置拒绝策略
|
||||
// taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
// //等待所有任务结束后再关闭线程池
|
||||
//// taskExecutor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
// taskExecutor.initialize();
|
||||
// return taskExecutor;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
// return AsyncConfigurer.super.getAsyncUncaughtExceptionHandler();
|
||||
// }
|
||||
//
|
||||
//}
|
||||
+3
-2
@@ -13,6 +13,7 @@ import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
import com.cf.imes.module.executor.enums.OrderItemTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -200,7 +201,7 @@ public class ExcelTypeRealize {
|
||||
.build();
|
||||
plateDOS.add(plateDO);
|
||||
|
||||
OrderItemDO orderItemDO = OrderItemDO.builder().orderId(orderId).type(1)
|
||||
OrderItemDO orderItemDO = OrderItemDO.builder().orderId(orderId).type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
||||
.roomId(roomId).bodyId(bodyId).plateId(plateId)
|
||||
.num(1.0).groupId(groupId).build();
|
||||
orderItemDOS.add(orderItemDO);
|
||||
@@ -217,7 +218,7 @@ public class ExcelTypeRealize {
|
||||
.model(combination.getModel()).spec(combination.getSpec()).brand(combination.getBrand()).factory(combination.getFactory())
|
||||
.unit(combination.getUnit()).price(0.0).isComposite(false).remark(combination.remarkJSON()).isComposite(false).build();
|
||||
orderPartsDOS.add(orderPartsDO);
|
||||
OrderItemDO orderItemDO = OrderItemDO.builder().orderId(orderId).type(2)
|
||||
OrderItemDO orderItemDO = OrderItemDO.builder().orderId(orderId).type(OrderItemTypeEnum.PARTS_ITEM.getStatus())
|
||||
.roomId(roomId).bodyId(bodyId).partsId(partsId).groupId(groupId)
|
||||
.num(Double.valueOf(combination.getGoodsNumber())).build();
|
||||
orderItemDOS.add(orderItemDO);
|
||||
|
||||
+2
-2
@@ -22,12 +22,12 @@
|
||||
g.plate_num AS group_num,b.plate_num AS body_num
|
||||
FROM `order_body` b
|
||||
LEFT JOIN `order_group` g ON b.id = g.body_id
|
||||
WHERE b.order_id = #{orderId}
|
||||
WHERE b.order_id = #{orderId} and b.organ_id = #{organId} and b.deleted = #{deleted}
|
||||
</select>
|
||||
|
||||
<select id="getOrderBodyByOrderId" resultType="com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO">
|
||||
SELECT b.id, b.order_id, b.room_id, b.name, b.width, b.height, b.depth, b.filename, b.remark, b.creator, b.create_time, b.updater, b.update_time, b.deleted, b.plate_num
|
||||
FROM `order_body` b
|
||||
WHERE b.order_id = #{orderId} and b.organ_id = #{organId} and b.deleted = 0
|
||||
WHERE b.order_id = #{orderId} and b.organ_id = #{organId}
|
||||
</select>
|
||||
</mapper>
|
||||
+10
-3
@@ -10,7 +10,8 @@
|
||||
FROM order_item i
|
||||
RIGHT JOIN `order_plate` p ON i.plate_id = p.id
|
||||
LEFT JOIN `order_goods` g ON g.id = p.goods_id
|
||||
WHERE i.order_id = #{orderId}
|
||||
LEFT JOIN `order_group` gp ON gp.id = i.group_id
|
||||
WHERE i.order_id = #{orderId} AND i.organ_id = #{organId} AND p.deleted = #{deleted}
|
||||
<if test="roomId != null">
|
||||
AND i.room_id = #{roomId}
|
||||
</if>
|
||||
@@ -20,6 +21,9 @@
|
||||
<if test="groupId != null">
|
||||
AND i.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="groupName != null">
|
||||
AND gp.name = #{groupName}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPartsDetailByOrderId" resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
|
||||
@@ -27,13 +31,16 @@
|
||||
p.is_composite,p.create_time
|
||||
FROM order_item i
|
||||
RIGHT JOIN `order_parts` p ON i.parts_id = p.id
|
||||
WHERE i.order_id = #{orderId}
|
||||
WHERE i.order_id = #{orderId} AND i.organ_id = #{organId} AND p.deleted = #{deleted}
|
||||
<if test="roomId != null">
|
||||
AND i.room_id = #{roomId}
|
||||
</if>
|
||||
<if test="bodyId != null">
|
||||
AND i.body_id = #{bodyId}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
AND p.name = #{name}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPartsByOrderId"
|
||||
@@ -41,7 +48,7 @@
|
||||
SELECT i.order_id, i.room_id, i.body_id, i.parts_id, p.`name` as part_name, i.num as plate_num
|
||||
FROM `order_item` i
|
||||
RIGHT JOIN `order_parts` p ON i.parts_id = p.id
|
||||
WHERE i.order_id = #{orderId}
|
||||
WHERE i.order_id = #{orderId} AND i.organ_id = #{organId} AND p.deleted = #{deleted}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
+8
@@ -47,4 +47,12 @@
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updateDeletedById">
|
||||
UPDATE order_parts
|
||||
SET deleted = #{deleted}
|
||||
WHERE id IN (
|
||||
SELECT parts_id FROM order_item
|
||||
WHERE body_id = #{bodyId} AND organ_id = #{organId}
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
+34
-5
@@ -178,11 +178,6 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectPlateGoodsList" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
|
||||
|
||||
select op.id,
|
||||
@@ -241,4 +236,38 @@
|
||||
and op.organ_id = #{organId}
|
||||
</select>
|
||||
|
||||
<select id="selectPlateGoodsListSummary" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
|
||||
|
||||
select
|
||||
op.name,
|
||||
op.open_door_type,
|
||||
op.height,
|
||||
op.width,
|
||||
op.thickness,
|
||||
op.area,
|
||||
ogs.thickness as goods_thickness,
|
||||
ogs.color,
|
||||
ogs.material,
|
||||
ogs.spec,
|
||||
bdy.id as body_id,
|
||||
bdy.`name` as body_name,
|
||||
bdy.room_id,
|
||||
bdy.room_name
|
||||
from order_plate op
|
||||
left join order_goods ogs on op.goods_id = ogs.id
|
||||
left join order_item its on op.id = its.plate_id
|
||||
left join order_body bdy on bdy.id = its.body_id
|
||||
left join order_goods gods on gods.id = op.goods_id
|
||||
where op.order_id = #{orderId}
|
||||
and op.organ_id = #{organId}
|
||||
</select>
|
||||
|
||||
<update id="updateDeletedById">
|
||||
UPDATE order_plate
|
||||
SET deleted = #{deleted}
|
||||
WHERE id IN (
|
||||
SELECT plate_id FROM order_item
|
||||
WHERE body_id = #{bodyId} AND organ_id = #{organId}
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class RemainPlateSaveReqVO {
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "轮廊数据,Json 串")
|
||||
@Schema(description = "轮廊数据,Json 串", requiredMode = Schema.RequiredMode.REQUIRED, example = "18318")
|
||||
private String outLineJson;
|
||||
|
||||
}
|
||||
+7
-4
@@ -17,8 +17,7 @@ import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
|
||||
@@ -46,8 +45,12 @@ public class RemainPlateServiceImpl implements RemainPlateService {
|
||||
|
||||
@Override
|
||||
public Boolean createRemainPlateMultiple(Set<RemainPlateSaveReqVO> createReqVOS) {
|
||||
// 批量插入
|
||||
return remainPlateMapper.insertBatch(Collections.singleton(BeanUtils.toBean(createReqVOS, RemainPlateDO.class)));
|
||||
Collection<RemainPlateDO> remainPlates = new ArrayList<>();
|
||||
createReqVOS.forEach(createReqVO -> {
|
||||
RemainPlateDO remainPlate = BeanUtils.toBean(createReqVO, RemainPlateDO.class);
|
||||
remainPlates.add(remainPlate);
|
||||
});
|
||||
return remainPlateMapper.insertBatch(remainPlates);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -67,14 +67,14 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
ProcessAndUserSaveReqVO processAndUserSaveReqVO = new ProcessAndUserSaveReqVO();
|
||||
try{
|
||||
if (adminUserService.getUser(Long.parseLong(user)) == null){
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.USER_NOT_EXISTS);
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
processAndUserSaveReqVO.setProcessId(processID);
|
||||
processAndUserSaveReqVO.setUserId(Long.parseLong(user));
|
||||
processUserService.createProcessUser(processAndUserSaveReqVO);
|
||||
}catch (Exception e){
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.ERR);
|
||||
throw exception(ERR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user