订单管理相关
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.zt.plat.module.contractorder.enums.purchaseorder;
|
||||
|
||||
import com.zt.plat.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* contract-order 错误码枚举类
|
||||
*
|
||||
* contract-order 系统,使用 1-xxx-xxx-xxx 段
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
ErrorCode PURCHASE_ORDER_NOT_EXISTS = new ErrorCode(1_008_000_001, "采购订单不存在");
|
||||
|
||||
ErrorCode PRCH_ORD_DTL_NOT_EXISTS = new ErrorCode(1_008_001_001, "采购订单明细不存在");
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder;
|
||||
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
|
||||
import com.zt.plat.module.contractorder.service.purchaseorder.PrchOrdDtlService;
|
||||
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 = "管理后台 - 采购订单明细")
|
||||
@RestController
|
||||
@RequestMapping("/base/prch-ord-dtl")
|
||||
@Validated
|
||||
public class PrchOrdDtlController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private PrchOrdDtlService prchOrdDtlService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购订单明细")
|
||||
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:create')")
|
||||
public CommonResult<PrchOrdDtlRespVO> createPrchOrdDtl(@Valid @RequestBody PrchOrdDtlSaveReqVO createReqVO) {
|
||||
return success(prchOrdDtlService.createPrchOrdDtl(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采购订单明细")
|
||||
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:update')")
|
||||
public CommonResult<Boolean> updatePrchOrdDtl(@Valid @RequestBody PrchOrdDtlSaveReqVO updateReqVO) {
|
||||
prchOrdDtlService.updatePrchOrdDtl(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采购订单明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:delete')")
|
||||
public CommonResult<Boolean> deletePrchOrdDtl(@RequestParam("id") Long id) {
|
||||
prchOrdDtlService.deletePrchOrdDtl(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除采购订单明细")
|
||||
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:delete')")
|
||||
public CommonResult<Boolean> deletePrchOrdDtlList(@RequestBody BatchDeleteReqVO req) {
|
||||
prchOrdDtlService.deletePrchOrdDtlListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采购订单明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:query')")
|
||||
public CommonResult<PrchOrdDtlRespVO> getPrchOrdDtl(@RequestParam("id") Long id) {
|
||||
PrchOrdDtlDO prchOrdDtl = prchOrdDtlService.getPrchOrdDtl(id);
|
||||
return success(BeanUtils.toBean(prchOrdDtl, PrchOrdDtlRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采购订单明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:query')")
|
||||
public CommonResult<PageResult<PrchOrdDtlRespVO>> getPrchOrdDtlPage(@Valid PrchOrdDtlPageReqVO pageReqVO) {
|
||||
PageResult<PrchOrdDtlDO> pageResult = prchOrdDtlService.getPrchOrdDtlPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PrchOrdDtlRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采购订单明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPrchOrdDtlExcel(@Valid PrchOrdDtlPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PrchOrdDtlDO> list = prchOrdDtlService.getPrchOrdDtlPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采购订单明细.xls", "数据", PrchOrdDtlRespVO.class,
|
||||
BeanUtils.toBean(list, PrchOrdDtlRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder;
|
||||
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import com.zt.plat.module.contractorder.service.purchaseorder.PurchaseOrderService;
|
||||
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 = "管理后台 - 采购订单")
|
||||
@RestController
|
||||
@RequestMapping("/base/purchase-order")
|
||||
@Validated
|
||||
public class PurchaseOrderController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private PurchaseOrderService purchaseOrderService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购订单")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:create')")
|
||||
public CommonResult<PurchaseOrderRespVO> createPurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO createReqVO) {
|
||||
return success(purchaseOrderService.createPurchaseOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采购订单")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||
public CommonResult<Boolean> updatePurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO updateReqVO) {
|
||||
purchaseOrderService.updatePurchaseOrder(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采购订单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:delete')")
|
||||
public CommonResult<Boolean> deletePurchaseOrder(@RequestParam("id") Long id) {
|
||||
purchaseOrderService.deletePurchaseOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除采购订单")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:delete')")
|
||||
public CommonResult<Boolean> deletePurchaseOrderList(@RequestBody BatchDeleteReqVO req) {
|
||||
purchaseOrderService.deletePurchaseOrderListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采购订单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
|
||||
public CommonResult<PurchaseOrderRespVO> getPurchaseOrder(@RequestParam("id") Long id) {
|
||||
PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id);
|
||||
return success(BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采购订单分页")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
|
||||
public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) {
|
||||
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采购订单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PurchaseOrderDO> list = purchaseOrderService.getPurchaseOrderPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采购订单.xls", "数据", PurchaseOrderRespVO.class,
|
||||
BeanUtils.toBean(list, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.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 = "管理后台 - 采购订单明细分页 Request VO")
|
||||
@Data
|
||||
public class PrchOrdDtlPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "采购订单主键", example = "29258")
|
||||
private Long ordId;
|
||||
|
||||
@Schema(description = "行项目;推送ERP(必须)")
|
||||
private Long lineNum;
|
||||
|
||||
@Schema(description = "物料编码;推送ERP")
|
||||
private String mtrlNum;
|
||||
|
||||
@Schema(description = "物料名称", example = "赵六")
|
||||
private String mtrlName;
|
||||
|
||||
@Schema(description = "收货工厂名称", example = "李四")
|
||||
private String rcvFactName;
|
||||
|
||||
@Schema(description = "收货工厂编码;推送ERP(必须)")
|
||||
private String rcvFactNum;
|
||||
|
||||
@Schema(description = "收货库位名称", example = "王五")
|
||||
private String rcvWrhName;
|
||||
|
||||
@Schema(description = "收货库位编码;推送ERP")
|
||||
private String rcvWrhNum;
|
||||
|
||||
@Schema(description = "暂估数量;推送ERP(必须)")
|
||||
private String qty;
|
||||
|
||||
@Schema(description = "计量单位;推送ERP(必须)")
|
||||
private BigDecimal unt;
|
||||
|
||||
@Schema(description = "含税单价;推送ERP(必须)")
|
||||
private BigDecimal inTaxUprc;
|
||||
|
||||
@Schema(description = "价格单位;推送ERP")
|
||||
private BigDecimal prcUnt;
|
||||
|
||||
@Schema(description = "税码(字典: PRCH_TAX);推送ERP")
|
||||
private BigDecimal taxNum;
|
||||
|
||||
@Schema(description = "是否基于GR的发票校验;推送ERP")
|
||||
private String isGrInv;
|
||||
|
||||
@Schema(description = "是否允许无限制收货;推送ERP")
|
||||
private String isUnlRcv;
|
||||
|
||||
@Schema(description = "批次;推送ERP")
|
||||
private String bat;
|
||||
|
||||
@Schema(description = "项目类别;推送ERP:委托加工L")
|
||||
private String prjCtgr;
|
||||
|
||||
@Schema(description = "科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型,固定资产订单A,服务订单S-销售服务费K-成本中心F-订单")
|
||||
private String actsCtgr;
|
||||
|
||||
@Schema(description = "物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
|
||||
private String mtrlCpntNum;
|
||||
|
||||
@Schema(description = "物料组描述;推送ERP:联动订单类型,服务订单必传")
|
||||
private String mtrlCpntDsp;
|
||||
|
||||
@Schema(description = "短文本")
|
||||
private String shrtTxt;
|
||||
|
||||
@Schema(description = "退货标识X标识退货;推送ERP")
|
||||
private String isRlbkCgo;
|
||||
|
||||
@Schema(description = "是否免费收货标识X;推送ERP")
|
||||
private String isFreeRcv;
|
||||
|
||||
@Schema(description = "外部行项目号;推送ERP")
|
||||
private Long outLineNum;
|
||||
|
||||
@Schema(description = "备注信息-需求单位;推送ERP")
|
||||
private String rmkUnt;
|
||||
|
||||
@Schema(description = "备注信息-物料详细;推送ERP")
|
||||
private String rmkMtrl;
|
||||
|
||||
@Schema(description = "交货起始日期;推送ERP")
|
||||
private LocalDateTime bgnDt;
|
||||
|
||||
@Schema(description = "交货截止日期;推送ERP")
|
||||
private LocalDateTime ddlDt;
|
||||
|
||||
@Schema(description = "已收货量")
|
||||
private BigDecimal lstQty;
|
||||
|
||||
@Schema(description = "已移库量库;存针对该订单产生的移库量")
|
||||
private BigDecimal trfQty;
|
||||
|
||||
@Schema(description = "小协议号")
|
||||
private String agrNum;
|
||||
|
||||
@Schema(description = "移库工厂名称", example = "张三")
|
||||
private String trfFactName;
|
||||
|
||||
@Schema(description = "移库工厂编码")
|
||||
private String trfFactNum;
|
||||
|
||||
@Schema(description = "移库库位名称", example = "李四")
|
||||
private String trfWrhName;
|
||||
|
||||
@Schema(description = "移库库位编码")
|
||||
private String trfWrhNum;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String rmk;
|
||||
|
||||
@Schema(description = "原料湿重;推送ERP")
|
||||
private BigDecimal origWet;
|
||||
|
||||
@Schema(description = "销售物料号;推送ERP:科目分配类别为S时必填")
|
||||
private String saleMtrlNum;
|
||||
|
||||
@Schema(description = "统计型内部订单;推送ERP")
|
||||
private String inOrd;
|
||||
|
||||
@Schema(description = "采购类别;推送ERP:0-生产性物资类1-项目投资类")
|
||||
private String prchCtgr;
|
||||
|
||||
@Schema(description = "是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
|
||||
private String isEnb;
|
||||
|
||||
@Schema(description = "科目分配详情;科目分配类别为K或P时使用(JSON)")
|
||||
private String actsCtgrDtl;
|
||||
|
||||
@Schema(description = "委托加工详情;委托加工订单使用(JSON)")
|
||||
private String enttDtl;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
private String elemAbbr;
|
||||
|
||||
@Schema(description = "金属元素名称", example = "李四")
|
||||
private String elemName;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
private String elemCdg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.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 = "管理后台 - 采购订单明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PrchOrdDtlRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26419")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29258")
|
||||
@ExcelProperty("采购订单主键")
|
||||
private Long ordId;
|
||||
|
||||
@Schema(description = "行项目;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("行项目;推送ERP(必须)")
|
||||
private Long lineNum;
|
||||
|
||||
@Schema(description = "物料编码;推送ERP")
|
||||
@ExcelProperty("物料编码;推送ERP")
|
||||
private String mtrlNum;
|
||||
|
||||
@Schema(description = "物料名称", example = "赵六")
|
||||
@ExcelProperty("物料名称")
|
||||
private String mtrlName;
|
||||
|
||||
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("收货工厂名称")
|
||||
private String rcvFactName;
|
||||
|
||||
@Schema(description = "收货工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收货工厂编码;推送ERP(必须)")
|
||||
private String rcvFactNum;
|
||||
|
||||
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("收货库位名称")
|
||||
private String rcvWrhName;
|
||||
|
||||
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收货库位编码;推送ERP")
|
||||
private String rcvWrhNum;
|
||||
|
||||
@Schema(description = "暂估数量;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("暂估数量;推送ERP(必须)")
|
||||
private String qty;
|
||||
|
||||
@Schema(description = "计量单位;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计量单位;推送ERP(必须)")
|
||||
private BigDecimal unt;
|
||||
|
||||
@Schema(description = "含税单价;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("含税单价;推送ERP(必须)")
|
||||
private BigDecimal inTaxUprc;
|
||||
|
||||
@Schema(description = "价格单位;推送ERP")
|
||||
@ExcelProperty("价格单位;推送ERP")
|
||||
private BigDecimal prcUnt;
|
||||
|
||||
@Schema(description = "税码(字典: PRCH_TAX);推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("税码(字典: PRCH_TAX);推送ERP")
|
||||
private BigDecimal taxNum;
|
||||
|
||||
@Schema(description = "是否基于GR的发票校验;推送ERP")
|
||||
@ExcelProperty("是否基于GR的发票校验;推送ERP")
|
||||
private String isGrInv;
|
||||
|
||||
@Schema(description = "是否允许无限制收货;推送ERP")
|
||||
@ExcelProperty("是否允许无限制收货;推送ERP")
|
||||
private String isUnlRcv;
|
||||
|
||||
@Schema(description = "批次;推送ERP")
|
||||
@ExcelProperty("批次;推送ERP")
|
||||
private String bat;
|
||||
|
||||
@Schema(description = "项目类别;推送ERP:委托加工L")
|
||||
@ExcelProperty("项目类别;推送ERP:委托加工L")
|
||||
private String prjCtgr;
|
||||
|
||||
@Schema(description = "科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型,固定资产订单A,服务订单S-销售服务费K-成本中心F-订单")
|
||||
@ExcelProperty("科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型,固定资产订单A,服务订单S-销售服务费K-成本中心F-订单")
|
||||
private String actsCtgr;
|
||||
|
||||
@Schema(description = "物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
|
||||
@ExcelProperty("物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
|
||||
private String mtrlCpntNum;
|
||||
|
||||
@Schema(description = "物料组描述;推送ERP:联动订单类型,服务订单必传")
|
||||
@ExcelProperty("物料组描述;推送ERP:联动订单类型,服务订单必传")
|
||||
private String mtrlCpntDsp;
|
||||
|
||||
@Schema(description = "短文本")
|
||||
@ExcelProperty("短文本")
|
||||
private String shrtTxt;
|
||||
|
||||
@Schema(description = "退货标识X标识退货;推送ERP")
|
||||
@ExcelProperty("退货标识X标识退货;推送ERP")
|
||||
private String isRlbkCgo;
|
||||
|
||||
@Schema(description = "是否免费收货标识X;推送ERP")
|
||||
@ExcelProperty("是否免费收货标识X;推送ERP")
|
||||
private String isFreeRcv;
|
||||
|
||||
@Schema(description = "外部行项目号;推送ERP")
|
||||
@ExcelProperty("外部行项目号;推送ERP")
|
||||
private Long outLineNum;
|
||||
|
||||
@Schema(description = "备注信息-需求单位;推送ERP")
|
||||
@ExcelProperty("备注信息-需求单位;推送ERP")
|
||||
private String rmkUnt;
|
||||
|
||||
@Schema(description = "备注信息-物料详细;推送ERP")
|
||||
@ExcelProperty("备注信息-物料详细;推送ERP")
|
||||
private String rmkMtrl;
|
||||
|
||||
@Schema(description = "交货起始日期;推送ERP")
|
||||
@ExcelProperty("交货起始日期;推送ERP")
|
||||
private LocalDateTime bgnDt;
|
||||
|
||||
@Schema(description = "交货截止日期;推送ERP")
|
||||
@ExcelProperty("交货截止日期;推送ERP")
|
||||
private LocalDateTime ddlDt;
|
||||
|
||||
@Schema(description = "已收货量")
|
||||
@ExcelProperty("已收货量")
|
||||
private BigDecimal lstQty;
|
||||
|
||||
@Schema(description = "已移库量库;存针对该订单产生的移库量")
|
||||
@ExcelProperty("已移库量库;存针对该订单产生的移库量")
|
||||
private BigDecimal trfQty;
|
||||
|
||||
@Schema(description = "小协议号")
|
||||
@ExcelProperty("小协议号")
|
||||
private String agrNum;
|
||||
|
||||
@Schema(description = "移库工厂名称", example = "张三")
|
||||
@ExcelProperty("移库工厂名称")
|
||||
private String trfFactName;
|
||||
|
||||
@Schema(description = "移库工厂编码")
|
||||
@ExcelProperty("移库工厂编码")
|
||||
private String trfFactNum;
|
||||
|
||||
@Schema(description = "移库库位名称", example = "李四")
|
||||
@ExcelProperty("移库库位名称")
|
||||
private String trfWrhName;
|
||||
|
||||
@Schema(description = "移库库位编码")
|
||||
@ExcelProperty("移库库位编码")
|
||||
private String trfWrhNum;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String rmk;
|
||||
|
||||
@Schema(description = "原料湿重;推送ERP")
|
||||
@ExcelProperty("原料湿重;推送ERP")
|
||||
private BigDecimal origWet;
|
||||
|
||||
@Schema(description = "销售物料号;推送ERP:科目分配类别为S时必填")
|
||||
@ExcelProperty("销售物料号;推送ERP:科目分配类别为S时必填")
|
||||
private String saleMtrlNum;
|
||||
|
||||
@Schema(description = "统计型内部订单;推送ERP")
|
||||
@ExcelProperty("统计型内部订单;推送ERP")
|
||||
private String inOrd;
|
||||
|
||||
@Schema(description = "采购类别;推送ERP:0-生产性物资类1-项目投资类")
|
||||
@ExcelProperty("采购类别;推送ERP:0-生产性物资类1-项目投资类")
|
||||
private String prchCtgr;
|
||||
|
||||
@Schema(description = "是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
|
||||
@ExcelProperty("是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
|
||||
private String isEnb;
|
||||
|
||||
@Schema(description = "科目分配详情;科目分配类别为K或P时使用(JSON)")
|
||||
@ExcelProperty("科目分配详情;科目分配类别为K或P时使用(JSON)")
|
||||
private String actsCtgrDtl;
|
||||
|
||||
@Schema(description = "委托加工详情;委托加工订单使用(JSON)")
|
||||
@ExcelProperty("委托加工详情;委托加工订单使用(JSON)")
|
||||
private String enttDtl;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
@ExcelProperty("金属元素缩写")
|
||||
private String elemAbbr;
|
||||
|
||||
@Schema(description = "金属元素名称", example = "李四")
|
||||
@ExcelProperty("金属元素名称")
|
||||
private String elemName;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
@ExcelProperty("金属元素编码")
|
||||
private String elemCdg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.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 PrchOrdDtlSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26419")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29258")
|
||||
@NotNull(message = "采购订单主键不能为空")
|
||||
private Long ordId;
|
||||
|
||||
@Schema(description = "行项目;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "行项目;推送ERP(必须)不能为空")
|
||||
private Long lineNum;
|
||||
|
||||
@Schema(description = "物料编码;推送ERP")
|
||||
private String mtrlNum;
|
||||
|
||||
@Schema(description = "物料名称", example = "赵六")
|
||||
private String mtrlName;
|
||||
|
||||
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "收货工厂名称不能为空")
|
||||
private String rcvFactName;
|
||||
|
||||
@Schema(description = "收货工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收货工厂编码;推送ERP(必须)不能为空")
|
||||
private String rcvFactNum;
|
||||
|
||||
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "收货库位名称不能为空")
|
||||
private String rcvWrhName;
|
||||
|
||||
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收货库位编码;推送ERP不能为空")
|
||||
private String rcvWrhNum;
|
||||
|
||||
@Schema(description = "暂估数量;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "暂估数量;推送ERP(必须)不能为空")
|
||||
private String qty;
|
||||
|
||||
@Schema(description = "计量单位;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "计量单位;推送ERP(必须)不能为空")
|
||||
private BigDecimal unt;
|
||||
|
||||
@Schema(description = "含税单价;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "含税单价;推送ERP(必须)不能为空")
|
||||
private BigDecimal inTaxUprc;
|
||||
|
||||
@Schema(description = "价格单位;推送ERP")
|
||||
private BigDecimal prcUnt;
|
||||
|
||||
@Schema(description = "税码(字典: PRCH_TAX);推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "税码(字典: PRCH_TAX);推送ERP不能为空")
|
||||
private BigDecimal taxNum;
|
||||
|
||||
@Schema(description = "是否基于GR的发票校验;推送ERP")
|
||||
private String isGrInv;
|
||||
|
||||
@Schema(description = "是否允许无限制收货;推送ERP")
|
||||
private String isUnlRcv;
|
||||
|
||||
@Schema(description = "批次;推送ERP")
|
||||
private String bat;
|
||||
|
||||
@Schema(description = "项目类别;推送ERP:委托加工L")
|
||||
private String prjCtgr;
|
||||
|
||||
@Schema(description = "科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型,固定资产订单A,服务订单S-销售服务费K-成本中心F-订单")
|
||||
private String actsCtgr;
|
||||
|
||||
@Schema(description = "物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
|
||||
private String mtrlCpntNum;
|
||||
|
||||
@Schema(description = "物料组描述;推送ERP:联动订单类型,服务订单必传")
|
||||
private String mtrlCpntDsp;
|
||||
|
||||
@Schema(description = "短文本")
|
||||
private String shrtTxt;
|
||||
|
||||
@Schema(description = "退货标识X标识退货;推送ERP")
|
||||
private String isRlbkCgo;
|
||||
|
||||
@Schema(description = "是否免费收货标识X;推送ERP")
|
||||
private String isFreeRcv;
|
||||
|
||||
@Schema(description = "外部行项目号;推送ERP")
|
||||
private Long outLineNum;
|
||||
|
||||
@Schema(description = "备注信息-需求单位;推送ERP")
|
||||
private String rmkUnt;
|
||||
|
||||
@Schema(description = "备注信息-物料详细;推送ERP")
|
||||
private String rmkMtrl;
|
||||
|
||||
@Schema(description = "交货起始日期;推送ERP")
|
||||
private LocalDateTime bgnDt;
|
||||
|
||||
@Schema(description = "交货截止日期;推送ERP")
|
||||
private LocalDateTime ddlDt;
|
||||
|
||||
@Schema(description = "已收货量")
|
||||
private BigDecimal lstQty;
|
||||
|
||||
@Schema(description = "已移库量库;存针对该订单产生的移库量")
|
||||
private BigDecimal trfQty;
|
||||
|
||||
@Schema(description = "小协议号")
|
||||
private String agrNum;
|
||||
|
||||
@Schema(description = "移库工厂名称", example = "张三")
|
||||
private String trfFactName;
|
||||
|
||||
@Schema(description = "移库工厂编码")
|
||||
private String trfFactNum;
|
||||
|
||||
@Schema(description = "移库库位名称", example = "李四")
|
||||
private String trfWrhName;
|
||||
|
||||
@Schema(description = "移库库位编码")
|
||||
private String trfWrhNum;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String rmk;
|
||||
|
||||
@Schema(description = "原料湿重;推送ERP")
|
||||
private BigDecimal origWet;
|
||||
|
||||
@Schema(description = "销售物料号;推送ERP:科目分配类别为S时必填")
|
||||
private String saleMtrlNum;
|
||||
|
||||
@Schema(description = "统计型内部订单;推送ERP")
|
||||
private String inOrd;
|
||||
|
||||
@Schema(description = "采购类别;推送ERP:0-生产性物资类1-项目投资类")
|
||||
private String prchCtgr;
|
||||
|
||||
@Schema(description = "是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
|
||||
private String isEnb;
|
||||
|
||||
@Schema(description = "科目分配详情;科目分配类别为K或P时使用(JSON)")
|
||||
private String actsCtgrDtl;
|
||||
|
||||
@Schema(description = "委托加工详情;委托加工订单使用(JSON)")
|
||||
private String enttDtl;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
private String elemAbbr;
|
||||
|
||||
@Schema(description = "金属元素名称", example = "李四")
|
||||
private String elemName;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
private String elemCdg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.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 = "管理后台 - 采购订单分页 Request VO")
|
||||
@Data
|
||||
public class PurchaseOrderPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "ERP订单号")
|
||||
private String orderSAPNumber;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private String systemOrderNumber;
|
||||
|
||||
@Schema(description = "公司编码;推送ERP(必须)")
|
||||
private String companyNumber;
|
||||
|
||||
@Schema(description = "客商编码;推送ERP(必须)")
|
||||
private String supplierNumber;
|
||||
|
||||
@Schema(description = "客商名称", example = "芋艿")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "凭证日期;推送ERP(必须)")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] voucherDate;
|
||||
|
||||
@Schema(description = "采购组织编码;推送ERP(必须)")
|
||||
private String purchaseOrganizationCustomsDeclaration;
|
||||
|
||||
@Schema(description = "收货工厂名称", example = "芋艿")
|
||||
private String receiveFactoryName;
|
||||
|
||||
@Schema(description = "收货工厂编码;推送ERP(必须)")
|
||||
private String receiveFactoryNumber;
|
||||
|
||||
@Schema(description = "收货库位名称", example = "王五")
|
||||
private String receiveWarehouseName;
|
||||
|
||||
@Schema(description = "收货库位编码;推送ERP")
|
||||
private String receiveWarehouseNumber;
|
||||
|
||||
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)")
|
||||
private String purchaseGroup;
|
||||
|
||||
@Schema(description = "货币码(字典:CUR);推送ERP(必须)")
|
||||
private String currencyNumber;
|
||||
|
||||
@Schema(description = "汇率;推送ERP")
|
||||
private BigDecimal exchangeRate;
|
||||
|
||||
@Schema(description = "合同纸质合同号;推送ERP(必须)")
|
||||
private String paperContractNumber;
|
||||
|
||||
@Schema(description = "小协议号;推送ERP")
|
||||
private String agreementNumber;
|
||||
|
||||
@Schema(description = "备注;推送ERP")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "代理方编码;推送ERP")
|
||||
private String agentNumber;
|
||||
|
||||
@Schema(description = "代理方名称", example = "张三")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "订单编码")
|
||||
private String orderNumber;
|
||||
|
||||
@Schema(description = "系统合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "物料名称", example = "王五")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "合同名称", example = "赵六")
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "小户头号")
|
||||
private String tenantNumber;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "ERP公司编号")
|
||||
private String erpPurchaseCompanyNumber;
|
||||
|
||||
@Schema(description = "ERP公司名称", example = "王五")
|
||||
private String erpPurchaseCompanyName;
|
||||
|
||||
@Schema(description = "ERP客商公司编码")
|
||||
private String erpSalesCompanyNumber;
|
||||
|
||||
@Schema(description = "ERP客商公司名称", example = "芋艿")
|
||||
private String erpSalesCompanyName;
|
||||
|
||||
@Schema(description = "采购组织名称", example = "赵六")
|
||||
private String purchaseOrganizationName;
|
||||
|
||||
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
|
||||
private String erpStatus;
|
||||
|
||||
@Schema(description = "请求ERP失败原因")
|
||||
private String cause;
|
||||
|
||||
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "采购组名称", example = "张三")
|
||||
private String purchaseGroupName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.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 = "管理后台 - 采购订单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PurchaseOrderRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6074")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "ERP订单号")
|
||||
@ExcelProperty("ERP订单号")
|
||||
private String orderSAPNumber;
|
||||
|
||||
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("订单号")
|
||||
private String systemOrderNumber;
|
||||
|
||||
@Schema(description = "公司编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("公司编码;推送ERP(必须)")
|
||||
private String companyNumber;
|
||||
|
||||
@Schema(description = "客商编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("客商编码;推送ERP(必须)")
|
||||
private String supplierNumber;
|
||||
|
||||
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("客商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("订单类型(字典:PRCH_ORD_TP);推送ERP(必须)")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "凭证日期;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("凭证日期;推送ERP(必须)")
|
||||
private LocalDateTime voucherDate;
|
||||
|
||||
@Schema(description = "采购组织编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("采购组织编码;推送ERP(必须)")
|
||||
private String purchaseOrganizationCustomsDeclaration;
|
||||
|
||||
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("收货工厂名称")
|
||||
private String receiveFactoryName;
|
||||
|
||||
@Schema(description = "收货工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收货工厂编码;推送ERP(必须)")
|
||||
private String receiveFactoryNumber;
|
||||
|
||||
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("收货库位名称")
|
||||
private String receiveWarehouseName;
|
||||
|
||||
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收货库位编码;推送ERP")
|
||||
private String receiveWarehouseNumber;
|
||||
|
||||
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)")
|
||||
private String purchaseGroup;
|
||||
|
||||
@Schema(description = "货币码(字典:CUR);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("货币码(字典:CUR);推送ERP(必须)")
|
||||
private String currencyNumber;
|
||||
|
||||
@Schema(description = "汇率;推送ERP")
|
||||
@ExcelProperty("汇率;推送ERP")
|
||||
private BigDecimal exchangeRate;
|
||||
|
||||
@Schema(description = "合同纸质合同号;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同纸质合同号;推送ERP(必须)")
|
||||
private String paperContractNumber;
|
||||
|
||||
@Schema(description = "小协议号;推送ERP")
|
||||
@ExcelProperty("小协议号;推送ERP")
|
||||
private String agreementNumber;
|
||||
|
||||
@Schema(description = "备注;推送ERP")
|
||||
@ExcelProperty("备注;推送ERP")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "代理方编码;推送ERP")
|
||||
@ExcelProperty("代理方编码;推送ERP")
|
||||
private String agentNumber;
|
||||
|
||||
@Schema(description = "代理方名称", example = "张三")
|
||||
@ExcelProperty("代理方名称")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("订单编码")
|
||||
private String orderNumber;
|
||||
|
||||
@Schema(description = "系统合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("系统合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
@ExcelProperty("物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "物料名称", example = "王五")
|
||||
@ExcelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "合同名称", example = "赵六")
|
||||
@ExcelProperty("合同名称")
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "小户头号")
|
||||
@ExcelProperty("小户头号")
|
||||
private String tenantNumber;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "ERP公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("ERP公司编号")
|
||||
private String erpPurchaseCompanyNumber;
|
||||
|
||||
@Schema(description = "ERP公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("ERP公司名称")
|
||||
private String erpPurchaseCompanyName;
|
||||
|
||||
@Schema(description = "ERP客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("ERP客商公司编码")
|
||||
private String erpSalesCompanyNumber;
|
||||
|
||||
@Schema(description = "ERP客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("ERP客商公司名称")
|
||||
private String erpSalesCompanyName;
|
||||
|
||||
@Schema(description = "采购组织名称", example = "赵六")
|
||||
@ExcelProperty("采购组织名称")
|
||||
private String purchaseOrganizationName;
|
||||
|
||||
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
|
||||
@ExcelProperty("ERP状态(字典: ERP_REQ_STS)")
|
||||
private String erpStatus;
|
||||
|
||||
@Schema(description = "请求ERP失败原因")
|
||||
@ExcelProperty("请求ERP失败原因")
|
||||
private String cause;
|
||||
|
||||
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
|
||||
@ExcelProperty("订单状态(字典:PRCH_ORD_STS)")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "采购组名称", example = "张三")
|
||||
@ExcelProperty("采购组名称")
|
||||
private String purchaseGroupName;
|
||||
|
||||
@Schema(description = "订单明细")
|
||||
@ExcelProperty("订单明细")
|
||||
private List<PrchOrdDtlRespVO> prchOrdDtlRespVOS;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
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 PurchaseOrderSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6074")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "公司名称不能为空")
|
||||
private String cpName;
|
||||
|
||||
@Schema(description = "ERP订单号")
|
||||
private String orderSAPNumber;
|
||||
|
||||
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "订单号不能为空")
|
||||
private String systemOrderNumber;
|
||||
|
||||
@Schema(description = "公司编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "公司编码;推送ERP(必须)不能为空")
|
||||
private String companyNumber;
|
||||
|
||||
@Schema(description = "客商编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "客商编码;推送ERP(必须)不能为空")
|
||||
private String supplierNumber;
|
||||
|
||||
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "客商名称不能为空")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "凭证日期;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "凭证日期;推送ERP(必须)不能为空")
|
||||
private LocalDateTime voucherDate;
|
||||
|
||||
@Schema(description = "采购组织编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "采购组织编码;推送ERP(必须)不能为空")
|
||||
private String purchaseOrganizationCustomsDeclaration;
|
||||
|
||||
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "收货工厂名称不能为空")
|
||||
private String receiveFactoryName;
|
||||
|
||||
@Schema(description = "收货工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收货工厂编码;推送ERP(必须)不能为空")
|
||||
private String receiveFactoryNumber;
|
||||
|
||||
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "收货库位名称不能为空")
|
||||
private String receiveWarehouseName;
|
||||
|
||||
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收货库位编码;推送ERP不能为空")
|
||||
private String receiveWarehouseNumber;
|
||||
|
||||
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)不能为空")
|
||||
private String purchaseGroup;
|
||||
|
||||
@Schema(description = "货币码(字典:CUR);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "货币码(字典:CUR);推送ERP(必须)不能为空")
|
||||
private String currencyNumber;
|
||||
|
||||
@Schema(description = "汇率;推送ERP")
|
||||
private BigDecimal exchangeRate;
|
||||
|
||||
@Schema(description = "合同纸质合同号;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "合同纸质合同号;推送ERP(必须)不能为空")
|
||||
private String paperContractNumber;
|
||||
|
||||
@Schema(description = "小协议号;推送ERP")
|
||||
private String agreementNumber;
|
||||
|
||||
@Schema(description = "备注;推送ERP")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "代理方编码;推送ERP")
|
||||
private String agentNumber;
|
||||
|
||||
@Schema(description = "代理方名称", example = "张三")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "订单编码不能为空")
|
||||
private String orderNumber;
|
||||
|
||||
@Schema(description = "系统合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "系统合同编号不能为空")
|
||||
private String contractNumber;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "物料名称", example = "王五")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "合同名称", example = "赵六")
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "小户头号")
|
||||
private String tenantNumber;
|
||||
|
||||
@Schema(description = "ERP公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "ERP公司编号不能为空")
|
||||
private String erpPurchaseCompanyNumber;
|
||||
|
||||
@Schema(description = "ERP公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "ERP公司名称不能为空")
|
||||
private String erpPurchaseCompanyName;
|
||||
|
||||
@Schema(description = "ERP客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "ERP客商公司编码不能为空")
|
||||
private String erpSalesCompanyNumber;
|
||||
|
||||
@Schema(description = "ERP客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "ERP客商公司名称不能为空")
|
||||
private String erpSalesCompanyName;
|
||||
|
||||
@Schema(description = "采购组织名称", example = "赵六")
|
||||
private String purchaseOrganizationName;
|
||||
|
||||
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
|
||||
private String erpStatus;
|
||||
|
||||
@Schema(description = "请求ERP失败原因")
|
||||
private String cause;
|
||||
|
||||
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "采购组名称", example = "张三")
|
||||
private String purchaseGroupName;
|
||||
|
||||
@Schema(description = "订单明细")
|
||||
@ExcelProperty("订单明细")
|
||||
private List<PrchOrdDtlSaveReqVO> prchOrdDtlSaveReqVOS;
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.purchaseorder;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
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;
|
||||
/**
|
||||
* 采购订单明细 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_prch_ord_dtl")
|
||||
@KeySequence("bse_prch_ord_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class PrchOrdDtlDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 采购订单主键
|
||||
*/
|
||||
@TableField("ORD_ID")
|
||||
private Long ordId;
|
||||
/**
|
||||
* 行项目;推送ERP(必须)
|
||||
*/
|
||||
@TableField("LINE_NUM")
|
||||
private Long lineNum;
|
||||
/**
|
||||
* 物料编码;推送ERP
|
||||
*/
|
||||
@TableField("MTRL_NUM")
|
||||
private String mtrlNum;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@TableField("MTRL_NAME")
|
||||
private String mtrlName;
|
||||
/**
|
||||
* 收货工厂名称
|
||||
*/
|
||||
@TableField("RCV_FACT_NAME")
|
||||
private String rcvFactName;
|
||||
/**
|
||||
* 收货工厂编码;推送ERP(必须)
|
||||
*/
|
||||
@TableField("RCV_FACT_NUM")
|
||||
private String rcvFactNum;
|
||||
/**
|
||||
* 收货库位名称
|
||||
*/
|
||||
@TableField("RCV_WRH_NAME")
|
||||
private String rcvWrhName;
|
||||
/**
|
||||
* 收货库位编码;推送ERP
|
||||
*/
|
||||
@TableField("RCV_WRH_NUM")
|
||||
private String rcvWrhNum;
|
||||
/**
|
||||
* 暂估数量;推送ERP(必须)
|
||||
*/
|
||||
@TableField("QTY")
|
||||
private String qty;
|
||||
/**
|
||||
* 计量单位;推送ERP(必须)
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private BigDecimal unt;
|
||||
/**
|
||||
* 含税单价;推送ERP(必须)
|
||||
*/
|
||||
@TableField("IN_TAX_UPRC")
|
||||
private BigDecimal inTaxUprc;
|
||||
/**
|
||||
* 价格单位;推送ERP
|
||||
*/
|
||||
@TableField("PRC_UNT")
|
||||
private BigDecimal prcUnt;
|
||||
/**
|
||||
* 税码(字典: PRCH_TAX);推送ERP
|
||||
*/
|
||||
@TableField("TAX_NUM")
|
||||
private BigDecimal taxNum;
|
||||
/**
|
||||
* 是否基于GR的发票校验;推送ERP
|
||||
*/
|
||||
@TableField("IS_GR_INV")
|
||||
private String isGrInv;
|
||||
/**
|
||||
* 是否允许无限制收货;推送ERP
|
||||
*/
|
||||
@TableField("IS_UNL_RCV")
|
||||
private String isUnlRcv;
|
||||
/**
|
||||
* 批次;推送ERP
|
||||
*/
|
||||
@TableField("BAT")
|
||||
private String bat;
|
||||
/**
|
||||
* 项目类别;推送ERP:委托加工L
|
||||
*/
|
||||
@TableField("PRJ_CTGR")
|
||||
private String prjCtgr;
|
||||
/**
|
||||
* 科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型,固定资产订单A,服务订单S-销售服务费K-成本中心F-订单
|
||||
*/
|
||||
@TableField("ACTS_CTGR")
|
||||
private String actsCtgr;
|
||||
/**
|
||||
* 物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传
|
||||
*/
|
||||
@TableField("MTRL_CPNT_NUM")
|
||||
private String mtrlCpntNum;
|
||||
/**
|
||||
* 物料组描述;推送ERP:联动订单类型,服务订单必传
|
||||
*/
|
||||
@TableField("MTRL_CPNT_DSP")
|
||||
private String mtrlCpntDsp;
|
||||
/**
|
||||
* 短文本
|
||||
*/
|
||||
@TableField("SHRT_TXT")
|
||||
private String shrtTxt;
|
||||
/**
|
||||
* 退货标识X标识退货;推送ERP
|
||||
*/
|
||||
@TableField("IS_RLBK_CGO")
|
||||
private String isRlbkCgo;
|
||||
/**
|
||||
* 是否免费收货标识X;推送ERP
|
||||
*/
|
||||
@TableField("IS_FREE_RCV")
|
||||
private String isFreeRcv;
|
||||
/**
|
||||
* 外部行项目号;推送ERP
|
||||
*/
|
||||
@TableField("OUT_LINE_NUM")
|
||||
private Long outLineNum;
|
||||
/**
|
||||
* 备注信息-需求单位;推送ERP
|
||||
*/
|
||||
@TableField("RMK_UNT")
|
||||
private String rmkUnt;
|
||||
/**
|
||||
* 备注信息-物料详细;推送ERP
|
||||
*/
|
||||
@TableField("RMK_MTRL")
|
||||
private String rmkMtrl;
|
||||
/**
|
||||
* 交货起始日期;推送ERP
|
||||
*/
|
||||
@TableField("BGN_DT")
|
||||
private LocalDateTime bgnDt;
|
||||
/**
|
||||
* 交货截止日期;推送ERP
|
||||
*/
|
||||
@TableField("DDL_DT")
|
||||
private LocalDateTime ddlDt;
|
||||
/**
|
||||
* 已收货量
|
||||
*/
|
||||
@TableField("LST_QTY")
|
||||
private BigDecimal lstQty;
|
||||
/**
|
||||
* 已移库量库;存针对该订单产生的移库量
|
||||
*/
|
||||
@TableField("TRF_QTY")
|
||||
private BigDecimal trfQty;
|
||||
/**
|
||||
* 小协议号
|
||||
*/
|
||||
@TableField("AGR_NUM")
|
||||
private String agrNum;
|
||||
/**
|
||||
* 移库工厂名称
|
||||
*/
|
||||
@TableField("TRF_FACT_NAME")
|
||||
private String trfFactName;
|
||||
/**
|
||||
* 移库工厂编码
|
||||
*/
|
||||
@TableField("TRF_FACT_NUM")
|
||||
private String trfFactNum;
|
||||
/**
|
||||
* 移库库位名称
|
||||
*/
|
||||
@TableField("TRF_WRH_NAME")
|
||||
private String trfWrhName;
|
||||
/**
|
||||
* 移库库位编码
|
||||
*/
|
||||
@TableField("TRF_WRH_NUM")
|
||||
private String trfWrhNum;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String rmk;
|
||||
/**
|
||||
* 原料湿重;推送ERP
|
||||
*/
|
||||
@TableField("ORIG_WET")
|
||||
private BigDecimal origWet;
|
||||
/**
|
||||
* 销售物料号;推送ERP:科目分配类别为S时必填
|
||||
*/
|
||||
@TableField("SALE_MTRL_NUM")
|
||||
private String saleMtrlNum;
|
||||
/**
|
||||
* 统计型内部订单;推送ERP
|
||||
*/
|
||||
@TableField("IN_ORD")
|
||||
private String inOrd;
|
||||
/**
|
||||
* 采购类别;推送ERP:0-生产性物资类1-项目投资类
|
||||
*/
|
||||
@TableField("PRCH_CTGR")
|
||||
private String prchCtgr;
|
||||
/**
|
||||
* 是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用
|
||||
*/
|
||||
@TableField("IS_ENB")
|
||||
private String isEnb;
|
||||
/**
|
||||
* 科目分配详情;科目分配类别为K或P时使用(JSON)
|
||||
*/
|
||||
@TableField("ACTS_CTGR_DTL")
|
||||
private String actsCtgrDtl;
|
||||
/**
|
||||
* 委托加工详情;委托加工订单使用(JSON)
|
||||
*/
|
||||
@TableField("ENTT_DTL")
|
||||
private String enttDtl;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
@TableField("ELEM_ABBR")
|
||||
private String elemAbbr;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
@TableField("ELEM_NAME")
|
||||
private String elemName;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
@TableField("ELEM_CDG")
|
||||
private String elemCdg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.purchaseorder;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
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;
|
||||
/**
|
||||
* 采购订单 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_prch_ord")
|
||||
@KeySequence("bse_prch_ord_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class PurchaseOrderDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* ERP订单号
|
||||
*/
|
||||
@TableField("ORD_SAP_NUM")
|
||||
private String orderSAPNumber;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@TableField("SYS_ORD_NUM")
|
||||
private String systemOrderNumber;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
@TableField("CPN_NAME")
|
||||
private String cpName;
|
||||
/**
|
||||
* 公司编码;推送ERP(必须)
|
||||
*/
|
||||
@TableField("CPN_NUM")
|
||||
private String companyNumber;
|
||||
/**
|
||||
* 客商编码;推送ERP(必须)
|
||||
*/
|
||||
@TableField("SPLR_NUM")
|
||||
private String supplierNumber;
|
||||
/**
|
||||
* 客商名称
|
||||
*/
|
||||
@TableField("SPLR_NAME")
|
||||
private String supplierName;
|
||||
/**
|
||||
* 订单类型(字典:PRCH_ORD_TP);推送ERP(必须)
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
/**
|
||||
* 凭证日期;推送ERP(必须)
|
||||
*/
|
||||
@TableField("VCHR_DT")
|
||||
private LocalDateTime voucherDate;
|
||||
/**
|
||||
* 采购组织编码;推送ERP(必须)
|
||||
*/
|
||||
@TableField("PRCH_ORGZ_CD")
|
||||
private String purchaseOrganizationCustomsDeclaration;
|
||||
/**
|
||||
* 收货工厂名称
|
||||
*/
|
||||
@TableField("RCV_FACT_NAME")
|
||||
private String receiveFactoryName;
|
||||
/**
|
||||
* 收货工厂编码;推送ERP(必须)
|
||||
*/
|
||||
@TableField("RCV_FACT_NUM")
|
||||
private String receiveFactoryNumber;
|
||||
/**
|
||||
* 收货库位名称
|
||||
*/
|
||||
@TableField("RCV_WRH_NAME")
|
||||
private String receiveWarehouseName;
|
||||
/**
|
||||
* 收货库位编码;推送ERP
|
||||
*/
|
||||
@TableField("RCV_WRH_NUM")
|
||||
private String receiveWarehouseNumber;
|
||||
/**
|
||||
* 采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)
|
||||
*/
|
||||
@TableField("PRCH_GRP")
|
||||
private String purchaseGroup;
|
||||
/**
|
||||
* 货币码(字典:CUR);推送ERP(必须)
|
||||
*/
|
||||
@TableField("CUR_NUM")
|
||||
private String currencyNumber;
|
||||
/**
|
||||
* 汇率;推送ERP
|
||||
*/
|
||||
@TableField("EXCH_RTE")
|
||||
private BigDecimal exchangeRate;
|
||||
/**
|
||||
* 合同纸质合同号;推送ERP(必须)
|
||||
*/
|
||||
@TableField("PPR_CTRT_NUM")
|
||||
private String paperContractNumber;
|
||||
/**
|
||||
* 小协议号;推送ERP
|
||||
*/
|
||||
@TableField("AGR_NUM")
|
||||
private String agreementNumber;
|
||||
/**
|
||||
* 备注;推送ERP
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
/**
|
||||
* 代理方编码;推送ERP
|
||||
*/
|
||||
@TableField("AGT_NUM")
|
||||
private String agentNumber;
|
||||
/**
|
||||
* 代理方名称
|
||||
*/
|
||||
@TableField("AGT_NAME")
|
||||
private String agentName;
|
||||
/**
|
||||
* 订单编码
|
||||
*/
|
||||
@TableField("ORD_NUM")
|
||||
private String orderNumber;
|
||||
/**
|
||||
* 系统合同编号
|
||||
*/
|
||||
@TableField("CTRT_NUM")
|
||||
private String contractNumber;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField("MTRL_NUM")
|
||||
private String materialNumber;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@TableField("MTRL_NAME")
|
||||
private String materialName;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@TableField("CTRT_NAME")
|
||||
private String contractName;
|
||||
/**
|
||||
* 小户头号
|
||||
*/
|
||||
@TableField("TNT_NUM")
|
||||
private String tenantNumber;
|
||||
/**
|
||||
* ERP公司编号
|
||||
*/
|
||||
@TableField("ERP_PRCH_CPN_NUM")
|
||||
private String erpPurchaseCompanyNumber;
|
||||
/**
|
||||
* ERP公司名称
|
||||
*/
|
||||
@TableField("ERP_PRCH_CPN_NAME")
|
||||
private String erpPurchaseCompanyName;
|
||||
/**
|
||||
* ERP客商公司编码
|
||||
*/
|
||||
@TableField("ERP_SALE_CPN_NUM")
|
||||
private String erpSalesCompanyNumber;
|
||||
/**
|
||||
* ERP客商公司名称
|
||||
*/
|
||||
@TableField("ERP_SALE_CPN_NAME")
|
||||
private String erpSalesCompanyName;
|
||||
/**
|
||||
* 采购组织名称
|
||||
*/
|
||||
@TableField("PRCH_ORGZ_NAME")
|
||||
private String purchaseOrganizationName;
|
||||
/**
|
||||
* ERP状态(字典: ERP_REQ_STS)
|
||||
*/
|
||||
@TableField("ERP_STS")
|
||||
private String erpStatus;
|
||||
/**
|
||||
* 请求ERP失败原因
|
||||
*/
|
||||
@TableField("CAUS")
|
||||
private String cause;
|
||||
/**
|
||||
* 订单状态(字典:PRCH_ORD_STS)
|
||||
*/
|
||||
@TableField("STS")
|
||||
private String status;
|
||||
/**
|
||||
* 采购组名称
|
||||
*/
|
||||
@TableField("PRCH_GRP_NAME")
|
||||
private String purchaseGroupName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.purchaseorder;
|
||||
|
||||
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.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 采购订单明细 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface PrchOrdDtlMapper extends BaseMapperX<PrchOrdDtlDO> {
|
||||
|
||||
default PageResult<PrchOrdDtlDO> selectPage(PrchOrdDtlPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PrchOrdDtlDO>()
|
||||
.eqIfPresent(PrchOrdDtlDO::getOrdId, reqVO.getOrdId())
|
||||
.eqIfPresent(PrchOrdDtlDO::getLineNum, reqVO.getLineNum())
|
||||
.eqIfPresent(PrchOrdDtlDO::getMtrlNum, reqVO.getMtrlNum())
|
||||
.likeIfPresent(PrchOrdDtlDO::getMtrlName, reqVO.getMtrlName())
|
||||
.likeIfPresent(PrchOrdDtlDO::getRcvFactName, reqVO.getRcvFactName())
|
||||
.eqIfPresent(PrchOrdDtlDO::getRcvFactNum, reqVO.getRcvFactNum())
|
||||
.likeIfPresent(PrchOrdDtlDO::getRcvWrhName, reqVO.getRcvWrhName())
|
||||
.eqIfPresent(PrchOrdDtlDO::getRcvWrhNum, reqVO.getRcvWrhNum())
|
||||
.eqIfPresent(PrchOrdDtlDO::getQty, reqVO.getQty())
|
||||
.eqIfPresent(PrchOrdDtlDO::getUnt, reqVO.getUnt())
|
||||
.eqIfPresent(PrchOrdDtlDO::getInTaxUprc, reqVO.getInTaxUprc())
|
||||
.eqIfPresent(PrchOrdDtlDO::getPrcUnt, reqVO.getPrcUnt())
|
||||
.eqIfPresent(PrchOrdDtlDO::getTaxNum, reqVO.getTaxNum())
|
||||
.eqIfPresent(PrchOrdDtlDO::getIsGrInv, reqVO.getIsGrInv())
|
||||
.eqIfPresent(PrchOrdDtlDO::getIsUnlRcv, reqVO.getIsUnlRcv())
|
||||
.eqIfPresent(PrchOrdDtlDO::getBat, reqVO.getBat())
|
||||
.eqIfPresent(PrchOrdDtlDO::getPrjCtgr, reqVO.getPrjCtgr())
|
||||
.eqIfPresent(PrchOrdDtlDO::getActsCtgr, reqVO.getActsCtgr())
|
||||
.eqIfPresent(PrchOrdDtlDO::getMtrlCpntNum, reqVO.getMtrlCpntNum())
|
||||
.eqIfPresent(PrchOrdDtlDO::getMtrlCpntDsp, reqVO.getMtrlCpntDsp())
|
||||
.eqIfPresent(PrchOrdDtlDO::getShrtTxt, reqVO.getShrtTxt())
|
||||
.eqIfPresent(PrchOrdDtlDO::getIsRlbkCgo, reqVO.getIsRlbkCgo())
|
||||
.eqIfPresent(PrchOrdDtlDO::getIsFreeRcv, reqVO.getIsFreeRcv())
|
||||
.eqIfPresent(PrchOrdDtlDO::getOutLineNum, reqVO.getOutLineNum())
|
||||
.eqIfPresent(PrchOrdDtlDO::getRmkUnt, reqVO.getRmkUnt())
|
||||
.eqIfPresent(PrchOrdDtlDO::getRmkMtrl, reqVO.getRmkMtrl())
|
||||
.eqIfPresent(PrchOrdDtlDO::getBgnDt, reqVO.getBgnDt())
|
||||
.eqIfPresent(PrchOrdDtlDO::getDdlDt, reqVO.getDdlDt())
|
||||
.eqIfPresent(PrchOrdDtlDO::getLstQty, reqVO.getLstQty())
|
||||
.eqIfPresent(PrchOrdDtlDO::getTrfQty, reqVO.getTrfQty())
|
||||
.eqIfPresent(PrchOrdDtlDO::getAgrNum, reqVO.getAgrNum())
|
||||
.likeIfPresent(PrchOrdDtlDO::getTrfFactName, reqVO.getTrfFactName())
|
||||
.eqIfPresent(PrchOrdDtlDO::getTrfFactNum, reqVO.getTrfFactNum())
|
||||
.likeIfPresent(PrchOrdDtlDO::getTrfWrhName, reqVO.getTrfWrhName())
|
||||
.eqIfPresent(PrchOrdDtlDO::getTrfWrhNum, reqVO.getTrfWrhNum())
|
||||
.eqIfPresent(PrchOrdDtlDO::getRmk, reqVO.getRmk())
|
||||
.eqIfPresent(PrchOrdDtlDO::getOrigWet, reqVO.getOrigWet())
|
||||
.eqIfPresent(PrchOrdDtlDO::getSaleMtrlNum, reqVO.getSaleMtrlNum())
|
||||
.eqIfPresent(PrchOrdDtlDO::getInOrd, reqVO.getInOrd())
|
||||
.eqIfPresent(PrchOrdDtlDO::getPrchCtgr, reqVO.getPrchCtgr())
|
||||
.eqIfPresent(PrchOrdDtlDO::getIsEnb, reqVO.getIsEnb())
|
||||
.eqIfPresent(PrchOrdDtlDO::getActsCtgrDtl, reqVO.getActsCtgrDtl())
|
||||
.eqIfPresent(PrchOrdDtlDO::getEnttDtl, reqVO.getEnttDtl())
|
||||
.betweenIfPresent(PrchOrdDtlDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(PrchOrdDtlDO::getElemAbbr, reqVO.getElemAbbr())
|
||||
.likeIfPresent(PrchOrdDtlDO::getElemName, reqVO.getElemName())
|
||||
.eqIfPresent(PrchOrdDtlDO::getElemCdg, reqVO.getElemCdg())
|
||||
.orderByDesc(PrchOrdDtlDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.purchaseorder;
|
||||
|
||||
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.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 采购订单 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
||||
|
||||
default PageResult<PurchaseOrderDO> selectPage(PurchaseOrderPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseOrderDO>()
|
||||
.eqIfPresent(PurchaseOrderDO::getOrderSAPNumber, reqVO.getOrderSAPNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getSystemOrderNumber, reqVO.getSystemOrderNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getSupplierNumber, reqVO.getSupplierNumber())
|
||||
.likeIfPresent(PurchaseOrderDO::getSupplierName, reqVO.getSupplierName())
|
||||
.eqIfPresent(PurchaseOrderDO::getType, reqVO.getType())
|
||||
.betweenIfPresent(PurchaseOrderDO::getVoucherDate, reqVO.getVoucherDate())
|
||||
.eqIfPresent(PurchaseOrderDO::getPurchaseOrganizationCustomsDeclaration, reqVO.getPurchaseOrganizationCustomsDeclaration())
|
||||
.likeIfPresent(PurchaseOrderDO::getReceiveFactoryName, reqVO.getReceiveFactoryName())
|
||||
.eqIfPresent(PurchaseOrderDO::getReceiveFactoryNumber, reqVO.getReceiveFactoryNumber())
|
||||
.likeIfPresent(PurchaseOrderDO::getReceiveWarehouseName, reqVO.getReceiveWarehouseName())
|
||||
.eqIfPresent(PurchaseOrderDO::getReceiveWarehouseNumber, reqVO.getReceiveWarehouseNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getPurchaseGroup, reqVO.getPurchaseGroup())
|
||||
.eqIfPresent(PurchaseOrderDO::getCurrencyNumber, reqVO.getCurrencyNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getExchangeRate, reqVO.getExchangeRate())
|
||||
.eqIfPresent(PurchaseOrderDO::getPaperContractNumber, reqVO.getPaperContractNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getAgreementNumber, reqVO.getAgreementNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(PurchaseOrderDO::getAgentNumber, reqVO.getAgentNumber())
|
||||
.likeIfPresent(PurchaseOrderDO::getAgentName, reqVO.getAgentName())
|
||||
.eqIfPresent(PurchaseOrderDO::getOrderNumber, reqVO.getOrderNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getContractNumber, reqVO.getContractNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||
.likeIfPresent(PurchaseOrderDO::getMaterialName, reqVO.getMaterialName())
|
||||
.likeIfPresent(PurchaseOrderDO::getContractName, reqVO.getContractName())
|
||||
.eqIfPresent(PurchaseOrderDO::getTenantNumber, reqVO.getTenantNumber())
|
||||
.betweenIfPresent(PurchaseOrderDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(PurchaseOrderDO::getErpPurchaseCompanyNumber, reqVO.getErpPurchaseCompanyNumber())
|
||||
.likeIfPresent(PurchaseOrderDO::getErpPurchaseCompanyName, reqVO.getErpPurchaseCompanyName())
|
||||
.eqIfPresent(PurchaseOrderDO::getErpSalesCompanyNumber, reqVO.getErpSalesCompanyNumber())
|
||||
.likeIfPresent(PurchaseOrderDO::getErpSalesCompanyName, reqVO.getErpSalesCompanyName())
|
||||
.likeIfPresent(PurchaseOrderDO::getPurchaseOrganizationName, reqVO.getPurchaseOrganizationName())
|
||||
.eqIfPresent(PurchaseOrderDO::getErpStatus, reqVO.getErpStatus())
|
||||
.eqIfPresent(PurchaseOrderDO::getCause, reqVO.getCause())
|
||||
.eqIfPresent(PurchaseOrderDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(PurchaseOrderDO::getPurchaseGroupName, reqVO.getPurchaseGroupName())
|
||||
.orderByDesc(PurchaseOrderDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zt.plat.module.contractorder.service.purchaseorder;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 采购订单明细 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface PrchOrdDtlService {
|
||||
|
||||
/**
|
||||
* 创建采购订单明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
PrchOrdDtlRespVO createPrchOrdDtl(@Valid PrchOrdDtlSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新采购订单明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePrchOrdDtl(@Valid PrchOrdDtlSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除采购订单明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePrchOrdDtl(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除采购订单明细
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deletePrchOrdDtlListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得采购订单明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 采购订单明细
|
||||
*/
|
||||
PrchOrdDtlDO getPrchOrdDtl(Long id);
|
||||
|
||||
/**
|
||||
* 获得采购订单明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 采购订单明细分页
|
||||
*/
|
||||
PageResult<PrchOrdDtlDO> getPrchOrdDtlPage(PrchOrdDtlPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 批量创建采购订单明细
|
||||
*
|
||||
* @param createReqVOS 创建信息
|
||||
* @return List<PrchOrdDtlRespVO>
|
||||
*/
|
||||
List<PrchOrdDtlRespVO> batchCreatePrchOrdDtl(@Valid List<PrchOrdDtlSaveReqVO> createReqVOS);
|
||||
/**
|
||||
* 批量删除采购订单明细
|
||||
*
|
||||
* @param ordIds 编号
|
||||
*/
|
||||
void deletePrchOrdDtlListByOrdIds(List<Long> ordIds);
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.zt.plat.module.contractorder.service.purchaseorder;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PrchOrdDtlMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.PRCH_ORD_DTL_NOT_EXISTS;
|
||||
|
||||
|
||||
/**
|
||||
* 采购订单明细 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class PrchOrdDtlServiceImpl implements PrchOrdDtlService {
|
||||
|
||||
@Resource
|
||||
private PrchOrdDtlMapper prchOrdDtlMapper;
|
||||
|
||||
@Override
|
||||
public PrchOrdDtlRespVO createPrchOrdDtl(PrchOrdDtlSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PrchOrdDtlDO prchOrdDtl = BeanUtils.toBean(createReqVO, PrchOrdDtlDO.class);
|
||||
prchOrdDtlMapper.insert(prchOrdDtl);
|
||||
// 返回
|
||||
return BeanUtils.toBean(prchOrdDtl, PrchOrdDtlRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePrchOrdDtl(PrchOrdDtlSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePrchOrdDtlExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PrchOrdDtlDO updateObj = BeanUtils.toBean(updateReqVO, PrchOrdDtlDO.class);
|
||||
prchOrdDtlMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePrchOrdDtl(Long id) {
|
||||
// 校验存在
|
||||
validatePrchOrdDtlExists(id);
|
||||
// 删除
|
||||
prchOrdDtlMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePrchOrdDtlListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validatePrchOrdDtlExists(ids);
|
||||
// 删除
|
||||
prchOrdDtlMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validatePrchOrdDtlExists(List<Long> ids) {
|
||||
List<PrchOrdDtlDO> list = prchOrdDtlMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(PRCH_ORD_DTL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validatePrchOrdDtlExists(Long id) {
|
||||
if (prchOrdDtlMapper.selectById(id) == null) {
|
||||
throw exception(PRCH_ORD_DTL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrchOrdDtlDO getPrchOrdDtl(Long id) {
|
||||
return prchOrdDtlMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PrchOrdDtlDO> getPrchOrdDtlPage(PrchOrdDtlPageReqVO pageReqVO) {
|
||||
return prchOrdDtlMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrchOrdDtlRespVO> batchCreatePrchOrdDtl(List<PrchOrdDtlSaveReqVO> createReqVOS) {
|
||||
List<PrchOrdDtlDO> prchOrdDtlDOS = BeanUtils.toBean(createReqVOS, PrchOrdDtlDO.class);
|
||||
prchOrdDtlMapper.insertBatch(prchOrdDtlDOS);
|
||||
log.info("批量创建采购订单明细成功,工插入【{}】条数据", prchOrdDtlDOS.size());
|
||||
return BeanUtils.toBean(prchOrdDtlDOS, PrchOrdDtlRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePrchOrdDtlListByOrdIds(List<Long> ordIds) {
|
||||
//通过订单组件查询订单明细
|
||||
List<PrchOrdDtlDO> prchOrdDtlDOS = prchOrdDtlMapper.selectList(new LambdaQueryWrapper<>(PrchOrdDtlDO.class).in(PrchOrdDtlDO::getOrdId, ordIds));
|
||||
//删除订单明细
|
||||
deletePrchOrdDtlListByIds(convertList(prchOrdDtlDOS, PrchOrdDtlDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.zt.plat.module.contractorder.service.purchaseorder;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import jakarta.validation.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 采购订单 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface PurchaseOrderService {
|
||||
|
||||
/**
|
||||
* 创建采购订单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
PurchaseOrderRespVO createPurchaseOrder(@Valid PurchaseOrderSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新采购订单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePurchaseOrder(@Valid PurchaseOrderSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除采购订单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePurchaseOrder(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除采购订单
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deletePurchaseOrderListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得采购订单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 采购订单
|
||||
*/
|
||||
PurchaseOrderDO getPurchaseOrder(Long id);
|
||||
|
||||
/**
|
||||
* 获得采购订单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 采购订单分页
|
||||
*/
|
||||
PageResult<PurchaseOrderDO> getPurchaseOrderPage(PurchaseOrderPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.zt.plat.module.contractorder.service.purchaseorder;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.PURCHASE_ORDER_NOT_EXISTS;
|
||||
|
||||
|
||||
/**
|
||||
* 采购订单 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
||||
|
||||
@Resource
|
||||
private PurchaseOrderMapper purchaseOrderMapper;
|
||||
@Resource
|
||||
private PrchOrdDtlService prchOrdDtlService;
|
||||
|
||||
@Override
|
||||
public PurchaseOrderRespVO createPurchaseOrder(PurchaseOrderSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PurchaseOrderDO purchaseOrder = BeanUtils.toBean(createReqVO, PurchaseOrderDO.class);
|
||||
purchaseOrderMapper.insert(purchaseOrder);
|
||||
// 返回
|
||||
//批量插入订单明细
|
||||
createReqVO.getPrchOrdDtlSaveReqVOS().forEach(prchOrdDtlSaveReqVO->prchOrdDtlSaveReqVO.setOrdId(purchaseOrder.getId()));
|
||||
List<PrchOrdDtlRespVO> prchOrdDtlRespVOS = prchOrdDtlService.batchCreatePrchOrdDtl(createReqVO.getPrchOrdDtlSaveReqVOS());
|
||||
PurchaseOrderRespVO purchaseOrderRespVO = BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class);
|
||||
purchaseOrderRespVO.setPrchOrdDtlRespVOS(prchOrdDtlRespVOS);
|
||||
return purchaseOrderRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePurchaseOrder(PurchaseOrderSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePurchaseOrderExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PurchaseOrderDO updateObj = BeanUtils.toBean(updateReqVO, PurchaseOrderDO.class);
|
||||
purchaseOrderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePurchaseOrder(Long id) {
|
||||
// 校验存在
|
||||
validatePurchaseOrderExists(id);
|
||||
// 删除
|
||||
purchaseOrderMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePurchaseOrderListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validatePurchaseOrderExists(ids);
|
||||
// 删除
|
||||
purchaseOrderMapper.deleteByIds(ids);
|
||||
//删除根据订单号订单明细
|
||||
prchOrdDtlService.deletePrchOrdDtlListByOrdIds(ids);
|
||||
|
||||
}
|
||||
|
||||
private void validatePurchaseOrderExists(List<Long> ids) {
|
||||
List<PurchaseOrderDO> list = purchaseOrderMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validatePurchaseOrderExists(Long id) {
|
||||
if (purchaseOrderMapper.selectById(id) == null) {
|
||||
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchaseOrderDO getPurchaseOrder(Long id) {
|
||||
return purchaseOrderMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PurchaseOrderDO> getPurchaseOrderPage(PurchaseOrderPageReqVO pageReqVO) {
|
||||
return purchaseOrderMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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.contractorder.dal.mysql.purchaseorder.PrchOrdDtlMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -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.contractorder.dal.mysql.purchaseorder.PurchaseOrderMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user