合并供应链代码

This commit is contained in:
Administrator
2025-09-04 00:51:32 +00:00
committed by chenbowen
parent 75a20dcf56
commit 70fd14513b
205 changed files with 10460 additions and 260 deletions

View File

@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yudao</artifactId>
<artifactId>dsc-supply</artifactId>
<groupId>cn.iocoder.cloud</groupId>
<version>${revision}</version>
</parent>

View File

@@ -13,5 +13,9 @@ public interface ErrorCodeConstants {
// ========== 示例模块 1-001-000-000 ==========
ErrorCode EXAMPLE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
ErrorCode BILL_MAIN_NOT_EXISTS = new ErrorCode(1, "收发货单不存在");
ErrorCode BILL_MAIN_DETAIL_NOT_EXISTS = new ErrorCode(2, "收发货单明细不存在");
ErrorCode PARAMS_NOT_EXISTS = new ErrorCode(1_029_000_101, "参数不合法");
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.receivedeliver.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 预报明细状态字典代码FRCST_DTL_STS
*/
@Getter
@AllArgsConstructor
public enum ForecastDetailStatusEnum {
IS_CFRM("IS_CFRM", "未确认"),
UN_ENBD("UN_ENBD", "未收发货"),
IS_ENBD("IS_ENBD", "已收发货"),
PRVS("PRVS","停用");
/**
* 条目代码
*/
private String code;
/**
* 条目显示名称
*/
private String name;
}

View File

@@ -0,0 +1,25 @@
package cn.iocoder.yudao.module.receivedeliver.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 预报明细类型字典代码FRCST_WY
*/
@Getter
@AllArgsConstructor
public enum ForecastDetailTypeEnum {
API("API", "接口上传"),
HAND("HAND", "用户新增");
/**
* 条目代码
*/
private String code;
/**
* 条目显示名称
*/
private String name;
}

View File

@@ -0,0 +1,25 @@
package cn.iocoder.yudao.module.receivedeliver.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 预报品位关联类型字典代码FRCST_REL_TP
*/
@Getter
@AllArgsConstructor
public enum ForecastElementRelativityTypeEnum {
MAIN("MAIN", "主表关联"),
DTL("DTL", "明细关联");
/**
* 条目代码
*/
private String code;
/**
* 条目显示名称
*/
private String name;
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.receivedeliver.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 预报类型字典代码FRCST_TP
*/
@Getter
@AllArgsConstructor
public enum ForecastPlanStatusEnum {
FRCST("FRCST", "到货预报"),
SND_PLN("SND_PLN", "发货计划"),
MVE_SBM("MVE_SBM", "移库提货单"),
SND_SBM("SND_SBM", "发货提货单");
/**
* 条目代码
*/
private String code;
/**
* 条目显示名称
*/
private String name;
}

View File

@@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.receivedeliver.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 预报状态字典代码FRCST_STS
*/
@Getter
@AllArgsConstructor
public enum ForecastStatusEnum {
UN("UN", "到货预报"),
IS_TRNS("IS_TRNS", "已下发"),
IS_CFRM("IS_CFRM", "已确认"),
IS_APRV("IS_APRV", "已收货/已发货"),
IS_DEL("IS_DEL", "已删除"),
IS_SUBMIT("IS_SUBMIT", "已提交"),
IS_CLOSE("IS_CLOSE", "已关闭");
/**
* 条目代码
*/
private String code;
/**
* 条目显示名称
*/
private String name;
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.receivedeliver.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 运输方式字典代码TRP_WY
*/
@Getter
@AllArgsConstructor
public enum ForecastTransportWayEnum {
CR("CR", "汽运配送"),
PLWY("PLWY", "火车配送"),
ARLN("ARLN", "机场配送"),
CSTM("CSTM", "客户自提");
/**
* 条目代码
*/
private String code;
/**
* 条目显示名称
*/
private String name;
}

View File

@@ -131,21 +131,21 @@
<build>
<!-- 设置构建的 jar 包名 -->
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- 打包 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
</goals>
</execution>
</executions>
</plugin>
</plugins>
<!-- <plugins>-->
<!-- &lt;!&ndash; 打包 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <version>${spring.boot.version}</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>repackage</goal> &lt;!&ndash; 将引入的 jar 打入其中 &ndash;&gt;-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- </plugins>-->
</build>
</project>

View File

@@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*
* @author ZT
*/
@SpringBootApplication
//@SpringBootApplication
public class ReceiveDeliverServerApplication {
public static void main(String[] args) {

View File

@@ -0,0 +1,99 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.assay;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.business.annotation.FileUploadController;
import cn.iocoder.yudao.framework.business.controller.AbstractFileUploadController;
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssayPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssayRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssaySaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.assay.AssayDO;
import cn.iocoder.yudao.module.receivedeliver.service.assay.AssayService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 品位")
@RestController
@RequestMapping("/supply/assay")
@FileUploadController(source = "sply.assay")
public class AssayController extends AbstractFileUploadController implements BusinessControllerMarker{
@Resource
private AssayService assayService;
@PostMapping("/create")
@Operation(summary = "创建品位")
public CommonResult<AssayRespVO> createAssay(@Valid @RequestBody AssaySaveReqVO createReqVO) {
return success(assayService.createAssay(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新品位")
public CommonResult<Boolean> updateAssay(@Valid @RequestBody AssaySaveReqVO updateReqVO) {
assayService.updateAssay(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除品位")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteAssay(@RequestParam("id") Long id) {
assayService.deleteAssay(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除品位")
public CommonResult<Boolean> deleteAssayList(@RequestBody BatchDeleteReqVO req) {
assayService.deleteAssayListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得品位")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<AssayRespVO> getAssay(@RequestParam("id") Long id) {
AssayDO assay = assayService.getAssay(id);
return success(BeanUtils.toBean(assay, AssayRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得品位分页")
public CommonResult<PageResult<AssayRespVO>> getAssayPage(@Valid AssayPageReqVO pageReqVO) {
PageResult<AssayDO> pageResult = assayService.getAssayPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, AssayRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出品位 Excel")
@ApiAccessLog(operateType = EXPORT)
public void exportAssayExcel(@Valid AssayPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<AssayDO> list = assayService.getAssayPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "品位.xls", "数据", AssayRespVO.class,
BeanUtils.toBean(list, AssayRespVO.class));
}
}

View File

@@ -0,0 +1,70 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 品位分页 Request VO")
@Data
public class AssayPageReqVO extends PageParam {
@Schema(description = "品味类型", example = "2")
private String gradeType;
@Schema(description = "订单号")
private String orderNumber;
@Schema(description = "订单类型;销售/采购/委托加工", example = "1")
private String orderType;
@Schema(description = "运单号")
private String waybillNumber;
@Schema(description = "批次号")
private String batchNumber;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素名称", example = "芋艿")
private String elementName;
@Schema(description = "检验结果")
private BigDecimal result;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "小数位数")
private Long countLocation;
@Schema(description = "小数位数(ERP)")
private Long countLocationErp;
@Schema(description = "检验时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] inspectionDatetime;
@Schema(description = "实验室代码")
private String laboratoryCode;
@Schema(description = "实验室名称", example = "王五")
private String laboratoryName;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,88 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 品位 Response VO")
@Data
@ExcelIgnoreUnannotated
public class AssayRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18214")
@ExcelProperty("主键")
private Long id;
@Schema(description = "品味类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("品味类型")
private String gradeType;
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("订单号")
private String orderNumber;
@Schema(description = "订单类型;销售/采购/委托加工", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("订单类型;销售/采购/委托加工")
private String orderType;
@Schema(description = "运单号")
@ExcelProperty("运单号")
private String waybillNumber;
@Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("批次号")
private String batchNumber;
@Schema(description = "小协议号")
@ExcelProperty("小协议号")
private String agreementNumber;
@Schema(description = "金属元素缩写", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("金属元素编码")
private String elementNumber;
@Schema(description = "金属元素名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("金属元素名称")
private String elementName;
@Schema(description = "检验结果", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("检验结果")
private BigDecimal result;
@Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("品位单位")
private String gradeUnit;
@Schema(description = "小数位数", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("小数位数")
private Long countLocation;
@Schema(description = "小数位数(ERP)", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("小数位数(ERP)")
private Long countLocationErp;
@Schema(description = "检验时间")
@ExcelProperty("检验时间")
private LocalDateTime inspectionDatetime;
@Schema(description = "实验室代码")
@ExcelProperty("实验室代码")
private String laboratoryCode;
@Schema(description = "实验室名称", example = "王五")
@ExcelProperty("实验室名称")
private String laboratoryName;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,77 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 品位新增/修改 Request VO")
@Data
public class AssaySaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18214")
private Long id;
@Schema(description = "品味类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "品味类型不能为空")
private String gradeType;
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "订单号不能为空")
private String orderNumber;
@Schema(description = "订单类型;销售/采购/委托加工", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "订单类型;销售/采购/委托加工不能为空")
private String orderType;
@Schema(description = "运单号")
private String waybillNumber;
@Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "批次号不能为空")
private String batchNumber;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "金属元素缩写", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "金属元素缩写不能为空")
private String elementAbbreviation;
@Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "金属元素编码不能为空")
private String elementNumber;
@Schema(description = "金属元素名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "金属元素名称不能为空")
private String elementName;
@Schema(description = "检验结果", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "检验结果不能为空")
private BigDecimal result;
@Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "品位单位不能为空")
private String gradeUnit;
@Schema(description = "小数位数", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "小数位数不能为空")
private Long countLocation;
@Schema(description = "小数位数(ERP)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "小数位数(ERP)不能为空")
private Long countLocationErp;
@Schema(description = "检验时间")
private LocalDateTime inspectionDatetime;
@Schema(description = "实验室代码")
private String laboratoryCode;
@Schema(description = "实验室名称", example = "王五")
private String laboratoryName;
}

View File

@@ -0,0 +1,110 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmain.BillMainDO;
import cn.iocoder.yudao.module.receivedeliver.service.billmain.BillMainService;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import cn.iocoder.yudao.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 cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 收发货单")
@RestController
@RequestMapping("/sply/bill-main")
@Validated
public class BillMainController implements BusinessControllerMarker {
@Resource
private BillMainService billMainService;
@PostMapping("/create")
@Operation(summary = "创建收发货单")
@PreAuthorize("@ss.hasPermission('sply:bill-main:create')")
public CommonResult<BillMainRespVO> createBillMain(@Valid @RequestBody BillMainSaveReqVO createReqVO) {
return success(billMainService.createBillMain(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新收发货单")
@PreAuthorize("@ss.hasPermission('sply:bill-main:update')")
public CommonResult<Boolean> updateBillMain(@Valid @RequestBody BillMainSaveReqVO updateReqVO) {
billMainService.updateBillMain(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除收发货单")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('sply:bill-main:delete')")
public CommonResult<Boolean> deleteBillMain(@RequestParam("id") Long id) {
billMainService.deleteBillMain(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除收发货单")
@PreAuthorize("@ss.hasPermission('sply:bill-main:delete')")
public CommonResult<Boolean> deleteBillMainList(@RequestBody BatchDeleteReqVO req) {
billMainService.deleteBillMainListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得收发货单")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('sply:bill-main:query')")
public CommonResult<BillMainRespVO> getBillMain(@RequestParam("id") Long id) {
BillMainDO billMain = billMainService.getBillMain(id);
return success(BeanUtils.toBean(billMain, BillMainRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得收发货单分页")
@PreAuthorize("@ss.hasPermission('sply:bill-main:query')")
public CommonResult<PageResult<BillMainRespVO>> getBillMainPage(@Valid BillMainPageReqVO pageReqVO) {
PageResult<BillMainDO> pageResult = billMainService.getBillMainPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, BillMainRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出收发货单 Excel")
@PreAuthorize("@ss.hasPermission('sply:bill-main:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportBillMainExcel(@Valid BillMainPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<BillMainDO> list = billMainService.getBillMainPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "收发货单.xls", "数据", BillMainRespVO.class,
BeanUtils.toBean(list, BillMainRespVO.class));
}
}

View File

@@ -0,0 +1,124 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 收发货单分页 Request VO")
@Data
public class BillMainPageReqVO extends PageParam {
@Schema(description = "类型;收货/发货", example = "2")
private String type;
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "订单明细主键", example = "10464")
private Long orderDetailId;
@Schema(description = "收货单号;自动生成")
private String billNumber;
@Schema(description = "实物物料编码")
private String materialCoding;
@Schema(description = "实物物料名称", example = "张三")
private String materialName;
@Schema(description = "实物收发货数量")
private BigDecimal materialQuantity;
@Schema(description = "总干重")
private BigDecimal dryQuantity;
@Schema(description = "实物计量单位")
private String materialUom;
@Schema(description = "金属物料编码")
private String metalCoding;
@Schema(description = "金属物料名称", example = "王五")
private String metalName;
@Schema(description = "金属收发货数量")
private BigDecimal metalQuantity;
@Schema(description = "金属计量单位")
private String metalUom;
@Schema(description = "工厂名称", example = "芋艿")
private String factoryName;
@Schema(description = "工厂编码")
private String factoryNumber;
@Schema(description = "库位名称", example = "芋艿")
private String warehouseName;
@Schema(description = "库位编码")
private String warehouseNumber;
@Schema(description = "不含税总金额")
private BigDecimal notTaxAmount;
@Schema(description = "含税总金额")
private BigDecimal inTaxAmount;
@Schema(description = "总税额")
private BigDecimal taxAmount;
@Schema(description = "付款比例")
private BigDecimal paymentRatio;
@Schema(description = "实付总金额")
private BigDecimal relativityAmount;
@Schema(description = "过账日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] postingDate;
@Schema(description = "客商编号")
private String customerNumber;
@Schema(description = "客商名称", example = "赵六")
private String customerName;
@Schema(description = "订单类型", example = "1")
private String orderType;
@Schema(description = "业务类型;原料/成品/服务/发票", example = "1")
private String businessType;
@Schema(description = "状态", example = "1")
private String status;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "备注")
private String remark;
@Schema(description = "合同编码")
private String contractNumber;
@Schema(description = "合同名称", example = "李四")
private String contractName;
@Schema(description = "合同纸质合同号")
private String paperContractNumber;
@Schema(description = "是否以金属结算;根据订单类型判断,如果订单为原料,则默认是,如果是服务订单则不显示,默认为否。如铁精矿/烟尘")
private String isMetalSettlement;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,160 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.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 BillMainRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14249")
@ExcelProperty("主键")
private Long id;
@Schema(description = "类型;收货/发货", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("类型;收货/发货")
private String type;
@Schema(description = "订单号")
@ExcelProperty("订单号")
private String orderNo;
@Schema(description = "订单明细主键", example = "10464")
@ExcelProperty("订单明细主键")
private Long orderDetailId;
@Schema(description = "收货单号;自动生成")
@ExcelProperty("收货单号;自动生成")
private String billNumber;
@Schema(description = "实物物料编码")
@ExcelProperty("实物物料编码")
private String materialCoding;
@Schema(description = "实物物料名称", example = "张三")
@ExcelProperty("实物物料名称")
private String materialName;
@Schema(description = "实物收发货数量")
@ExcelProperty("实物收发货数量")
private BigDecimal materialQuantity;
@Schema(description = "总干重")
@ExcelProperty("总干重")
private BigDecimal dryQuantity;
@Schema(description = "实物计量单位")
@ExcelProperty("实物计量单位")
private String materialUom;
@Schema(description = "金属物料编码")
@ExcelProperty("金属物料编码")
private String metalCoding;
@Schema(description = "金属物料名称", example = "王五")
@ExcelProperty("金属物料名称")
private String metalName;
@Schema(description = "金属收发货数量")
@ExcelProperty("金属收发货数量")
private BigDecimal metalQuantity;
@Schema(description = "金属计量单位")
@ExcelProperty("金属计量单位")
private String metalUom;
@Schema(description = "工厂名称", example = "芋艿")
@ExcelProperty("工厂名称")
private String factoryName;
@Schema(description = "工厂编码")
@ExcelProperty("工厂编码")
private String factoryNumber;
@Schema(description = "库位名称", example = "芋艿")
@ExcelProperty("库位名称")
private String warehouseName;
@Schema(description = "库位编码")
@ExcelProperty("库位编码")
private String warehouseNumber;
@Schema(description = "不含税总金额")
@ExcelProperty("不含税总金额")
private BigDecimal notTaxAmount;
@Schema(description = "含税总金额")
@ExcelProperty("含税总金额")
private BigDecimal inTaxAmount;
@Schema(description = "总税额")
@ExcelProperty("总税额")
private BigDecimal taxAmount;
@Schema(description = "付款比例")
@ExcelProperty("付款比例")
private BigDecimal paymentRatio;
@Schema(description = "实付总金额")
@ExcelProperty("实付总金额")
private BigDecimal relativityAmount;
@Schema(description = "过账日期")
@ExcelProperty("过账日期")
private LocalDateTime postingDate;
@Schema(description = "客商编号")
@ExcelProperty("客商编号")
private String customerNumber;
@Schema(description = "客商名称", example = "赵六")
@ExcelProperty("客商名称")
private String customerName;
@Schema(description = "订单类型", example = "1")
@ExcelProperty("订单类型")
private String orderType;
@Schema(description = "业务类型;原料/成品/服务/发票", example = "1")
@ExcelProperty("业务类型;原料/成品/服务/发票")
private String businessType;
@Schema(description = "状态", example = "1")
@ExcelProperty("状态")
private String status;
@Schema(description = "小协议号")
@ExcelProperty("小协议号")
private String agreementNumber;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "合同编码")
@ExcelProperty("合同编码")
private String contractNumber;
@Schema(description = "合同名称", example = "李四")
@ExcelProperty("合同名称")
private String contractName;
@Schema(description = "合同纸质合同号")
@ExcelProperty("合同纸质合同号")
private String paperContractNumber;
@Schema(description = "是否以金属结算;根据订单类型判断,如果订单为原料,则默认是,如果是服务订单则不显示,默认为否。如铁精矿/烟尘")
@ExcelProperty("是否以金属结算;根据订单类型判断,如果订单为原料,则默认是,如果是服务订单则不显示,默认为否。如铁精矿/烟尘")
private String isMetalSettlement;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,125 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailSaveReqVO;
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 BillMainSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14249")
private Long id;
@Schema(description = "类型;收货/发货", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "类型;收货/发货不能为空")
private String type;
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "订单明细主键", example = "10464")
private Long orderDetailId;
@Schema(description = "收货单号;自动生成")
private String billNumber;
@Schema(description = "实物物料编码")
private String materialCoding;
@Schema(description = "实物物料名称", example = "张三")
private String materialName;
@Schema(description = "实物收发货数量")
private BigDecimal materialQuantity;
@Schema(description = "总干重")
private BigDecimal dryQuantity;
@Schema(description = "实物计量单位")
private String materialUom;
@Schema(description = "金属物料编码")
private String metalCoding;
@Schema(description = "金属物料名称", example = "王五")
private String metalName;
@Schema(description = "金属收发货数量")
private BigDecimal metalQuantity;
@Schema(description = "金属计量单位")
private String metalUom;
@Schema(description = "工厂名称", example = "芋艿")
private String factoryName;
@Schema(description = "工厂编码")
private String factoryNumber;
@Schema(description = "库位名称", example = "芋艿")
private String warehouseName;
@Schema(description = "库位编码")
private String warehouseNumber;
@Schema(description = "不含税总金额")
private BigDecimal notTaxAmount;
@Schema(description = "含税总金额")
private BigDecimal inTaxAmount;
@Schema(description = "总税额")
private BigDecimal taxAmount;
@Schema(description = "付款比例")
private BigDecimal paymentRatio;
@Schema(description = "实付总金额")
private BigDecimal relativityAmount;
@Schema(description = "过账日期")
private LocalDateTime postingDate;
@Schema(description = "客商编号")
private String customerNumber;
@Schema(description = "客商名称", example = "赵六")
private String customerName;
@Schema(description = "订单类型", example = "1")
private String orderType;
@Schema(description = "业务类型;原料/成品/服务/发票", example = "1")
private String businessType;
@Schema(description = "状态", example = "1")
private String status;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "备注")
private String remark;
@Schema(description = "合同编码")
private String contractNumber;
@Schema(description = "合同名称", example = "李四")
private String contractName;
@Schema(description = "合同纸质合同号")
private String paperContractNumber;
@Schema(description = "是否以金属结算;根据订单类型判断,如果订单为原料,则默认是,如果是服务订单则不显示,默认为否。如铁精矿/烟尘")
private String isMetalSettlement;
@Schema(description = "收发货单明细新集合")
private List<BillMainDetailSaveReqVO> billMainDetailSaveReqVOS;
}

View File

@@ -0,0 +1,110 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmaindetail.BillMainDetailDO;
import cn.iocoder.yudao.module.receivedeliver.service.billmaindetail.BillMainDetailService;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import cn.iocoder.yudao.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 cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 收发货单明细")
@RestController
@RequestMapping("/sply/bill-main-detail")
@Validated
public class BillMainDetailController implements BusinessControllerMarker {
@Resource
private BillMainDetailService billMainDetailService;
@PostMapping("/create")
@Operation(summary = "创建收发货单明细")
@PreAuthorize("@ss.hasPermission('sply:bill-main-detail:create')")
public CommonResult<BillMainDetailRespVO> createBillMainDetail(@Valid @RequestBody BillMainDetailSaveReqVO createReqVO) {
return success(billMainDetailService.createBillMainDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新收发货单明细")
@PreAuthorize("@ss.hasPermission('sply:bill-main-detail:update')")
public CommonResult<Boolean> updateBillMainDetail(@Valid @RequestBody BillMainDetailSaveReqVO updateReqVO) {
billMainDetailService.updateBillMainDetail(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除收发货单明细")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('sply:bill-main-detail:delete')")
public CommonResult<Boolean> deleteBillMainDetail(@RequestParam("id") Long id) {
billMainDetailService.deleteBillMainDetail(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除收发货单明细")
@PreAuthorize("@ss.hasPermission('sply:bill-main-detail:delete')")
public CommonResult<Boolean> deleteBillMainDetailList(@RequestBody BatchDeleteReqVO req) {
billMainDetailService.deleteBillMainDetailListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得收发货单明细")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('sply:bill-main-detail:query')")
public CommonResult<BillMainDetailRespVO> getBillMainDetail(@RequestParam("id") Long id) {
BillMainDetailDO billMainDetail = billMainDetailService.getBillMainDetail(id);
return success(BeanUtils.toBean(billMainDetail, BillMainDetailRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得收发货单明细分页")
@PreAuthorize("@ss.hasPermission('sply:bill-main-detail:query')")
public CommonResult<PageResult<BillMainDetailRespVO>> getBillMainDetailPage(@Valid BillMainDetailPageReqVO pageReqVO) {
PageResult<BillMainDetailDO> pageResult = billMainDetailService.getBillMainDetailPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, BillMainDetailRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出收发货单明细 Excel")
@PreAuthorize("@ss.hasPermission('sply:bill-main-detail:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportBillMainDetailExcel(@Valid BillMainDetailPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<BillMainDetailDO> list = billMainDetailService.getBillMainDetailPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "收发货单明细.xls", "数据", BillMainDetailRespVO.class,
BeanUtils.toBean(list, BillMainDetailRespVO.class));
}
}

View File

@@ -0,0 +1,87 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 收发货单明细分页 Request VO")
@Data
public class BillMainDetailPageReqVO extends PageParam {
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "收发货单主键", example = "12176")
private Long recordId;
@Schema(description = "批次号")
private String batchNo;
@Schema(description = "磅单号")
private String poundNo;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "李四")
private String elementName;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "品位类型;暂估/化验/复检/仲裁", example = "1")
private String gradeType;
@Schema(description = "品位值")
private BigDecimal grade;
@Schema(description = "金属物料编码")
private String metalNumber;
@Schema(description = "金属物料名称", example = "芋艿")
private String metalName;
@Schema(description = "总收货量")
private BigDecimal quantity;
@Schema(description = "计量单位")
private String uom;
@Schema(description = "税码")
private String taxNumber;
@Schema(description = "不含税金额")
private BigDecimal notTaxAmount;
@Schema(description = "含税金额")
private BigDecimal inTaxAmount;
@Schema(description = "税额")
private BigDecimal taxAmount;
@Schema(description = "付款比例")
private BigDecimal paymentRatio;
@Schema(description = "实付金额")
private BigDecimal relativityAmount;
@Schema(description = "备注")
private String remark;
@Schema(description = "状态", example = "2")
private String status;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,112 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.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 BillMainDetailRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8550")
@ExcelProperty("主键")
private Long id;
@Schema(description = "订单号")
@ExcelProperty("订单号")
private String orderNo;
@Schema(description = "收发货单主键", example = "12176")
@ExcelProperty("收发货单主键")
private Long recordId;
@Schema(description = "批次号")
@ExcelProperty("批次号")
private String batchNo;
@Schema(description = "磅单号")
@ExcelProperty("磅单号")
private String poundNo;
@Schema(description = "金属元素缩写")
@ExcelProperty("金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "李四")
@ExcelProperty("金属元素名称")
private String elementName;
@Schema(description = "金属元素编码")
@ExcelProperty("金属元素编码")
private String elementNumber;
@Schema(description = "品位单位")
@ExcelProperty("品位单位")
private String gradeUnit;
@Schema(description = "品位类型;暂估/化验/复检/仲裁", example = "1")
@ExcelProperty("品位类型;暂估/化验/复检/仲裁")
private String gradeType;
@Schema(description = "品位值")
@ExcelProperty("品位值")
private BigDecimal grade;
@Schema(description = "金属物料编码")
@ExcelProperty("金属物料编码")
private String metalNumber;
@Schema(description = "金属物料名称", example = "芋艿")
@ExcelProperty("金属物料名称")
private String metalName;
@Schema(description = "总收货量")
@ExcelProperty("总收货量")
private BigDecimal quantity;
@Schema(description = "计量单位")
@ExcelProperty("计量单位")
private String uom;
@Schema(description = "税码")
@ExcelProperty("税码")
private String taxNumber;
@Schema(description = "不含税金额")
@ExcelProperty("不含税金额")
private BigDecimal notTaxAmount;
@Schema(description = "含税金额")
@ExcelProperty("含税金额")
private BigDecimal inTaxAmount;
@Schema(description = "税额")
@ExcelProperty("税额")
private BigDecimal taxAmount;
@Schema(description = "付款比例")
@ExcelProperty("付款比例")
private BigDecimal paymentRatio;
@Schema(description = "实付金额")
@ExcelProperty("实付金额")
private BigDecimal relativityAmount;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "状态", example = "2")
@ExcelProperty("状态")
private String status;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,82 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 收发货单明细新增/修改 Request VO")
@Data
public class BillMainDetailSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8550")
private Long id;
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "收发货单主键", example = "12176")
private Long recordId;
@Schema(description = "批次号")
private String batchNo;
@Schema(description = "磅单号")
private String poundNo;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "李四")
private String elementName;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "品位类型;暂估/化验/复检/仲裁", example = "1")
private String gradeType;
@Schema(description = "品位值")
private BigDecimal grade;
@Schema(description = "金属物料编码")
private String metalNumber;
@Schema(description = "金属物料名称", example = "芋艿")
private String metalName;
@Schema(description = "总收货量")
private BigDecimal quantity;
@Schema(description = "计量单位")
private String uom;
@Schema(description = "税码")
private String taxNumber;
@Schema(description = "不含税金额")
private BigDecimal notTaxAmount;
@Schema(description = "含税金额")
private BigDecimal inTaxAmount;
@Schema(description = "税额")
private BigDecimal taxAmount;
@Schema(description = "付款比例")
private BigDecimal paymentRatio;
@Schema(description = "实付金额")
private BigDecimal relativityAmount;
@Schema(description = "备注")
private String remark;
@Schema(description = "状态", example = "2")
private String status;
}

View File

@@ -0,0 +1,175 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.business.controller.AbstractFileUploadController;
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecast.ForecastDO;
import cn.iocoder.yudao.module.receivedeliver.service.forecast.ForecastService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.core.io.ClassPathResource;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.rmi.ServerException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.IMPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 预报")
@RestController
@RequestMapping("/supply/forecast")
public class ForecastController extends AbstractFileUploadController implements BusinessControllerMarker{
@Resource
private ForecastService forecastService;
@PostMapping("/create")
@Operation(summary = "创建预报")
public CommonResult<ForecastRespVO> createForecast(@Valid @RequestBody ForecastSaveReqVO createReqVO) {
return success(forecastService.createForecast(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新预报")
public CommonResult<Boolean> updateForecast(@Valid @RequestBody ForecastSaveReqVO updateReqVO) {
forecastService.updateForecast(updateReqVO);
return success(true);
}
@PutMapping("/submit")
@Operation(summary = "提交")
public CommonResult<Boolean> submit(@Valid @RequestBody ForecastSaveReqVO updateReqVO) {
forecastService.submit(updateReqVO);
return success(true);
}
@PutMapping("/submit-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量提交")
public CommonResult<Boolean> submitList(@RequestBody List<Long> ids) {
forecastService.submitList(ids);
return success(true);
}
@PutMapping("/issued")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "下发")
public CommonResult<Boolean> issued(@RequestBody List<Long> ids) {
forecastService.issued(ids);
return success(true);
}
@PutMapping("/close")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "关闭")
public CommonResult<Boolean> close(@RequestBody List<Long> ids) {
forecastService.close(ids);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除预报")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteForecast(@RequestParam("id") Long id) {
forecastService.deleteForecast(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除预报")
public CommonResult<Boolean> deleteForecastList(@RequestBody BatchDeleteReqVO req) {
forecastService.deleteForecastListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得预报")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<ForecastRespVO> getForecast(@RequestParam("id") Long id) {
return success(forecastService.getForecast(id));
}
@GetMapping("/page")
@Operation(summary = "获得预报分页")
public CommonResult<PageResult<ForecastRespVO>> getForecastPage(@Valid ForecastPageReqVO pageReqVO) {
PageResult<ForecastDO> pageResult = forecastService.getForecastPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ForecastRespVO.class));
}
@GetMapping("/get-import-template")
@Operation(summary = "获得导入模板")
public void importTemplate(HttpServletResponse response) throws IOException {
ClassPathResource resource = new ClassPathResource("template/ForecastTemplate.xlsx");
respInfo(response, "预报导入模板.xlsx", resource.getInputStream(), "EXCEL");
}
@PostMapping("/import")
@Operation(summary = "导入预报")
@Parameter(name = "file", description = "Excel 文件", required = true)
@ApiAccessLog(operateType = IMPORT)
public CommonResult<Boolean> importForecastExcel(@RequestParam("file") MultipartFile file) throws IOException {
forecastService.importForecastExcel(file);
return success(true);
}
@GetMapping("/export-excel")
@Operation(summary = "导出预报 Excel")
@ApiAccessLog(operateType = EXPORT)
public void exportForecastExcel(@Valid ForecastPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
InputStream inputStream = forecastService.exportForecastExcel(pageReqVO);
respInfo(response, "预报表.xlsx", inputStream, "EXCEL");
}
@GetMapping("/print")
@Operation(summary = "打印")
public void print() throws IOException {
// TODO 打印
}
/**
* 导出文件
*
* @param response
* @param fileName
* @param inputStream
* @throws IOException
*/
public void respInfo(HttpServletResponse response, String fileName, InputStream inputStream, String fileType) throws IOException {
String type;
switch (fileType) {
case "EXCEL" -> type = "application/vnd.ms-excel";
case "PDF" -> type = "application/pdf";
default -> type = null;
}
if (type == null) {
throw new ServerException("不支持的文件类型");
}
response.addHeader("Content-Disposition", "attachment;filename=" + HttpUtils.encodeUtf8(fileName));
response.setContentType(type + ";charset=UTF-8");
if (inputStream != null) {
inputStream.transferTo(response.getOutputStream());
response.flushBuffer();
}
}
}

View File

@@ -0,0 +1,128 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 预报分页 Request VO")
@Data
public class ForecastPageReqVO extends PageParam {
@Schema(description = "订单主键", example = "9315")
private Long orderId;
@Schema(description = "预报单号")
private String planNumber;
@Schema(description = "预报类型", example = "2")
private String planStatus;
@Schema(description = "物料名称", example = "李四")
private String materialName;
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "承运商编码")
private String carrierNumber;
@Schema(description = "承运商名称", example = "芋艿")
private String carrierName;
@Schema(description = "预报量")
private BigDecimal forecastWet;
@Schema(description = "计量单位")
private String unit;
@Schema(description = "运输方式")
private String transportWay;
@Schema(description = "开始日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] startDate;
@Schema(description = "结束日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] endDate;
@Schema(description = "客商名称", example = "张三")
private String customerName;
@Schema(description = "客商编号")
private String customerNumber;
@Schema(description = "工厂名称;收发货工厂", example = "芋艿")
private String factoryName;
@Schema(description = "工厂编码;收发货工厂")
private String factoryNumber;
@Schema(description = "库位编码;收发货库位")
private String warehouseNumber;
@Schema(description = "库位名称;收发货库位", example = "李四")
private String warehouseName;
@Schema(description = "源工厂名称;提货单使用:需要移库的工厂", example = "芋艿")
private String outFactoryName;
@Schema(description = "源工厂编码;提货单使用:需要移库的工厂")
private String outFactoryNumber;
@Schema(description = "源库位名称;提货单使用:需要移库的库位", example = "张三")
private String outWarehouseName;
@Schema(description = "源库位编码;提货单使用:需要移库的库位")
private String outWarehouseNumber;
@Schema(description = "售达方编码;提货单使用:默认客商编码")
private String salesNumber;
@Schema(description = "售达方名称;提货单使用:默认客商名称", example = "张三")
private String salesName;
@Schema(description = "送达方编码;提货单使用:默认客商编码")
private String sendingNumber;
@Schema(description = "送达方名称;提货单使用:默认客商名称", example = "李四")
private String sendingName;
@Schema(description = "备注")
private String remark;
@Schema(description = "状态", example = "2")
private String status;
@Schema(description = "合同编码")
private String contractNumber;
@Schema(description = "合同名称", example = "张三")
private String contractName;
@Schema(description = "合同纸质合同号")
private String paperContractNumber;
@Schema(description = "订单编码")
private String orderNumber;
@Schema(description = "SAP订单号")
private String orderSAPNumber;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "小户头号")
private String tenantNumber;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,175 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementSaveReqVO;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 预报 Response VO")
@Data
@ExcelIgnoreUnannotated
@Accessors(chain = false)
public class ForecastRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11874")
@ExcelProperty("预报编号")
private Long id;
@Schema(description = "订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9315")
private Long orderId;
@Schema(description = "预报单号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("预报单号")
private String planNumber;
@Schema(description = "预报类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("预报类型")
private String planStatus;
@Schema(description = "物料名称", example = "李四")
@ExcelProperty("物料名称")
private String materialName;
@Schema(description = "物料编码")
@ExcelProperty("物料编码")
private String materialNumber;
@Schema(description = "承运商编码")
@ExcelProperty("承运商编码")
private String carrierNumber;
@Schema(description = "承运商名称", example = "芋艿")
@ExcelProperty("承运商名称")
private String carrierName;
@Schema(description = "预报量", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("预报量")
private BigDecimal forecastWet;
@Schema(description = "计量单位")
@ExcelProperty("计量单位")
private String unit;
@Schema(description = "运输方式")
@ExcelProperty("运输方式")
private String transportWay;
@Schema(description = "开始日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("开始日期")
private LocalDateTime startDate;
@Schema(description = "结束日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("结束日期")
private LocalDateTime endDate;
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@ExcelProperty("客商名称")
private String customerName;
@Schema(description = "客商编号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("客商编号")
private String customerNumber;
@Schema(description = "工厂名称;收发货工厂", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("工厂名称")
private String factoryName;
@Schema(description = "工厂编码;收发货工厂", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("工厂编码")
private String factoryNumber;
@Schema(description = "库位编码;收发货库位", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("库位编码")
private String warehouseNumber;
@Schema(description = "库位名称;收发货库位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@ExcelProperty("库位名称")
private String warehouseName;
@Schema(description = "源工厂名称;提货单使用:需要移库的工厂", example = "芋艿")
@ExcelProperty("源工厂名称")
private String outFactoryName;
@Schema(description = "源工厂编码;提货单使用:需要移库的工厂")
@ExcelProperty("源工厂编码")
private String outFactoryNumber;
@Schema(description = "源库位名称;提货单使用:需要移库的库位", example = "张三")
@ExcelProperty("源库位名称")
private String outWarehouseName;
@Schema(description = "源库位编码;提货单使用:需要移库的库位")
@ExcelProperty("源库位编码")
private String outWarehouseNumber;
@Schema(description = "售达方编码;提货单使用:默认客商编码")
@ExcelProperty("售达方编码")
private String salesNumber;
@Schema(description = "售达方名称;提货单使用:默认客商名称", example = "张三")
@ExcelProperty("售达方名称")
private String salesName;
@Schema(description = "送达方编码;提货单使用:默认客商编码")
@ExcelProperty("送达方编码")
private String sendingNumber;
@Schema(description = "送达方名称;提货单使用:默认客商名称", example = "李四")
@ExcelProperty("送达方名称")
private String sendingName;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("状态")
private String status;
@Schema(description = "合同编码")
@ExcelProperty("合同编码")
private String contractNumber;
@Schema(description = "合同名称", example = "张三")
@ExcelProperty("合同名称")
private String contractName;
@Schema(description = "合同纸质合同号")
@ExcelProperty("合同纸质合同号")
private String paperContractNumber;
@Schema(description = "订单编码")
@ExcelProperty("订单编码")
private String orderNumber;
@Schema(description = "SAP订单号")
@ExcelProperty("SAP订单号")
private String orderSAPNumber;
@Schema(description = "小协议号")
@ExcelProperty("小协议号")
private String agreementNumber;
@Schema(description = "小户头号")
@ExcelProperty("小户头号")
private String tenantNumber;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "预报表明细")
private List<ForecastDetailRespVO> detailList;
@Schema(description = "预报品位")
private List<ForecastElementRespVO> elementList;
}

View File

@@ -0,0 +1,153 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementSaveReqVO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 预报新增/修改 Request VO")
@Data
public class ForecastSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11874")
private Long id;
@Schema(description = "订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9315")
@NotNull(message = "订单主键不能为空")
private Long orderId;
@Schema(description = "预报单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "预报单号不能为空")
private String planNumber;
@Schema(description = "预报类型字典代码FRCST_TP", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "预报类型不能为空")
private String planStatus;
@Schema(description = "物料名称", example = "李四")
@NotNull(message = "物料名称")
private String materialName;
@Schema(description = "物料编码")
@NotNull(message = "物料编码")
private String materialNumber;
@Schema(description = "承运商编码")
@NotNull(message = "承运商编码")
private String carrierNumber;
@Schema(description = "承运商名称", example = "芋艿")
@NotNull(message = "承运商名称")
private String carrierName;
@Schema(description = "预报量", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "预报量不能为空")
private BigDecimal forecastWet;
@Schema(description = "计量单位")
@NotNull(message = "计量单位")
private String unit;
@Schema(description = "运输方式字典代码TRP_WY")
@NotNull(message = "运输方式不能为空")
private String transportWay;
@Schema(description = "开始日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "开始日期不能为空")
private LocalDateTime startDate;
@Schema(description = "结束日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "结束日期不能为空")
private LocalDateTime endDate;
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@NotEmpty(message = "客商名称不能为空")
private String customerName;
@Schema(description = "客商编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "客商编号不能为空")
private String customerNumber;
@Schema(description = "工厂名称;收发货工厂", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "工厂名称;收发货工厂不能为空")
private String factoryName;
@Schema(description = "工厂编码;收发货工厂", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "工厂编码;收发货工厂不能为空")
private String factoryNumber;
@Schema(description = "库位编码;收发货库位", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "库位编码;收发货库位不能为空")
private String warehouseNumber;
@Schema(description = "库位名称;收发货库位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@NotEmpty(message = "库位名称;收发货库位不能为空")
private String warehouseName;
@Schema(description = "源工厂名称;提货单使用:需要移库的工厂", example = "芋艿")
private String outFactoryName;
@Schema(description = "源工厂编码;提货单使用:需要移库的工厂")
private String outFactoryNumber;
@Schema(description = "源库位名称;提货单使用:需要移库的库位", example = "张三")
private String outWarehouseName;
@Schema(description = "源库位编码;提货单使用:需要移库的库位")
private String outWarehouseNumber;
@Schema(description = "售达方编码;提货单使用:默认客商编码")
private String salesNumber;
@Schema(description = "售达方名称;提货单使用:默认客商名称", example = "张三")
private String salesName;
@Schema(description = "送达方编码;提货单使用:默认客商编码")
private String sendingNumber;
@Schema(description = "送达方名称;提货单使用:默认客商名称", example = "李四")
private String sendingName;
@Schema(description = "备注")
private String remark;
@Schema(description = "状态字典代码FRCST_STS", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "状态不能为空")
private String status;
@Schema(description = "合同编码")
private String contractNumber;
@Schema(description = "合同名称", example = "张三")
private String contractName;
@Schema(description = "合同纸质合同号")
private String paperContractNumber;
@Schema(description = "订单编码")
private String orderNumber;
@Schema(description = "SAP订单号")
private String orderSAPNumber;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "小户头号")
private String tenantNumber;
@Schema(description = "预报表明细")
private List<ForecastDetailSaveReqVO> detailList;
@Schema(description = "预报品位")
private List<ForecastElementSaveReqVO> elementList;
}

View File

@@ -0,0 +1,98 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.business.annotation.FileUploadController;
import cn.iocoder.yudao.framework.business.controller.AbstractFileUploadController;
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastdetail.ForecastDetailDO;
import cn.iocoder.yudao.module.receivedeliver.service.forecastdetail.ForecastDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 预报表明细")
@RestController
@RequestMapping("/supply/forecast-detail")
public class ForecastDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
@Resource
private ForecastDetailService forecastDetailService;
@PostMapping("/create")
@Operation(summary = "创建预报表明细")
public CommonResult<ForecastDetailRespVO> createForecastDetail(@Valid @RequestBody ForecastDetailSaveReqVO createReqVO) {
return success(forecastDetailService.createForecastDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新预报表明细")
public CommonResult<Boolean> updateForecastDetail(@Valid @RequestBody ForecastDetailSaveReqVO updateReqVO) {
forecastDetailService.updateForecastDetail(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除预报表明细")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteForecastDetail(@RequestParam("id") Long id) {
forecastDetailService.deleteForecastDetail(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除预报表明细")
public CommonResult<Boolean> deleteForecastDetailList(@RequestBody BatchDeleteReqVO req) {
forecastDetailService.deleteForecastDetailListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得预报表明细")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<ForecastDetailRespVO> getForecastDetail(@RequestParam("id") Long id) {
ForecastDetailDO forecastDetail = forecastDetailService.getForecastDetail(id);
return success(BeanUtils.toBean(forecastDetail, ForecastDetailRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得预报表明细分页")
public CommonResult<PageResult<ForecastDetailRespVO>> getForecastDetailPage(@Valid ForecastDetailPageReqVO pageReqVO) {
PageResult<ForecastDetailDO> pageResult = forecastDetailService.getForecastDetailPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ForecastDetailRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出预报表明细 Excel")
@ApiAccessLog(operateType = EXPORT)
public void exportForecastDetailExcel(@Valid ForecastDetailPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ForecastDetailDO> list = forecastDetailService.getForecastDetailPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "预报表明细.xls", "数据", ForecastDetailRespVO.class,
BeanUtils.toBean(list, ForecastDetailRespVO.class));
}
}

View File

@@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 预报表明细分页 Request VO")
@Data
public class ForecastDetailPageReqVO extends PageParam {
@Schema(description = "预报主表主键", example = "5783")
private Long forecastId;
@Schema(description = "预报单号")
private String forecastNumber;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "运单号")
private String waybillNumber;
@Schema(description = "载重")
private BigDecimal loadWeight;
@Schema(description = "重净")
private BigDecimal weight;
@Schema(description = "车牌号")
private String vehicleNumber;
@Schema(description = "驾驶员姓名", example = "王五")
private String drivingName;
@Schema(description = "手机号")
private String phone;
@Schema(description = "类型", example = "2")
private String type;
@Schema(description = "身份证号")
private String identityNumber;
@Schema(description = "状态", example = "1")
private String status;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 预报表明细 Response VO")
@Data
@ExcelIgnoreUnannotated
@Accessors(chain = false)
public class ForecastDetailRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15428")
@ExcelProperty("预报明细编号")
private Long id;
@Schema(description = "预报主表主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5783")
@ExcelProperty("预报编号")
private Long forecastId;
@Schema(description = "预报单号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("预报单号")
private String forecastNumber;
@Schema(description = "小协议号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("小协议号")
private String agreementNumber;
@Schema(description = "运单号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("运单号")
private String waybillNumber;
@Schema(description = "载重", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("载重")
private BigDecimal loadWeight;
@Schema(description = "重净", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("重净")
private BigDecimal weight;
@Schema(description = "车牌号")
@ExcelProperty("车牌号")
private String vehicleNumber;
@Schema(description = "驾驶员姓名", example = "王五")
@ExcelProperty("驾驶员姓名")
private String drivingName;
@Schema(description = "手机号")
@ExcelProperty("手机号")
private String phone;
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("类型")
private String type;
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String identityNumber;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("状态")
private String status;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 预报表明细新增/修改 Request VO")
@Data
public class ForecastDetailSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15428")
private Long id;
@Schema(description = "预报主表主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5783")
@NotNull(message = "预报主表主键不能为空")
private Long forecastId;
@Schema(description = "预报单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "预报单号不能为空")
private String forecastNumber;
@Schema(description = "小协议号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "小协议号不能为空")
private String agreementNumber;
@Schema(description = "运单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "运单号不能为空")
private String waybillNumber;
@Schema(description = "载重", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "载重不能为空")
private BigDecimal loadWeight;
@Schema(description = "重净", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "重净不能为空")
private BigDecimal weight;
@Schema(description = "车牌号")
private String vehicleNumber;
@Schema(description = "驾驶员姓名", example = "王五")
private String drivingName;
@Schema(description = "手机号")
private String phone;
@Schema(description = "类型字典代码FRCST_WY", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "类型不能为空")
private String type;
@Schema(description = "身份证号")
private String identityNumber;
@Schema(description = "状态字典代码FRCST_DTL_STS", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "状态不能为空")
private String status;
}

View File

@@ -0,0 +1,98 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.business.annotation.FileUploadController;
import cn.iocoder.yudao.framework.business.controller.AbstractFileUploadController;
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastelement.ForecastElementDO;
import cn.iocoder.yudao.module.receivedeliver.service.forecastelement.ForecastElementService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 预报品位")
@RestController
@RequestMapping("/supply/forecast-element")
public class ForecastElementController extends AbstractFileUploadController implements BusinessControllerMarker{
@Resource
private ForecastElementService forecastElementService;
@PostMapping("/create")
@Operation(summary = "创建预报品位")
public CommonResult<ForecastElementRespVO> createForecastElement(@Valid @RequestBody ForecastElementSaveReqVO createReqVO) {
return success(forecastElementService.createForecastElement(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新预报品位")
public CommonResult<Boolean> updateForecastElement(@Valid @RequestBody ForecastElementSaveReqVO updateReqVO) {
forecastElementService.updateForecastElement(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除预报品位")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteForecastElement(@RequestParam("id") Long id) {
forecastElementService.deleteForecastElement(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除预报品位")
public CommonResult<Boolean> deleteForecastElementList(@RequestBody BatchDeleteReqVO req) {
forecastElementService.deleteForecastElementListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得预报品位")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<ForecastElementRespVO> getForecastElement(@RequestParam("id") Long id) {
ForecastElementDO forecastElement = forecastElementService.getForecastElement(id);
return success(BeanUtils.toBean(forecastElement, ForecastElementRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得预报品位分页")
public CommonResult<PageResult<ForecastElementRespVO>> getForecastElementPage(@Valid ForecastElementPageReqVO pageReqVO) {
PageResult<ForecastElementDO> pageResult = forecastElementService.getForecastElementPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ForecastElementRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出预报品位 Excel")
@ApiAccessLog(operateType = EXPORT)
public void exportForecastElementExcel(@Valid ForecastElementPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ForecastElementDO> list = forecastElementService.getForecastElementPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "预报品位.xls", "数据", ForecastElementRespVO.class,
BeanUtils.toBean(list, ForecastElementRespVO.class));
}
}

View File

@@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 预报品位分页 Request VO")
@Data
public class ForecastElementPageReqVO extends PageParam {
@Schema(description = "关联类型", example = "1")
private String relativityType;
@Schema(description = "关联主键", example = "7183")
private Long relativityId;
@Schema(description = "合同纸质合同号")
private String paperContractNumber;
@Schema(description = "合同名称", example = "李四")
private String contractName;
@Schema(description = "订单编码")
private String orderNumber;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "芋艿")
private String elementName;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "小户头号")
private String tenantNumber;
@Schema(description = "预估品位值")
private BigDecimal gradeValue;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,72 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 预报品位 Response VO")
@Data
@ExcelIgnoreUnannotated
@Accessors(chain = false)
public class ForecastElementRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4074")
private Long id;
@Schema(description = "关联类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private String relativityType;
@Schema(description = "关联主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7183")
@ExcelProperty("预报明细编号")
private Long relativityId;
@Schema(description = "合同纸质合同号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("合同纸质合同号")
private String paperContractNumber;
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@ExcelProperty("合同名称")
private String contractName;
@Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("订单编码")
private String orderNumber;
@Schema(description = "小协议号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("小协议号")
private String agreementNumber;
@Schema(description = "金属元素缩写", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("金属元素名称")
private String elementName;
@Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("金属元素编码")
private String elementNumber;
@Schema(description = "小户头号")
@ExcelProperty("小户头号")
private String tenantNumber;
@Schema(description = "预估品位值", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("预估品位值")
private BigDecimal gradeValue;
@Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("品位单位")
private String gradeUnit;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 预报品位新增/修改 Request VO")
@Data
public class ForecastElementSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4074")
private Long id;
@Schema(description = "关联类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "关联类型不能为空")
private String relativityType;
@Schema(description = "关联主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7183")
@NotNull(message = "关联主键不能为空")
private Long relativityId;
@Schema(description = "合同纸质合同号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "合同纸质合同号不能为空")
private String paperContractNumber;
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@NotEmpty(message = "合同名称不能为空")
private String contractName;
@Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "订单编码不能为空")
private String orderNumber;
@Schema(description = "小协议号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "小协议号不能为空")
private String agreementNumber;
@Schema(description = "金属元素缩写", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "金属元素缩写不能为空")
private String elementAbbreviation;
@Schema(description = "金属元素名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "金属元素名称不能为空")
private String elementName;
@Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "金属元素编码不能为空")
private String elementNumber;
@Schema(description = "小户头号")
private String tenantNumber;
@Schema(description = "预估品位值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "预估品位值不能为空")
private BigDecimal gradeValue;
@Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "品位单位不能为空")
private String gradeUnit;
}

View File

@@ -0,0 +1,98 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.metering;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.business.annotation.FileUploadController;
import cn.iocoder.yudao.framework.business.controller.AbstractFileUploadController;
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.metering.MeteringDO;
import cn.iocoder.yudao.module.receivedeliver.service.metering.MeteringService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 计量")
@RestController
@RequestMapping("/supply/metering")
public class MeteringController extends AbstractFileUploadController implements BusinessControllerMarker{
@Resource
private MeteringService meteringService;
@PostMapping("/create")
@Operation(summary = "创建计量")
public CommonResult<MeteringRespVO> createMetering(@Valid @RequestBody MeteringSaveReqVO createReqVO) {
return success(meteringService.createMetering(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新计量")
public CommonResult<Boolean> updateMetering(@Valid @RequestBody MeteringSaveReqVO updateReqVO) {
meteringService.updateMetering(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除计量")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteMetering(@RequestParam("id") Long id) {
meteringService.deleteMetering(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除计量")
public CommonResult<Boolean> deleteMeteringList(@RequestBody BatchDeleteReqVO req) {
meteringService.deleteMeteringListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得计量")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<MeteringRespVO> getMetering(@RequestParam("id") Long id) {
MeteringDO metering = meteringService.getMetering(id);
return success(BeanUtils.toBean(metering, MeteringRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得计量分页")
public CommonResult<PageResult<MeteringRespVO>> getMeteringPage(@Valid MeteringPageReqVO pageReqVO) {
PageResult<MeteringDO> pageResult = meteringService.getMeteringPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MeteringRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出计量 Excel")
@PreAuthorize("@ss.hasPermission('sply:metering:export')")
public void exportMeteringExcel(@Valid MeteringPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MeteringDO> list = meteringService.getMeteringPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "计量.xls", "数据", MeteringRespVO.class,
BeanUtils.toBean(list, MeteringRespVO.class));
}
}

View File

@@ -0,0 +1,84 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 计量分页 Request VO")
@Data
public class MeteringPageReqVO extends PageParam {
@Schema(description = "订单号")
private String orderNumber;
@Schema(description = "预报明细主键", example = "11310")
private Long forecastDetailId;
@Schema(description = "小协议号")
private String agreementNumber;
@Schema(description = "物料名称", example = "芋艿")
private String materialName;
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "订单类型;销售/采购/委托加工", example = "2")
private String orderType;
@Schema(description = "运单号;与预报明细对应")
private String waybillNumber;
@Schema(description = "批次号")
private String batchNumber;
@Schema(description = "磅单号")
private String poundNumber;
@Schema(description = "净重")
private BigDecimal realWeight;
@Schema(description = "驾驶员名称", example = "王五")
private String drivingName;
@Schema(description = "计量类型", example = "2")
private String meteringType;
@Schema(description = "运输方式")
private String transportWay;
@Schema(description = "车箱号")
private String carriageNumber;
@Schema(description = "车牌号")
private String vehicleNumber;
@Schema(description = "进厂日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] intoDate;
@Schema(description = "出厂日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] outDate;
@Schema(description = "计量时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] meteringTime;
@Schema(description = "是否作废")
private String isCancel;
@Schema(description = "小户头号")
private String tenantNumber;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,104 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 计量 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MeteringRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4183")
@ExcelProperty("主键")
private Long id;
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("订单号")
private String orderNumber;
@Schema(description = "预报明细主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11310")
@ExcelProperty("预报明细主键")
private Long forecastDetailId;
@Schema(description = "小协议号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("小协议号")
private String agreementNumber;
@Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("物料名称")
private String materialName;
@Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("物料编码")
private String materialNumber;
@Schema(description = "订单类型;销售/采购/委托加工", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("订单类型;销售/采购/委托加工")
private String orderType;
@Schema(description = "运单号;与预报明细对应", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("运单号;与预报明细对应")
private String waybillNumber;
@Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("批次号")
private String batchNumber;
@Schema(description = "磅单号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("磅单号")
private String poundNumber;
@Schema(description = "净重", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("净重")
private BigDecimal realWeight;
@Schema(description = "驾驶员名称", example = "王五")
@ExcelProperty("驾驶员名称")
private String drivingName;
@Schema(description = "计量类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("计量类型")
private String meteringType;
@Schema(description = "运输方式")
@ExcelProperty("运输方式")
private String transportWay;
@Schema(description = "车箱号")
@ExcelProperty("车箱号")
private String carriageNumber;
@Schema(description = "车牌号")
@ExcelProperty("车牌号")
private String vehicleNumber;
@Schema(description = "进厂日期")
@ExcelProperty("进厂日期")
private LocalDateTime intoDate;
@Schema(description = "出厂日期")
@ExcelProperty("出厂日期")
private LocalDateTime outDate;
@Schema(description = "计量时间")
@ExcelProperty("计量时间")
private LocalDateTime meteringTime;
@Schema(description = "是否作废")
@ExcelProperty("是否作废")
private String isCancel;
@Schema(description = "小户头号")
@ExcelProperty("小户头号")
private String tenantNumber;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,89 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 计量新增/修改 Request VO")
@Data
public class MeteringSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4183")
private Long id;
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "订单号不能为空")
private String orderNumber;
@Schema(description = "预报明细主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11310")
@NotNull(message = "预报明细主键不能为空")
private Long forecastDetailId;
@Schema(description = "小协议号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "小协议号不能为空")
private String agreementNumber;
@Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "物料名称不能为空")
private String materialName;
@Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "物料编码不能为空")
private String materialNumber;
@Schema(description = "订单类型;销售/采购/委托加工", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "订单类型;销售/采购/委托加工不能为空")
private String orderType;
@Schema(description = "运单号;与预报明细对应", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "运单号;与预报明细对应不能为空")
private String waybillNumber;
@Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "批次号不能为空")
private String batchNumber;
@Schema(description = "磅单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "磅单号不能为空")
private String poundNumber;
@Schema(description = "净重", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "净重不能为空")
private BigDecimal realWeight;
@Schema(description = "驾驶员名称", example = "王五")
private String drivingName;
@Schema(description = "计量类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "计量类型不能为空")
private String meteringType;
@Schema(description = "运输方式")
private String transportWay;
@Schema(description = "车箱号")
private String carriageNumber;
@Schema(description = "车牌号")
private String vehicleNumber;
@Schema(description = "进厂日期")
private LocalDateTime intoDate;
@Schema(description = "出厂日期")
private LocalDateTime outDate;
@Schema(description = "计量时间")
private LocalDateTime meteringTime;
@Schema(description = "是否作废")
private String isCancel;
@Schema(description = "小户头号")
private String tenantNumber;
}

View File

@@ -1,12 +1,13 @@
package cn.iocoder.yudao.module.receivedeliver.controller.admin.receivedeliver;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**

View File

@@ -0,0 +1,115 @@
package cn.iocoder.yudao.module.receivedeliver.dal.dataobject.assay;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 品位 DO
*
* @author 后台管理
*/
@TableName("sply_asy")
@KeySequence("sply_asy_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class AssayDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 品味类型
*/
@TableField("GRD_TP")
private String gradeType;
/**
* 订单号
*/
@TableField("ORD_NUM")
private String orderNumber;
/**
* 订单类型;销售/采购/委托加工
*/
@TableField("ORD_TP")
private String orderType;
/**
* 运单号
*/
@TableField("WYBL_NUM")
private String waybillNumber;
/**
* 批次号
*/
@TableField("BAT_NUM")
private String batchNumber;
/**
* 小协议号
*/
@TableField("AGR_NUM")
private String agreementNumber;
/**
* 金属元素缩写
*/
@TableField("ELEM_ABBR")
private String elementAbbreviation;
/**
* 金属元素编码
*/
@TableField("ELEM_NUM")
private String elementNumber;
/**
* 金属元素名称
*/
@TableField("ELEM_NAME")
private String elementName;
/**
* 检验结果
*/
@TableField("RSLT")
private BigDecimal result;
/**
* 品位单位
*/
@TableField("GRD_UNT")
private String gradeUnit;
/**
* 小数位数
*/
@TableField("CNT_LOC")
private Long countLocation;
/**
* 小数位数(ERP)
*/
@TableField("CNT_LOC_ERP")
private Long countLocationErp;
/**
* 检验时间
*/
@TableField("INSP_DTM")
private LocalDateTime inspectionDatetime;
/**
* 实验室代码
*/
@TableField("LAB_CD")
private String laboratoryCode;
/**
* 实验室名称
*/
@TableField("LAB_NAME")
private String laboratoryName;
}

View File

@@ -0,0 +1,214 @@
package cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmain;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
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.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 收发货单 DO
*
* @author 后台管理
*/
@TableName("sply_bll_main")
@KeySequence("sply_bll_main_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class BillMainDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 类型;收货/发货
*/
@TableField("TP")
private String type;
/**
* 订单号
*/
@TableField("ORD_NO")
private String orderNo;
/**
* 订单明细主键
*/
@TableField("ORD_DTL_ID")
private Long orderDetailId;
/**
* 收货单号;自动生成
*/
@TableField("BLL_NUM")
private String billNumber;
/**
* 实物物料编码
*/
@TableField("MTRL_CDG")
private String materialCoding;
/**
* 实物物料名称
*/
@TableField("MTRL_NAME")
private String materialName;
/**
* 实物收发货数量
*/
@TableField("MTRL_QTY")
private BigDecimal materialQuantity;
/**
* 总干重
*/
@TableField("DRY_QTY")
private BigDecimal dryQuantity;
/**
* 实物计量单位
*/
@TableField("MTRL_UOM")
private String materialUom;
/**
* 金属物料编码
*/
@TableField("MTL_CDG")
private String metalCoding;
/**
* 金属物料名称
*/
@TableField("MTL_NAME")
private String metalName;
/**
* 金属收发货数量
*/
@TableField("MTL_QTY")
private BigDecimal metalQuantity;
/**
* 金属计量单位
*/
@TableField("MTL_UOM")
private String metalUom;
/**
* 工厂名称
*/
@TableField("FACT_NAME")
private String factoryName;
/**
* 工厂编码
*/
@TableField("FACT_NUM")
private String factoryNumber;
/**
* 库位名称
*/
@TableField("WRH_NAME")
private String warehouseName;
/**
* 库位编码
*/
@TableField("WRH_NUM")
private String warehouseNumber;
/**
* 不含税总金额
*/
@TableField("NT_TAX_AMT")
private BigDecimal notTaxAmount;
/**
* 含税总金额
*/
@TableField("IN_TAX_AMT")
private BigDecimal inTaxAmount;
/**
* 总税额
*/
@TableField("TAX_AMT")
private BigDecimal taxAmount;
/**
* 付款比例
*/
@TableField("PYMT_RTIO")
private BigDecimal paymentRatio;
/**
* 实付总金额
*/
@TableField("REL_AMT")
private BigDecimal relativityAmount;
/**
* 过账日期
*/
@TableField("PSTG_DT")
private LocalDateTime postingDate;
/**
* 客商编号
*/
@TableField("CSTM_NUM")
private String customerNumber;
/**
* 客商名称
*/
@TableField("CSTM_NAME")
private String customerName;
/**
* 订单类型
*/
@TableField("ORD_TP")
private String orderType;
/**
* 业务类型;原料/成品/服务/发票
*/
@TableField("BSN_TP")
private String businessType;
/**
* 状态
*/
@TableField("STS")
private String status;
/**
* 小协议号
*/
@TableField("AGR_NUM")
private String agreementNumber;
/**
* 备注
*/
@TableField("RMK")
private String remark;
/**
* 合同编码
*/
@TableField("CTRT_NUM")
private String contractNumber;
/**
* 合同名称
*/
@TableField("CTRT_NAME")
private String contractName;
/**
* 合同纸质合同号
*/
@TableField("PPR_CTRT_NUM")
private String paperContractNumber;
/**
* 是否以金属结算;根据订单类型判断,如果订单为原料,则默认"是",如果是服务订单则不显示,默认为否。如铁精矿/烟尘
*/
@TableField("IS_MTL_STLM")
private String isMetalSettlement;
}

View File

@@ -0,0 +1,152 @@
package cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmaindetail;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
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 com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 收发货单明细 DO
*
* @author 后台管理
*/
@TableName("sply_bll_main_dtl")
@KeySequence("sply_bll_main_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class BillMainDetailDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 订单号
*/
@TableField("ORD_NO")
private String orderNo;
/**
* 收发货单主键
*/
@TableField("RCD_ID")
private Long recordId;
/**
* 批次号
*/
@TableField("BAT_NO")
private String batchNo;
/**
* 磅单号
*/
@TableField("POD_NO")
private String poundNo;
/**
* 金属元素缩写
*/
@TableField("ELEM_ABBR")
private String elementAbbreviation;
/**
* 金属元素名称
*/
@TableField("ELEM_NAME")
private String elementName;
/**
* 金属元素编码
*/
@TableField("ELEM_NUM")
private String elementNumber;
/**
* 品位单位
*/
@TableField("GRD_UNT")
private String gradeUnit;
/**
* 品位类型;暂估/化验/复检/仲裁
*/
@TableField("GRD_TP")
private String gradeType;
/**
* 品位值
*/
@TableField("GRD")
private BigDecimal grade;
/**
* 金属物料编码
*/
@TableField("MTL_NUM")
private String metalNumber;
/**
* 金属物料名称
*/
@TableField("MTL_NAME")
private String metalName;
/**
* 总收货量
*/
@TableField("QTY")
private BigDecimal quantity;
/**
* 计量单位
*/
@TableField("UOM")
private String uom;
/**
* 税码
*/
@TableField("TAX_NUM")
private String taxNumber;
/**
* 不含税金额
*/
@TableField("NT_TAX_AMT")
private BigDecimal notTaxAmount;
/**
* 含税金额
*/
@TableField("IN_TAX_AMT")
private BigDecimal inTaxAmount;
/**
* 税额
*/
@TableField("TAX_AMT")
private BigDecimal taxAmount;
/**
* 付款比例
*/
@TableField("PYMT_RTIO")
private BigDecimal paymentRatio;
/**
* 实付金额
*/
@TableField("REL_AMT")
private BigDecimal relativityAmount;
/**
* 备注
*/
@TableField("RMK")
private String remark;
/**
* 状态
*/
@TableField("STS")
private String status;
}

View File

@@ -0,0 +1,210 @@
package cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecast;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 预报 DO
*
* @author 后台管理
*/
@TableName("sply_frcst")
@KeySequence("sply_frcst_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ForecastDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 订单主键
*/
@TableField("ORD_ID")
private Long orderId;
/**
* 预报单号
*/
@TableField("PLN_NUM")
private String planNumber;
/**
* 预报类型
*/
@TableField("PLN_STS")
private String planStatus;
/**
* 物料名称
*/
@TableField("MTRL_NAME")
private String materialName;
/**
* 物料编码
*/
@TableField("MTRL_NUM")
private String materialNumber;
/**
* 承运商编码
*/
@TableField("CRR_NUM")
private String carrierNumber;
/**
* 承运商名称
*/
@TableField("CRR_NAME")
private String carrierName;
/**
* 预报量
*/
@TableField("FRCST_WET")
private BigDecimal forecastWet;
/**
* 计量单位
*/
@TableField("UNT")
private String unit;
/**
* 运输方式
*/
@TableField("TRP_WY")
private String transportWay;
/**
* 开始日期
*/
@TableField("STRT_DT")
private LocalDateTime startDate;
/**
* 结束日期
*/
@TableField("END_DT")
private LocalDateTime endDate;
/**
* 客商名称
*/
@TableField("CSTM_NAME")
private String customerName;
/**
* 客商编号
*/
@TableField("CSTM_NUM")
private String customerNumber;
/**
* 工厂名称;收发货工厂
*/
@TableField("FACT_NAME")
private String factoryName;
/**
* 工厂编码;收发货工厂
*/
@TableField("FACT_NUM")
private String factoryNumber;
/**
* 库位编码;收发货库位
*/
@TableField("WRH_NUM")
private String warehouseNumber;
/**
* 库位名称;收发货库位
*/
@TableField("WRH_NAME")
private String warehouseName;
/**
* 源工厂名称;提货单使用:需要移库的工厂
*/
@TableField("OUT_FACT_NAME")
private String outFactoryName;
/**
* 源工厂编码;提货单使用:需要移库的工厂
*/
@TableField("OUT_FACT_NUM")
private String outFactoryNumber;
/**
* 源库位名称;提货单使用:需要移库的库位
*/
@TableField("OUT_WRH_NAME")
private String outWarehouseName;
/**
* 源库位编码;提货单使用:需要移库的库位
*/
@TableField("OUT_WRH_NUM")
private String outWarehouseNumber;
/**
* 售达方编码;提货单使用:默认客商编码
*/
@TableField("SALE_NUM")
private String salesNumber;
/**
* 售达方名称;提货单使用:默认客商名称
*/
@TableField("SALE_NAME")
private String salesName;
/**
* 送达方编码;提货单使用:默认客商编码
*/
@TableField("SNDG_NUM")
private String sendingNumber;
/**
* 送达方名称;提货单使用:默认客商名称
*/
@TableField("SNDG_NAME")
private String sendingName;
/**
* 备注
*/
@TableField("RMK")
private String remark;
/**
* 状态
*/
@TableField("STS")
private String status;
/**
* 合同编码
*/
@TableField("CTRT_NUM")
private String contractNumber;
/**
* 合同名称
*/
@TableField("CTRT_NAME")
private String contractName;
/**
* 合同纸质合同号
*/
@TableField("PPR_CTRT_NUM")
private String paperContractNumber;
/**
* 订单编码
*/
@TableField("ORD_NUM")
private String orderNumber;
/**
* SAP订单号
*/
@TableField("ORD_SAP_NUM")
private String orderSAPNumber;
/**
* 小协议号
*/
@TableField("AGR_NUM")
private String agreementNumber;
/**
* 小户头号
*/
@TableField("TNT_NUM")
private String tenantNumber;
}

View File

@@ -0,0 +1,94 @@
package cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastdetail;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import java.math.BigDecimal;
/**
* 预报表明细 DO
*
* @author 后台管理
*/
@TableName("sply_frcst_dtl")
@KeySequence("sply_frcst_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ForecastDetailDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 预报主表主键
*/
@TableField("FRCST_ID")
private Long forecastId;
/**
* 预报单号
*/
@TableField("FRCST_NUM")
private String forecastNumber;
/**
* 小协议号
*/
@TableField("AGR_NUM")
private String agreementNumber;
/**
* 运单号
*/
@TableField("WYBL_NUM")
private String waybillNumber;
/**
* 载重
*/
@TableField("LAD_WGT")
private BigDecimal loadWeight;
/**
* 重净
*/
@TableField("WGT")
private BigDecimal weight;
/**
* 车牌号
*/
@TableField("VHC_NUM")
private String vehicleNumber;
/**
* 驾驶员姓名
*/
@TableField("DRVG_NAME")
private String drivingName;
/**
* 手机号
*/
@TableField("PHN")
private String phone;
/**
* 类型
*/
@TableField("TP")
private String type;
/**
* 身份证号
*/
@TableField("IDTY_NUM")
private String identityNumber;
/**
* 状态
*/
@TableField("STS")
private String status;
}

View File

@@ -0,0 +1,94 @@
package cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastelement;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import java.math.BigDecimal;
/**
* 预报品位 DO
*
* @author 后台管理
*/
@TableName("sply_frcst_elem")
@KeySequence("sply_frcst_elem_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ForecastElementDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 关联类型
*/
@TableField("REL_TP")
private String relativityType;
/**
* 关联主键
*/
@TableField("REL_ID")
private Long relativityId;
/**
* 合同纸质合同号
*/
@TableField("PPR_CTRT_NUM")
private String paperContractNumber;
/**
* 合同名称
*/
@TableField("CTRT_NAME")
private String contractName;
/**
* 订单编码
*/
@TableField("ORD_NUM")
private String orderNumber;
/**
* 小协议号
*/
@TableField("AGR_NUM")
private String agreementNumber;
/**
* 金属元素缩写
*/
@TableField("ELEM_ABBR")
private String elementAbbreviation;
/**
* 金属元素名称
*/
@TableField("ELEM_NAME")
private String elementName;
/**
* 金属元素编码
*/
@TableField("ELEM_NUM")
private String elementNumber;
/**
* 小户头号
*/
@TableField("TNT_NUM")
private String tenantNumber;
/**
* 预估品位值
*/
@TableField("GRD_VAL")
private BigDecimal gradeValue;
/**
* 品位单位
*/
@TableField("GRD_UNT")
private String gradeUnit;
}

View File

@@ -0,0 +1,135 @@
package cn.iocoder.yudao.module.receivedeliver.dal.dataobject.metering;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 计量 DO
*
* @author 后台管理
*/
@TableName("sply_mtng")
@KeySequence("sply_mtng_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class MeteringDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 订单号
*/
@TableField("ORD_NUM")
private String orderNumber;
/**
* 预报明细主键
*/
@TableField("FRCST_DTL_ID")
private Long forecastDetailId;
/**
* 小协议号
*/
@TableField("AGR_NUM")
private String agreementNumber;
/**
* 物料名称
*/
@TableField("MTRL_NAME")
private String materialName;
/**
* 物料编码
*/
@TableField("MTRL_NUM")
private String materialNumber;
/**
* 订单类型;销售/采购/委托加工
*/
@TableField("ORD_TP")
private String orderType;
/**
* 运单号;与预报明细对应
*/
@TableField("WYBL_NUM")
private String waybillNumber;
/**
* 批次号
*/
@TableField("BAT_NUM")
private String batchNumber;
/**
* 磅单号
*/
@TableField("POD_NUM")
private String poundNumber;
/**
* 净重
*/
@TableField("RAL_WGT")
private BigDecimal realWeight;
/**
* 驾驶员名称
*/
@TableField("DRVG_NAME")
private String drivingName;
/**
* 计量类型
*/
@TableField("MTNG_TP")
private String meteringType;
/**
* 运输方式
*/
@TableField("TRP_WY")
private String transportWay;
/**
* 车箱号
*/
@TableField("CRG_NUM")
private String carriageNumber;
/**
* 车牌号
*/
@TableField("VHC_NUM")
private String vehicleNumber;
/**
* 进厂日期
*/
@TableField("INTO_DT")
private LocalDateTime intoDate;
/**
* 出厂日期
*/
@TableField("OUT_DT")
private LocalDateTime outDate;
/**
* 计量时间
*/
@TableField("MTNG_TM")
private LocalDateTime meteringTime;
/**
* 是否作废
*/
@TableField("IS_CNL")
private String isCancel;
/**
* 小户头号
*/
@TableField("TNT_NUM")
private String tenantNumber;
}

View File

@@ -0,0 +1,40 @@
package cn.iocoder.yudao.module.receivedeliver.dal.mysql.assay;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssayPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.assay.AssayDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 品位 Mapper
*
* @author 后台管理
*/
@Mapper
public interface AssayMapper extends BaseMapperX<AssayDO> {
default PageResult<AssayDO> selectPage(AssayPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<AssayDO>()
.eqIfPresent(AssayDO::getGradeType, reqVO.getGradeType())
.eqIfPresent(AssayDO::getOrderNumber, reqVO.getOrderNumber())
.eqIfPresent(AssayDO::getOrderType, reqVO.getOrderType())
.eqIfPresent(AssayDO::getWaybillNumber, reqVO.getWaybillNumber())
.eqIfPresent(AssayDO::getBatchNumber, reqVO.getBatchNumber())
.eqIfPresent(AssayDO::getAgreementNumber, reqVO.getAgreementNumber())
.eqIfPresent(AssayDO::getElementAbbreviation, reqVO.getElementAbbreviation())
.eqIfPresent(AssayDO::getElementNumber, reqVO.getElementNumber())
.likeIfPresent(AssayDO::getElementName, reqVO.getElementName())
.eqIfPresent(AssayDO::getResult, reqVO.getResult())
.eqIfPresent(AssayDO::getGradeUnit, reqVO.getGradeUnit())
.eqIfPresent(AssayDO::getCountLocation, reqVO.getCountLocation())
.eqIfPresent(AssayDO::getCountLocationErp, reqVO.getCountLocationErp())
.betweenIfPresent(AssayDO::getInspectionDatetime, reqVO.getInspectionDatetime())
.eqIfPresent(AssayDO::getLaboratoryCode, reqVO.getLaboratoryCode())
.likeIfPresent(AssayDO::getLaboratoryName, reqVO.getLaboratoryName())
.betweenIfPresent(AssayDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(AssayDO::getId));
}
}

View File

@@ -0,0 +1,60 @@
package cn.iocoder.yudao.module.receivedeliver.dal.mysql.billmain;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmain.BillMainDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 收发货单 Mapper
*
* @author 后台管理
*/
@Mapper
public interface BillMainMapper extends BaseMapperX<BillMainDO> {
default PageResult<BillMainDO> selectPage(BillMainPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BillMainDO>()
.eqIfPresent(BillMainDO::getType, reqVO.getType())
.eqIfPresent(BillMainDO::getOrderNo, reqVO.getOrderNo())
.eqIfPresent(BillMainDO::getOrderDetailId, reqVO.getOrderDetailId())
.eqIfPresent(BillMainDO::getBillNumber, reqVO.getBillNumber())
.eqIfPresent(BillMainDO::getMaterialCoding, reqVO.getMaterialCoding())
.likeIfPresent(BillMainDO::getMaterialName, reqVO.getMaterialName())
.eqIfPresent(BillMainDO::getMaterialQuantity, reqVO.getMaterialQuantity())
.eqIfPresent(BillMainDO::getDryQuantity, reqVO.getDryQuantity())
.eqIfPresent(BillMainDO::getMaterialUom, reqVO.getMaterialUom())
.eqIfPresent(BillMainDO::getMetalCoding, reqVO.getMetalCoding())
.likeIfPresent(BillMainDO::getMetalName, reqVO.getMetalName())
.eqIfPresent(BillMainDO::getMetalQuantity, reqVO.getMetalQuantity())
.eqIfPresent(BillMainDO::getMetalUom, reqVO.getMetalUom())
.likeIfPresent(BillMainDO::getFactoryName, reqVO.getFactoryName())
.eqIfPresent(BillMainDO::getFactoryNumber, reqVO.getFactoryNumber())
.likeIfPresent(BillMainDO::getWarehouseName, reqVO.getWarehouseName())
.eqIfPresent(BillMainDO::getWarehouseNumber, reqVO.getWarehouseNumber())
.eqIfPresent(BillMainDO::getNotTaxAmount, reqVO.getNotTaxAmount())
.eqIfPresent(BillMainDO::getInTaxAmount, reqVO.getInTaxAmount())
.eqIfPresent(BillMainDO::getTaxAmount, reqVO.getTaxAmount())
.eqIfPresent(BillMainDO::getPaymentRatio, reqVO.getPaymentRatio())
.eqIfPresent(BillMainDO::getRelativityAmount, reqVO.getRelativityAmount())
.betweenIfPresent(BillMainDO::getPostingDate, reqVO.getPostingDate())
.eqIfPresent(BillMainDO::getCustomerNumber, reqVO.getCustomerNumber())
.likeIfPresent(BillMainDO::getCustomerName, reqVO.getCustomerName())
.eqIfPresent(BillMainDO::getOrderType, reqVO.getOrderType())
.eqIfPresent(BillMainDO::getBusinessType, reqVO.getBusinessType())
.eqIfPresent(BillMainDO::getStatus, reqVO.getStatus())
.eqIfPresent(BillMainDO::getAgreementNumber, reqVO.getAgreementNumber())
.eqIfPresent(BillMainDO::getRemark, reqVO.getRemark())
.eqIfPresent(BillMainDO::getContractNumber, reqVO.getContractNumber())
.likeIfPresent(BillMainDO::getContractName, reqVO.getContractName())
.eqIfPresent(BillMainDO::getPaperContractNumber, reqVO.getPaperContractNumber())
.eqIfPresent(BillMainDO::getIsMetalSettlement, reqVO.getIsMetalSettlement())
.betweenIfPresent(BillMainDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(BillMainDO::getId));
}
}

View File

@@ -0,0 +1,48 @@
package cn.iocoder.yudao.module.receivedeliver.dal.mysql.billmaindetail;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmaindetail.BillMainDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 收发货单明细 Mapper
*
* @author 后台管理
*/
@Mapper
public interface BillMainDetailMapper extends BaseMapperX<BillMainDetailDO> {
default PageResult<BillMainDetailDO> selectPage(BillMainDetailPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BillMainDetailDO>()
.eqIfPresent(BillMainDetailDO::getOrderNo, reqVO.getOrderNo())
.eqIfPresent(BillMainDetailDO::getRecordId, reqVO.getRecordId())
.eqIfPresent(BillMainDetailDO::getBatchNo, reqVO.getBatchNo())
.eqIfPresent(BillMainDetailDO::getPoundNo, reqVO.getPoundNo())
.eqIfPresent(BillMainDetailDO::getElementAbbreviation, reqVO.getElementAbbreviation())
.likeIfPresent(BillMainDetailDO::getElementName, reqVO.getElementName())
.eqIfPresent(BillMainDetailDO::getElementNumber, reqVO.getElementNumber())
.eqIfPresent(BillMainDetailDO::getGradeUnit, reqVO.getGradeUnit())
.eqIfPresent(BillMainDetailDO::getGradeType, reqVO.getGradeType())
.eqIfPresent(BillMainDetailDO::getGrade, reqVO.getGrade())
.eqIfPresent(BillMainDetailDO::getMetalNumber, reqVO.getMetalNumber())
.likeIfPresent(BillMainDetailDO::getMetalName, reqVO.getMetalName())
.eqIfPresent(BillMainDetailDO::getQuantity, reqVO.getQuantity())
.eqIfPresent(BillMainDetailDO::getUom, reqVO.getUom())
.eqIfPresent(BillMainDetailDO::getTaxNumber, reqVO.getTaxNumber())
.eqIfPresent(BillMainDetailDO::getNotTaxAmount, reqVO.getNotTaxAmount())
.eqIfPresent(BillMainDetailDO::getInTaxAmount, reqVO.getInTaxAmount())
.eqIfPresent(BillMainDetailDO::getTaxAmount, reqVO.getTaxAmount())
.eqIfPresent(BillMainDetailDO::getPaymentRatio, reqVO.getPaymentRatio())
.eqIfPresent(BillMainDetailDO::getRelativityAmount, reqVO.getRelativityAmount())
.eqIfPresent(BillMainDetailDO::getRemark, reqVO.getRemark())
.eqIfPresent(BillMainDetailDO::getStatus, reqVO.getStatus())
.betweenIfPresent(BillMainDetailDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(BillMainDetailDO::getId));
}
}

View File

@@ -0,0 +1,59 @@
package cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecast;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecast.ForecastDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 预报 Mapper
*
* @author 后台管理
*/
@Mapper
public interface ForecastMapper extends BaseMapperX<ForecastDO> {
default PageResult<ForecastDO> selectPage(ForecastPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ForecastDO>()
.eqIfPresent(ForecastDO::getOrderId, reqVO.getOrderId())
.eqIfPresent(ForecastDO::getPlanNumber, reqVO.getPlanNumber())
.eqIfPresent(ForecastDO::getPlanStatus, reqVO.getPlanStatus())
.likeIfPresent(ForecastDO::getMaterialName, reqVO.getMaterialName())
.eqIfPresent(ForecastDO::getMaterialNumber, reqVO.getMaterialNumber())
.eqIfPresent(ForecastDO::getCarrierNumber, reqVO.getCarrierNumber())
.likeIfPresent(ForecastDO::getCarrierName, reqVO.getCarrierName())
.eqIfPresent(ForecastDO::getForecastWet, reqVO.getForecastWet())
.eqIfPresent(ForecastDO::getUnit, reqVO.getUnit())
.eqIfPresent(ForecastDO::getTransportWay, reqVO.getTransportWay())
.betweenIfPresent(ForecastDO::getStartDate, reqVO.getStartDate())
.betweenIfPresent(ForecastDO::getEndDate, reqVO.getEndDate())
.likeIfPresent(ForecastDO::getCustomerName, reqVO.getCustomerName())
.eqIfPresent(ForecastDO::getCustomerNumber, reqVO.getCustomerNumber())
.likeIfPresent(ForecastDO::getFactoryName, reqVO.getFactoryName())
.eqIfPresent(ForecastDO::getFactoryNumber, reqVO.getFactoryNumber())
.eqIfPresent(ForecastDO::getWarehouseNumber, reqVO.getWarehouseNumber())
.likeIfPresent(ForecastDO::getWarehouseName, reqVO.getWarehouseName())
.likeIfPresent(ForecastDO::getOutFactoryName, reqVO.getOutFactoryName())
.eqIfPresent(ForecastDO::getOutFactoryNumber, reqVO.getOutFactoryNumber())
.likeIfPresent(ForecastDO::getOutWarehouseName, reqVO.getOutWarehouseName())
.eqIfPresent(ForecastDO::getOutWarehouseNumber, reqVO.getOutWarehouseNumber())
.eqIfPresent(ForecastDO::getSalesNumber, reqVO.getSalesNumber())
.likeIfPresent(ForecastDO::getSalesName, reqVO.getSalesName())
.eqIfPresent(ForecastDO::getSendingNumber, reqVO.getSendingNumber())
.likeIfPresent(ForecastDO::getSendingName, reqVO.getSendingName())
.eqIfPresent(ForecastDO::getRemark, reqVO.getRemark())
.eqIfPresent(ForecastDO::getStatus, reqVO.getStatus())
.eqIfPresent(ForecastDO::getContractNumber, reqVO.getContractNumber())
.likeIfPresent(ForecastDO::getContractName, reqVO.getContractName())
.eqIfPresent(ForecastDO::getPaperContractNumber, reqVO.getPaperContractNumber())
.eqIfPresent(ForecastDO::getOrderNumber, reqVO.getOrderNumber())
.eqIfPresent(ForecastDO::getOrderSAPNumber, reqVO.getOrderSAPNumber())
.eqIfPresent(ForecastDO::getAgreementNumber, reqVO.getAgreementNumber())
.eqIfPresent(ForecastDO::getTenantNumber, reqVO.getTenantNumber())
.betweenIfPresent(ForecastDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ForecastDO::getId));
}
}

View File

@@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastdetail;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastdetail.ForecastDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 预报表明细 Mapper
*
* @author 后台管理
*/
@Mapper
public interface ForecastDetailMapper extends BaseMapperX<ForecastDetailDO> {
default PageResult<ForecastDetailDO> selectPage(ForecastDetailPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ForecastDetailDO>()
.eqIfPresent(ForecastDetailDO::getForecastId, reqVO.getForecastId())
.eqIfPresent(ForecastDetailDO::getForecastNumber, reqVO.getForecastNumber())
.eqIfPresent(ForecastDetailDO::getAgreementNumber, reqVO.getAgreementNumber())
.eqIfPresent(ForecastDetailDO::getWaybillNumber, reqVO.getWaybillNumber())
.eqIfPresent(ForecastDetailDO::getLoadWeight, reqVO.getLoadWeight())
.eqIfPresent(ForecastDetailDO::getWeight, reqVO.getWeight())
.eqIfPresent(ForecastDetailDO::getVehicleNumber, reqVO.getVehicleNumber())
.likeIfPresent(ForecastDetailDO::getDrivingName, reqVO.getDrivingName())
.eqIfPresent(ForecastDetailDO::getPhone, reqVO.getPhone())
.eqIfPresent(ForecastDetailDO::getType, reqVO.getType())
.eqIfPresent(ForecastDetailDO::getIdentityNumber, reqVO.getIdentityNumber())
.eqIfPresent(ForecastDetailDO::getStatus, reqVO.getStatus())
.betweenIfPresent(ForecastDetailDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ForecastDetailDO::getId));
}
}

View File

@@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastelement;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastelement.ForecastElementDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 预报品位 Mapper
*
* @author 后台管理
*/
@Mapper
public interface ForecastElementMapper extends BaseMapperX<ForecastElementDO> {
default PageResult<ForecastElementDO> selectPage(ForecastElementPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ForecastElementDO>()
.eqIfPresent(ForecastElementDO::getRelativityType, reqVO.getRelativityType())
.eqIfPresent(ForecastElementDO::getRelativityId, reqVO.getRelativityId())
.eqIfPresent(ForecastElementDO::getPaperContractNumber, reqVO.getPaperContractNumber())
.likeIfPresent(ForecastElementDO::getContractName, reqVO.getContractName())
.eqIfPresent(ForecastElementDO::getOrderNumber, reqVO.getOrderNumber())
.eqIfPresent(ForecastElementDO::getAgreementNumber, reqVO.getAgreementNumber())
.eqIfPresent(ForecastElementDO::getElementAbbreviation, reqVO.getElementAbbreviation())
.likeIfPresent(ForecastElementDO::getElementName, reqVO.getElementName())
.eqIfPresent(ForecastElementDO::getElementNumber, reqVO.getElementNumber())
.eqIfPresent(ForecastElementDO::getTenantNumber, reqVO.getTenantNumber())
.eqIfPresent(ForecastElementDO::getGradeValue, reqVO.getGradeValue())
.eqIfPresent(ForecastElementDO::getGradeUnit, reqVO.getGradeUnit())
.betweenIfPresent(ForecastElementDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ForecastElementDO::getId));
}
}

View File

@@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.receivedeliver.dal.mysql.metering;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.metering.MeteringDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 计量 Mapper
*
* @author 后台管理
*/
@Mapper
public interface MeteringMapper extends BaseMapperX<MeteringDO> {
default PageResult<MeteringDO> selectPage(MeteringPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MeteringDO>()
.eqIfPresent(MeteringDO::getOrderNumber, reqVO.getOrderNumber())
.eqIfPresent(MeteringDO::getForecastDetailId, reqVO.getForecastDetailId())
.eqIfPresent(MeteringDO::getAgreementNumber, reqVO.getAgreementNumber())
.likeIfPresent(MeteringDO::getMaterialName, reqVO.getMaterialName())
.eqIfPresent(MeteringDO::getMaterialNumber, reqVO.getMaterialNumber())
.eqIfPresent(MeteringDO::getOrderType, reqVO.getOrderType())
.eqIfPresent(MeteringDO::getWaybillNumber, reqVO.getWaybillNumber())
.eqIfPresent(MeteringDO::getBatchNumber, reqVO.getBatchNumber())
.eqIfPresent(MeteringDO::getPoundNumber, reqVO.getPoundNumber())
.eqIfPresent(MeteringDO::getRealWeight, reqVO.getRealWeight())
.likeIfPresent(MeteringDO::getDrivingName, reqVO.getDrivingName())
.eqIfPresent(MeteringDO::getMeteringType, reqVO.getMeteringType())
.eqIfPresent(MeteringDO::getTransportWay, reqVO.getTransportWay())
.eqIfPresent(MeteringDO::getCarriageNumber, reqVO.getCarriageNumber())
.eqIfPresent(MeteringDO::getVehicleNumber, reqVO.getVehicleNumber())
.betweenIfPresent(MeteringDO::getIntoDate, reqVO.getIntoDate())
.betweenIfPresent(MeteringDO::getOutDate, reqVO.getOutDate())
.betweenIfPresent(MeteringDO::getMeteringTime, reqVO.getMeteringTime())
.eqIfPresent(MeteringDO::getIsCancel, reqVO.getIsCancel())
.eqIfPresent(MeteringDO::getTenantNumber, reqVO.getTenantNumber())
.betweenIfPresent(MeteringDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MeteringDO::getId));
}
}

View File

@@ -0,0 +1,10 @@
package cn.iocoder.yudao.module.receivedeliver.framework.rpc.config;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
@Configuration(value = "receivedeliverRpcConfiguration", proxyBeanMethods = false)
@EnableFeignClients(clients = {DeptApi.class})
public class RpcConfiguration {
}

View File

@@ -9,11 +9,9 @@ import org.springframework.security.config.annotation.web.configurers.AuthorizeH
/**
* ReceiveDeliver 模块的 Security 配置
*
* @author ZT
* Template 模块的 Security 配置
*/
@Configuration(proxyBeanMethods = false)
@Configuration("receiveDeliverSecurityConfiguration")
public class SecurityConfiguration {
@Bean

View File

@@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.receivedeliver.service.assay;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssayPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssayRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssaySaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.assay.AssayDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 品位 Service 接口
*
* @author 后台管理
*/
public interface AssayService {
/**
* 创建品位
*
* @param createReqVO 创建信息
* @return 编号
*/
AssayRespVO createAssay(@Valid AssaySaveReqVO createReqVO);
/**
* 更新品位
*
* @param updateReqVO 更新信息
*/
void updateAssay(@Valid AssaySaveReqVO updateReqVO);
/**
* 删除品位
*
* @param id 编号
*/
void deleteAssay(Long id);
/**
* 批量删除品位
*
* @param ids 编号
*/
void deleteAssayListByIds(List<Long> ids);
/**
* 获得品位
*
* @param id 编号
* @return 品位
*/
AssayDO getAssay(Long id);
/**
* 获得品位分页
*
* @param pageReqVO 分页查询
* @return 品位分页
*/
PageResult<AssayDO> getAssayPage(AssayPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,90 @@
package cn.iocoder.yudao.module.receivedeliver.service.assay;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssayPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssayRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.assay.vo.AssaySaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.assay.AssayDO;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.assay.AssayMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static cn.iocoder.yudao.module.receivedeliver.enums.ErrorCodeConstants.*;
/**
* 品位 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class AssayServiceImpl implements AssayService {
@Resource
private AssayMapper assayMapper;
@Override
public AssayRespVO createAssay(AssaySaveReqVO createReqVO) {
// 插入
AssayDO assay = BeanUtils.toBean(createReqVO, AssayDO.class);
assayMapper.insert(assay);
// 返回
return BeanUtils.toBean(assay, AssayRespVO.class);
}
@Override
public void updateAssay(AssaySaveReqVO updateReqVO) {
// 校验存在
validateAssayExists(updateReqVO.getId());
// 更新
AssayDO updateObj = BeanUtils.toBean(updateReqVO, AssayDO.class);
assayMapper.updateById(updateObj);
}
@Override
public void deleteAssay(Long id) {
// 校验存在
validateAssayExists(id);
// 删除
assayMapper.deleteById(id);
}
@Override
public void deleteAssayListByIds(List<Long> ids) {
// 校验存在
validateAssayExists(ids);
// 删除
assayMapper.deleteByIds(ids);
}
private void validateAssayExists(List<Long> ids) {
List<AssayDO> list = assayMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
// throw exception(ASSAY_NOT_EXISTS);
throw new RuntimeException("品位id不能为空");
}
}
private void validateAssayExists(Long id) {
if (assayMapper.selectById(id) == null) {
//throw exception(ASSAY_NOT_EXISTS);
throw new RuntimeException("品位id不能为空");
}
}
@Override
public AssayDO getAssay(Long id) {
return assayMapper.selectById(id);
}
@Override
public PageResult<AssayDO> getAssayPage(AssayPageReqVO pageReqVO) {
return assayMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.receivedeliver.service.billmain;
import java.util.*;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmain.BillMainDO;
import jakarta.validation.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 收发货单 Service 接口
*
* @author 后台管理
*/
public interface BillMainService {
/**
* 创建收发货单
*
* @param createReqVO 创建信息
* @return 编号
*/
BillMainRespVO createBillMain(@Valid BillMainSaveReqVO createReqVO);
/**
* 更新收发货单
*
* @param updateReqVO 更新信息
*/
void updateBillMain(@Valid BillMainSaveReqVO updateReqVO);
/**
* 删除收发货单
*
* @param id 编号
*/
void deleteBillMain(Long id);
/**
* 批量删除收发货单
*
* @param ids 编号
*/
void deleteBillMainListByIds(List<Long> ids);
/**
* 获得收发货单
*
* @param id 编号
* @return 收发货单
*/
BillMainDO getBillMain(Long id);
/**
* 获得收发货单分页
*
* @param pageReqVO 分页查询
* @return 收发货单分页
*/
PageResult<BillMainDO> getBillMainPage(BillMainPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,102 @@
package cn.iocoder.yudao.module.receivedeliver.service.billmain;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmain.vo.BillMainSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmain.BillMainDO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmaindetail.BillMainDetailDO;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.billmain.BillMainMapper;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.billmaindetail.BillMainDetailMapper;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.receivedeliver.enums.ErrorCodeConstants.BILL_MAIN_NOT_EXISTS;
/**
* 收发货单 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class BillMainServiceImpl implements BillMainService {
@Resource
private BillMainMapper billMainMapper;
@Resource
private BillMainDetailMapper billMainDetailMapper;
@Override
public BillMainRespVO createBillMain(BillMainSaveReqVO createReqVO) {
// 插入
BillMainDO billMain = BeanUtils.toBean(createReqVO, BillMainDO.class);
billMainMapper.insert(billMain);
List<BillMainDetailSaveReqVO> billMainDetailSaveReqVOS = createReqVO.getBillMainDetailSaveReqVOS();
if(CollUtil.isEmpty(billMainDetailSaveReqVOS)){
List<BillMainDetailDO> billMainDetailDOS = BeanUtils.toBean(billMainDetailSaveReqVOS, BillMainDetailDO.class);
billMainDetailMapper.insertBatch(billMainDetailDOS);
}
// 返回
return BeanUtils.toBean(billMain, BillMainRespVO.class);
}
@Override
public void updateBillMain(BillMainSaveReqVO updateReqVO) {
// 校验存在
validateBillMainExists(updateReqVO.getId());
// 更新
BillMainDO updateObj = BeanUtils.toBean(updateReqVO, BillMainDO.class);
billMainMapper.updateById(updateObj);
}
@Override
public void deleteBillMain(Long id) {
// 校验存在
validateBillMainExists(id);
// 删除
billMainMapper.deleteById(id);
}
@Override
public void deleteBillMainListByIds(List<Long> ids) {
// 校验存在
validateBillMainExists(ids);
// 删除
billMainMapper.deleteByIds(ids);
}
private void validateBillMainExists(List<Long> ids) {
List<BillMainDO> list = billMainMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(BILL_MAIN_NOT_EXISTS);
}
}
private void validateBillMainExists(Long id) {
if (billMainMapper.selectById(id) == null) {
throw exception(BILL_MAIN_NOT_EXISTS);
}
}
@Override
public BillMainDO getBillMain(Long id) {
return billMainMapper.selectById(id);
}
@Override
public PageResult<BillMainDO> getBillMainPage(BillMainPageReqVO pageReqVO) {
return billMainMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.receivedeliver.service.billmaindetail;
import java.util.*;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmaindetail.BillMainDetailDO;
import jakarta.validation.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 收发货单明细 Service 接口
*
* @author 后台管理
*/
public interface BillMainDetailService {
/**
* 创建收发货单明细
*
* @param createReqVO 创建信息
* @return 编号
*/
BillMainDetailRespVO createBillMainDetail(@Valid BillMainDetailSaveReqVO createReqVO);
/**
* 更新收发货单明细
*
* @param updateReqVO 更新信息
*/
void updateBillMainDetail(@Valid BillMainDetailSaveReqVO updateReqVO);
/**
* 删除收发货单明细
*
* @param id 编号
*/
void deleteBillMainDetail(Long id);
/**
* 批量删除收发货单明细
*
* @param ids 编号
*/
void deleteBillMainDetailListByIds(List<Long> ids);
/**
* 获得收发货单明细
*
* @param id 编号
* @return 收发货单明细
*/
BillMainDetailDO getBillMainDetail(Long id);
/**
* 获得收发货单明细分页
*
* @param pageReqVO 分页查询
* @return 收发货单明细分页
*/
PageResult<BillMainDetailDO> getBillMainDetailPage(BillMainDetailPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,90 @@
package cn.iocoder.yudao.module.receivedeliver.service.billmaindetail;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.billmaindetail.vo.BillMainDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.billmaindetail.BillMainDetailDO;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.billmaindetail.BillMainDetailMapper;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.receivedeliver.enums.ErrorCodeConstants.BILL_MAIN_DETAIL_NOT_EXISTS;
/**
* 收发货单明细 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class BillMainDetailServiceImpl implements BillMainDetailService {
@Resource
private BillMainDetailMapper billMainDetailMapper;
@Override
public BillMainDetailRespVO createBillMainDetail(BillMainDetailSaveReqVO createReqVO) {
// 插入
BillMainDetailDO billMainDetail = BeanUtils.toBean(createReqVO, BillMainDetailDO.class);
billMainDetailMapper.insert(billMainDetail);
// 返回
return BeanUtils.toBean(billMainDetail, BillMainDetailRespVO.class);
}
@Override
public void updateBillMainDetail(BillMainDetailSaveReqVO updateReqVO) {
// 校验存在
validateBillMainDetailExists(updateReqVO.getId());
// 更新
BillMainDetailDO updateObj = BeanUtils.toBean(updateReqVO, BillMainDetailDO.class);
billMainDetailMapper.updateById(updateObj);
}
@Override
public void deleteBillMainDetail(Long id) {
// 校验存在
validateBillMainDetailExists(id);
// 删除
billMainDetailMapper.deleteById(id);
}
@Override
public void deleteBillMainDetailListByIds(List<Long> ids) {
// 校验存在
validateBillMainDetailExists(ids);
// 删除
billMainDetailMapper.deleteByIds(ids);
}
private void validateBillMainDetailExists(List<Long> ids) {
List<BillMainDetailDO> list = billMainDetailMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(BILL_MAIN_DETAIL_NOT_EXISTS);
}
}
private void validateBillMainDetailExists(Long id) {
if (billMainDetailMapper.selectById(id) == null) {
throw exception(BILL_MAIN_DETAIL_NOT_EXISTS);
}
}
@Override
public BillMainDetailDO getBillMainDetail(Long id) {
return billMainDetailMapper.selectById(id);
}
@Override
public PageResult<BillMainDetailDO> getBillMainDetailPage(BillMainDetailPageReqVO pageReqVO) {
return billMainDetailMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,103 @@
package cn.iocoder.yudao.module.receivedeliver.service.forecast;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecast.ForecastDO;
import jakarta.validation.Valid;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.List;
/**
* 预报 Service 接口
*
* @author 后台管理
*/
public interface ForecastService {
/**
* 创建预报
*
* @param createReqVO 创建信息
* @return 编号
*/
ForecastRespVO createForecast(@Valid ForecastSaveReqVO createReqVO);
/**
* 更新预报
*
* @param updateReqVO 更新信息
*/
void updateForecast(@Valid ForecastSaveReqVO updateReqVO);
/**
* 删除预报
*
* @param id 编号
*/
void deleteForecast(Long id);
/**
* 批量删除预报
*
* @param ids 编号
*/
void deleteForecastListByIds(List<Long> ids);
/**
* 获得预报
*
* @param id 编号
* @return 预报
*/
ForecastRespVO getForecast(Long id);
/**
* 获得预报分页
*
* @param pageReqVO 分页查询
* @return 预报分页
*/
PageResult<ForecastDO> getForecastPage(ForecastPageReqVO pageReqVO);
/**
* 提交
* @param updateReqVO
*/
void submit(ForecastSaveReqVO updateReqVO);
/**
* 批量提交
* @param ids
*/
void submitList(List<Long> ids);
/**
* 下发
* @param ids
*/
void issued(List<Long> ids);
/**
* 下发
* @param ids
*/
void close(List<Long> ids);
/**
* 导入预报
* @param file
* @return
*/
void importForecastExcel(MultipartFile file);
/**
* 导出预报 Excel
* @param pageReqVO
* @return
*/
InputStream exportForecastExcel(ForecastPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,486 @@
package cn.iocoder.yudao.module.receivedeliver.service.forecast;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecast.vo.ForecastSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecast.ForecastDO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastdetail.ForecastDetailDO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastelement.ForecastElementDO;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecast.ForecastMapper;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastdetail.ForecastDetailMapper;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastelement.ForecastElementMapper;
import cn.iocoder.yudao.module.receivedeliver.enums.*;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.receivedeliver.enums.ErrorCodeConstants.*;
/**
* 预报 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class ForecastServiceImpl implements ForecastService {
@Resource
private ForecastMapper forecastMapper;
@Resource
private ForecastDetailMapper forecastDetailMapper;
@Resource
private ForecastElementMapper forecastElementMapper;
@Override
@Transactional
public ForecastRespVO createForecast(ForecastSaveReqVO createReqVO) {
// 预报
ForecastDO forecast = BeanUtils.toBean(createReqVO, ForecastDO.class);
// 预报明细
List<ForecastDetailSaveReqVO> detailList = createReqVO.getDetailList();
if (detailList == null || detailList.isEmpty()) {
throw exception(PARAMS_NOT_EXISTS);
}
// 预报品位
List<ForecastElementSaveReqVO> elementList = createReqVO.getElementList();
if (CollectionUtil.isEmpty(elementList)) {
throw exception(PARAMS_NOT_EXISTS);
}
if (elementList.size() != detailList.size()) {
throw exception(PARAMS_NOT_EXISTS);
}
// 保存
forecast.setId(IdWorker.getId());
List<ForecastDetailDO> detailDOList = BeanUtils.toBean(detailList, ForecastDetailDO.class);
for (int i = 0; i < detailDOList.size(); i++) {
ForecastDetailDO forecastDetailDO = detailDOList.get(i);
forecastDetailDO.setForecastId(forecast.getId());
forecastDetailDO.setId(IdWorker.getId());
}
List<ForecastElementDO> elementDOList = BeanUtils.toBean(elementList, ForecastElementDO.class);
for (int i = 0; i < elementDOList.size(); i++) {
ForecastElementDO forecastElementDO = elementDOList.get(i);
forecastElementDO.setRelativityType(ForecastElementRelativityTypeEnum.DTL.getCode());
forecastElementDO.setRelativityId(detailDOList.get(i).getId());
}
forecastMapper.insert(forecast);
forecastDetailMapper.insertBatch(detailDOList);
forecastElementMapper.insertBatch(elementDOList);
// 返回
ForecastRespVO result = BeanUtils.toBean(forecast, ForecastRespVO.class);
result.setDetailList(BeanUtils.toBean(detailDOList, ForecastDetailRespVO.class));
result.setElementList(BeanUtils.toBean(elementDOList, ForecastElementRespVO.class));
return result;
}
@Override
@Transactional
public void updateForecast(ForecastSaveReqVO updateReqVO) {
if (updateReqVO.getId() == null
|| CollectionUtil.isEmpty(updateReqVO.getDetailList())
|| CollectionUtil.isEmpty(updateReqVO.getElementList())) {
throw exception(PARAMS_NOT_EXISTS);
}
// 删除旧数据
if (updateReqVO.getId() == null) {
throw exception(PARAMS_NOT_EXISTS);
}
List<ForecastDetailDO> detailDOList = forecastDetailMapper.selectList(
new LambdaQueryWrapper<ForecastDetailDO>()
.eq(ForecastDetailDO::getForecastId, updateReqVO.getId()));
List<Long> detailIds = detailDOList.stream().map(forecastDetailDO -> forecastDetailDO.getId()).toList();
forecastElementMapper.delete(new LambdaQueryWrapper<ForecastElementDO>().in(ForecastElementDO::getRelativityId, detailIds));
forecastDetailMapper.deleteByIds(detailIds);
// 保存新数据
saveData(Arrays.asList(updateReqVO));
}
@Override
@Transactional
public void deleteForecast(Long id) {
deleteData(Arrays.asList(id));
}
@Override
@Transactional
public void deleteForecastListByIds(List<Long> ids) {
deleteData(ids);
}
@Override
public ForecastRespVO getForecast(Long id) {
ForecastDO forecastDO = forecastMapper.selectById(id);
if (forecastDO == null) {
return null;
}
ForecastRespVO result = BeanUtils.toBean(forecastDO, ForecastRespVO.class);
List<ForecastDetailDO> detailDOList = forecastDetailMapper.selectList(
new LambdaQueryWrapper<ForecastDetailDO>()
.in(ForecastDetailDO::getForecastId, id)
.orderByAsc(ForecastDetailDO::getId));
List<Long> detailIds = detailDOList.stream().map(detailDO -> detailDO.getId()).toList();
List<ForecastElementDO> elementDOList = forecastElementMapper.selectList(
new LambdaQueryWrapper<ForecastElementDO>()
.in(ForecastElementDO::getRelativityId, detailIds)
.orderByAsc(ForecastElementDO::getRelativityId));
result.setDetailList(BeanUtils.toBean(detailDOList, ForecastDetailRespVO.class));
result.setElementList(BeanUtils.toBean(elementDOList, ForecastElementRespVO.class));
return result;
}
@Override
public PageResult<ForecastDO> getForecastPage(ForecastPageReqVO pageReqVO) {
return forecastMapper.selectPage(pageReqVO);
}
@Override
public void submit(ForecastSaveReqVO updateReqVO) {
updateReqVO.setStatus(ForecastStatusEnum.IS_SUBMIT.getCode());
updateForecast(updateReqVO);
}
@Override
public void submitList(List<Long> ids) {
updateStatus(ids, ForecastStatusEnum.IS_SUBMIT.getCode());
}
@Override
public void issued(List<Long> ids) {
updateStatus(ids, ForecastStatusEnum.IS_TRNS.getCode());
}
@Override
public void close(List<Long> ids) {
updateStatus(ids, ForecastStatusEnum.IS_CLOSE.getCode());
}
@Override
@Transactional
public void importForecastExcel(MultipartFile file) {
List<ForecastRespVO> forecastRespVOList = new ArrayList<>();
List<ForecastDetailRespVO> deatailRespVOList = new ArrayList<>();
List<ForecastElementRespVO> elementRespVOList = new ArrayList<>();
// 读取数据
try (ExcelReader excelReader = EasyExcel.read(file.getInputStream()).build()) {
int[] rowNum = {1, 1, 1};
ReadSheet readSheet1 = EasyExcel.readSheet(0)
.head(ForecastRespVO.class)
.headRowNumber(2)
.registerReadListener(new ReadListener<ForecastRespVO>() {
@Override
public void invoke(ForecastRespVO forecastRespVO, AnalysisContext analysisContext) {
if (StringUtils.isBlank(forecastRespVO.getOrderNumber())) {
throw new ServiceException(500, "" + rowNum[0] + "行订单编号为空");
}
// TODO 订单id
forecastRespVO.setOrderId(666L);
// 预报类型
if (StringUtils.isBlank(forecastRespVO.getPlanStatus())) {
throw new ServiceException(500, "" + rowNum[0] + "行类型为空");
}
List<ForecastPlanStatusEnum> planStatusEnum = Arrays.stream(ForecastPlanStatusEnum.values()).filter(obj -> obj.getName().equals(forecastRespVO.getPlanStatus())).toList();
if (CollectionUtil.isEmpty(planStatusEnum)) {
throw new ServiceException(500, "" + rowNum[0] + "行类型错误");
}
forecastRespVO.setPlanStatus(planStatusEnum.get(0).getCode());
// 运输方式
if (StringUtils.isBlank(forecastRespVO.getTransportWay())) {
throw new ServiceException(500, "" + rowNum[0] + "行运输方式为空");
}
List<ForecastTransportWayEnum> transportWayEnum = Arrays.stream(ForecastTransportWayEnum.values()).filter(obj -> obj.getName().equals(forecastRespVO.getTransportWay())).toList();
if (CollectionUtil.isEmpty(transportWayEnum)) {
throw new ServiceException(500, "" + rowNum[0] + "行运输方式错误");
}
forecastRespVO.setTransportWay(transportWayEnum.get(0).getCode());
// 预报状态
if (StringUtils.isBlank(forecastRespVO.getStatus())) {
throw new ServiceException(500, "" + rowNum[0] + "行状态为空");
}
List<ForecastStatusEnum> statusEnum = Arrays.stream(ForecastStatusEnum.values()).filter(obj -> obj.getName().equals(forecastRespVO.getStatus())).toList();
if (CollectionUtil.isEmpty(statusEnum)) {
throw new ServiceException(500, "" + rowNum[0] + "行状态错误");
}
forecastRespVO.setStatus(statusEnum.get(0).getCode());
forecastRespVOList.add(forecastRespVO);
rowNum[0]++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
})
.build();
// 预报明细
ReadSheet readSheet2 = EasyExcel.readSheet(1)
.head(ForecastDetailRespVO.class)
.headRowNumber(2)
.registerReadListener(new ReadListener<ForecastDetailRespVO>() {
@Override
public void invoke(ForecastDetailRespVO forecastDetailRespVO, AnalysisContext analysisContext) {
// 类型
if (StringUtils.isBlank(forecastDetailRespVO.getType())) {
throw new ServiceException(500, "" + rowNum[0] + "行类型为空");
}
List<ForecastDetailTypeEnum> typeEnums = Arrays.stream(ForecastDetailTypeEnum.values()).filter(obj -> obj.getName().equals(forecastDetailRespVO.getType())).toList();
if (CollectionUtil.isEmpty(typeEnums)) {
throw new ServiceException(500, "" + rowNum[0] + "行类型错误");
}
forecastDetailRespVO.setType(typeEnums.get(0).getCode());
// 类型
if (StringUtils.isBlank(forecastDetailRespVO.getStatus())) {
throw new ServiceException(500, "" + rowNum[0] + "行状态为空");
}
List<ForecastDetailStatusEnum> statusEnums = Arrays.stream(ForecastDetailStatusEnum.values()).filter(obj -> obj.getName().equals(forecastDetailRespVO.getStatus())).toList();
if (CollectionUtil.isEmpty(statusEnums)) {
throw new ServiceException(500, "" + rowNum[0] + "行状态错误");
}
forecastDetailRespVO.setStatus(statusEnums.get(0).getCode());
deatailRespVOList.add(forecastDetailRespVO);
rowNum[1]++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
})
.build();
// 预报品位
ReadSheet readSheet3 = EasyExcel.readSheet(2)
.head(ForecastElementRespVO.class)
.headRowNumber(2)
.registerReadListener(new ReadListener<ForecastElementRespVO>() {
@Override
public void invoke(ForecastElementRespVO forecastElementRespVO, AnalysisContext analysisContext) {
elementRespVOList.add(forecastElementRespVO);
rowNum[1]++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
})
.build();
excelReader.read(readSheet1, readSheet2, readSheet3);
} catch (ServiceException e) {
System.out.println("数据错误" + e.getMessage());
throw e;
} catch (Exception e) {
System.out.println("其他异常:" + e.getMessage());
throw exception(PARAMS_NOT_EXISTS);
}
if (forecastRespVOList.size() == 0
|| deatailRespVOList.size() == 0
|| elementRespVOList.size() == 0
|| deatailRespVOList.size()!=elementRespVOList.size()) {
throw exception(PARAMS_NOT_EXISTS);
}
Map<Long, List<ForecastDetailRespVO>> detailRespVOMap = deatailRespVOList.stream().collect(Collectors.groupingBy(ForecastDetailRespVO::getForecastId));
Map<Long, List<ForecastElementRespVO>> elementRespVOMap = elementRespVOList.stream().collect(Collectors.groupingBy(ForecastElementRespVO::getRelativityId));
List<ForecastSaveReqVO> forecastSaveReqVOList = new ArrayList<>();
for (ForecastRespVO forecastRespVO : forecastRespVOList) {
ForecastSaveReqVO forecastSaveReqVO = BeanUtils.toBean(forecastRespVO, ForecastSaveReqVO.class);
forecastSaveReqVO.setId(IdWorker.getId());
// 预报明细
List<ForecastDetailRespVO> forecastDetailRespVOS = detailRespVOMap.get(forecastRespVO.getId());
List<ForecastDetailSaveReqVO> detailSaveReqVOList = BeanUtils.toBean(forecastDetailRespVOS, ForecastDetailSaveReqVO.class);
detailSaveReqVOList.forEach(detailSaveReqVO -> detailSaveReqVO.setId(IdWorker.getId()));
forecastSaveReqVO.setDetailList(detailSaveReqVOList);
// 预报品位
List<ForecastElementRespVO> forecastElementRespVOS = elementRespVOMap.get(forecastRespVO.getId());
forecastSaveReqVO.setElementList(BeanUtils.toBean(forecastElementRespVOS, ForecastElementSaveReqVO.class));
forecastSaveReqVOList.add(forecastSaveReqVO);
}
saveData(forecastSaveReqVOList);
}
@Override
public InputStream exportForecastExcel(ForecastPageReqVO pageReqVO) {
List<ForecastDO> list = forecastMapper.selectPage(pageReqVO).getList();
if (list.isEmpty()) {
return null;
}
List<ForecastRespVO> forecastRespVOList = BeanUtils.toBean(list, ForecastRespVO.class);
for (ForecastRespVO forecastRespVO : forecastRespVOList) {
// 预报类型
List<ForecastPlanStatusEnum> planStatusEnum = Arrays.stream(ForecastPlanStatusEnum.values()).filter(obj -> obj.getName().equals(forecastRespVO.getPlanStatus())).toList();
if (CollectionUtil.isNotEmpty(planStatusEnum)) {
forecastRespVO.setPlanStatus(planStatusEnum.get(0).getCode());
}
// 运输方式
List<ForecastTransportWayEnum> transportWayEnum = Arrays.stream(ForecastTransportWayEnum.values()).filter(obj -> obj.getName().equals(forecastRespVO.getTransportWay())).toList();
if (CollectionUtil.isNotEmpty(transportWayEnum)) {
forecastRespVO.setTransportWay(transportWayEnum.get(0).getCode());
}
// 预报状态
List<ForecastStatusEnum> statusEnum = Arrays.stream(ForecastStatusEnum.values()).filter(obj -> obj.getName().equals(forecastRespVO.getStatus())).toList();
if (CollectionUtil.isNotEmpty(statusEnum)) {
forecastRespVO.setStatus(statusEnum.get(0).getCode());
}
}
// 预报明细
List<Long> forecastIdList = list.stream().map(ForecastDO::getId).toList();
List<ForecastDetailDO> detailDOList = forecastDetailMapper.selectList(new LambdaQueryWrapper<ForecastDetailDO>()
.in(ForecastDetailDO::getForecastId, forecastIdList)
.orderByDesc(ForecastDetailDO::getForecastId)
.orderByDesc(ForecastDetailDO::getId));
List<ForecastDetailRespVO> forecastDetailRespVOList = BeanUtils.toBean(detailDOList, ForecastDetailRespVO.class);
// 预报品位
List<Long> forecastDetailIdList = detailDOList.stream().map(ForecastDetailDO::getId).toList();
List<ForecastElementDO> elementDOList = forecastElementMapper.selectList(new LambdaQueryWrapper<ForecastElementDO>()
.in(ForecastElementDO::getRelativityId, forecastDetailIdList)
.orderByDesc(ForecastElementDO::getRelativityId));
List<ForecastElementRespVO> forecastElementRespVOList = BeanUtils.toBean(elementDOList, ForecastElementRespVO.class);
// 写入excel
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (ExcelWriter excelWriter = EasyExcel.write(outputStream).build()) {
excelWriter.write(forecastRespVOList, EasyExcel.writerSheet(0,"预报").head(ForecastRespVO.class).build());
excelWriter.write(forecastDetailRespVOList, EasyExcel.writerSheet(1,"预报明细").head(ForecastDetailRespVO.class).build());
excelWriter.write(forecastElementRespVOList, EasyExcel.writerSheet(2,"预报品位").head(ForecastElementRespVO.class).build());
} catch (Exception e) {
return null;
}
return new ByteArrayInputStream(outputStream.toByteArray());
}
/**
* 编辑状态
* @param ids
* @param status 状态FRCST_STS字典
*/
public void updateStatus(List<Long> ids, String status) {
if (CollectionUtil.isEmpty(ids)) {
throw exception(PARAMS_NOT_EXISTS);
}
forecastMapper.update(new LambdaUpdateWrapper<ForecastDO>()
.in(ForecastDO::getId,ids)
.set(ForecastDO::getStatus, status));
}
/**
* 删除数据
* @param ids
*/
public void deleteData(List<Long> ids) {
if (CollectionUtil.isEmpty(ids)) {
throw exception(PARAMS_NOT_EXISTS);
}
List<ForecastDO> forecastDOList = forecastMapper.selectByIds(ids);
if (CollectionUtil.isEmpty(forecastDOList) || forecastDOList.size() != ids.size()) {
throw exception(PARAMS_NOT_EXISTS);
}
List<ForecastDetailDO> detailDOList = forecastDetailMapper.selectList(
new LambdaQueryWrapper<ForecastDetailDO>()
.in(ForecastDetailDO::getForecastId, ids));
List<Long> detailIds = detailDOList.stream().map(forecastDetailDO -> forecastDetailDO.getId()).toList();
forecastElementMapper.delete(new LambdaQueryWrapper<ForecastElementDO>().in(ForecastElementDO::getRelativityId, detailIds));
forecastDetailMapper.deleteByIds(detailIds);
forecastMapper.deleteByIds(forecastDOList);
}
/**
* 保存数据
* @param forecastSaveReqVOList
*/
public void saveData(List<ForecastSaveReqVO> forecastSaveReqVOList) {
if (CollectionUtil.isEmpty(forecastSaveReqVOList)) {
throw exception(PARAMS_NOT_EXISTS);
}
if (forecastSaveReqVOList.stream()
.anyMatch(forecastSaveReqVO -> CollectionUtil.isEmpty(forecastSaveReqVO.getDetailList())
|| CollectionUtil.isEmpty(forecastSaveReqVO.getElementList())
|| forecastSaveReqVO.getDetailList().size() != forecastSaveReqVO.getElementList().size())) {
throw exception(PARAMS_NOT_EXISTS);
}
List<ForecastDO> forecastDOList = new ArrayList<>();
List<ForecastDetailDO> detailDOList = new ArrayList<>();
List<ForecastElementDO> elementDOList = new ArrayList<>();
for (ForecastSaveReqVO forecastSaveReqVO : forecastSaveReqVOList) {
// 预报
ForecastDO forecastDO = BeanUtils.toBean(forecastSaveReqVO, ForecastDO.class);
if (forecastDO.getId() == null) {
forecastDO.setId(IdWorker.getId());
}
forecastDOList.add(forecastDO);
List<ForecastDetailSaveReqVO> detailList = forecastSaveReqVO.getDetailList();
List<ForecastElementSaveReqVO> elementList = forecastSaveReqVO.getElementList();
for (int i = 0; i < detailList.size(); i++) {
// 明细
ForecastDetailDO forecastDetailDO = BeanUtils.toBean(detailList.get(i), ForecastDetailDO.class);
forecastDetailDO.setId(IdWorker.getId());
forecastDetailDO.setForecastId(forecastDO.getId());
detailDOList.add(forecastDetailDO);
// 预报品位
ForecastElementDO forecastElementDO = BeanUtils.toBean(elementList.get(i), ForecastElementDO.class);
forecastElementDO.setId(IdWorker.getId());
forecastElementDO.setRelativityType(ForecastElementRelativityTypeEnum.DTL.getCode());
forecastElementDO.setRelativityId(forecastDetailDO.getId());
elementDOList.add(forecastElementDO);
}
}
// 保存
forecastMapper.insertOrUpdate(forecastDOList);
forecastDetailMapper.insertOrUpdate(detailDOList);
forecastElementMapper.insertOrUpdate(elementDOList);
}
}

View File

@@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.receivedeliver.service.forecastdetail;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastdetail.ForecastDetailDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 预报表明细 Service 接口
*
* @author 后台管理
*/
public interface ForecastDetailService {
/**
* 创建预报表明细
*
* @param createReqVO 创建信息
* @return 编号
*/
ForecastDetailRespVO createForecastDetail(@Valid ForecastDetailSaveReqVO createReqVO);
/**
* 更新预报表明细
*
* @param updateReqVO 更新信息
*/
void updateForecastDetail(@Valid ForecastDetailSaveReqVO updateReqVO);
/**
* 删除预报表明细
*
* @param id 编号
*/
void deleteForecastDetail(Long id);
/**
* 批量删除预报表明细
*
* @param ids 编号
*/
void deleteForecastDetailListByIds(List<Long> ids);
/**
* 获得预报表明细
*
* @param id 编号
* @return 预报表明细
*/
ForecastDetailDO getForecastDetail(Long id);
/**
* 获得预报表明细分页
*
* @param pageReqVO 分页查询
* @return 预报表明细分页
*/
PageResult<ForecastDetailDO> getForecastDetailPage(ForecastDetailPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,90 @@
package cn.iocoder.yudao.module.receivedeliver.service.forecastdetail;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastdetail.vo.ForecastDetailSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastdetail.ForecastDetailDO;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastdetail.ForecastDetailMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static cn.iocoder.yudao.module.receivedeliver.enums.ErrorCodeConstants.*;
/**
* 预报表明细 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class ForecastDetailServiceImpl implements ForecastDetailService {
@Resource
private ForecastDetailMapper forecastDetailMapper;
@Override
public ForecastDetailRespVO createForecastDetail(ForecastDetailSaveReqVO createReqVO) {
// 插入
ForecastDetailDO forecastDetail = BeanUtils.toBean(createReqVO, ForecastDetailDO.class);
forecastDetailMapper.insert(forecastDetail);
// 返回
return BeanUtils.toBean(forecastDetail, ForecastDetailRespVO.class);
}
@Override
public void updateForecastDetail(ForecastDetailSaveReqVO updateReqVO) {
// 校验存在
validateForecastDetailExists(updateReqVO.getId());
// 更新
ForecastDetailDO updateObj = BeanUtils.toBean(updateReqVO, ForecastDetailDO.class);
forecastDetailMapper.updateById(updateObj);
}
@Override
public void deleteForecastDetail(Long id) {
// 校验存在
validateForecastDetailExists(id);
// 删除
forecastDetailMapper.deleteById(id);
}
@Override
public void deleteForecastDetailListByIds(List<Long> ids) {
// 校验存在
validateForecastDetailExists(ids);
// 删除
forecastDetailMapper.deleteByIds(ids);
}
private void validateForecastDetailExists(List<Long> ids) {
List<ForecastDetailDO> list = forecastDetailMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
// throw exception(FORECAST_DETAIL_NOT_EXISTS);
throw new RuntimeException("预报表明细id不能为空");
}
}
private void validateForecastDetailExists(Long id) {
if (forecastDetailMapper.selectById(id) == null) {
// throw exception(FORECAST_DETAIL_NOT_EXISTS);
throw new RuntimeException("预报表明细id不能为空");
}
}
@Override
public ForecastDetailDO getForecastDetail(Long id) {
return forecastDetailMapper.selectById(id);
}
@Override
public PageResult<ForecastDetailDO> getForecastDetailPage(ForecastDetailPageReqVO pageReqVO) {
return forecastDetailMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.receivedeliver.service.forecastelement;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastelement.ForecastElementDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 预报品位 Service 接口
*
* @author 后台管理
*/
public interface ForecastElementService {
/**
* 创建预报品位
*
* @param createReqVO 创建信息
* @return 编号
*/
ForecastElementRespVO createForecastElement(@Valid ForecastElementSaveReqVO createReqVO);
/**
* 更新预报品位
*
* @param updateReqVO 更新信息
*/
void updateForecastElement(@Valid ForecastElementSaveReqVO updateReqVO);
/**
* 删除预报品位
*
* @param id 编号
*/
void deleteForecastElement(Long id);
/**
* 批量删除预报品位
*
* @param ids 编号
*/
void deleteForecastElementListByIds(List<Long> ids);
/**
* 获得预报品位
*
* @param id 编号
* @return 预报品位
*/
ForecastElementDO getForecastElement(Long id);
/**
* 获得预报品位分页
*
* @param pageReqVO 分页查询
* @return 预报品位分页
*/
PageResult<ForecastElementDO> getForecastElementPage(ForecastElementPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,90 @@
package cn.iocoder.yudao.module.receivedeliver.service.forecastelement;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.forecastelement.vo.ForecastElementSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.forecastelement.ForecastElementDO;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastelement.ForecastElementMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static cn.iocoder.yudao.module.receivedeliver.enums.ErrorCodeConstants.*;
/**
* 预报品位 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class ForecastElementServiceImpl implements ForecastElementService {
@Resource
private ForecastElementMapper forecastElementMapper;
@Override
public ForecastElementRespVO createForecastElement(ForecastElementSaveReqVO createReqVO) {
// 插入
ForecastElementDO forecastElement = BeanUtils.toBean(createReqVO, ForecastElementDO.class);
forecastElementMapper.insert(forecastElement);
// 返回
return BeanUtils.toBean(forecastElement, ForecastElementRespVO.class);
}
@Override
public void updateForecastElement(ForecastElementSaveReqVO updateReqVO) {
// 校验存在
validateForecastElementExists(updateReqVO.getId());
// 更新
ForecastElementDO updateObj = BeanUtils.toBean(updateReqVO, ForecastElementDO.class);
forecastElementMapper.updateById(updateObj);
}
@Override
public void deleteForecastElement(Long id) {
// 校验存在
validateForecastElementExists(id);
// 删除
forecastElementMapper.deleteById(id);
}
@Override
public void deleteForecastElementListByIds(List<Long> ids) {
// 校验存在
validateForecastElementExists(ids);
// 删除
forecastElementMapper.deleteByIds(ids);
}
private void validateForecastElementExists(List<Long> ids) {
List<ForecastElementDO> list = forecastElementMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
// throw exception(FORECAST_ELEMENT_NOT_EXISTS);
throw new RuntimeException("预报品位id不能为空");
}
}
private void validateForecastElementExists(Long id) {
if (forecastElementMapper.selectById(id) == null) {
// throw exception(FORECAST_ELEMENT_NOT_EXISTS);
throw new RuntimeException("预报品位id不能为空");
}
}
@Override
public ForecastElementDO getForecastElement(Long id) {
return forecastElementMapper.selectById(id);
}
@Override
public PageResult<ForecastElementDO> getForecastElementPage(ForecastElementPageReqVO pageReqVO) {
return forecastElementMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.receivedeliver.service.metering;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.metering.MeteringDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 计量 Service 接口
*
* @author 后台管理
*/
public interface MeteringService {
/**
* 创建计量
*
* @param createReqVO 创建信息
* @return 编号
*/
MeteringRespVO createMetering(@Valid MeteringSaveReqVO createReqVO);
/**
* 更新计量
*
* @param updateReqVO 更新信息
*/
void updateMetering(@Valid MeteringSaveReqVO updateReqVO);
/**
* 删除计量
*
* @param id 编号
*/
void deleteMetering(Long id);
/**
* 批量删除计量
*
* @param ids 编号
*/
void deleteMeteringListByIds(List<Long> ids);
/**
* 获得计量
*
* @param id 编号
* @return 计量
*/
MeteringDO getMetering(Long id);
/**
* 获得计量分页
*
* @param pageReqVO 分页查询
* @return 计量分页
*/
PageResult<MeteringDO> getMeteringPage(MeteringPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,90 @@
package cn.iocoder.yudao.module.receivedeliver.service.metering;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringPageReqVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringRespVO;
import cn.iocoder.yudao.module.receivedeliver.controller.admin.metering.vo.MeteringSaveReqVO;
import cn.iocoder.yudao.module.receivedeliver.dal.dataobject.metering.MeteringDO;
import cn.iocoder.yudao.module.receivedeliver.dal.mysql.metering.MeteringMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static cn.iocoder.yudao.module.receivedeliver.enums.ErrorCodeConstants.*;
/**
* 计量 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class MeteringServiceImpl implements MeteringService {
@Resource
private MeteringMapper meteringMapper;
@Override
public MeteringRespVO createMetering(MeteringSaveReqVO createReqVO) {
// 插入
MeteringDO metering = BeanUtils.toBean(createReqVO, MeteringDO.class);
meteringMapper.insert(metering);
// 返回
return BeanUtils.toBean(metering, MeteringRespVO.class);
}
@Override
public void updateMetering(MeteringSaveReqVO updateReqVO) {
// 校验存在
validateMeteringExists(updateReqVO.getId());
// 更新
MeteringDO updateObj = BeanUtils.toBean(updateReqVO, MeteringDO.class);
meteringMapper.updateById(updateObj);
}
@Override
public void deleteMetering(Long id) {
// 校验存在
validateMeteringExists(id);
// 删除
meteringMapper.deleteById(id);
}
@Override
public void deleteMeteringListByIds(List<Long> ids) {
// 校验存在
validateMeteringExists(ids);
// 删除
meteringMapper.deleteByIds(ids);
}
private void validateMeteringExists(List<Long> ids) {
List<MeteringDO> list = meteringMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
// throw exception(METERING_NOT_EXISTS);
throw new RuntimeException("预报品位id不能为空");
}
}
private void validateMeteringExists(Long id) {
if (meteringMapper.selectById(id) == null) {
// throw exception(METERING_NOT_EXISTS);
throw new RuntimeException("预报品位id不能为空");
}
}
@Override
public MeteringDO getMetering(Long id) {
return meteringMapper.selectById(id);
}
@Override
public PageResult<MeteringDO> getMeteringPage(MeteringPageReqVO pageReqVO) {
return meteringMapper.selectPage(pageReqVO);
}
}

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="cn.iocoder.yudao.module.receivedeliver.dal.mysql.assay.AssayMapper">
<!--
一般情况下,尽可能使用 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="cn.iocoder.yudao.module.receivedeliver.dal.mysql.billmain.BillMainMapper">
<!--
一般情况下,尽可能使用 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="cn.iocoder.yudao.module.receivedeliver.dal.mysql.billmaindetail.BillMainDetailMapper">
<!--
一般情况下,尽可能使用 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="cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecast.ForecastMapper">
<!--
一般情况下,尽可能使用 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="cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastdetail.ForecastDetailMapper">
<!--
一般情况下,尽可能使用 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="cn.iocoder.yudao.module.receivedeliver.dal.mysql.forecastelement.ForecastElementMapper">
<!--
一般情况下,尽可能使用 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="cn.iocoder.yudao.module.receivedeliver.dal.mysql.metering.MeteringMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>