Merge remote-tracking branch 'origin/dev' into test

This commit is contained in:
qianshijiang
2026-01-19 17:53:04 +08:00
39 changed files with 1582 additions and 30 deletions

View File

@@ -66,6 +66,8 @@ public interface ErrorCodeConstants {
ErrorCode PROCESSING_OPERATION_NOT_EXISTS = new ErrorCode(1_027_101_007, "工序不存在"); ErrorCode PROCESSING_OPERATION_NOT_EXISTS = new ErrorCode(1_027_101_007, "工序不存在");
ErrorCode PROCESSING_OPERATION_MATERIAL_NOT_EXISTS = new ErrorCode(1_027_101_008, "工艺工序物料不存在"); ErrorCode PROCESSING_OPERATION_MATERIAL_NOT_EXISTS = new ErrorCode(1_027_101_008, "工艺工序物料不存在");
ErrorCode PLAN_DATE_NOT_EXISTS = new ErrorCode(1_027_101_009, "计划数据不存在"); ErrorCode PLAN_DATE_NOT_EXISTS = new ErrorCode(1_027_101_009, "计划数据不存在");
ErrorCode PLAN_ORD_NOT_EXISTS = new ErrorCode(1_027_101_010, "计划与订单关系不存在");
ErrorCode PLAN_ORD_EXISTS = new ErrorCode(1_027_101_011, "该种类的绑定关系已存在");
// ========== 主数据同步 ========== // ========== 主数据同步 ==========
ErrorCode MASTER_DATA_SYNC_DISABLED = new ErrorCode(1_027_900_001, "主数据同步功能已禁用"); ErrorCode MASTER_DATA_SYNC_DISABLED = new ErrorCode(1_027_900_001, "主数据同步功能已禁用");
ErrorCode MASTER_DATA_SYNC_BATCH_SIZE_TOO_LARGE = new ErrorCode(1_027_900_002, "最大批次不得超过 1000"); ErrorCode MASTER_DATA_SYNC_BATCH_SIZE_TOO_LARGE = new ErrorCode(1_027_900_002, "最大批次不得超过 1000");

View File

@@ -0,0 +1,14 @@
package com.zt.plat.module.erpmonthproductiveplancheck;
import com.zt.plat.framework.common.exception.ErrorCode;
public interface ErrorCodeConstants {
// ========== 示例模块 1-001-000-000 ==========
//模块 base 错误码区间[1-027-000-000 ~1-028-000-000)
ErrorCode ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS = new ErrorCode(1_027_000_709, "ERP月度产品计划核对不存在");
ErrorCode ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS = new ErrorCode(1_027_000_710, "ERP月度产品计划核对明细不存在");
ErrorCode DATA_NOT_ERROR = new ErrorCode(1_027_000_711, "数据错误");
}

View File

@@ -166,6 +166,12 @@
<artifactId>zt-spring-boot-starter-biz-business</artifactId> <artifactId>zt-spring-boot-starter-biz-business</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<dependency>
<groupId>com.zt.plat</groupId>
<artifactId>zt-module-contract-order-api</artifactId>
<version>3.0.47-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@@ -0,0 +1,139 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO;
import com.zt.plat.module.base.service.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckService;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - ERP月度产品计划核对")
@RestController
@RequestMapping("/base/erp-month-productive-plan-check")
@Validated
public class ErpMonthProductivePlanCheckController implements BusinessControllerMarker {
@Resource
private ErpMonthProductivePlanCheckService erpMonthProductivePlanCheckService;
@PostMapping("/create")
@Operation(summary = "创建ERP月度产品计划核对")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:create')")
public CommonResult<ErpMonthProductivePlanCheckRespVO> createErpMonthProductivePlanCheck(@Valid @RequestBody ErpMonthProductivePlanCheckSaveReqVO createReqVO) {
return success(erpMonthProductivePlanCheckService.createErpMonthProductivePlanCheck(createReqVO));
}
@PostMapping("/create-batch")
@Operation(summary = "创建ERP月度产品计划核对")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:create')")
public CommonResult<?> createBatchErpMonthProductivePlanCheck(@Valid @RequestBody List<ErpMonthProductivePlanCheckSaveReqVO> createReqVOList) {
erpMonthProductivePlanCheckService.createBatchErpMonthProductivePlanCheck(createReqVOList);
return success(true);
}
@PutMapping("/update")
@Operation(summary = "更新ERP月度产品计划核对")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:update')")
public CommonResult<Boolean> updateErpMonthProductivePlanCheck(@Valid @RequestBody ErpMonthProductivePlanCheckSaveReqVO updateReqVO) {
erpMonthProductivePlanCheckService.updateErpMonthProductivePlanCheck(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除ERP月度产品计划核对")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:delete')")
public CommonResult<Boolean> deleteErpMonthProductivePlanCheck(@RequestParam("id") Long id) {
erpMonthProductivePlanCheckService.deleteErpMonthProductivePlanCheck(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除ERP月度产品计划核对")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:delete')")
public CommonResult<Boolean> deleteErpMonthProductivePlanCheckList(@RequestBody BatchDeleteReqVO req) {
erpMonthProductivePlanCheckService.deleteErpMonthProductivePlanCheckListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得ERP月度产品计划核对")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:query')")
public CommonResult<ErpMonthProductivePlanCheckRespVO> getErpMonthProductivePlanCheck(@RequestParam("id") Long id) {
ErpMonthProductivePlanCheckDO erpMonthProductivePlanCheck = erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheck(id);
ErpMonthProductivePlanCheckRespVO respVO = BeanUtils.toBean(erpMonthProductivePlanCheck, ErpMonthProductivePlanCheckRespVO.class);
if (respVO != null) {
respVO.setDetails(erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckDetail(id));
}
return success(respVO);
}
@GetMapping("/page")
@Operation(summary = "获得ERP月度产品计划核对分页")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:query')")
public CommonResult<PageResult<ErpMonthProductivePlanCheckRespVO>> getErpMonthProductivePlanCheckPage(@Valid ErpMonthProductivePlanCheckPageReqVO pageReqVO) {
PageResult<ErpMonthProductivePlanCheckDO> pageResult = erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckPage(pageReqVO);
PageResult<ErpMonthProductivePlanCheckRespVO> result = BeanUtils.toBean(pageResult, ErpMonthProductivePlanCheckRespVO.class);
if (result != null && result.getList() != null && !result.getList().isEmpty()){
result.getList().forEach(erpMonthProductivePlanCheckRespVO
-> erpMonthProductivePlanCheckRespVO.setDetails(erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckDetail(erpMonthProductivePlanCheckRespVO.getId())));
}
return success(result);
}
@GetMapping("/export-excel")
@Operation(summary = "导出ERP月度产品计划核对 Excel")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportErpMonthProductivePlanCheckExcel(@Valid ErpMonthProductivePlanCheckPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ErpMonthProductivePlanCheckDO> list = erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "ERP月度产品计划核对.xls", "数据", ErpMonthProductivePlanCheckRespVO.class,
BeanUtils.toBean(list, ErpMonthProductivePlanCheckRespVO.class));
}
//根据id查询明细详情
@GetMapping("/get-detail")
@Operation(summary = "获得ERP月度产品计划核对明细详情")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:query')")
public CommonResult<List<ErpMonthProductivePlanCheckDetailRespVO>> getErpMonthProductivePlanCheckDetail(@RequestParam("id") Long id) {
return success(erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckDetail(id));
}
}

View File

@@ -0,0 +1,112 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO;
import com.zt.plat.module.base.service.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailService;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - ERP月度产品计划核对明细")
@RestController
@RequestMapping("/base/erp-month-productive-plan-check-detail")
@Validated
public class ErpMonthProductivePlanCheckDetailController implements BusinessControllerMarker {
@Resource
private ErpMonthProductivePlanCheckDetailService erpMonthProductivePlanCheckDetailService;
@PostMapping("/create")
@Operation(summary = "创建ERP月度产品计划核对明细")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:create')")
public CommonResult<ErpMonthProductivePlanCheckDetailRespVO> createErpMonthProductivePlanCheckDetail(@Valid @RequestBody ErpMonthProductivePlanCheckDetailSaveReqVO createReqVO) {
return success(erpMonthProductivePlanCheckDetailService.createErpMonthProductivePlanCheckDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新ERP月度产品计划核对明细")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:update')")
public CommonResult<Boolean> updateErpMonthProductivePlanCheckDetail(@Valid @RequestBody ErpMonthProductivePlanCheckDetailSaveReqVO updateReqVO) {
erpMonthProductivePlanCheckDetailService.updateErpMonthProductivePlanCheckDetail(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除ERP月度产品计划核对明细")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:delete')")
public CommonResult<Boolean> deleteErpMonthProductivePlanCheckDetail(@RequestParam("id") Long id) {
erpMonthProductivePlanCheckDetailService.deleteErpMonthProductivePlanCheckDetail(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除ERP月度产品计划核对明细")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:delete')")
public CommonResult<Boolean> deleteErpMonthProductivePlanCheckDetailList(@RequestBody BatchDeleteReqVO req) {
erpMonthProductivePlanCheckDetailService.deleteErpMonthProductivePlanCheckDetailListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得ERP月度产品计划核对明细")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:query')")
public CommonResult<ErpMonthProductivePlanCheckDetailRespVO> getErpMonthProductivePlanCheckDetail(@RequestParam("id") Long id) {
ErpMonthProductivePlanCheckDetailDO erpMonthProductivePlanCheckDetail = erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetail(id);
return success(BeanUtils.toBean(erpMonthProductivePlanCheckDetail, ErpMonthProductivePlanCheckDetailRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得ERP月度产品计划核对明细分页")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:query')")
public CommonResult<PageResult<ErpMonthProductivePlanCheckDetailRespVO>> getErpMonthProductivePlanCheckDetailPage(@Valid ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO) {
PageResult<ErpMonthProductivePlanCheckDetailDO> pageResult = erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetailPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ErpMonthProductivePlanCheckDetailRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出ERP月度产品计划核对明细 Excel")
@PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportErpMonthProductivePlanCheckDetailExcel(@Valid ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ErpMonthProductivePlanCheckDetailDO> list = erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetailPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "ERP月度产品计划核对明细.xls", "数据", ErpMonthProductivePlanCheckDetailRespVO.class,
BeanUtils.toBean(list, ErpMonthProductivePlanCheckDetailRespVO.class));
}
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - ERP月度产品计划核对明细分页 Request VO")
@Data
public class ErpMonthProductivePlanCheckDetailPageReqVO extends PageParam {
@Schema(description = "日期格式YYYY-MM-DD")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] date;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "")
private BigDecimal value;
@Schema(description = "主数据ID关联主表ID", example = "3745")
private Long mainId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,40 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.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 com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - ERP月度产品计划核对明细 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ErpMonthProductivePlanCheckDetailRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14111")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "日期格式YYYY-MM-DD")
@ExcelProperty("日期格式YYYY-MM-DD")
private String date;
@Schema(description = "排序")
@ExcelProperty("排序")
private Integer sort;
@Schema(description = "")
@ExcelProperty("")
private BigDecimal value;
@Schema(description = "主数据ID关联主表ID", example = "3745")
@ExcelProperty("主数据ID关联主表ID")
private Long mainId;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,28 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - ERP月度产品计划核对明细新增/修改 Request VO")
@Data
public class ErpMonthProductivePlanCheckDetailSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14111")
private Long id;
@Schema(description = "日期格式YYYY-MM-DD")
private String date;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "")
private BigDecimal value;
@Schema(description = "主数据ID关联主表ID", example = "3745")
private Long mainId;
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - ERP月度产品计划核对分页 Request VO")
@Data
public class ErpMonthProductivePlanCheckPageReqVO extends PageParam {
@Schema(description = "产品名")
private String product;
@Schema(description = "年度")
private String year;
@Schema(description = "月份")
private String month;
@Schema(description = "月计划量")
private BigDecimal monthPlan;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.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 com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - ERP月度产品计划核对 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ErpMonthProductivePlanCheckRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19081")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "产品名")
@ExcelProperty("产品名")
private String product;
@Schema(description = "年度")
@ExcelProperty("年度")
private String year;
@Schema(description = "月份")
@ExcelProperty("月份")
private String month;
@Schema(description = "月计划量")
@ExcelProperty("月计划量")
private BigDecimal monthPlan;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "详情")
@ExcelProperty("详情")
private List<ErpMonthProductivePlanCheckDetailRespVO> details;
}

View File

@@ -0,0 +1,31 @@
package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - ERP月度产品计划核对新增/修改 Request VO")
@Data
public class ErpMonthProductivePlanCheckSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19081")
private Long id;
@Schema(description = "产品名")
private String product;
@Schema(description = "年度")
private String year;
@Schema(description = "月份")
private String month;
@Schema(description = "月计划量")
private BigDecimal monthPlan;
@Schema(description = "月计划明细")
private List<ErpMonthProductivePlanCheckDetailSaveReqVO> details;
}

View File

@@ -113,7 +113,7 @@ public class PlanDateController implements BusinessControllerMarker {
@GetMapping("/tree/list-all") @GetMapping("/tree/list-all")
@Operation(summary = "查询所有计划数据(树形结构)") @Operation(summary = "查询所有计划数据(树形结构)")
@PreAuthorize("@ss.hasPermission('base:plan-date:query')") @PreAuthorize("@ss.hasPermission('base:plan-date:query')")
public List<PlanDateRespVO> listAllPlanDateTree() { public CommonResult<List<PlanDateRespVO>> listAllPlanDateTree() {
return planDateService.listPlanDateTree(); return success(planDateService.listPlanDateTree());
} }
} }

View File

@@ -0,0 +1,59 @@
package com.zt.plat.module.base.controller.admin.plandate;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderSaveReqVO;
import com.zt.plat.module.base.service.plandate.PlanOrderService;
import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO;
import com.zt.plat.module.contractorder.api.dto.order.OrderDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Delete;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 计划数据与订单绑定")
@RestController
@RequestMapping("/base/plan-order")
@Validated
public class PlanOrderController {
@Resource
private PlanOrderService planOrderService;
//绑定订单
@PostMapping("/bind-order")
@Operation(summary = "计划与订单绑定")
@PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:query'})")
public CommonResult<?> bindOrder(@RequestBody PlanOrderSaveReqVO reqVO) {
return success( planOrderService.bindOrder(reqVO));
}
//解绑订单
@DeleteMapping("/release-order")
@Operation(summary = "计划与订单解绑")
@PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:releaseOrder'})")
public CommonResult<?> unbindOrder(@RequestParam("planId") String planId,@RequestParam("orderNumber") String orderNumber) {
planOrderService.unbindOrder(planId, orderNumber);
return success(true);
}
//根据订单号获取已绑定的订单
@GetMapping("/get-bound-order")
@Operation(summary = "根据计划ID获取已绑定的订单")
@PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:query'})")
public CommonResult<?> getBoundOrder(@RequestParam("planId") String planId) {
return success(planOrderService.getBoundOrder(planId));
}
//根据计划和订单的参数查询相关的订单
@PostMapping("/query-order-plan-data")
@Operation(summary = "根据计划和订单的参数查询相关的订单")
@PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:query'})")
public CommonResult<PageResult<OrderDTO>> queryOrder(@RequestBody OrderAndPlanDataReqDTO reqVO) {
return success(planOrderService.queryOrderAndPlanData(reqVO));
}
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.base.controller.admin.plandate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "计划数据与订单绑定响应VO")
public class PlanOrderRspVO {
/**
* 编号
*/
@Schema(description = "编号")
private Long id;
/**
* 订单编号
*/
@Schema(description = "订单号")
private String orderNumber;
/**
* 订单类型
*/
@Schema(description = "订单类型")
private String orderType;
/**
* 计划ID
*/
@Schema(description = "计划ID")
private Long planId;
/**
* 订单状态
*/
@Schema(description = "订单状态")
private String orderStatus;
}

View File

@@ -0,0 +1,35 @@
package com.zt.plat.module.base.controller.admin.plandate.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "保存计划数据与订单绑定的请求VO")
public class PlanOrderSaveReqVO {
/**
* 编号
*/
@Schema(description = "编号")
private Long id;
/**
* 订单编号
*/
@Schema(description = "订单号")
private String orderNumber;
/**
* 订单类型
*/
@Schema(description = "订单类型")
private String orderType;
/**
* 订单ID
*/
@Schema(description = "订单ID")
private Long orderId;
/**
* 计划ID
*/
@Schema(description = "计划ID")
private Long planId;
}

View File

@@ -0,0 +1,31 @@
package com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
* ERP月度产品计划核对明细 Mapper
*
* @author 后台管理-1
*/
@Mapper
public interface ErpMonthProductivePlanCheckDetailMapper extends BaseMapperX<ErpMonthProductivePlanCheckDetailDO> {
default PageResult<ErpMonthProductivePlanCheckDetailDO> selectPage(ErpMonthProductivePlanCheckDetailPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ErpMonthProductivePlanCheckDetailDO>()
.betweenIfPresent(ErpMonthProductivePlanCheckDetailDO::getDate, reqVO.getDate())
.eqIfPresent(ErpMonthProductivePlanCheckDetailDO::getSort, reqVO.getSort())
.eqIfPresent(ErpMonthProductivePlanCheckDetailDO::getValue, reqVO.getValue())
.eqIfPresent(ErpMonthProductivePlanCheckDetailDO::getMainId, reqVO.getMainId())
.betweenIfPresent(ErpMonthProductivePlanCheckDetailDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ErpMonthProductivePlanCheckDetailDO::getId));
}
}

View File

@@ -0,0 +1,32 @@
package com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO;
import org.apache.ibatis.annotations.Mapper;
/**
* ERP月度产品计划核对 Mapper
*
* @author 后台管理-1
*/
@Mapper
public interface ErpMonthProductivePlanCheckMapper extends BaseMapperX<ErpMonthProductivePlanCheckDO> {
default PageResult<ErpMonthProductivePlanCheckDO> selectPage(ErpMonthProductivePlanCheckPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ErpMonthProductivePlanCheckDO>()
.eqIfPresent(ErpMonthProductivePlanCheckDO::getProduct, reqVO.getProduct())
.eqIfPresent(ErpMonthProductivePlanCheckDO::getYear, reqVO.getYear())
.eqIfPresent(ErpMonthProductivePlanCheckDO::getMonth, reqVO.getMonth())
.eqIfPresent(ErpMonthProductivePlanCheckDO::getMonthPlan, reqVO.getMonthPlan())
.betweenIfPresent(ErpMonthProductivePlanCheckDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ErpMonthProductivePlanCheckDO::getId));
}
}

View File

@@ -0,0 +1,9 @@
package com.zt.plat.module.base.dal.dao.plandate;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.base.dal.dataobject.plandate.PlanOrderDO;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PlanOrderMapper extends BaseMapperX<PlanOrderDO> {
}

View File

@@ -0,0 +1,56 @@
package com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* ERP月度产品计划核对 DO
*
* @author 后台管理-1
*/
@TableName("bes_erp_mnt_pdtv_pln_chk")
@KeySequence("bes_erp_mnt_pdtv_pln_chk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ErpMonthProductivePlanCheckDO extends BusinessBaseDO {
/**
* 主键ID
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 产品名
*/
@TableField("PDT")
private String product;
/**
* 年度
*/
@TableField("YR")
private String year;
/**
* 月份
*/
@TableField("MNT")
private String month;
/**
* 月计划量
*/
@TableField("MNT_PLN")
private BigDecimal monthPlan;
}

View File

@@ -0,0 +1,56 @@
package com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* ERP月度产品计划核对明细 DO
*
* @author 后台管理-1
*/
@TableName("bes_erp_mnt_pdtv_pln_chk_dtl")
@KeySequence("bes_erp_mnt_pdtv_pln_chk_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ErpMonthProductivePlanCheckDetailDO extends BusinessBaseDO {
/**
* 主键ID
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 日期格式YYYY-MM-DD
*/
@TableField("DT")
private String date;
/**
* 排序
*/
@TableField("SRT")
private Integer sort;
/**
* 值
*/
@TableField("VAL")
private BigDecimal value;
/**
* 主数据ID关联主表ID
*/
@TableField("MAIN_ID")
private Long mainId;
}

View File

@@ -0,0 +1,51 @@
package com.zt.plat.module.base.dal.dataobject.plandate;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
/**
* 计划订单 DO
*
* @author 后台管理-1
*/
@TableName("bse_pln_ord_corr")
@KeySequence("bse_pln_ord_corr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class PlanOrderDO extends BusinessBaseDO {
/**
* 编号
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 订单编号
*/
@TableField("ORD_NUM")
private String orderNumber;
/**
* 订单类型
*/
@TableField("ORD_ID")
private Long orderId;
/**
* 订单类型
*/
@TableField("ORD_TP")
private String orderType;
/**
* 计划ID
*/
@TableField("PLN_ID")
private Long planId;
}

View File

@@ -0,0 +1,81 @@
package com.zt.plat.module.base.service.erpmonthproductiveplancheck;
import java.util.*;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO;
import jakarta.validation.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
/**
* ERP月度产品计划核对明细 Service 接口
*
* @author 后台管理-1
*/
public interface ErpMonthProductivePlanCheckDetailService {
/**
* 创建ERP月度产品计划核对明细
*
* @param createReqVO 创建信息
* @return 编号
*/
ErpMonthProductivePlanCheckDetailRespVO createErpMonthProductivePlanCheckDetail(@Valid ErpMonthProductivePlanCheckDetailSaveReqVO createReqVO);
/**
* 创建ERP月度产品计划核对明细
*
* @param createReqVOS 创建信息
* @return 编号
*/
List<ErpMonthProductivePlanCheckDetailRespVO> createErpMonthProductivePlanCheckDetail(@Valid List<ErpMonthProductivePlanCheckDetailSaveReqVO> createReqVOS);
/**
* 更新ERP月度产品计划核对明细
*
* @param updateReqVO 更新信息
*/
void updateErpMonthProductivePlanCheckDetail(@Valid ErpMonthProductivePlanCheckDetailSaveReqVO updateReqVO);
/**
* 删除ERP月度产品计划核对明细
*
* @param id 编号
*/
void deleteErpMonthProductivePlanCheckDetail(Long id);
/**
* 批量删除ERP月度产品计划核对明细
*
* @param ids 编号
*/
void deleteErpMonthProductivePlanCheckDetailListByIds(List<Long> ids);
/**
* 获得ERP月度产品计划核对明细
*
* @param id 编号
* @return ERP月度产品计划核对明细
*/
ErpMonthProductivePlanCheckDetailDO getErpMonthProductivePlanCheckDetail(Long id);
/**
* 获得ERP月度产品计划核对明细分页
*
* @param pageReqVO 分页查询
* @return ERP月度产品计划核对明细分页
*/
PageResult<ErpMonthProductivePlanCheckDetailDO> getErpMonthProductivePlanCheckDetailPage(ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO);
/**
* 根据mainId获取到ERP月度产品计划核对明细
*
* @param mainId 分页查询
* @return ERP月度产品计划核对明细
*/
List<ErpMonthProductivePlanCheckDetailRespVO> getErpMonthProductivePlanCheckDetailListByMainId(Long mainId);
}

View File

@@ -0,0 +1,106 @@
package com.zt.plat.module.base.service.erpmonthproductiveplancheck;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailSaveReqVO;
import com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailMapper;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.erpmonthproductiveplancheck.ErrorCodeConstants.ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS;
/**
* ERP月度产品计划核对明细 Service 实现类
*
* @author 后台管理-1
*/
@Service
@Validated
public class ErpMonthProductivePlanCheckDetailServiceImpl implements ErpMonthProductivePlanCheckDetailService {
@Resource
private ErpMonthProductivePlanCheckDetailMapper erpMonthProductivePlanCheckDetailMapper;
@Override
public ErpMonthProductivePlanCheckDetailRespVO createErpMonthProductivePlanCheckDetail(ErpMonthProductivePlanCheckDetailSaveReqVO createReqVO) {
// 插入
ErpMonthProductivePlanCheckDetailDO erpMonthProductivePlanCheckDetail = BeanUtils.toBean(createReqVO, ErpMonthProductivePlanCheckDetailDO.class);
erpMonthProductivePlanCheckDetailMapper.insert(erpMonthProductivePlanCheckDetail);
// 返回
return BeanUtils.toBean(erpMonthProductivePlanCheckDetail, ErpMonthProductivePlanCheckDetailRespVO.class);
}
@Override
public List<ErpMonthProductivePlanCheckDetailRespVO> createErpMonthProductivePlanCheckDetail(List<ErpMonthProductivePlanCheckDetailSaveReqVO> createReqVOS) {
if (CollUtil.isEmpty(createReqVOS)) {
return List.of();
}
List<ErpMonthProductivePlanCheckDetailDO> erpMonthProductivePlanCheckDetails = BeanUtils.toBean(createReqVOS, ErpMonthProductivePlanCheckDetailDO.class);
erpMonthProductivePlanCheckDetailMapper.insertBatch(erpMonthProductivePlanCheckDetails);
return BeanUtils.toBean(erpMonthProductivePlanCheckDetails, ErpMonthProductivePlanCheckDetailRespVO.class);
}
@Override
public void updateErpMonthProductivePlanCheckDetail(ErpMonthProductivePlanCheckDetailSaveReqVO updateReqVO) {
// 校验存在
validateErpMonthProductivePlanCheckDetailExists(updateReqVO.getId());
// 更新
ErpMonthProductivePlanCheckDetailDO updateObj = BeanUtils.toBean(updateReqVO, ErpMonthProductivePlanCheckDetailDO.class);
erpMonthProductivePlanCheckDetailMapper.updateById(updateObj);
}
@Override
public void deleteErpMonthProductivePlanCheckDetail(Long id) {
// 校验存在
validateErpMonthProductivePlanCheckDetailExists(id);
// 删除
erpMonthProductivePlanCheckDetailMapper.deleteById(id);
}
@Override
public void deleteErpMonthProductivePlanCheckDetailListByIds(List<Long> ids) {
// 校验存在
validateErpMonthProductivePlanCheckDetailExists(ids);
// 删除
erpMonthProductivePlanCheckDetailMapper.deleteByIds(ids);
}
private void validateErpMonthProductivePlanCheckDetailExists(List<Long> ids) {
List<ErpMonthProductivePlanCheckDetailDO> list = erpMonthProductivePlanCheckDetailMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS);
}
}
private void validateErpMonthProductivePlanCheckDetailExists(Long id) {
if (erpMonthProductivePlanCheckDetailMapper.selectById(id) == null) {
throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS);
}
}
@Override
public ErpMonthProductivePlanCheckDetailDO getErpMonthProductivePlanCheckDetail(Long id) {
return erpMonthProductivePlanCheckDetailMapper.selectById(id);
}
@Override
public PageResult<ErpMonthProductivePlanCheckDetailDO> getErpMonthProductivePlanCheckDetailPage(ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO) {
return erpMonthProductivePlanCheckDetailMapper.selectPage(pageReqVO);
}
@Override
public List<ErpMonthProductivePlanCheckDetailRespVO> getErpMonthProductivePlanCheckDetailListByMainId(Long mainId) {
return BeanUtils.toBean(erpMonthProductivePlanCheckDetailMapper.selectList(ErpMonthProductivePlanCheckDetailDO::getMainId, mainId), ErpMonthProductivePlanCheckDetailRespVO.class);
}
}

View File

@@ -0,0 +1,78 @@
package com.zt.plat.module.base.service.erpmonthproductiveplancheck;
import java.util.*;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO;
import jakarta.validation.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
/**
* ERP月度产品计划核对 Service 接口
*
* @author 后台管理-1
*/
public interface ErpMonthProductivePlanCheckService {
/**
* 创建ERP月度产品计划核对
*
* @param createReqVO 创建信息
* @return 编号
*/
ErpMonthProductivePlanCheckRespVO createErpMonthProductivePlanCheck(@Valid ErpMonthProductivePlanCheckSaveReqVO createReqVO);
/**
* 更新ERP月度产品计划核对
*
* @param updateReqVO 更新信息
*/
void updateErpMonthProductivePlanCheck(@Valid ErpMonthProductivePlanCheckSaveReqVO updateReqVO);
/**
* 删除ERP月度产品计划核对
*
* @param id 编号
*/
void deleteErpMonthProductivePlanCheck(Long id);
/**
* 批量删除ERP月度产品计划核对
*
* @param ids 编号
*/
void deleteErpMonthProductivePlanCheckListByIds(List<Long> ids);
/**
* 获得ERP月度产品计划核对
*
* @param id 编号
* @return ERP月度产品计划核对
*/
ErpMonthProductivePlanCheckDO getErpMonthProductivePlanCheck(Long id);
/**
* 获得ERP月度产品计划核对分页
*
* @param pageReqVO 分页查询
* @return ERP月度产品计划核对分页
*/
PageResult<ErpMonthProductivePlanCheckDO> getErpMonthProductivePlanCheckPage(ErpMonthProductivePlanCheckPageReqVO pageReqVO);
/**
* 批量创建ERP月度产品计划核对
*
* @param createReqVOList 创建信息
*/
void createBatchErpMonthProductivePlanCheck(List<ErpMonthProductivePlanCheckSaveReqVO> createReqVOList);
/**
* 获得ERP月度产品计划核对明细
*
* @param id 编号
* @return ERP月度产品计划核对明细
*/
List<ErpMonthProductivePlanCheckDetailRespVO> getErpMonthProductivePlanCheckDetail(Long id);
}

View File

@@ -0,0 +1,133 @@
package com.zt.plat.module.base.service.erpmonthproductiveplancheck;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckRespVO;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckSaveReqVO;
import com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckMapper;
import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.util.ArrayList;
import java.util.List;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.erpmonthproductiveplancheck.ErrorCodeConstants.DATA_NOT_ERROR;
import static com.zt.plat.module.erpmonthproductiveplancheck.ErrorCodeConstants.ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS;
/**
* ERP月度产品计划核对 Service 实现类
*
* @author 后台管理-1
*/
@Service
@Validated
public class ErpMonthProductivePlanCheckServiceImpl implements ErpMonthProductivePlanCheckService {
@Resource
private ErpMonthProductivePlanCheckMapper erpMonthProductivePlanCheckMapper;
@Resource
private ErpMonthProductivePlanCheckDetailService erpMonthProductivePlanCheckDetailService;
@Override
public ErpMonthProductivePlanCheckRespVO createErpMonthProductivePlanCheck(ErpMonthProductivePlanCheckSaveReqVO createReqVO) {
// 插入
ErpMonthProductivePlanCheckDO erpMonthProductivePlanCheck = BeanUtils.toBean(createReqVO, ErpMonthProductivePlanCheckDO.class);
erpMonthProductivePlanCheckMapper.insert(erpMonthProductivePlanCheck);
List<ErpMonthProductivePlanCheckDetailRespVO> erpMonthProductivePlanCheckDetail = new ArrayList<>();
if (createReqVO.getDetails() != null && !createReqVO.getDetails().isEmpty()) {
createReqVO.getDetails().forEach(detail -> detail.setMainId(erpMonthProductivePlanCheck.getId()));
erpMonthProductivePlanCheckDetail = erpMonthProductivePlanCheckDetailService.createErpMonthProductivePlanCheckDetail(createReqVO.getDetails());
}
// 返回
ErpMonthProductivePlanCheckRespVO erpMonthProductivePlanCheckRespVO = BeanUtils.toBean(erpMonthProductivePlanCheck, ErpMonthProductivePlanCheckRespVO.class);
erpMonthProductivePlanCheckRespVO.setDetails(erpMonthProductivePlanCheckDetail);
return erpMonthProductivePlanCheckRespVO;
}
@Override
public void updateErpMonthProductivePlanCheck(ErpMonthProductivePlanCheckSaveReqVO updateReqVO) {
// 校验存在
validateErpMonthProductivePlanCheckExists(updateReqVO.getId());
// 更新
ErpMonthProductivePlanCheckDO updateObj = BeanUtils.toBean(updateReqVO, ErpMonthProductivePlanCheckDO.class);
erpMonthProductivePlanCheckMapper.updateById(updateObj);
}
@Override
public void deleteErpMonthProductivePlanCheck(Long id) {
// 校验存在
validateErpMonthProductivePlanCheckExists(id);
// 删除
erpMonthProductivePlanCheckMapper.deleteById(id);
}
@Override
public void deleteErpMonthProductivePlanCheckListByIds(List<Long> ids) {
// 校验存在
validateErpMonthProductivePlanCheckExists(ids);
// 删除
erpMonthProductivePlanCheckMapper.deleteByIds(ids);
}
private void validateErpMonthProductivePlanCheckExists(List<Long> ids) {
List<ErpMonthProductivePlanCheckDO> list = erpMonthProductivePlanCheckMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS);
}
}
private void validateErpMonthProductivePlanCheckExists(Long id) {
if (erpMonthProductivePlanCheckMapper.selectById(id) == null) {
throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS);
}
}
@Override
public ErpMonthProductivePlanCheckDO getErpMonthProductivePlanCheck(Long id) {
return erpMonthProductivePlanCheckMapper.selectById(id);
}
@Override
public PageResult<ErpMonthProductivePlanCheckDO> getErpMonthProductivePlanCheckPage(ErpMonthProductivePlanCheckPageReqVO pageReqVO) {
return erpMonthProductivePlanCheckMapper.selectPage(pageReqVO);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void createBatchErpMonthProductivePlanCheck(List<ErpMonthProductivePlanCheckSaveReqVO> createReqVOList) {
if (createReqVOList == null || createReqVOList.isEmpty()) {
throw exception(DATA_NOT_ERROR);
}
createReqVOList.forEach(createReqVO -> {
ErpMonthProductivePlanCheckDO erpMonthProductivePlanCheck = BeanUtils.toBean(createReqVO, ErpMonthProductivePlanCheckDO.class);
erpMonthProductivePlanCheckMapper.insert(erpMonthProductivePlanCheck);
if (createReqVO.getDetails() != null && !createReqVO.getDetails().isEmpty()) {
createReqVO.getDetails().forEach(detail -> detail.setMainId(erpMonthProductivePlanCheck.getId()));
erpMonthProductivePlanCheckDetailService.createErpMonthProductivePlanCheckDetail(createReqVO.getDetails());
}
});
}
@Override
public List<ErpMonthProductivePlanCheckDetailRespVO> getErpMonthProductivePlanCheckDetail(Long id) {
return setErpMonthProductivePlanCheckDetailData(id);
}
private List<ErpMonthProductivePlanCheckDetailRespVO> setErpMonthProductivePlanCheckDetailData(Long id){
if (id == null){
return new ArrayList<>();
}
return erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetailListByMainId(id);
}
}

View File

@@ -0,0 +1,20 @@
package com.zt.plat.module.base.service.plandate;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderRspVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderSaveReqVO;
import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO;
import com.zt.plat.module.contractorder.api.dto.order.OrderDTO;
public interface PlanOrderService {
PlanOrderRspVO bindOrder(PlanOrderSaveReqVO reqVO);
void unbindOrder(String planId, String orderNumber);
PageResult<OrderDTO> getBoundOrder(String id);
PageResult<OrderDTO> queryOrderAndPlanData(OrderAndPlanDataReqDTO reqVO);
}

View File

@@ -0,0 +1,74 @@
package com.zt.plat.module.base.service.plandate;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderRspVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderSaveReqVO;
import com.zt.plat.module.base.dal.dao.plandate.PlanOrderMapper;
import com.zt.plat.module.base.dal.dataobject.plandate.PlanOrderDO;
import com.zt.plat.module.contractorder.api.OrderApi;
import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO;
import com.zt.plat.module.contractorder.api.dto.order.OrderDTO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
@Service
@Validated
public class PlanOrderServiceImpl implements PlanOrderService {
@Resource
private PlanOrderMapper planOrderMapper;
@Resource
private OrderApi orderApi;
@Override
public PlanOrderRspVO bindOrder(PlanOrderSaveReqVO reqVO) {
PlanOrderDO bean = BeanUtils.toBean(reqVO, PlanOrderDO.class);
//校验当前计划下是否已存在该类型的订单
validateExists(reqVO);
planOrderMapper.insert(bean);
return BeanUtils.toBean(bean, PlanOrderRspVO.class);
}
@Override
public void unbindOrder(String planId, String orderNumber) {
//检验存在
validateExists(planId, orderNumber);
planOrderMapper.delete(new LambdaQueryWrapper<PlanOrderDO>().eq(PlanOrderDO::getPlanId, planId).eq(PlanOrderDO::getOrderNumber, orderNumber));
}
@Override
public PageResult<OrderDTO> getBoundOrder(String id) {
OrderAndPlanDataReqDTO reqVO = new OrderAndPlanDataReqDTO();
reqVO.setPlanId(id);
CommonResult<PageResult<OrderDTO>> pageResultCommonResult = orderApi.queryOrderPlanData(reqVO);
return pageResultCommonResult.getData();
}
@Override
public PageResult<OrderDTO> queryOrderAndPlanData(OrderAndPlanDataReqDTO reqVO) {
CommonResult<PageResult<OrderDTO>> pageResultCommonResult = orderApi.queryOrderPlanData(reqVO);
return pageResultCommonResult.getData();
}
private void validateExists(PlanOrderSaveReqVO reqVO) {
if (planOrderMapper.exists(new LambdaQueryWrapper<PlanOrderDO>().eq(PlanOrderDO::getPlanId, reqVO.getPlanId()).eq(PlanOrderDO::getOrderType, reqVO.getOrderType()).eq(PlanOrderDO::getOrderNumber, reqVO.getOrderNumber()))) {
throw exception(PLAN_ORD_EXISTS);
}
}
private void validateExists(String planId, String orderNumber) {
if (planOrderMapper.selectOne(new LambdaQueryWrapper<PlanOrderDO>().eq(PlanOrderDO::getPlanId, planId).eq(PlanOrderDO::getOrderNumber, orderNumber),false) == null) {
throw exception(PLAN_ORD_NOT_EXISTS);
}
}
}

View File

@@ -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="com.zt.plat.module.baes.dal.dao.erpmonthproductiveplancheckdetail.ErpMonthProductivePlanCheckDetailMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@@ -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="com.zt.plat.module.bes.dal.dao.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@@ -1,6 +1,8 @@
package com.zt.plat.module.contractorder.api; package com.zt.plat.module.contractorder.api;
import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO;
import com.zt.plat.module.contractorder.api.dto.order.OrderDTO; import com.zt.plat.module.contractorder.api.dto.order.OrderDTO;
import com.zt.plat.module.contractorder.api.dto.order.SalesOrdDtlDTO; import com.zt.plat.module.contractorder.api.dto.order.SalesOrdDtlDTO;
import com.zt.plat.module.contractorder.api.dto.order.UpdateOrderLstQtyDTO; import com.zt.plat.module.contractorder.api.dto.order.UpdateOrderLstQtyDTO;
@@ -44,4 +46,8 @@ public interface OrderApi {
@GetMapping(PREFIX + "/get-salas-order-details-by-id") @GetMapping(PREFIX + "/get-salas-order-details-by-id")
@Operation(summary = "通过销售订单明细id获取销售订单详情", description = "通过销售订单明细id获取销售订单详情") @Operation(summary = "通过销售订单明细id获取销售订单详情", description = "通过销售订单明细id获取销售订单详情")
CommonResult<SalesOrdDtlDTO> getSalesOrderDetailsByOrderId(@RequestParam("id") Long id); CommonResult<SalesOrdDtlDTO> getSalesOrderDetailsByOrderId(@RequestParam("id") Long id);
@PostMapping(PREFIX + "/query-order-plan-data")
@Operation(summary = "根据计划和订单的参数查询相关的订单", description = "根据计划和订单的参数查询相关的订单")
CommonResult<PageResult<OrderDTO>> queryOrderPlanData(@RequestBody @Valid OrderAndPlanDataReqDTO reqVO);
} }

View File

@@ -0,0 +1,41 @@
package com.zt.plat.module.contractorder.api.dto.order;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
@Data
@Schema(description = "订单和计划数据请求DTO")
@Validated
public class OrderAndPlanDataReqDTO extends PageParam {
//合同编号
@Schema(description = "合同编号")
private String contractSystemNumber;
//纸质合同编号
@Schema(description = "纸质合同编号")
private String paperContractNumber;
//订单号
@Schema(description = "订单号")
private String orderNumber;
//订单分类
@Schema(description = "订单分类")
//@NotEmpty(message = "订单分类不能为空")
private String orderType;
//物料编码
@Schema(description = "物料编码")
private String materialNumber;
//物料名称
@Schema(description = "物料名称")
private String materialName;
//客商编码
@Schema(description = "客商编码")
private String customerNumber;
//客商名称
@Schema(description = "客商名称")
private String customerName;
//计划编号
@Schema(description = "计划编号")
@NotEmpty(message = "计划Id不能为空")
private String planId;
}

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.api;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import com.zt.plat.framework.common.exception.ErrorCode; import com.zt.plat.framework.common.exception.ErrorCode;
import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.contractorder.api.dto.order.*; import com.zt.plat.module.contractorder.api.dto.order.*;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO; import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
@@ -183,6 +184,13 @@ public class OrderApiImpl implements OrderApi {
return success(BeanUtils.toBean(salesOrderDetailDOS, SalesOrdDtlDTO.class)); return success(BeanUtils.toBean(salesOrderDetailDOS, SalesOrdDtlDTO.class));
} }
@Override
public CommonResult<PageResult<OrderDTO>> queryOrderPlanData(OrderAndPlanDataReqDTO reqVO) {
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.queryOrderAndPlanData(reqVO);
List<OrderDTO> bean = BeanUtils.toBean(pageResult.getList(), OrderDTO.class);
return success(new PageResult<>(bean, pageResult.getTotal()));
}
private List<SalesOrderDO> getOrderByIds(List<Long> ids) { private List<SalesOrderDO> getOrderByIds(List<Long> ids) {
return SpringUtil.getBean(SalesOrderMapper.class).selectByIds(ids); // 采购订单与销售订单的 return SpringUtil.getBean(SalesOrderMapper.class).selectByIds(ids); // 采购订单与销售订单的
} }

View File

@@ -52,14 +52,14 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建采购订单") @Operation(summary = "创建采购订单")
@PreAuthorize("@ss.hasPermission('base:purchase-order:create')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:create','purchase:order:list:OrderList:add')")
public CommonResult<PurchaseOrderRespVO> createPurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO createReqVO) { public CommonResult<PurchaseOrderRespVO> createPurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO createReqVO) {
return success(purchaseOrderService.createPurchaseOrder(createReqVO)); return success(purchaseOrderService.createPurchaseOrder(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@Operation(summary = "更新采购订单") @Operation(summary = "更新采购订单")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<Boolean> updatePurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO updateReqVO) { public CommonResult<Boolean> updatePurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO updateReqVO) {
purchaseOrderService.updatePurchaseOrder(updateReqVO); purchaseOrderService.updatePurchaseOrder(updateReqVO);
return success(true); return success(true);
@@ -68,7 +68,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除采购订单") @Operation(summary = "删除采购订单")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:purchase-order:delete')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:delete','purchase:order:list:OrderList:delete')")
public CommonResult<Boolean> deletePurchaseOrder(@RequestParam("id") Long id) { public CommonResult<Boolean> deletePurchaseOrder(@RequestParam("id") Long id) {
purchaseOrderService.deletePurchaseOrder(id); purchaseOrderService.deletePurchaseOrder(id);
return success(true); return success(true);
@@ -77,7 +77,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@DeleteMapping("/delete-list") @DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true) @Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除采购订单") @Operation(summary = "批量删除采购订单")
@PreAuthorize("@ss.hasPermission('base:purchase-order:delete')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:delete','purchase:order:list:OrderList:delete')")
public CommonResult<Boolean> deletePurchaseOrderList(@RequestBody BatchDeleteReqVO req) { public CommonResult<Boolean> deletePurchaseOrderList(@RequestBody BatchDeleteReqVO req) {
purchaseOrderService.deletePurchaseOrderListByIds(req.getIds()); purchaseOrderService.deletePurchaseOrderListByIds(req.getIds());
return success(true); return success(true);
@@ -86,7 +86,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@GetMapping("/get") @GetMapping("/get")
@Operation(summary = "获得采购订单") @Operation(summary = "获得采购订单")
@Parameter(name = "id", description = "id是订单主键splyBsnTp是订单类型采购或者是消费", required = true, example = "1024") @Parameter(name = "id", description = "id是订单主键splyBsnTp是订单类型采购或者是消费", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:purchase-order:query')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
public CommonResult<PurchaseOrderRespVO> getPurchaseOrder(@RequestParam("id") Long id, @RequestParam(value = "splyBsnTp", required = false) String splyBsnTp) { public CommonResult<PurchaseOrderRespVO> getPurchaseOrder(@RequestParam("id") Long id, @RequestParam(value = "splyBsnTp", required = false) String splyBsnTp) {
PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id, splyBsnTp); PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id, splyBsnTp);
PurchaseOrderRespVO purchaseOrderRespVO = BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class); PurchaseOrderRespVO purchaseOrderRespVO = BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class);
@@ -99,7 +99,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得采购订单分页") @Operation(summary = "获得采购订单分页")
@PreAuthorize("@ss.hasPermission('base:purchase-order:query')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) { public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) {
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO); PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO);
PageResult<PurchaseOrderRespVO> purchaseOrderRespVOPageResult = BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class); PageResult<PurchaseOrderRespVO> purchaseOrderRespVOPageResult = BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class);
@@ -112,7 +112,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出采购订单 Excel") @Operation(summary = "导出采购订单 Excel")
@PreAuthorize("@ss.hasPermission('base:purchase-order:export')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:export')")
@ApiAccessLog(operateType = EXPORT) @ApiAccessLog(operateType = EXPORT)
public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO, public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
@@ -126,7 +126,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
//提交订单审核 //提交订单审核
@PostMapping("/submit-order") @PostMapping("/submit-order")
@Operation(summary = "提交订单审核") @Operation(summary = "提交订单审核")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<Boolean> submitOrder(@RequestParam("id") String id) { public CommonResult<Boolean> submitOrder(@RequestParam("id") String id) {
purchaseOrderService.submitOrder(Long.valueOf(id)); purchaseOrderService.submitOrder(Long.valueOf(id));
return success(true); return success(true);
@@ -134,7 +134,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@PostMapping("/submit-order-batch") @PostMapping("/submit-order-batch")
@Operation(summary = "批量提交订单审核") @Operation(summary = "批量提交订单审核")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<Boolean> submitOrder(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> ids) { public CommonResult<Boolean> submitOrder(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> ids) {
System.out.println("ids:" + ids); System.out.println("ids:" + ids);
ids.forEach(id -> purchaseOrderService.submitOrder(Long.valueOf(id))); ids.forEach(id -> purchaseOrderService.submitOrder(Long.valueOf(id)));
@@ -144,7 +144,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
//提交ERP订单 //提交ERP订单
@PostMapping("/submit-erp061") @PostMapping("/submit-erp061")
@Operation(summary = "推送ERP订单", description = "061')") @Operation(summary = "推送ERP订单", description = "061')")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> idsStr) { public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> idsStr) {
List<Long> ids = idsStr.stream().map(Long::valueOf).toList(); List<Long> ids = idsStr.stream().map(Long::valueOf).toList();
// todo 推送ERP订单 // todo 推送ERP订单
@@ -153,7 +153,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@PostMapping("/submit-erp062") @PostMapping("/submit-erp062")
@Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口") @Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") String id) { public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") String id) {
// todo 推送ERP订单 // todo 推送ERP订单
return success(purchaseOrderService.submitErp062(Long.valueOf(id))); return success(purchaseOrderService.submitErp062(Long.valueOf(id)));
@@ -162,7 +162,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
//通过订单号查询订单信息 //通过订单号查询订单信息
@PostMapping("/get-order-by-order-no") @PostMapping("/get-order-by-order-no")
@Operation(summary = "通过订单号查询订单信息", description = "通过订单号查询订单信息") @Operation(summary = "通过订单号查询订单信息", description = "通过订单号查询订单信息")
@PreAuthorize("@ss.hasPermission('base:purchase-order:query')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
public CommonResult<List<PurchaseOrderDetailsRespVO>> getOrderByOrderNo(@RequestBody @Validated @NotEmpty(message = "采购订单不能为空") List<String> orderNos) { public CommonResult<List<PurchaseOrderDetailsRespVO>> getOrderByOrderNo(@RequestBody @Validated @NotEmpty(message = "采购订单不能为空") List<String> orderNos) {
return success(purchaseOrderService.getOrderByOrderNo(orderNos)); return success(purchaseOrderService.getOrderByOrderNo(orderNos));
} }
@@ -170,7 +170,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
//根据订单id修改订单状态 //根据订单id修改订单状态
@PutMapping("/update-order-status") @PutMapping("/update-order-status")
@Operation(summary = "批量修改订单状态", description = "sts取值于字典名称'采购订单状态',字典类型'PRCH_ORD_STS' 可以根据订单号和订单id修改") @Operation(summary = "批量修改订单状态", description = "sts取值于字典名称'采购订单状态',字典类型'PRCH_ORD_STS' 可以根据订单号和订单id修改")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<Boolean> updateOrderStatus(@RequestBody @Validated OrderStsReqVO req) { public CommonResult<Boolean> updateOrderStatus(@RequestBody @Validated OrderStsReqVO req) {
purchaseOrderService.updateOrderStatusByIdOrOrderNo(req); purchaseOrderService.updateOrderStatusByIdOrOrderNo(req);
return success(true); return success(true);
@@ -179,7 +179,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
//查询物料接口 //查询物料接口
@GetMapping("/material") @GetMapping("/material")
@Operation(summary = "查询物料接口") @Operation(summary = "查询物料接口")
@PreAuthorize("@ss.hasPermission('base:purchase-order:query')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
public CommonResult<MaterialRespVO> getMaterialList(@RequestParam public CommonResult<MaterialRespVO> getMaterialList(@RequestParam
@Schema(description = "采购订单号") @Schema(description = "采购订单号")
@Validated @Validated
@@ -191,14 +191,14 @@ public class PurchaseOrderController implements BusinessControllerMarker {
//关联订单 //关联订单
@PostMapping("/link-order") @PostMapping("/link-order")
@Operation(summary = "关联订单") @Operation(summary = "关联订单")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<Boolean> linkOrder(@RequestBody @Validated LinkOrderReqVO req) { public CommonResult<Boolean> linkOrder(@RequestBody @Validated LinkOrderReqVO req) {
return success(purchaseOrderService.linkOrder(req)); return success(purchaseOrderService.linkOrder(req));
} }
@PostMapping("/order-pass-reject") @PostMapping("/order-pass-reject")
@Operation(summary = "订单审核") @Operation(summary = "订单审核")
@PreAuthorize("@ss.hasPermission('base:purchase-order:update')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')")
public CommonResult<Boolean> orderPassReject(@RequestBody PurchaseorderReqVO reqVO) { public CommonResult<Boolean> orderPassReject(@RequestBody PurchaseorderReqVO reqVO) {
return success(purchaseOrderService.orderPassReject(reqVO)); return success(purchaseOrderService.orderPassReject(reqVO));
} }
@@ -206,7 +206,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
//根据订单id和方式获取上或下游订单 //根据订单id和方式获取上或下游订单
@PostMapping("/order-by-order-id-and-type") @PostMapping("/order-by-order-id-and-type")
@Operation(summary = "根据订单id和方式获取上或下游订单") @Operation(summary = "根据订单id和方式获取上或下游订单")
@PreAuthorize("@ss.hasPermission('base:purchase-order:query')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
public CommonResult<List<DownOrUpOrderRespVO>> getOrderByOrderIdAndType(@RequestBody DownOrUpOrderReqVO reqVO) { public CommonResult<List<DownOrUpOrderRespVO>> getOrderByOrderIdAndType(@RequestBody DownOrUpOrderReqVO reqVO) {
return success( purchaseOrderService.getOrderByOrderIdAndType(reqVO)); return success( purchaseOrderService.getOrderByOrderIdAndType(reqVO));
} }
@@ -214,7 +214,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
@PostMapping("/bound-order") @PostMapping("/bound-order")
@Operation(summary = "获取已绑定的订单") @Operation(summary = "获取已绑定的订单")
@PreAuthorize("@ss.hasPermission('base:purchase-order:query')") @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
public CommonResult<List<PurchaseOrderRespVO>> boundOrder(@RequestBody DownOrUpOrderReqVO reqVO) { public CommonResult<List<PurchaseOrderRespVO>> boundOrder(@RequestBody DownOrUpOrderReqVO reqVO) {
return success(purchaseOrderService.getBindOrderByOrder(reqVO)); return success(purchaseOrderService.getBindOrderByOrder(reqVO));
} }

View File

@@ -177,12 +177,12 @@ public class PurchaseOrderDetailsRespVO {
private String reviewOpinion; private String reviewOpinion;
/** /**
* 是否需要审批 * 是否提交审核value为0或1
*/ */
private int isPush; private int isPush;
/** /**
* 物料类 * 物料类别(字典:MTRL_TP)
*/ */
private String mtrlTp; private String mtrlTp;
@@ -192,7 +192,7 @@ public class PurchaseOrderDetailsRespVO {
private List<PrchOrdDtlDetailsRespVO> orderDetails; private List<PrchOrdDtlDetailsRespVO> orderDetails;
/** /**
* 订单类型 * 订单分类(字典SPLY_BSN_TP)
*/ */
private String splyBsnTp; private String splyBsnTp;
@@ -202,7 +202,7 @@ public class PurchaseOrderDetailsRespVO {
private String unt; private String unt;
/** /**
* 权转移 * 权转移类型(字典ASY_MTNG_TP)
*/ */
private String meteringType; private String meteringType;
} }

View File

@@ -131,7 +131,7 @@ public class PurchaseOrderPageReqVO extends PageParam {
@Schema(description = "物料类型(字典:MTRL_TP)", example = "2") @Schema(description = "物料类型(字典:MTRL_TP)", example = "2")
private String mtrlTp; private String mtrlTp;
@Schema(description = "订单分类") @Schema(description = "订单分类(字典SPLY_BSN_TP)")
private String splyBsnTp; private String splyBsnTp;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)") @Schema(description = "货权转移类型(字典ASY_MTNG_TP)")

View File

@@ -6,6 +6,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderWithDetailsVO; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderWithDetailsVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO; import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
@@ -71,4 +72,6 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
List<PurchaseOrderWithDetailsVO> selectOrderByIds(@Param("ids") List<Long> id); List<PurchaseOrderWithDetailsVO> selectOrderByIds(@Param("ids") List<Long> id);
PurchaseOrderDO selectByOrderId(@Param("orderId") Long orderId); PurchaseOrderDO selectByOrderId(@Param("orderId") Long orderId);
List<PurchaseOrderDO> queryOrderAndPlanData(OrderAndPlanDataReqDTO reqDTO);
} }

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.service.purchaseorder;
import java.util.*; import java.util.*;
import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO; import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO; import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
@@ -145,4 +146,12 @@ public interface PurchaseOrderService {
* @return 订单详情 * @return 订单详情
*/ */
List<PurchaseOrderDO> getOrdersByIds(List<String> ids); List<PurchaseOrderDO> getOrdersByIds(List<String> ids);
/**
* 查询订单和计划数据
*
* @param reqDTO 查询条件
* @return 订单和计划数据
*/
PageResult<PurchaseOrderDO> queryOrderAndPlanData(OrderAndPlanDataReqDTO reqDTO);
} }

View File

@@ -13,6 +13,7 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.bpm.api.task.BpmTaskApi;
import com.zt.plat.module.bpm.api.task.dto.*; import com.zt.plat.module.bpm.api.task.dto.*;
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum; import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO;
import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO; import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO; import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
@@ -698,6 +699,8 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
return purchaseOrderMapper.selectByIds(ids); return purchaseOrderMapper.selectByIds(ids);
} }
@Override @Override
@Transactional(rollbackFor=Exception.class) @Transactional(rollbackFor=Exception.class)
public boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO) { public boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO) {
@@ -788,4 +791,24 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
int number = (int) (Math.random() * 900000 + 100000); int number = (int) (Math.random() * 900000 + 100000);
return String.valueOf(number); return String.valueOf(number);
} }
@Override
public PageResult<PurchaseOrderDO> queryOrderAndPlanData(OrderAndPlanDataReqDTO reqDTO) {
// 1. 查询所有符合条件的数据
List<PurchaseOrderDO> allData = purchaseOrderMapper.queryOrderAndPlanData(reqDTO);
// 2. 获取分页参数
Integer pageSize = reqDTO.getPageSize();
Integer pageNum = reqDTO.getPageNo();
// 3. 计算分页截取的起始/结束索引
int startIndex = (pageNum - 1) * pageSize;
int endIndex = Math.min(startIndex + pageSize, allData.size());
// 4. 截取当前页数据(索引越界时返回空列表)
List<PurchaseOrderDO> pageData = startIndex >= allData.size()
? new ArrayList<>()
: allData.subList(startIndex, endIndex);
return new PageResult<>(pageData, (long) allData.size());
}
} }

View File

@@ -237,17 +237,23 @@
<select id="selectByOrderId" <select id="selectByOrderId"
resultType="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO"> resultType="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO">
select * from bse_prch_ord where sys_ord_num =#{orderId}; select *
from bse_prch_ord
where sys_ord_num = #{orderId};
</select> </select>
<resultMap id="PurchaseOrderWithDetailsResultMap" type="com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderWithDetailsVO"> <resultMap id="PurchaseOrderWithDetailsResultMap"
type="com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderWithDetailsVO">
<result column="SYS_ORD_NUM" property="systemOrderNumber"/> <result column="SYS_ORD_NUM" property="systemOrderNumber"/>
<association property="purchaseOrder" resultMap="PurchaseOrderResultMap"/> <association property="purchaseOrder" resultMap="PurchaseOrderResultMap"/>
<collection property="orderDetails" ofType="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO" resultMap="PrchOrdDtlResultMap"/> <collection property="orderDetails"
ofType="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO"
resultMap="PrchOrdDtlResultMap"/>
</resultMap> </resultMap>
<resultMap id="PurchaseOrderResultMap" type="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO"> <resultMap id="PurchaseOrderResultMap"
type="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO">
<id column="po_id" property="id"/> <id column="po_id" property="id"/>
<result column="ORD_SAP_NUM" property="orderSAPNumber"/> <result column="ORD_SAP_NUM" property="orderSAPNumber"/>
<result column="SYS_ORD_NUM" property="systemOrderNumber"/> <result column="SYS_ORD_NUM" property="systemOrderNumber"/>
@@ -298,7 +304,8 @@
<result column="SALE_ACS_NAME" property="saleAcsName"/> <result column="SALE_ACS_NAME" property="saleAcsName"/>
</resultMap> </resultMap>
<resultMap id="PrchOrdDtlResultMap" type="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO"> <resultMap id="PrchOrdDtlResultMap"
type="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO">
<id column="pod_id" property="id"/> <id column="pod_id" property="id"/>
<result column="ORD_ID" property="ordId"/> <result column="ORD_ID" property="ordId"/>
<result column="LINE_NUM" property="lineNum"/> <result column="LINE_NUM" property="lineNum"/>
@@ -346,4 +353,98 @@
<result column="ELEM_ABBR" property="elemAbbr"/> <result column="ELEM_ABBR" property="elemAbbr"/>
<result column="ELEM_NAME" property="elemName"/> <result column="ELEM_NAME" property="elemName"/>
</resultMap> </resultMap>
<resultMap id="PlanOrderResultMap"
type="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO">
<id column="ID" property="id"/>
<result column="ORD_SAP_NUM" property="orderSAPNumber"/>
<result column="SYS_ORD_NUM" property="systemOrderNumber"/>
<result column="CPN_NAME" property="cpName"/>
<result column="CPN_NUM" property="cpNum"/>
<result column="SPLR_NUM" property="supplierNumber"/>
<result column="SPLR_NAME" property="supplierName"/>
<result column="TP" property="type"/>
<result column="VCHR_DT" property="voucherDate"/>
<result column="PRCH_ORGZ_CD" property="purchaseOrganizationCustomsDeclaration"/>
<result column="RCV_FACT_NAME" property="receiveFactoryName"/>
<result column="RCV_FACT_NUM" property="receiveFactoryNumber"/>
<result column="RCV_WRH_NAME" property="receiveWarehouseName"/>
<result column="RCV_WRH_NUM" property="receiveWarehouseNumber"/>
<result column="PRCH_GRP" property="purchaseGroup"/>
<result column="CUR_NUM" property="currencyNumber"/>
<result column="EXCH_RTE" property="exchangeRate"/>
<result column="PPR_CTRT_NUM" property="paperContractNumber"/>
<result column="AGR_NUM" property="agreementNumber"/>
<result column="RMK" property="remark"/>
<result column="MTNG_TP" property="meteringType"/>
<result column="AGT_NUM" property="agentNumber"/>
<result column="AGT_NAME" property="agentName"/>
<result column="CTRT_NUM" property="contractNumber"/>
<result column="MTRL_NUM" property="materialNumber"/>
<result column="MTRL_NAME" property="materialName"/>
<result column="CTRT_NAME" property="contractName"/>
<result column="TNT_NUM" property="tenantNumber"/>
<result column="ERP_PRCH_CPN_NUM" property="erpPurchaseCompanyNumber"/>
<result column="ERP_PRCH_CPN_NAME" property="erpPurchaseCompanyName"/>
<result column="ERP_SALE_CPN_NUM" property="erpSalesCompanyNumber"/>
<result column="ERP_SALE_CPN_NAME" property="erpSalesCompanyName"/>
<result column="PRCH_ORGZ_NAME" property="purchaseOrganizationName"/>
<result column="ERP_STS" property="erpStatus"/>
<result column="CAUS" property="cause"/>
<result column="STS" property="status"/>
<result column="PRCH_GRP_NAME" property="purchaseGroupName"/>
<result column="PRCS_INSC_ID" property="processInstanceId"/>
<result column="RVW_ONN" property="reviewOpinion"/>
<result column="TSK_NDE_ID" property="taskId"/>
<result column="IS_PUSH" property="isPush"/>
<result column="UNT" property="unt"/>
<result column="MTRL_TP" property="mtrlTp"/>
<result column="SPLY_BSN_TP" property="splyBsnTp"/>
<result column="PDT_GRP_CDG" property="pdtGrpCdg"/>
<result column="PDT_GRP_NAME" property="pdtGrpName"/>
<result column="SALE_ACS_CDG" property="saleAcsCdg"/>
<result column="SALE_ACS_NAME" property="saleAcsName"/>
</resultMap>
<select id="queryOrderAndPlanData"
parameterType="com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO"
resultMap="PlanOrderResultMap"> <!-- 也可以替换为具体的实体类类型 -->
SELECT
po.*
FROM
BSE_PRCH_ORD po
INNER JOIN BSE_PLN_ORD_CORR oc ON po.SYS_ORD_NUM = oc.ORD_NUM
WHERE
po.deleted=0
AND oc.deleted=0
<if test="orderType != null and orderType != ''">
AND po.SPLY_BSN_TP = #{orderType}
</if>
<if test="materialNumber != null and materialNumber != ''">
AND po.MTRL_NUM = #{materialNumber}
</if>
<if test="materialName != null and materialName != ''">
AND po.MTRL_NAME = #{materialName}
</if>
<if test="customerNumber != null and customerNumber != ''">
AND po.ERP_SALE_CPN_NUM = #{customerNumber}
</if>
<if test="customerName != null and customerName != ''">
AND po.ERP_SALE_CPN_NAME = #{customerName}
</if>
<if test="orderNumber != null and orderNumber != ''">
AND po.SYS_ORD_NUM = #{orderNumber}
</if>
<if test="contractSystemNumber != null and contractSystemNumber != ''">
AND po.CTRT_NUM = #{contractSystemNumber}
</if>
<!-- 纸质合同编号:参数非空时才拼接条件 -->
<if test="paperContractNumber != null and paperContractNumber != ''">
AND po.PPR_CTRT_NUM = #{paperContractNumber}
</if>
<if test="planId != null and planId != ''">
AND oc.PLN_ID = #{planId}
</if>
</select>
</mapper> </mapper>