Merge remote-tracking branch 'refs/remotes/origin/huachuang_ls' into feature/20260808/packaging_workshop
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package cn.code.nl.module.lms.controller.admin.slittingproductionplan;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.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 jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.code.nl.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.code.nl.module.lms.controller.admin.slittingproductionplan.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.slittingproductionplan.SlittingproductionplanDO;
|
||||
import cn.code.nl.module.lms.service.slittingproductionplan.SlittingproductionplanService;
|
||||
|
||||
@Tag(name = "管理后台 - 分切生产计划")
|
||||
@RestController
|
||||
@RequestMapping("lms/slittingproductionplan")
|
||||
@Validated
|
||||
public class SlittingproductionplanController {
|
||||
|
||||
@Resource
|
||||
private SlittingproductionplanService slittingproductionplanService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分切生产计划")
|
||||
@PreAuthorize("@ss.hasPermission('lms:slittingproductionplan:create')")
|
||||
public CommonResult<String> createSlittingproductionplan(@Valid @RequestBody SlittingproductionplanSaveReqVO createReqVO) {
|
||||
return success(slittingproductionplanService.createSlittingproductionplan(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分切生产计划")
|
||||
@PreAuthorize("@ss.hasPermission('lms:slittingproductionplan:update')")
|
||||
public CommonResult<Boolean> updateSlittingproductionplan(@Valid @RequestBody SlittingproductionplanSaveReqVO updateReqVO) {
|
||||
slittingproductionplanService.updateSlittingproductionplan(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分切生产计划")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('lms:slittingproductionplan:delete')")
|
||||
public CommonResult<Boolean> deleteSlittingproductionplan(@RequestParam("id") String id) {
|
||||
slittingproductionplanService.deleteSlittingproductionplan(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除分切生产计划")
|
||||
@PreAuthorize("@ss.hasPermission('lms:slittingproductionplan:delete')")
|
||||
public CommonResult<Boolean> deleteSlittingproductionplanList(@RequestParam("ids") List<String> ids) {
|
||||
slittingproductionplanService.deleteSlittingproductionplanListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分切生产计划")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lms:slittingproductionplan:query')")
|
||||
public CommonResult<SlittingproductionplanRespVO> getSlittingproductionplan(@RequestParam("id") String id) {
|
||||
SlittingproductionplanDO slittingproductionplan = slittingproductionplanService.getSlittingproductionplan(id);
|
||||
return success(BeanUtils.toBean(slittingproductionplan, SlittingproductionplanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分切生产计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('lms:slittingproductionplan:query')")
|
||||
public CommonResult<PageResult<SlittingproductionplanRespVO>> getSlittingproductionplanPage(@Valid SlittingproductionplanPageReqVO pageReqVO) {
|
||||
PageResult<SlittingproductionplanDO> pageResult = slittingproductionplanService.getSlittingproductionplanPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SlittingproductionplanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分切生产计划 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('lms:slittingproductionplan:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSlittingproductionplanExcel(@Valid SlittingproductionplanPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SlittingproductionplanDO> list = slittingproductionplanService.getSlittingproductionplanPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分切生产计划.xls", "数据", SlittingproductionplanRespVO.class,
|
||||
BeanUtils.toBean(list, SlittingproductionplanRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.code.nl.module.lms.controller.admin.slittingproductionplan.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.code.nl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 分切生产计划分页 Request VO")
|
||||
@Data
|
||||
public class SlittingproductionplanPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分切订单类型", example = "1")
|
||||
private String orderType;
|
||||
|
||||
@Schema(description = "来源母卷号", example = "王五")
|
||||
private String parentContainerName;
|
||||
|
||||
@Schema(description = "生产日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] manufactureDate;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endTime;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "气涨轴规格")
|
||||
private String qzzSize;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package cn.code.nl.module.lms.controller.admin.slittingproductionplan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分切生产计划 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SlittingproductionplanRespVO {
|
||||
|
||||
@Schema(description = "分切订单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("分切订单类型")
|
||||
private String orderType;
|
||||
|
||||
@Schema(description = "产品编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("产品编码")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "产品描述", example = "随便")
|
||||
@ExcelProperty("产品描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "来源母卷号", example = "王五")
|
||||
@ExcelProperty("来源母卷号")
|
||||
private String parentContainerName;
|
||||
|
||||
@Schema(description = "子卷立库木箱号")
|
||||
@ExcelProperty("子卷立库木箱号")
|
||||
private String packageBoxSn;
|
||||
|
||||
@Schema(description = "来源卷位置")
|
||||
@ExcelProperty("来源卷位置")
|
||||
private String wareHouse;
|
||||
|
||||
@Schema(description = "分切组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("分切组")
|
||||
private String splitGroup;
|
||||
|
||||
@Schema(description = "生产顺序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产顺序")
|
||||
private String manufactureSort;
|
||||
|
||||
@Schema(description = "生产订单", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("生产订单")
|
||||
private String mfgOrderName;
|
||||
|
||||
@Schema(description = "生产日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产日期")
|
||||
private String manufactureDate;
|
||||
|
||||
@Schema(description = "管件类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("管件类型")
|
||||
private String paperTubeOrFrp;
|
||||
|
||||
@Schema(description = "纸筒物料编码")
|
||||
@ExcelProperty("纸筒物料编码")
|
||||
private String paperTubeMaterial;
|
||||
|
||||
@Schema(description = "纸筒物料描述", example = "随便")
|
||||
@ExcelProperty("纸筒物料描述")
|
||||
private String paperTubeDescription;
|
||||
|
||||
@Schema(description = "纸筒规格")
|
||||
@ExcelProperty("纸筒规格")
|
||||
private String paperTubeModel;
|
||||
|
||||
@Schema(description = "FRP管物料编码")
|
||||
@ExcelProperty("FRP管物料编码")
|
||||
private String frpMaterial;
|
||||
|
||||
@Schema(description = "FRP管物料描述", example = "你猜")
|
||||
@ExcelProperty("FRP管物料描述")
|
||||
private String frpDescription;
|
||||
|
||||
@Schema(description = "FRP管规格")
|
||||
@ExcelProperty("FRP管规格")
|
||||
private String frpModel;
|
||||
|
||||
@Schema(description = "子卷幅宽", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子卷幅宽")
|
||||
private BigDecimal splitBreadth;
|
||||
|
||||
@Schema(description = "子卷理论长度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子卷理论长度")
|
||||
private BigDecimal splitHeight;
|
||||
|
||||
@Schema(description = "子卷理论重量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子卷理论重量")
|
||||
private BigDecimal splitWeight;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@ExcelProperty("开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@ExcelProperty("结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "上料完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("上料完成")
|
||||
private String isParentOk;
|
||||
|
||||
@Schema(description = "子卷套轴完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子卷套轴完成")
|
||||
private String isChildTzOk;
|
||||
|
||||
@Schema(description = "子卷配送完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子卷配送完成")
|
||||
private String isChildPsOk;
|
||||
|
||||
@Schema(description = "气涨轴编码")
|
||||
@ExcelProperty("气涨轴编码")
|
||||
private String qzzno;
|
||||
|
||||
@Schema(description = "修改人", example = "22455")
|
||||
@ExcelProperty("修改人")
|
||||
private Long updateOptid;
|
||||
|
||||
@Schema(description = "部门ID", example = "12797")
|
||||
@ExcelProperty("部门ID")
|
||||
private Long sysdeptid;
|
||||
|
||||
@Schema(description = "公司ID", example = "6749")
|
||||
@ExcelProperty("公司ID")
|
||||
private Long syscompanyid;
|
||||
|
||||
@Schema(description = "销售订单及行号", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("销售订单及行号")
|
||||
private String saleOrderName;
|
||||
|
||||
@Schema(description = "是否呼叫", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否呼叫")
|
||||
private String isCall;
|
||||
|
||||
@Schema(description = "呼叫时间")
|
||||
@ExcelProperty("呼叫时间")
|
||||
private String callTime;
|
||||
|
||||
@Schema(description = "是否呼叫纸管")
|
||||
@ExcelProperty("是否呼叫纸管")
|
||||
private String isPaperOk;
|
||||
|
||||
@Schema(description = "气涨轴规格")
|
||||
@ExcelProperty("气涨轴规格")
|
||||
private String qzzSize;
|
||||
|
||||
@Schema(description = "上下")
|
||||
@ExcelProperty("上下")
|
||||
private String upOrDown;
|
||||
|
||||
@Schema(description = "子卷等级")
|
||||
@ExcelProperty("子卷等级")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "重量")
|
||||
@ExcelProperty("重量")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "纸管重量")
|
||||
@ExcelProperty("纸管重量")
|
||||
private String paperWeight;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
@ExcelProperty("生产区域")
|
||||
private String productArea;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package cn.code.nl.module.lms.controller.admin.slittingproductionplan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 分切生产计划新增/修改 Request VO")
|
||||
@Data
|
||||
public class SlittingproductionplanSaveReqVO {
|
||||
|
||||
private String workorderId;
|
||||
|
||||
@Schema(description = "分切订单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "分切订单类型不能为空")
|
||||
private String orderType;
|
||||
|
||||
@Schema(description = "产品编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "产品编码不能为空")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "产品描述", example = "随便")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "来源母卷号", example = "王五")
|
||||
private String parentContainerName;
|
||||
|
||||
@Schema(description = "子卷立库木箱号")
|
||||
private String packageBoxSn;
|
||||
|
||||
@Schema(description = "来源卷位置")
|
||||
private String wareHouse;
|
||||
|
||||
@Schema(description = "分切组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "分切组不能为空")
|
||||
private String splitGroup;
|
||||
|
||||
@Schema(description = "生产顺序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生产顺序不能为空")
|
||||
private String manufactureSort;
|
||||
|
||||
@Schema(description = "生产订单", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "生产订单不能为空")
|
||||
private String mfgOrderName;
|
||||
|
||||
@Schema(description = "生产日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生产日期不能为空")
|
||||
private String manufactureDate;
|
||||
|
||||
@Schema(description = "管件类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "管件类型不能为空")
|
||||
private String paperTubeOrFrp;
|
||||
|
||||
@Schema(description = "纸筒物料编码")
|
||||
private String paperTubeMaterial;
|
||||
|
||||
@Schema(description = "纸筒物料描述", example = "随便")
|
||||
private String paperTubeDescription;
|
||||
|
||||
@Schema(description = "纸筒规格")
|
||||
private String paperTubeModel;
|
||||
|
||||
@Schema(description = "FRP管物料编码")
|
||||
private String frpMaterial;
|
||||
|
||||
@Schema(description = "FRP管物料描述", example = "你猜")
|
||||
private String frpDescription;
|
||||
|
||||
@Schema(description = "FRP管规格")
|
||||
private String frpModel;
|
||||
|
||||
@Schema(description = "子卷幅宽", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "子卷幅宽不能为空")
|
||||
private BigDecimal splitBreadth;
|
||||
|
||||
@Schema(description = "子卷理论长度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "子卷理论长度不能为空")
|
||||
private BigDecimal splitHeight;
|
||||
|
||||
@Schema(description = "子卷理论重量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "子卷理论重量不能为空")
|
||||
private BigDecimal splitWeight;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "状态不能为空")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "上料完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "上料完成不能为空")
|
||||
private String isParentOk;
|
||||
|
||||
@Schema(description = "子卷套轴完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "子卷套轴完成不能为空")
|
||||
private String isChildTzOk;
|
||||
|
||||
@Schema(description = "子卷配送完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "子卷配送完成不能为空")
|
||||
private String isChildPsOk;
|
||||
|
||||
@Schema(description = "气涨轴编码")
|
||||
private String qzzno;
|
||||
|
||||
@Schema(description = "修改人", example = "22455")
|
||||
private Long updateOptid;
|
||||
|
||||
@Schema(description = "部门ID", example = "12797")
|
||||
private Long sysdeptid;
|
||||
|
||||
@Schema(description = "公司ID", example = "6749")
|
||||
private Long syscompanyid;
|
||||
|
||||
@Schema(description = "销售订单及行号", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "销售订单及行号不能为空")
|
||||
private String saleOrderName;
|
||||
|
||||
@Schema(description = "是否呼叫", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "是否呼叫不能为空")
|
||||
private String isCall;
|
||||
|
||||
@Schema(description = "呼叫时间")
|
||||
private String callTime;
|
||||
|
||||
@Schema(description = "是否呼叫纸管")
|
||||
private String isPaperOk;
|
||||
|
||||
@Schema(description = "气涨轴规格")
|
||||
private String qzzSize;
|
||||
|
||||
@Schema(description = "上下")
|
||||
private String upOrDown;
|
||||
|
||||
@Schema(description = "子卷等级")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "重量")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "纸管重量")
|
||||
private String paperWeight;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
private String productArea;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.code.nl.module.lms.controller.pda.slittingproduction;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.vo.SlittingDownVO;
|
||||
import cn.code.nl.module.lms.service.pda.slittingproduction.CuttingProcessService;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @author sh
|
||||
* 2026/7/23
|
||||
* 手持-分切下料控制层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/pda/cuttingProcess")
|
||||
@RequiredArgsConstructor
|
||||
public class CuttingProcessController {
|
||||
|
||||
private final CuttingProcessService cuttingProcessService;
|
||||
|
||||
/**
|
||||
* 分切下料子卷到分切缓存架
|
||||
* @param createReqVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/createSlittingDown")
|
||||
@PreAuthorize("@ss.hasPermission('lms:cutting-process:create')")
|
||||
public CommonResult<Boolean> createWorkOrder(@Valid @RequestBody SlittingDownVO createReqVO) {
|
||||
cuttingProcessService.markingFoilSlittingToCache(createReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分切下料-分切送轴
|
||||
* @param createReqVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/doUpShaftToSlitter")
|
||||
@PreAuthorize("@ss.hasPermission('lms:cutting-process:create')")
|
||||
public CommonResult<Boolean> doUpShaftToSlitter(@Valid @RequestBody SlittingDownVO createReqVO) {
|
||||
cuttingProcessService.doUpShaftToSlitter(createReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.code.nl.module.lms.controller.pda.slittingproduction.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SlittingDownDTO {
|
||||
|
||||
|
||||
private String pointCode;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.code.nl.module.lms.controller.pda.slittingproduction.eum;
|
||||
|
||||
public enum CutpointivtPointStatusEnum {
|
||||
|
||||
NO_STOCK("0", "无货"),
|
||||
HAS_TUBE_AXIS("1", "有管轴"),
|
||||
HAS_SUB_ROLL("2", "有子卷");
|
||||
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
private CutpointivtPointStatusEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.code.nl.module.lms.controller.pda.slittingproduction.eum;
|
||||
|
||||
import cn.code.nl.module.lms.controller.admin.btcutpointivt.vo.BtIvtCutpointivtPageReqVO;
|
||||
|
||||
public enum CutpointivtTypeEnum {
|
||||
|
||||
CUTTING_BLANKING_CACHE("1", "分切下料缓存位"),
|
||||
CUTTING_BLANKING_AGV("2", "分切下料agv对接位"),
|
||||
PULL_AXIS_SUB_DOCK("3", "拔轴子卷对接位"),
|
||||
PULL_AXIS_SUB_CACHE("4", "拔轴子卷缓存位"),
|
||||
PULL_AXIS_QZZ_CACHE("5", "气涨轴缓存位");
|
||||
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
private CutpointivtTypeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.code.nl.module.lms.controller.pda.slittingproduction.eum;
|
||||
|
||||
public enum SlittingproductionplanStausEnum {
|
||||
|
||||
START("1", "开始"),
|
||||
INBOUND_FINISHED("2", "入站完成"),
|
||||
OUTBOUND_PROCESSING("3", "出站中"),
|
||||
END("4", "结束");
|
||||
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
private SlittingproductionplanStausEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package cn.code.nl.module.lms.controller.pda.slittingproduction.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "手持 - 分切工序分切送轴 Request VO")
|
||||
@Data
|
||||
public class ShaftToSlitterVO {
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
private String pointCode;
|
||||
|
||||
|
||||
@Schema(description = "气涨轴编码")
|
||||
private String qzzNo;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.code.nl.module.lms.controller.pda.slittingproduction.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "手持 - 分切工序分切下料 Request VO")
|
||||
@Data
|
||||
public class SlittingDownVO {
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
private String pointCode;
|
||||
@Schema(description = "纸管编码")
|
||||
private String gxNo;
|
||||
|
||||
@Schema(description = "上轴气涨轴编码")
|
||||
private String upQzzNo;
|
||||
|
||||
@Schema(description = "下轴气涨轴编码")
|
||||
private String downQzzNo;
|
||||
|
||||
@Schema(description = "上轴纸管编码")
|
||||
private String upPaperTubeMaterial;
|
||||
|
||||
@Schema(description = "下轴纸管编码")
|
||||
private String downPaperTubeMaterial;
|
||||
|
||||
|
||||
}
|
||||
@@ -32,38 +32,33 @@ public class BtIvtCutpointivtDO extends BaseDO {
|
||||
* AGV点位名称
|
||||
*/
|
||||
private String pointName;
|
||||
|
||||
/**
|
||||
* 桁架点位编码1
|
||||
* 气胀轴编码
|
||||
*/
|
||||
private String trussPointCode1;
|
||||
private String qzzNo;
|
||||
|
||||
/**
|
||||
* 桁架点位编码2
|
||||
* 管芯编码
|
||||
*/
|
||||
private String trussPointCode2;
|
||||
private String gxNo;
|
||||
|
||||
/**
|
||||
* 气胀轴编码1
|
||||
* 子卷号
|
||||
*/
|
||||
private String qzzNo1;
|
||||
private String subContainer;
|
||||
/**
|
||||
* 气胀轴编码2
|
||||
*/
|
||||
private String qzzNo2;
|
||||
/**
|
||||
* 上轴管芯
|
||||
*/
|
||||
private String upGx;
|
||||
/**
|
||||
* 下轴管芯
|
||||
*/
|
||||
private String downGx;
|
||||
/**
|
||||
* 点位类型,1-分切缓存位,2-分切对接位,3-套轴对接位,4-套轴缓存位
|
||||
* 点位类型,1-分切下料缓存位,2-分切下料agv对接位,3-拔轴子卷对接位,4-拔轴子卷缓存位
|
||||
*/
|
||||
private String pointType;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String productArea;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
@@ -98,4 +93,10 @@ public class BtIvtCutpointivtDO extends BaseDO {
|
||||
private String pointStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 锁状态
|
||||
*/
|
||||
private String lockStatus;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -117,4 +117,9 @@ public class IvtCutpointivtDO extends BaseDO {
|
||||
private String qzzGeneration;
|
||||
|
||||
|
||||
/**
|
||||
* 锁状态
|
||||
*/
|
||||
private String lockStatus;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
package cn.code.nl.module.lms.dal.dataobject.slittingproductionplan;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.code.nl.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 分切生产计划 DO
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@TableName("lms_slittingproductionplan")
|
||||
@KeySequence("lms_slittingproductionplan_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SlittingproductionplanDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 分切计划标识
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String workorderId;
|
||||
/**
|
||||
* 分切订单类型
|
||||
*/
|
||||
private String orderType;
|
||||
/**
|
||||
* 产品编码
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 产品描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 来源母卷号
|
||||
*/
|
||||
private String parentContainerName;
|
||||
/**
|
||||
* 子卷立库木箱号
|
||||
*/
|
||||
private String packageBoxSn;
|
||||
/**
|
||||
* 来源卷位置
|
||||
*/
|
||||
private String wareHouse;
|
||||
/**
|
||||
* 分切组
|
||||
*/
|
||||
private String splitGroup;
|
||||
/**
|
||||
* 生产顺序
|
||||
*/
|
||||
private String manufactureSort;
|
||||
/**
|
||||
* 生产订单
|
||||
*/
|
||||
private String mfgOrderName;
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private String manufactureDate;
|
||||
/**
|
||||
* 管件类型
|
||||
*/
|
||||
private String paperTubeOrFrp;
|
||||
/**
|
||||
* 纸筒物料编码
|
||||
*/
|
||||
private String paperTubeMaterial;
|
||||
/**
|
||||
* 纸筒物料描述
|
||||
*/
|
||||
private String paperTubeDescription;
|
||||
/**
|
||||
* 纸筒规格
|
||||
*/
|
||||
private String paperTubeModel;
|
||||
/**
|
||||
* FRP管物料编码
|
||||
*/
|
||||
private String frpMaterial;
|
||||
/**
|
||||
* FRP管物料描述
|
||||
*/
|
||||
private String frpDescription;
|
||||
/**
|
||||
* FRP管规格
|
||||
*/
|
||||
private String frpModel;
|
||||
/**
|
||||
* 子卷幅宽
|
||||
*/
|
||||
private BigDecimal splitBreadth;
|
||||
/**
|
||||
* 子卷理论长度
|
||||
*/
|
||||
private BigDecimal splitHeight;
|
||||
/**
|
||||
* 子卷理论重量
|
||||
*/
|
||||
private BigDecimal splitWeight;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 上料完成
|
||||
*/
|
||||
private String isParentOk;
|
||||
/**
|
||||
* 子卷套轴完成
|
||||
*/
|
||||
private String isChildTzOk;
|
||||
/**
|
||||
* 子卷配送完成
|
||||
*/
|
||||
private String isChildPsOk;
|
||||
/**
|
||||
* 气涨轴编码
|
||||
*/
|
||||
private String qzzno;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateOptid;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long sysdeptid;
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
private Long syscompanyid;
|
||||
/**
|
||||
* 销售订单及行号
|
||||
*/
|
||||
private String saleOrderName;
|
||||
/**
|
||||
* 是否呼叫
|
||||
*/
|
||||
private String isCall;
|
||||
/**
|
||||
* 呼叫时间
|
||||
*/
|
||||
private String callTime;
|
||||
/**
|
||||
* 是否呼叫纸管
|
||||
*/
|
||||
private String isPaperOk;
|
||||
/**
|
||||
* 气涨轴规格
|
||||
*/
|
||||
private String qzzSize;
|
||||
/**
|
||||
* 上下
|
||||
*/
|
||||
private String upOrDown;
|
||||
/**
|
||||
* 子卷等级
|
||||
*/
|
||||
private String level;
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private String weight;
|
||||
/**
|
||||
* 纸管重量
|
||||
*/
|
||||
private String paperWeight;
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String productArea;
|
||||
|
||||
/**
|
||||
* 分切编码
|
||||
*/
|
||||
private String cutCode;
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.lms.controller.admin.btcutpointivt.vo.BtIvtCutpointivtPageReqVO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.btivtcutpointivt.BtIvtCutpointivtDO;
|
||||
import cn.code.nl.module.lms.enums.LockStatusEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -26,4 +28,12 @@ public interface BtIvtCutpointivtMapper extends BaseMapperX<BtIvtCutpointivtDO>
|
||||
.orderByDesc(BtIvtCutpointivtDO::getIvtId));
|
||||
}
|
||||
|
||||
default int lockPoint(Long ivtId) {
|
||||
BtIvtCutpointivtDO updateObj = new BtIvtCutpointivtDO();
|
||||
updateObj.setLockStatus(LockStatusEnum.OCCUPIED.getCode());
|
||||
return update(updateObj, new LambdaUpdateWrapper<BtIvtCutpointivtDO>()
|
||||
.eq(BtIvtCutpointivtDO::getIvtId, ivtId)
|
||||
.eq(BtIvtCutpointivtDO::getLockStatus, LockStatusEnum.IDLE.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.lms.controller.admin.cutpointivt.vo.IvtCutpointivtPageReqVO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.cutpointIvt.IvtCutpointivtDO;
|
||||
import cn.code.nl.module.lms.enums.LockStatusEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -27,4 +29,17 @@ public interface IvtCutpointivtMapper extends BaseMapperX<IvtCutpointivtDO> {
|
||||
.orderByDesc(IvtCutpointivtDO::getIvtId));
|
||||
}
|
||||
|
||||
default IvtCutpointivtDO selectByPointCode(String pointCode){
|
||||
return selectOne(IvtCutpointivtDO::getPointCode,pointCode);
|
||||
};
|
||||
|
||||
|
||||
default int lockPoint(Long ivtId) {
|
||||
IvtCutpointivtDO updateObj = new IvtCutpointivtDO();
|
||||
updateObj.setLockStatus(LockStatusEnum.OCCUPIED.getCode());
|
||||
return update(updateObj, new LambdaUpdateWrapper<IvtCutpointivtDO>()
|
||||
.eq(IvtCutpointivtDO::getIvtId, ivtId)
|
||||
.eq(IvtCutpointivtDO::getLockStatus, LockStatusEnum.IDLE.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package cn.code.nl.module.lms.dal.mysql.slittingproductionplan;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.dto.SlittingDownDTO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.slittingproductionplan.SlittingproductionplanDO;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.code.nl.module.lms.controller.admin.slittingproductionplan.vo.*;
|
||||
|
||||
/**
|
||||
* 分切生产计划 Mapper
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface SlittingproductionplanMapper extends BaseMapperX<SlittingproductionplanDO> {
|
||||
|
||||
default PageResult<SlittingproductionplanDO> selectPage(SlittingproductionplanPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SlittingproductionplanDO>()
|
||||
.eqIfPresent(SlittingproductionplanDO::getOrderType, reqVO.getOrderType())
|
||||
.likeIfPresent(SlittingproductionplanDO::getParentContainerName, reqVO.getParentContainerName())
|
||||
.betweenIfPresent(SlittingproductionplanDO::getManufactureDate, reqVO.getManufactureDate())
|
||||
.betweenIfPresent(SlittingproductionplanDO::getStartTime, reqVO.getStartTime())
|
||||
.betweenIfPresent(SlittingproductionplanDO::getEndTime, reqVO.getEndTime())
|
||||
.eqIfPresent(SlittingproductionplanDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(SlittingproductionplanDO::getQzzSize, reqVO.getQzzSize())
|
||||
.orderByDesc(SlittingproductionplanDO::getWorkorderId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -61,4 +61,14 @@ public interface IvtCutpointivtService {
|
||||
*/
|
||||
PageResult<IvtCutpointivtDO> getIvtCutpointivtPage(IvtCutpointivtPageReqVO pageReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 根据AGV对应的点位编码获取点位实体
|
||||
* @param point AGV点位编码
|
||||
* @param flag 是否需要校验启用
|
||||
* @return 实体
|
||||
*/
|
||||
IvtCutpointivtDO getPintByAgvCode(String point, boolean flag);
|
||||
|
||||
IvtCutpointivtDO allocatePoint(String pointCode);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import cn.code.nl.module.lms.controller.admin.cutpointivt.vo.IvtCutpointivtSaveR
|
||||
import cn.code.nl.module.lms.dal.dataobject.cutpointIvt.IvtCutpointivtDO;
|
||||
import cn.code.nl.module.lms.dal.mysql.ivtcutpointivt.IvtCutpointivtMapper;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -19,6 +21,7 @@ import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.CUT_POINT_OCCUPIED;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.IVT_CUTPOINTIVT_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@@ -83,4 +86,23 @@ public class IvtCutpointivtServiceImpl implements IvtCutpointivtService {
|
||||
return ivtCutpointivtMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IvtCutpointivtDO getPintByAgvCode(String point, boolean flag) {
|
||||
LambdaQueryWrapper<IvtCutpointivtDO> lam = new QueryWrapper<IvtCutpointivtDO>().lambda();
|
||||
lam.eq(flag, IvtCutpointivtDO::getIsUsed, "1").eq(IvtCutpointivtDO::getPointCode, point);
|
||||
return ivtCutpointivtMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IvtCutpointivtDO allocatePoint(String pointCode) {
|
||||
IvtCutpointivtDO ivtCutpointivtDO = ivtCutpointivtMapper.selectByPointCode(pointCode);
|
||||
// CAS 占用:抢占失败说明已被其他任务占有
|
||||
if (ivtCutpointivtMapper.lockPoint(ivtCutpointivtDO.getIvtId()) == 0) {
|
||||
throw exception(CUT_POINT_OCCUPIED, ivtCutpointivtDO.getPointCode());
|
||||
}
|
||||
|
||||
return ivtCutpointivtDO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,4 +60,13 @@ public interface BtIvtCutpointivtService {
|
||||
*/
|
||||
PageResult<BtIvtCutpointivtDO> getIvtCutpointivtPage(BtIvtCutpointivtPageReqVO pageReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 根据类型查询集合
|
||||
*
|
||||
*
|
||||
*/
|
||||
List<BtIvtCutpointivtDO> getIvtCutpointivtListByType(String type, String status, String pullAxisQzzCacheCode);
|
||||
|
||||
void allocatePoint(List<BtIvtCutpointivtDO> ivtCutpointivtListByTypeList);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package cn.code.nl.module.lms.service.ivtcutpointivt;
|
||||
|
||||
import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.module.lms.controller.admin.btcutpointivt.vo.BtIvtCutpointivtPageReqVO;
|
||||
import cn.code.nl.module.lms.controller.admin.btcutpointivt.vo.BtIvtCutpointivtSaveReqVO;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.eum.CutpointivtPointStatusEnum;
|
||||
import cn.code.nl.module.lms.dal.dataobject.btivtcutpointivt.BtIvtCutpointivtDO;
|
||||
import cn.code.nl.module.lms.dal.mysql.btivtcutpointivt.BtIvtCutpointivtMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -9,13 +11,14 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.IVT_CUTPOINTIVT_NOT_EXISTS;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 分切区缓存点位库存 Service 实现类
|
||||
@@ -57,10 +60,10 @@ public class BtIvtCutpointivtServiceImpl implements BtIvtCutpointivtService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteIvtCutpointivtListByIds(List<Long> ids) {
|
||||
public void deleteIvtCutpointivtListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
btIvtCutpointivtMapper.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void validateIvtCutpointivtExists(Long id) {
|
||||
@@ -79,4 +82,25 @@ public class BtIvtCutpointivtServiceImpl implements BtIvtCutpointivtService {
|
||||
return btIvtCutpointivtMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BtIvtCutpointivtDO> getIvtCutpointivtListByType(String type, String status, String pullAxisQzzCacheCode) {
|
||||
return btIvtCutpointivtMapper.selectList(new LambdaQueryWrapperX<BtIvtCutpointivtDO>()
|
||||
.eqIfPresent(BtIvtCutpointivtDO::getPointType, type)
|
||||
.eqIfPresent(BtIvtCutpointivtDO::getPointStatus, status)
|
||||
.eqIfPresent(BtIvtCutpointivtDO::getGxNo, pullAxisQzzCacheCode)
|
||||
.eqIfPresent(BtIvtCutpointivtDO::getIsUsed, "1")
|
||||
.orderByDesc(BtIvtCutpointivtDO::getIvtId));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allocatePoint(List<BtIvtCutpointivtDO> ivtCutpointivtListByTypeList) {
|
||||
for (BtIvtCutpointivtDO btIvtCutpointivtDO : ivtCutpointivtListByTypeList) {
|
||||
// CAS 占用:抢占失败说明已被其他任务占有
|
||||
if (btIvtCutpointivtMapper.lockPoint(btIvtCutpointivtDO.getIvtId()) == 0) {
|
||||
throw exception(CUT_POINT_OCCUPIED, btIvtCutpointivtDO.getPointCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package cn.code.nl.module.lms.service.pda.slittingproduction;
|
||||
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.vo.SlittingDownVO;
|
||||
|
||||
public interface CuttingProcessService {
|
||||
void markingFoilSlittingToCache(SlittingDownVO createReqVO);
|
||||
|
||||
void doUpShaftToSlitter(SlittingDownVO createReqVO);
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
package cn.code.nl.module.lms.service.pda.slittingproduction.impl;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.dto.SlittingDownDTO;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.eum.CutpointivtPointStatusEnum;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.eum.CutpointivtTypeEnum;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.vo.SlittingDownVO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.btivtcutpointivt.BtIvtCutpointivtDO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.cutpointIvt.IvtCutpointivtDO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.rawfoilcasheposition.RawFoilCashePositionDO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.slittingproductionplan.SlittingproductionplanDO;
|
||||
import cn.code.nl.module.lms.enums.RawFoilHandleCodeConstants;
|
||||
import cn.code.nl.module.lms.enums.slittingproduction.SlittingproductionHandleCodeConstants;
|
||||
import cn.code.nl.module.lms.service.cutpointIvt.IvtCutpointivtService;
|
||||
import cn.code.nl.module.lms.service.ivtcutpointivt.BtIvtCutpointivtService;
|
||||
import cn.code.nl.module.lms.service.pda.slittingproduction.CuttingProcessService;
|
||||
import cn.code.nl.module.lms.service.slittingproductionplan.SlittingproductionplanService;
|
||||
import cn.code.nl.module.task.api.TransportTaskApi;
|
||||
import cn.code.nl.module.task.dto.TransportTaskCreateReqDTO;
|
||||
import cn.code.nl.module.task.enums.AcsTaskTypeEnum;
|
||||
import cn.code.nl.module.task.enums.TaskOwnerServiceEnum;
|
||||
import cn.code.nl.module.task.enums.TaskTypeEnum;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CuttingProcessServiceImpl implements CuttingProcessService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BtIvtCutpointivtService btIvtCutpointivtService;
|
||||
|
||||
@Autowired
|
||||
private IvtCutpointivtService ivtCutpointivtService;
|
||||
|
||||
@Resource
|
||||
private TransportTaskApi transportTaskApi;
|
||||
|
||||
@Autowired
|
||||
private SlittingproductionplanService slittingproductionplanService;
|
||||
public void markingFoilSlittingToCache(SlittingDownVO createReqVO) {
|
||||
|
||||
|
||||
//查找分切设备
|
||||
checkPoint(createReqVO);
|
||||
|
||||
//创建分切计划,根据上下轴生成任务
|
||||
creatTask(createReqVO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void checkPoint(SlittingDownVO createReqVO) {
|
||||
IvtCutpointivtDO ivtCutpointivtDO = ivtCutpointivtService.getPintByAgvCode(createReqVO.getPointCode(), false);
|
||||
|
||||
if (ObjectUtil.isEmpty(ivtCutpointivtDO)){
|
||||
throw exception(IVT_CUTPOINTIVT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
//分切设备上、下轴气涨轴均已下发,不允许重复送轴
|
||||
if (StringUtils.isNotEmpty(ivtCutpointivtDO.getDownQzzno())
|
||||
&& StringUtils.isNotEmpty(ivtCutpointivtDO.getUpQzzno())) {
|
||||
throw exception(CUT_QZZ_ISSUED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分切送轴
|
||||
* @param createReqVO
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void doUpShaftToSlitter(SlittingDownVO createReqVO) {
|
||||
//TODO
|
||||
//点位校验
|
||||
checkPoint(createReqVO);
|
||||
|
||||
ivtCutpointivtService.allocatePoint(createReqVO.getPointCode());
|
||||
|
||||
|
||||
// 生成分切计划
|
||||
SlittingproductionplanDO plan = new SlittingproductionplanDO();
|
||||
plan.setWorkorderId(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
plan.setOrderType("1");
|
||||
plan.setProductName("-");
|
||||
plan.setDescription("-");
|
||||
plan.setCutCode(createReqVO.getPointCode());
|
||||
plan.setManufactureDate(DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||
// if ("1".equals(callShaftVo.getPaper_or_frp())) {
|
||||
// // 纸管
|
||||
// plan.setPaper_tube_material(callShaftVo.getMaterial_code());
|
||||
// plan.setPaper_tube_model(callShaftVo.getMaterial_spec());
|
||||
// plan.setPaper_tube_description(callShaftVo.getMaterial_spec());
|
||||
// } else {
|
||||
// // frp
|
||||
// plan.setFRP_material(callShaftVo.getMaterial_code());
|
||||
// plan.setFRP_model(callShaftVo.getMaterial_spec());
|
||||
// plan.setFRP_description(callShaftVo.getMaterial_spec());
|
||||
// }
|
||||
// plan.setStatus("01");
|
||||
//
|
||||
// plan.setSale_order_name("-");
|
||||
// plan.setQzz_size(callShaftVo.getQzz_size());
|
||||
// plan.setUp_or_down(cutDevice.getUp_point_code().equals(callShaftVo.getPoint_code())
|
||||
// ? "1" : "2");
|
||||
// plan.setLeft_or_right(callShaftVo.getLeft_or_right());
|
||||
// plans.add(plan);
|
||||
|
||||
// 创建任务
|
||||
creatShaftToSlitterTask(createReqVO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void creatShaftToSlitterTask(SlittingDownVO createReqVO) {
|
||||
// 两个编码不为空生成送双轴任务
|
||||
List<BtIvtCutpointivtDO> ivtCutpointivtListByTypeList = btIvtCutpointivtService.getIvtCutpointivtListByType(CutpointivtTypeEnum.PULL_AXIS_QZZ_CACHE.getCode(), CutpointivtPointStatusEnum.HAS_TUBE_AXIS.getCode(),createReqVO.getGxNo());
|
||||
|
||||
|
||||
if (StringUtils.isEmpty(createReqVO.getUpQzzNo()) && StringUtils.isEmpty(createReqVO.getDownQzzNo())) {
|
||||
if (ivtCutpointivtListByTypeList.size()<2){
|
||||
throw exception(CUTPOINTIVT_POINT_NOT_EXISTS);
|
||||
}
|
||||
// 点位占用
|
||||
btIvtCutpointivtService.allocatePoint(ivtCutpointivtListByTypeList);
|
||||
|
||||
|
||||
|
||||
|
||||
TransportTaskCreateReqDTO reqDTO = new TransportTaskCreateReqDTO();
|
||||
reqDTO.setTaskName(UUID.randomUUID().toString());
|
||||
reqDTO.setOwnerService(TaskOwnerServiceEnum.LMS.getCode());
|
||||
reqDTO.setHandleCode(SlittingproductionHandleCodeConstants.SLI_UP_QZZ_TASK);
|
||||
reqDTO.setAcsTaskType(AcsTaskTypeEnum.TRUSS_TASK.getCode());
|
||||
reqDTO.setAgvSystemType("1");
|
||||
reqDTO.setPointCode1(ivtCutpointivtListByTypeList.get(0).getPointCode());
|
||||
reqDTO.setPointCode2(ivtCutpointivtListByTypeList.get(1).getPointCode());
|
||||
reqDTO.setPointCode3(createReqVO.getPointCode()+ "_S");
|
||||
reqDTO.setPointCode4(createReqVO.getPointCode()+ "_X");
|
||||
reqDTO.setMaterialCode(createReqVO.getDownQzzNo());
|
||||
reqDTO.setPriority("1");
|
||||
reqDTO.setIsAutoIssue("1");
|
||||
reqDTO.setIsCreateFinish(true);
|
||||
reqDTO.setTaskType(TaskTypeEnum.SLI_UP_QZZ_TASK.getCode());
|
||||
try {
|
||||
|
||||
CommonResult<Long> result = transportTaskApi.createTransportTask(reqDTO);
|
||||
if (result.isError()) {
|
||||
log.error("创建搬运任务失败, pointCode={}, reqDTO={}, 返回={}",
|
||||
createReqVO.getPointCode(), reqDTO, result);
|
||||
throw exception(CUT_FOIL_TRANSPORT_TASK_CREATE_FAIL);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 补偿释放:生箔机点位 + 母卷下料位(下料位尚未分配成功时跳过)
|
||||
// rawFoilPointIVTService.releasePointLock(rawFoilPointIVTDO.getPointCode());
|
||||
// if (ObjectUtil.isNotEmpty(unloadingPosition)) {
|
||||
// rawFoilCashePositionService.releasePositionLock(unloadingPosition.getPointCode());
|
||||
// }
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
// 送单轴任务
|
||||
else if (StringUtils.isEmpty(createReqVO.getUpQzzNo())) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void creatTask(SlittingDownVO createReqVO) {
|
||||
|
||||
// 两个编码为空生成下双轴任务
|
||||
if (StringUtils.isEmpty(createReqVO.getUpQzzNo()) && StringUtils.isEmpty(createReqVO.getDownQzzNo())) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 上单轴任务
|
||||
else if (StringUtils.isEmpty(createReqVO.getUpQzzNo())) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
else if (StringUtils.isEmpty(createReqVO.getDownQzzNo())) {
|
||||
|
||||
|
||||
}
|
||||
// 下
|
||||
else {
|
||||
// TODO 在这里写【都不为空】的正常业务代码
|
||||
System.out.println("上下轴气涨轴编码均有值,执行正常分支逻辑");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.code.nl.module.lms.service.slittingproductionplan;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.dto.SlittingDownDTO;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.vo.SlittingDownVO;
|
||||
import jakarta.validation.*;
|
||||
import cn.code.nl.module.lms.controller.admin.slittingproductionplan.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.slittingproductionplan.SlittingproductionplanDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 分切生产计划 Service 接口
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
public interface SlittingproductionplanService {
|
||||
|
||||
/**
|
||||
* 创建分切生产计划
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createSlittingproductionplan(@Valid SlittingproductionplanSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新分切生产计划
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSlittingproductionplan(@Valid SlittingproductionplanSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除分切生产计划
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSlittingproductionplan(String id);
|
||||
|
||||
/**
|
||||
* 批量删除分切生产计划
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteSlittingproductionplanListByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获得分切生产计划
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 分切生产计划
|
||||
*/
|
||||
SlittingproductionplanDO getSlittingproductionplan(String id);
|
||||
|
||||
/**
|
||||
* 获得分切生产计划分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 分切生产计划分页
|
||||
*/
|
||||
PageResult<SlittingproductionplanDO> getSlittingproductionplanPage(SlittingproductionplanPageReqVO pageReqVO);
|
||||
|
||||
|
||||
|
||||
|
||||
List<SlittingproductionplanDO> getSlittingproductionplanByDTO(SlittingDownDTO slittingDownDTO);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package cn.code.nl.module.lms.service.slittingproductionplan;
|
||||
|
||||
import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.dto.SlittingDownDTO;
|
||||
import cn.code.nl.module.lms.controller.pda.slittingproduction.eum.SlittingproductionplanStausEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.code.nl.module.lms.controller.admin.slittingproductionplan.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.slittingproductionplan.SlittingproductionplanDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.code.nl.module.lms.dal.mysql.slittingproductionplan.SlittingproductionplanMapper;
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 分切生产计划 Service 实现类
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SlittingproductionplanServiceImpl implements SlittingproductionplanService {
|
||||
|
||||
@Resource
|
||||
private SlittingproductionplanMapper slittingproductionplanMapper;
|
||||
|
||||
@Override
|
||||
public String createSlittingproductionplan(SlittingproductionplanSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SlittingproductionplanDO slittingproductionplan = BeanUtils.toBean(createReqVO, SlittingproductionplanDO.class);
|
||||
slittingproductionplanMapper.insert(slittingproductionplan);
|
||||
|
||||
// 返回
|
||||
return slittingproductionplan.getWorkorderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSlittingproductionplan(SlittingproductionplanSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSlittingproductionplanExists(updateReqVO.getWorkorderId());
|
||||
// 更新
|
||||
SlittingproductionplanDO updateObj = BeanUtils.toBean(updateReqVO, SlittingproductionplanDO.class);
|
||||
slittingproductionplanMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSlittingproductionplan(String id) {
|
||||
// 校验存在
|
||||
validateSlittingproductionplanExists(id);
|
||||
// 删除
|
||||
slittingproductionplanMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSlittingproductionplanListByIds(List<String> ids) {
|
||||
// 删除
|
||||
slittingproductionplanMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateSlittingproductionplanExists(String id) {
|
||||
if (slittingproductionplanMapper.selectById(id) == null) {
|
||||
throw exception(SLITTINGPRODUCTIONPLAN_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SlittingproductionplanDO getSlittingproductionplan(String id) {
|
||||
return slittingproductionplanMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SlittingproductionplanDO> getSlittingproductionplanPage(SlittingproductionplanPageReqVO pageReqVO) {
|
||||
return slittingproductionplanMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SlittingproductionplanDO> getSlittingproductionplanByDTO(SlittingDownDTO slittingDownDTO) {
|
||||
return slittingproductionplanMapper.selectList(new LambdaQueryWrapperX<SlittingproductionplanDO>()
|
||||
.eq(SlittingproductionplanDO::getStatus, SlittingproductionplanStausEnum.START.getCode())
|
||||
.eq(SlittingproductionplanDO::getCutCode, slittingDownDTO.getPointCode()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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="cn.code.nl.module.lms.dal.mysql.slittingproductionplan.SlittingproductionplanMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user