同步业务库代码
This commit is contained in:
@@ -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-base</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
@@ -11,7 +11,8 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 示例模块 1-001-000-000 ==========
|
||||
ErrorCode EXAMPLE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||
|
||||
// ========== 合同模块 1-027-000-000 ==========
|
||||
ErrorCode CONTRACT_NUM_TRANSFINITE = new ErrorCode(1_027_000_000, "系统合同编号超限,最大合同编号:999999");
|
||||
ErrorCode CONTRACT_NAME_EXISTS = new ErrorCode(1_027_000_001, "合同名已存在");
|
||||
ErrorCode CONTRACT_PAPER_NUMBER_EXISTS = new ErrorCode(1_027_000_002, "合同编号已存在");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.contractorder.enums.contract;
|
||||
|
||||
/**
|
||||
* 合同字典类型常量
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
public class ContractDictTypeConstants {
|
||||
|
||||
// 合同状态
|
||||
public static String BSE_CTRT_STS = "BSE_CTRT_STS";
|
||||
// 合同类型(字典名:业务类型)
|
||||
public static String BSN_TP = "BSN_TP";
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.contractorder.enums.contract;
|
||||
|
||||
/**
|
||||
* 合同状态枚举
|
||||
*/
|
||||
public enum ContractStatusEnum {
|
||||
|
||||
/**
|
||||
* 合同状态-草稿
|
||||
*/
|
||||
DRAFT("草稿","DRAFT","可以删除"),
|
||||
/**
|
||||
* 合同状态-正在审核
|
||||
*/
|
||||
UNDER_REVIEW("正在审核","UNDER_REVIEW","不允许任何操作"),
|
||||
/**
|
||||
* 合同状态-执行中
|
||||
*/
|
||||
IN_PROGRESS("执行中","IN_PROGRESS","可以终止、归档"),
|
||||
/**
|
||||
* 合同状态-已驳回
|
||||
*/
|
||||
REJECTED("已驳回","REJECTED","可以删除"),
|
||||
/**
|
||||
* 合同状态-已终止
|
||||
*/
|
||||
TERMINATED("已终止","TERMINATED","只允许归档"),
|
||||
/**
|
||||
* 合同状态-已归档
|
||||
*/
|
||||
ARCHIVED("已归档","ARCHIVED","不允许任何操作"),
|
||||
/**
|
||||
* 合同状态-已删除
|
||||
*/
|
||||
DELETED("已删除","DELETED","不允许任何操作");
|
||||
|
||||
ContractStatusEnum(String label, String code, String remark) {
|
||||
this.label = label;
|
||||
this.code = code;
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
private final String label;
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private final String remark;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.contractorder.enums.contract;
|
||||
|
||||
/**
|
||||
* 合同类型枚举
|
||||
*/
|
||||
public enum ContractTypeEnum {
|
||||
|
||||
/**
|
||||
* 采购
|
||||
*/
|
||||
PRCH("采购","PRCH",null),
|
||||
/**
|
||||
* 销售
|
||||
*/
|
||||
SALE("销售","SALE",null),
|
||||
/**
|
||||
* 委托加工
|
||||
*/
|
||||
ENTT("委托加工","ENTT",null),
|
||||
/**
|
||||
* 来料加工
|
||||
*/
|
||||
MKE("来料加工","MKE",null);
|
||||
|
||||
ContractTypeEnum(String label, String code, String remark) {
|
||||
this.label = label;
|
||||
this.code = code;
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
private final String label;
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private final String remark;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package cn.iocoder.yudao.module.contractorder.enums.contract;
|
||||
|
||||
public class DateConstants {
|
||||
|
||||
// 日期格式
|
||||
public static final String DATE_FORMAT_YEAR_MONTH_DAY_8_BIT = "yyyyMMdd";
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.contractorder;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* ContractOrder 模块的启动类
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.contractorder.controller.admin.contract;
|
||||
|
||||
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.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.contractorder.controller.admin.contract.vo.preparaton.ContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.contractorder.controller.admin.contract.vo.preparaton.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.contractorder.controller.admin.contract.vo.preparaton.ContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.contractorder.dal.dataobject.contract.ContractMainDO;
|
||||
import cn.iocoder.yudao.module.contractorder.service.contract.ContractService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "管理后台 - 合同管理")
|
||||
@RestController
|
||||
@RequestMapping("/base/contract-order/contract")
|
||||
@Validated
|
||||
public class ContractController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得合同分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract-main:query')")
|
||||
public CommonResult<PageResult<ContractRespVO>> getContractPage(@Valid ContractPageReqVO pageReqVO) {
|
||||
PageResult<ContractMainDO> pageResult = contractService.getContractPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ContractRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新增合同")
|
||||
@PreAuthorize("@ss.hasPermission('system:contract-main:create')")
|
||||
public CommonResult<Long> createContract(@Valid @RequestBody ContractSaveReqVO reqVO) {
|
||||
Long id = contractService.createContract(reqVO);
|
||||
return success(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 合同明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32609")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同主信息主键", example = "13595")
|
||||
private Long contractMainId;
|
||||
|
||||
@Schema(description = "物料名称", example = "张三")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "计量单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "含税单价", example = "28579")
|
||||
private BigDecimal inTaxUnitPrice;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "金属元素名称", example = "赵六")
|
||||
private String elementName;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
private String elementNumber;
|
||||
|
||||
// 交货计划
|
||||
private List<ContractPlanSaveReqVO> plans;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
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 ContractPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "合同名称;与ERP(HTMC)对应,校验唯一", example = "芋艿")
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "合同编号;与ERP(HTBH)对应,校验唯一")
|
||||
private String contractPaperNumber;
|
||||
|
||||
@Schema(description = "甲方公司名称", example = "王五")
|
||||
private String purchaseCompanyName;
|
||||
|
||||
@Schema(description = "乙方公司名称", example = "王五")
|
||||
private String salesCompanyName;
|
||||
|
||||
@Schema(description = "收支性质;与ERP(SZXZ)对应")
|
||||
private String direction;
|
||||
|
||||
@Schema(description = "签署日期;与ERP(HTQDRQ)对应")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] signDate;
|
||||
|
||||
@Schema(description = "本币金额;与ERP(HTBWBZJE)对应")
|
||||
private BigDecimal basicAmount;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user