Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd8236ddb9 | ||
|
|
2a5312a4d8 | ||
|
|
48075b431c | ||
|
|
49ccfe70b5 |
@ -69,12 +69,12 @@ public interface LauncherConstant {
|
|||||||
/**
|
/**
|
||||||
* nacos prod 地址
|
* nacos prod 地址
|
||||||
*/
|
*/
|
||||||
String NACOS_PROD_ADDR = "172.30.0.48:8848";
|
String NACOS_PROD_ADDR = "127.0.0.1:8848";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nacos test 地址
|
* nacos test 地址
|
||||||
*/
|
*/
|
||||||
String NACOS_TEST_ADDR = "172.19.2.126:30848";
|
String NACOS_TEST_ADDR = "127.0.0.1:8848";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sentinel dev 地址
|
* sentinel dev 地址
|
||||||
|
|||||||
@ -6,7 +6,7 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
config:
|
config:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
namespace:
|
namespace: public
|
||||||
group: DEFAULT_GROUP
|
group: DEFAULT_GROUP
|
||||||
username: nacos
|
username: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据号码实体类
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("zc_bill_code")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class BillCode extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据号
|
||||||
|
*/
|
||||||
|
@Schema(description = "单据号")
|
||||||
|
private String billCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类型
|
||||||
|
*/
|
||||||
|
@Schema(description = "单据类型")
|
||||||
|
private String billType;
|
||||||
|
|
||||||
|
}
|
||||||
@ -29,21 +29,21 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.springblade.core.mp.base.BaseEntity;
|
import org.springblade.core.tenant.mp.TenantEntity;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招采计划实体类
|
* 年度招采计划实体类
|
||||||
*
|
*
|
||||||
* @author Chill
|
* @author Chill
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("blade_procurement_plan")
|
@TableName("zc_procurement_plan")
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ProcurementPlan extends BaseEntity {
|
public class ProcurementPlan extends TenantEntity {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -85,21 +85,21 @@ public class ProcurementPlan extends BaseEntity {
|
|||||||
private String year;
|
private String year;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属部门
|
* 需求部门
|
||||||
*/
|
*/
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "需求部门")
|
||||||
private String dept;
|
private String dept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请信息中的所属公司
|
* 需求公司
|
||||||
*/
|
*/
|
||||||
@Schema(description = "申请所属公司")
|
@Schema(description = "需求公司")
|
||||||
private String applyCompany;
|
private String applyCompany;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预估总金额(万元)
|
* 年度预估总金额(万元)
|
||||||
*/
|
*/
|
||||||
@Schema(description = "预估总金额(万元)")
|
@Schema(description = "年度预估总金额(万元)")
|
||||||
private BigDecimal estimatedAmount;
|
private BigDecimal estimatedAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -114,4 +114,16 @@ public class ProcurementPlan extends BaseEntity {
|
|||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程当前节点
|
||||||
|
*/
|
||||||
|
@Schema(description = "流程当前节点")
|
||||||
|
private String flowStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "流程实例ID")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,20 +31,21 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.springblade.core.mp.base.BaseEntity;
|
import org.springblade.core.tenant.mp.TenantEntity;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招采计划明细实体类
|
* 年度招采计划项目明细实体类
|
||||||
*
|
*
|
||||||
* @author Chill
|
* @author Chill
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("blade_procurement_plan_detail")
|
@TableName("zc_procurement_plan_project")
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ProcurementPlanDetail extends BaseEntity {
|
public class ProcurementPlanDetail extends TenantEntity {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -63,16 +64,10 @@ public class ProcurementPlanDetail extends BaseEntity {
|
|||||||
private String year;
|
private String year;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划
|
* 计划号
|
||||||
*/
|
*/
|
||||||
@Schema(description = "计划")
|
@Schema(description = "计划号")
|
||||||
private String plan;
|
private String planNo;
|
||||||
|
|
||||||
/**
|
|
||||||
* 计划类型
|
|
||||||
*/
|
|
||||||
@Schema(description = "计划类型")
|
|
||||||
private String planType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 序号
|
* 序号
|
||||||
@ -98,6 +93,13 @@ public class ProcurementPlanDetail extends BaseEntity {
|
|||||||
@Schema(description = "项目对接人")
|
@Schema(description = "项目对接人")
|
||||||
private String contactPerson;
|
private String contactPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目对接人ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@Schema(description = "项目对接人ID")
|
||||||
|
private Long contactPersonId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划申请日期
|
* 计划申请日期
|
||||||
*/
|
*/
|
||||||
@ -117,9 +119,39 @@ public class ProcurementPlanDetail extends BaseEntity {
|
|||||||
private String projectAttr;
|
private String projectAttr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购物料明细
|
* 采购需求
|
||||||
*/
|
*/
|
||||||
@Schema(description = "采购物料明细")
|
@Schema(description = "采购需求")
|
||||||
|
private String purchaseRequirement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预算金额(万元)
|
||||||
|
*/
|
||||||
|
@Schema(description = "预算金额(万元)")
|
||||||
|
private BigDecimal budgetAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招标方式
|
||||||
|
*/
|
||||||
|
@Schema(description = "招标方式")
|
||||||
|
private String biddingMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目简介
|
||||||
|
*/
|
||||||
|
@Schema(description = "项目简介")
|
||||||
|
private String projectIntro;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料明细冗余汇总
|
||||||
|
*/
|
||||||
|
@Schema(description = "物料明细冗余汇总")
|
||||||
private String materialDetail;
|
private String materialDetail;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,176 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.tenant.mp.TenantEntity;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年度招采计划物料明细实体类
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("zc_procurement_plan_material")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ProcurementPlanMaterial extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主表ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@Schema(description = "主表ID")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目明细ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@Schema(description = "项目明细ID")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
|
@Schema(description = "序号")
|
||||||
|
private Integer sortNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
@Schema(description = "规格型号")
|
||||||
|
private String specification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*/
|
||||||
|
@Schema(description = "品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
@Schema(description = "计量单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参考价
|
||||||
|
*/
|
||||||
|
@Schema(description = "参考价")
|
||||||
|
private BigDecimal referencePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计数量
|
||||||
|
*/
|
||||||
|
@Schema(description = "预计数量")
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预估金额(元)
|
||||||
|
*/
|
||||||
|
@Schema(description = "预估金额(元)")
|
||||||
|
private BigDecimal estimatedAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对接人
|
||||||
|
*/
|
||||||
|
@Schema(description = "对接人")
|
||||||
|
private String contactPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对接人ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@Schema(description = "对接人ID")
|
||||||
|
private Long contactPersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划申请日期
|
||||||
|
*/
|
||||||
|
@Schema(description = "计划申请日期")
|
||||||
|
private LocalDate applyDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 期望使用/完成日期
|
||||||
|
*/
|
||||||
|
@Schema(description = "期望使用/完成日期")
|
||||||
|
private LocalDate expectDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去年总量
|
||||||
|
*/
|
||||||
|
@Schema(description = "去年总量")
|
||||||
|
private Integer lastYearTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去年均价
|
||||||
|
*/
|
||||||
|
@Schema(description = "去年均价")
|
||||||
|
private BigDecimal lastYearAvgPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去年总金额
|
||||||
|
*/
|
||||||
|
@Schema(description = "去年总金额")
|
||||||
|
private BigDecimal lastYearTotalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求简介
|
||||||
|
*/
|
||||||
|
@Schema(description = "需求简介")
|
||||||
|
private String requirementIntro;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -31,9 +31,10 @@ import lombok.EqualsAndHashCode;
|
|||||||
import org.springblade.zhaocai.pojo.entity.ProcurementPlanDetail;
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlanDetail;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招采计划明细视图对象
|
* 年度招采计划项目明细视图对象
|
||||||
*
|
*
|
||||||
* @author Chill
|
* @author Chill
|
||||||
*/
|
*/
|
||||||
@ -44,4 +45,10 @@ public class ProcurementPlanDetailVO extends ProcurementPlanDetail {
|
|||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料明细列表
|
||||||
|
*/
|
||||||
|
@Schema(description = "物料明细列表")
|
||||||
|
private List<ProcurementPlanMaterialVO> materialList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlanMaterial;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年度招采计划物料明细视图对象
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ProcurementPlanMaterialVO extends ProcurementPlanMaterial {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@ -36,6 +36,11 @@
|
|||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>blade-zhaocai-api</artifactId>
|
<artifactId>blade-zhaocai-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 系统服务api,用于Feign调用blade-system -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springblade</groupId>
|
||||||
|
<artifactId>blade-system-api</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- 测试依赖 -->
|
<!-- 测试依赖 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
@ -48,6 +53,10 @@
|
|||||||
<artifactId>blade-core-auto</artifactId>
|
<artifactId>blade-core-auto</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springblade</groupId>
|
||||||
|
<artifactId>blade-core-tool</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@ -37,33 +37,49 @@ import lombok.AllArgsConstructor;
|
|||||||
import org.springblade.core.boot.ctrl.BladeController;
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.Condition;
|
||||||
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.secure.annotation.PreAuth;
|
||||||
|
import org.springblade.core.tenant.annotation.NonDS;
|
||||||
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.api.R;
|
||||||
import org.springblade.core.tool.utils.Func;
|
import org.springblade.core.tool.utils.Func;
|
||||||
import org.springblade.zhaocai.pojo.entity.ProcurementPlan;
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlan;
|
||||||
import org.springblade.zhaocai.pojo.vo.ProcurementPlanVO;
|
import org.springblade.zhaocai.pojo.vo.ProcurementPlanVO;
|
||||||
|
import org.springblade.zhaocai.service.IBillCodeService;
|
||||||
import org.springblade.zhaocai.service.IProcurementPlanService;
|
import org.springblade.zhaocai.service.IProcurementPlanService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招采计划控制器
|
* 年度招采计划控制器
|
||||||
*
|
*
|
||||||
* @author Chill
|
* @author Chill
|
||||||
*/
|
*/
|
||||||
|
@NonDS
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("procurement-plan")
|
@RequestMapping("procurement-plan")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Tag(name = "招采计划", description = "招采计划接口")
|
@PreAuth(menu = "procurement-plan")
|
||||||
|
@Tag(name = "年度招采计划", description = "年度招采计划接口")
|
||||||
public class ProcurementPlanController extends BladeController {
|
public class ProcurementPlanController extends BladeController {
|
||||||
|
|
||||||
private final IProcurementPlanService procurementPlanService;
|
private final IProcurementPlanService procurementPlanService;
|
||||||
|
private final IBillCodeService billCodeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成单据号
|
||||||
|
*/
|
||||||
|
@GetMapping("/bill-no")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "生成单据号", description = "生成唯一单据号")
|
||||||
|
public R<String> generateBillNo() {
|
||||||
|
return R.data(billCodeService.generateBillCode("PROCUREMENT_PLAN"));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情(含明细)
|
* 详情(含明细)
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
@ApiOperationSupport(order = 1)
|
@ApiOperationSupport(order = 2)
|
||||||
@Operation(summary = "详情", description = "传入id")
|
@Operation(summary = "详情", description = "传入id")
|
||||||
public R<ProcurementPlanVO> detail(@Parameter(name = "id", description = "主键", in = ParameterIn.QUERY, schema = @Schema(type = "integer")) @RequestParam Long id) {
|
public R<ProcurementPlanVO> detail(@Parameter(name = "id", description = "主键", in = ParameterIn.QUERY, schema = @Schema(type = "integer")) @RequestParam Long id) {
|
||||||
ProcurementPlanVO detail = procurementPlanService.detail(id);
|
ProcurementPlanVO detail = procurementPlanService.detail(id);
|
||||||
@ -79,7 +95,7 @@ public class ProcurementPlanController extends BladeController {
|
|||||||
@Parameter(name = "billNo", description = "单据号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
|
@Parameter(name = "billNo", description = "单据号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
|
||||||
@Parameter(name = "year", description = "年度", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
|
@Parameter(name = "year", description = "年度", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
|
||||||
})
|
})
|
||||||
@ApiOperationSupport(order = 2)
|
@ApiOperationSupport(order = 3)
|
||||||
@Operation(summary = "分页", description = "传入procurementPlan")
|
@Operation(summary = "分页", description = "传入procurementPlan")
|
||||||
public R<IPage<ProcurementPlan>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> procurementPlan, Query query) {
|
public R<IPage<ProcurementPlan>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> procurementPlan, Query query) {
|
||||||
IPage<ProcurementPlan> pages = procurementPlanService.page(Condition.getPage(query), Condition.getQueryWrapper(procurementPlan, ProcurementPlan.class));
|
IPage<ProcurementPlan> pages = procurementPlanService.page(Condition.getPage(query), Condition.getQueryWrapper(procurementPlan, ProcurementPlan.class));
|
||||||
@ -90,7 +106,7 @@ public class ProcurementPlanController extends BladeController {
|
|||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@ApiOperationSupport(order = 3)
|
@ApiOperationSupport(order = 4)
|
||||||
@Operation(summary = "新增", description = "传入procurementPlan")
|
@Operation(summary = "新增", description = "传入procurementPlan")
|
||||||
public R save(@RequestBody ProcurementPlanVO procurementPlanVO) {
|
public R save(@RequestBody ProcurementPlanVO procurementPlanVO) {
|
||||||
return R.status(procurementPlanService.submit(procurementPlanVO));
|
return R.status(procurementPlanService.submit(procurementPlanVO));
|
||||||
@ -100,7 +116,7 @@ public class ProcurementPlanController extends BladeController {
|
|||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperationSupport(order = 4)
|
@ApiOperationSupport(order = 5)
|
||||||
@Operation(summary = "修改", description = "传入procurementPlan")
|
@Operation(summary = "修改", description = "传入procurementPlan")
|
||||||
public R update(@RequestBody ProcurementPlanVO procurementPlanVO) {
|
public R update(@RequestBody ProcurementPlanVO procurementPlanVO) {
|
||||||
return R.status(procurementPlanService.submit(procurementPlanVO));
|
return R.status(procurementPlanService.submit(procurementPlanVO));
|
||||||
@ -110,7 +126,7 @@ public class ProcurementPlanController extends BladeController {
|
|||||||
* 新增或修改
|
* 新增或修改
|
||||||
*/
|
*/
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
@ApiOperationSupport(order = 5)
|
@ApiOperationSupport(order = 6)
|
||||||
@Operation(summary = "新增或修改", description = "传入procurementPlan")
|
@Operation(summary = "新增或修改", description = "传入procurementPlan")
|
||||||
public R submit(@RequestBody ProcurementPlanVO procurementPlanVO) {
|
public R submit(@RequestBody ProcurementPlanVO procurementPlanVO) {
|
||||||
return R.status(procurementPlanService.submit(procurementPlanVO));
|
return R.status(procurementPlanService.submit(procurementPlanVO));
|
||||||
@ -120,7 +136,7 @@ public class ProcurementPlanController extends BladeController {
|
|||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ApiOperationSupport(order = 6)
|
@ApiOperationSupport(order = 7)
|
||||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
public R remove(@Parameter(name = "ids", description = "主键集合", in = ParameterIn.QUERY, schema = @Schema(type = "string")) @RequestParam String ids) {
|
public R remove(@Parameter(name = "ids", description = "主键集合", in = ParameterIn.QUERY, schema = @Schema(type = "string")) @RequestParam String ids) {
|
||||||
boolean temp = procurementPlanService.deleteLogic(Func.toLongList(ids));
|
boolean temp = procurementPlanService.deleteLogic(Func.toLongList(ids));
|
||||||
|
|||||||
@ -0,0 +1,77 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.controller;
|
||||||
|
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.secure.annotation.PreAuth;
|
||||||
|
import org.springblade.core.tenant.annotation.NonDS;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.system.feign.ISysClient;
|
||||||
|
import org.springblade.system.pojo.entity.Dept;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前登录用户部门公司查询控制器
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
@NonDS
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("current-user")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@PreAuth(menu = "procurement-plan")
|
||||||
|
@Tag(name = "当前用户信息", description = "当前登录用户部门公司查询接口")
|
||||||
|
public class UserDeptController extends BladeController {
|
||||||
|
|
||||||
|
private final ISysClient sysClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录用户所属公司
|
||||||
|
*/
|
||||||
|
@GetMapping("/company")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "获取当前登录用户所属公司", description = "根据当前登录用户部门ID向上查找dept_category=1的公司")
|
||||||
|
public R<Dept> getCurrentUserCompany() {
|
||||||
|
return sysClient.getCurrentUserCompany();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录用户所属部门
|
||||||
|
*/
|
||||||
|
@GetMapping("/dept")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "获取当前登录用户所属部门", description = "根据当前登录用户部门ID查找dept_category=2的部门")
|
||||||
|
public R<Dept> getCurrentUserDept() {
|
||||||
|
return sysClient.getCurrentUserDept();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.BillCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据号码 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
public interface BillCodeMapper extends BaseMapper<BillCode> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -14,15 +14,20 @@
|
|||||||
<result column="is_deleted" property="isDeleted"/>
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
<result column="plan_id" property="planId"/>
|
<result column="plan_id" property="planId"/>
|
||||||
<result column="year" property="year"/>
|
<result column="year" property="year"/>
|
||||||
<result column="plan" property="plan"/>
|
<result column="plan_no" property="planNo"/>
|
||||||
<result column="plan_type" property="planType"/>
|
|
||||||
<result column="sort_no" property="sortNo"/>
|
<result column="sort_no" property="sortNo"/>
|
||||||
<result column="project_name" property="projectName"/>
|
<result column="project_name" property="projectName"/>
|
||||||
<result column="project_type" property="projectType"/>
|
<result column="project_type" property="projectType"/>
|
||||||
<result column="contact_person" property="contactPerson"/>
|
<result column="contact_person" property="contactPerson"/>
|
||||||
|
<result column="contact_person_id" property="contactPersonId"/>
|
||||||
<result column="apply_date" property="applyDate"/>
|
<result column="apply_date" property="applyDate"/>
|
||||||
<result column="expect_date" property="expectDate"/>
|
<result column="expect_date" property="expectDate"/>
|
||||||
<result column="project_attr" property="projectAttr"/>
|
<result column="project_attr" property="projectAttr"/>
|
||||||
|
<result column="purchase_requirement" property="purchaseRequirement"/>
|
||||||
|
<result column="budget_amount" property="budgetAmount"/>
|
||||||
|
<result column="bidding_method" property="biddingMethod"/>
|
||||||
|
<result column="project_intro" property="projectIntro"/>
|
||||||
|
<result column="remark" property="remark"/>
|
||||||
<result column="material_detail" property="materialDetail"/>
|
<result column="material_detail" property="materialDetail"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
@ -30,20 +35,21 @@
|
|||||||
<sql id="baseColumnList">
|
<sql id="baseColumnList">
|
||||||
select
|
select
|
||||||
id, tenant_id, create_user, create_time, update_user, update_time, status, is_deleted,
|
id, tenant_id, create_user, create_time, update_user, update_time, status, is_deleted,
|
||||||
plan_id, year, plan, plan_type, sort_no, project_name, project_type, contact_person,
|
plan_id, year, plan_no, sort_no, project_name, project_type, contact_person, contact_person_id,
|
||||||
apply_date, expect_date, project_attr, material_detail
|
apply_date, expect_date, project_attr, purchase_requirement, budget_amount, bidding_method,
|
||||||
|
project_intro, remark, material_detail
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectByPlanId" resultMap="procurementPlanDetailResultMap">
|
<select id="selectByPlanId" resultMap="procurementPlanDetailResultMap">
|
||||||
<include refid="baseColumnList"/>
|
<include refid="baseColumnList"/>
|
||||||
from blade_procurement_plan_detail
|
from zc_procurement_plan_project
|
||||||
where plan_id = #{planId}
|
where plan_id = #{planId}
|
||||||
and is_deleted = 0
|
and is_deleted = 0
|
||||||
order by sort_no asc
|
order by sort_no asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteByPlanId">
|
<delete id="deleteByPlanId">
|
||||||
delete from blade_procurement_plan_detail where plan_id = #{planId}
|
delete from zc_procurement_plan_project where plan_id = #{planId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -24,18 +24,21 @@
|
|||||||
<result column="estimated_amount" property="estimatedAmount"/>
|
<result column="estimated_amount" property="estimatedAmount"/>
|
||||||
<result column="amount_upper" property="amountUpper"/>
|
<result column="amount_upper" property="amountUpper"/>
|
||||||
<result column="remark" property="remark"/>
|
<result column="remark" property="remark"/>
|
||||||
|
<result column="flow_status" property="flowStatus"/>
|
||||||
|
<result column="process_instance_id" property="processInstanceId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="baseColumnList">
|
<sql id="baseColumnList">
|
||||||
select
|
select
|
||||||
id, tenant_id, create_user, create_dept, create_time, update_user, update_time, status, is_deleted,
|
id, tenant_id, create_user, create_dept, create_time, update_user, update_time, status, is_deleted,
|
||||||
applicant, apply_time, phone, company, bill_no, year, dept, apply_company, estimated_amount, amount_upper, remark
|
applicant, apply_time, phone, company, bill_no, year, dept, apply_company, estimated_amount, amount_upper,
|
||||||
|
remark, flow_status, process_instance_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectProcurementPlanPage" resultMap="procurementPlanResultMap">
|
<select id="selectProcurementPlanPage" resultMap="procurementPlanResultMap">
|
||||||
<include refid="baseColumnList"/>
|
<include refid="baseColumnList"/>
|
||||||
from blade_procurement_plan
|
from zc_procurement_plan
|
||||||
where is_deleted = 0
|
where is_deleted = 0
|
||||||
<if test="procurementPlan.applicant != null and procurementPlan.applicant != ''">
|
<if test="procurementPlan.applicant != null and procurementPlan.applicant != ''">
|
||||||
and applicant like concat('%', #{procurementPlan.applicant}, '%')
|
and applicant like concat('%', #{procurementPlan.applicant}, '%')
|
||||||
|
|||||||
@ -0,0 +1,56 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlanMaterial;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年度招采计划物料明细 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
public interface ProcurementPlanMaterialMapper extends BaseMapper<ProcurementPlanMaterial> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目明细ID查询物料明细列表
|
||||||
|
*
|
||||||
|
* @param projectId 项目明细ID
|
||||||
|
* @return 物料明细列表
|
||||||
|
*/
|
||||||
|
List<ProcurementPlanMaterial> selectByProjectId(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主表ID删除物料明细
|
||||||
|
*
|
||||||
|
* @param planId 主表ID
|
||||||
|
* @return 影响行数
|
||||||
|
*/
|
||||||
|
int deleteByPlanId(Long planId);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
<?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="org.springblade.zhaocai.mapper.ProcurementPlanMaterialMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="procurementPlanMaterialResultMap" type="org.springblade.zhaocai.pojo.entity.ProcurementPlanMaterial">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="tenant_id" property="tenantId"/>
|
||||||
|
<result column="create_user" property="createUser"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_user" property="updateUser"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="status" property="status"/>
|
||||||
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
|
<result column="plan_id" property="planId"/>
|
||||||
|
<result column="project_id" property="projectId"/>
|
||||||
|
<result column="sort_no" property="sortNo"/>
|
||||||
|
<result column="material_name" property="materialName"/>
|
||||||
|
<result column="material_code" property="materialCode"/>
|
||||||
|
<result column="specification" property="specification"/>
|
||||||
|
<result column="brand" property="brand"/>
|
||||||
|
<result column="unit" property="unit"/>
|
||||||
|
<result column="reference_price" property="referencePrice"/>
|
||||||
|
<result column="quantity" property="quantity"/>
|
||||||
|
<result column="estimated_amount" property="estimatedAmount"/>
|
||||||
|
<result column="contact_person" property="contactPerson"/>
|
||||||
|
<result column="contact_person_id" property="contactPersonId"/>
|
||||||
|
<result column="apply_date" property="applyDate"/>
|
||||||
|
<result column="expect_date" property="expectDate"/>
|
||||||
|
<result column="last_year_total" property="lastYearTotal"/>
|
||||||
|
<result column="last_year_avg_price" property="lastYearAvgPrice"/>
|
||||||
|
<result column="last_year_total_amount" property="lastYearTotalAmount"/>
|
||||||
|
<result column="requirement_intro" property="requirementIntro"/>
|
||||||
|
<result column="remark" property="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="baseColumnList">
|
||||||
|
select
|
||||||
|
id, tenant_id, create_user, create_time, update_user, update_time, status, is_deleted,
|
||||||
|
plan_id, project_id, sort_no, material_name, material_code, specification, brand, unit,
|
||||||
|
reference_price, quantity, estimated_amount, contact_person, contact_person_id, apply_date,
|
||||||
|
expect_date, last_year_total, last_year_avg_price, last_year_total_amount, requirement_intro, remark
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByProjectId" resultMap="procurementPlanMaterialResultMap">
|
||||||
|
<include refid="baseColumnList"/>
|
||||||
|
from zc_procurement_plan_material
|
||||||
|
where project_id = #{projectId}
|
||||||
|
and is_deleted = 0
|
||||||
|
order by sort_no asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteByPlanId">
|
||||||
|
delete from zc_procurement_plan_material where plan_id = #{planId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.BillCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据号码服务类
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
public interface IBillCodeService extends IService<BillCode> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成唯一单据号
|
||||||
|
*
|
||||||
|
* @param billType 单据类型
|
||||||
|
* @return 单据号
|
||||||
|
*/
|
||||||
|
String generateBillCode(String billType);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlanMaterial;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年度招采计划物料明细服务类
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
public interface IProcurementPlanMaterialService extends IService<ProcurementPlanMaterial> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目明细ID查询物料明细列表
|
||||||
|
*
|
||||||
|
* @param projectId 项目明细ID
|
||||||
|
* @return 物料明细列表
|
||||||
|
*/
|
||||||
|
List<ProcurementPlanMaterial> listByProjectId(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主表ID删除物料明细
|
||||||
|
*
|
||||||
|
* @param planId 主表ID
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
boolean removeByPlanId(Long planId);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.zhaocai.mapper.BillCodeMapper;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.BillCode;
|
||||||
|
import org.springblade.zhaocai.service.IBillCodeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据号码服务实现类
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BillCodeServiceImpl extends ServiceImpl<BillCodeMapper, BillCode> implements IBillCodeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大重试次数
|
||||||
|
*/
|
||||||
|
private static final int MAX_RETRY = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据号前缀
|
||||||
|
*/
|
||||||
|
private static final String BILL_NO_PREFIX = "NDZC";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String generateBillCode(String billType) {
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm");
|
||||||
|
for (int i = 0; i < MAX_RETRY; i++) {
|
||||||
|
String dateStr = dateFormat.format(new Date());
|
||||||
|
String randomStr = String.format("%03d", ThreadLocalRandom.current().nextInt(0, 1000));
|
||||||
|
String candidate = BILL_NO_PREFIX + dateStr + randomStr;
|
||||||
|
if (baseMapper.selectCount(Wrappers.<BillCode>lambdaQuery()
|
||||||
|
.eq(BillCode::getBillCode, candidate)) == 0) {
|
||||||
|
BillCode billCode = new BillCode();
|
||||||
|
billCode.setBillCode(candidate);
|
||||||
|
billCode.setBillType(billType);
|
||||||
|
billCode.setCreateTime(DateUtil.now());
|
||||||
|
baseMapper.insert(billCode);
|
||||||
|
return candidate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new ServiceException("单据号生成失败,请重试");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.zhaocai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springblade.zhaocai.mapper.ProcurementPlanMaterialMapper;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlanMaterial;
|
||||||
|
import org.springblade.zhaocai.service.IProcurementPlanMaterialService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年度招采计划物料明细服务实现类
|
||||||
|
*
|
||||||
|
* @author Chill
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProcurementPlanMaterialServiceImpl extends ServiceImpl<ProcurementPlanMaterialMapper, ProcurementPlanMaterial> implements IProcurementPlanMaterialService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProcurementPlanMaterial> listByProjectId(Long projectId) {
|
||||||
|
return baseMapper.selectByProjectId(projectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeByPlanId(Long planId) {
|
||||||
|
return baseMapper.deleteByPlanId(planId) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -32,17 +32,25 @@ import org.springblade.core.tool.utils.Func;
|
|||||||
import org.springblade.zhaocai.mapper.ProcurementPlanMapper;
|
import org.springblade.zhaocai.mapper.ProcurementPlanMapper;
|
||||||
import org.springblade.zhaocai.pojo.entity.ProcurementPlan;
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlan;
|
||||||
import org.springblade.zhaocai.pojo.entity.ProcurementPlanDetail;
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlanDetail;
|
||||||
|
import org.springblade.zhaocai.pojo.entity.ProcurementPlanMaterial;
|
||||||
import org.springblade.zhaocai.pojo.vo.ProcurementPlanDetailVO;
|
import org.springblade.zhaocai.pojo.vo.ProcurementPlanDetailVO;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.ProcurementPlanMaterialVO;
|
||||||
import org.springblade.zhaocai.pojo.vo.ProcurementPlanVO;
|
import org.springblade.zhaocai.pojo.vo.ProcurementPlanVO;
|
||||||
|
import org.springblade.zhaocai.service.IBillCodeService;
|
||||||
import org.springblade.zhaocai.service.IProcurementPlanDetailService;
|
import org.springblade.zhaocai.service.IProcurementPlanDetailService;
|
||||||
|
import org.springblade.zhaocai.service.IProcurementPlanMaterialService;
|
||||||
import org.springblade.zhaocai.service.IProcurementPlanService;
|
import org.springblade.zhaocai.service.IProcurementPlanService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招采计划服务实现类
|
* 年度招采计划服务实现类
|
||||||
*
|
*
|
||||||
* @author Chill
|
* @author Chill
|
||||||
*/
|
*/
|
||||||
@ -51,6 +59,8 @@ import java.util.List;
|
|||||||
public class ProcurementPlanServiceImpl extends BaseServiceImpl<ProcurementPlanMapper, ProcurementPlan> implements IProcurementPlanService {
|
public class ProcurementPlanServiceImpl extends BaseServiceImpl<ProcurementPlanMapper, ProcurementPlan> implements IProcurementPlanService {
|
||||||
|
|
||||||
private final IProcurementPlanDetailService procurementPlanDetailService;
|
private final IProcurementPlanDetailService procurementPlanDetailService;
|
||||||
|
private final IProcurementPlanMaterialService procurementPlanMaterialService;
|
||||||
|
private final IBillCodeService billCodeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<ProcurementPlan> selectProcurementPlanPage(IPage<ProcurementPlan> page, ProcurementPlan procurementPlan) {
|
public IPage<ProcurementPlan> selectProcurementPlanPage(IPage<ProcurementPlan> page, ProcurementPlan procurementPlan) {
|
||||||
@ -69,34 +79,170 @@ public class ProcurementPlanServiceImpl extends BaseServiceImpl<ProcurementPlanM
|
|||||||
vo.setDetailList(detailList.stream().map(detail -> {
|
vo.setDetailList(detailList.stream().map(detail -> {
|
||||||
ProcurementPlanDetailVO detailVO = new ProcurementPlanDetailVO();
|
ProcurementPlanDetailVO detailVO = new ProcurementPlanDetailVO();
|
||||||
Func.copy(detail, detailVO);
|
Func.copy(detail, detailVO);
|
||||||
|
List<ProcurementPlanMaterial> materialList = procurementPlanMaterialService.listByProjectId(detail.getId());
|
||||||
|
detailVO.setMaterialList(materialList.stream().map(material -> {
|
||||||
|
ProcurementPlanMaterialVO materialVO = new ProcurementPlanMaterialVO();
|
||||||
|
Func.copy(material, materialVO);
|
||||||
|
return materialVO;
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
return detailVO;
|
return detailVO;
|
||||||
}).toList());
|
}).collect(Collectors.toList()));
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean submit(ProcurementPlanVO procurementPlanVO) {
|
public boolean submit(ProcurementPlanVO procurementPlanVO) {
|
||||||
|
// 新建时生成单据号
|
||||||
|
if (procurementPlanVO.getId() == null && !StringUtils.hasText(procurementPlanVO.getBillNo())) {
|
||||||
|
String billNo = billCodeService.generateBillCode("PROCUREMENT_PLAN");
|
||||||
|
procurementPlanVO.setBillNo(billNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自动计算项目属性、招标方式、主表金额
|
||||||
|
this.calculateDetail(procurementPlanVO);
|
||||||
|
|
||||||
// 保存主表
|
// 保存主表
|
||||||
boolean result = saveOrUpdate(procurementPlanVO);
|
boolean result = saveOrUpdate(procurementPlanVO);
|
||||||
Long planId = procurementPlanVO.getId();
|
Long planId = procurementPlanVO.getId();
|
||||||
// 删除旧明细
|
|
||||||
|
// 删除旧项目明细和物料明细
|
||||||
procurementPlanDetailService.removeByPlanId(planId);
|
procurementPlanDetailService.removeByPlanId(planId);
|
||||||
// 保存新明细
|
procurementPlanMaterialService.removeByPlanId(planId);
|
||||||
|
|
||||||
|
// 保存项目明细及物料明细
|
||||||
List<ProcurementPlanDetailVO> detailVOList = procurementPlanVO.getDetailList();
|
List<ProcurementPlanDetailVO> detailVOList = procurementPlanVO.getDetailList();
|
||||||
if (Func.isNotEmpty(detailVOList)) {
|
if (Func.isNotEmpty(detailVOList)) {
|
||||||
List<ProcurementPlanDetail> detailList = detailVOList.stream().map(detailVO -> {
|
for (int i = 0; i < detailVOList.size(); i++) {
|
||||||
|
ProcurementPlanDetailVO detailVO = detailVOList.get(i);
|
||||||
ProcurementPlanDetail detail = new ProcurementPlanDetail();
|
ProcurementPlanDetail detail = new ProcurementPlanDetail();
|
||||||
Func.copy(detailVO, detail);
|
Func.copy(detailVO, detail);
|
||||||
detail.setPlanId(planId);
|
detail.setPlanId(planId);
|
||||||
return detail;
|
detail.setSortNo(i + 1);
|
||||||
}).toList();
|
procurementPlanDetailService.save(detail);
|
||||||
for (int i = 0; i < detailList.size(); i++) {
|
Long detailId = detail.getId();
|
||||||
detailList.get(i).setSortNo(i + 1);
|
|
||||||
|
// 保存物料明细
|
||||||
|
List<ProcurementPlanMaterialVO> materialVOList = detailVO.getMaterialList();
|
||||||
|
if (Func.isNotEmpty(materialVOList)) {
|
||||||
|
List<ProcurementPlanMaterial> materialList = new ArrayList<>();
|
||||||
|
for (int j = 0; j < materialVOList.size(); j++) {
|
||||||
|
ProcurementPlanMaterialVO materialVO = materialVOList.get(j);
|
||||||
|
ProcurementPlanMaterial material = new ProcurementPlanMaterial();
|
||||||
|
Func.copy(materialVO, material);
|
||||||
|
material.setPlanId(planId);
|
||||||
|
material.setProjectId(detailId);
|
||||||
|
material.setSortNo(j + 1);
|
||||||
|
materialList.add(material);
|
||||||
|
}
|
||||||
|
procurementPlanMaterialService.saveBatch(materialList);
|
||||||
|
// 冗余汇总
|
||||||
|
detail.setMaterialDetail(buildMaterialSummary(materialList));
|
||||||
|
procurementPlanDetailService.updateById(detail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
procurementPlanDetailService.saveBatch(detailList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 接入 blade-flow 流程引擎
|
||||||
|
// R<BladeFlow> result = flowClient.startProcessInstanceById(
|
||||||
|
// processDefinitionId,
|
||||||
|
// FlowUtil.getBusinessKey("zc_procurement_plan", String.valueOf(planId)),
|
||||||
|
// variables
|
||||||
|
// );
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算项目明细的项目属性、招标方式,并汇总主表金额
|
||||||
|
*/
|
||||||
|
private void calculateDetail(ProcurementPlanVO procurementPlanVO) {
|
||||||
|
List<ProcurementPlanDetailVO> detailVOList = procurementPlanVO.getDetailList();
|
||||||
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
||||||
|
if (Func.isNotEmpty(detailVOList)) {
|
||||||
|
for (ProcurementPlanDetailVO detailVO : detailVOList) {
|
||||||
|
String projectType = detailVO.getProjectType();
|
||||||
|
BigDecimal budgetAmount = detailVO.getBudgetAmount() == null ? BigDecimal.ZERO : detailVO.getBudgetAmount();
|
||||||
|
String projectAttr = calculateProjectAttr(projectType, budgetAmount);
|
||||||
|
String biddingMethod = calculateBiddingMethod(projectType, budgetAmount);
|
||||||
|
detailVO.setProjectAttr(projectAttr);
|
||||||
|
detailVO.setBiddingMethod(biddingMethod);
|
||||||
|
totalAmount = totalAmount.add(budgetAmount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
procurementPlanVO.setEstimatedAmount(totalAmount);
|
||||||
|
procurementPlanVO.setAmountUpper(digitUppercase(totalAmount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算项目属性
|
||||||
|
*/
|
||||||
|
private String calculateProjectAttr(String projectType, BigDecimal budgetAmount) {
|
||||||
|
boolean isEngineering = "工程类".equals(projectType);
|
||||||
|
if ((isEngineering && budgetAmount.compareTo(new BigDecimal("100")) >= 0)
|
||||||
|
|| (!isEngineering && budgetAmount.compareTo(new BigDecimal("50")) >= 0)) {
|
||||||
|
return "一类项目";
|
||||||
|
}
|
||||||
|
if ((isEngineering && budgetAmount.compareTo(new BigDecimal("50")) >= 0)
|
||||||
|
|| (!isEngineering && budgetAmount.compareTo(new BigDecimal("10")) >= 0)) {
|
||||||
|
return "二类项目";
|
||||||
|
}
|
||||||
|
return "三类项目";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算招标方式
|
||||||
|
*/
|
||||||
|
private String calculateBiddingMethod(String projectType, BigDecimal budgetAmount) {
|
||||||
|
String projectAttr = calculateProjectAttr(projectType, budgetAmount);
|
||||||
|
if ("一类项目".equals(projectAttr) || "二类项目".equals(projectAttr)) {
|
||||||
|
return "招标";
|
||||||
|
}
|
||||||
|
return "比价";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建物料明细冗余汇总
|
||||||
|
*/
|
||||||
|
private String buildMaterialSummary(List<ProcurementPlanMaterial> materialList) {
|
||||||
|
return materialList.stream()
|
||||||
|
.map(material -> material.getMaterialName() + " x " + material.getQuantity())
|
||||||
|
.collect(Collectors.joining(", "));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额大写转换
|
||||||
|
*/
|
||||||
|
private String digitUppercase(BigDecimal amount) {
|
||||||
|
if (amount == null || amount.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
return "零元整";
|
||||||
|
}
|
||||||
|
String[] fraction = {"角", "分"};
|
||||||
|
String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
|
||||||
|
String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}};
|
||||||
|
double n = amount.doubleValue();
|
||||||
|
String head = n < 0 ? "欠" : "";
|
||||||
|
n = Math.abs(n);
|
||||||
|
StringBuilder s = new StringBuilder();
|
||||||
|
for (int i = 0; i < fraction.length; i++) {
|
||||||
|
s.append((digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("零.", ""));
|
||||||
|
}
|
||||||
|
if (s.length() == 0) {
|
||||||
|
s.append("整");
|
||||||
|
}
|
||||||
|
n = Math.floor(n);
|
||||||
|
for (int i = 0; i < unit[0].length && n > 0; i++) {
|
||||||
|
StringBuilder p = new StringBuilder();
|
||||||
|
for (int j = 0; j < unit[1].length && n > 0; j++) {
|
||||||
|
p.insert(0, digit[(int) (n % 10)] + unit[1][j]);
|
||||||
|
n = Math.floor(n / 10);
|
||||||
|
}
|
||||||
|
s.insert(0, p.toString().replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i]);
|
||||||
|
}
|
||||||
|
return head + s.toString()
|
||||||
|
.replaceAll("(零.)*零元", "元")
|
||||||
|
.replaceAll("(零.)+", "零")
|
||||||
|
.replaceAll("^整$", "零元整");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
#主数据源信息
|
#主数据源信息
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://172.16.92.89:3306/bladex_zhaocai?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://localhost:3306/bladex_zhaocai?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: Aa123456
|
password: Aa123456
|
||||||
#动态数据源信息
|
#动态数据源信息
|
||||||
@ -23,6 +23,6 @@ spring:
|
|||||||
#独立校验配置
|
#独立校验配置
|
||||||
validation-query: select 1
|
validation-query: select 1
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://172.16.92.89:3306/bladex_zhaocai?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://localhost:3306/bladex_zhaocai?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: Aa123456
|
password: Aa123456
|
||||||
|
|||||||
@ -3,7 +3,7 @@ spring:
|
|||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
##redis 单机环境配置
|
##redis 单机环境配置
|
||||||
host: 172.16.92.89
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password:
|
password:
|
||||||
database: 0
|
database: 0
|
||||||
|
|||||||
@ -3,11 +3,35 @@
|
|||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for blade_procurement_plan
|
-- Table structure for zc_bill_code
|
||||||
|
-- 单据号码表,用于保证单据号唯一性
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `blade_procurement_plan`;
|
DROP TABLE IF EXISTS `zc_bill_code`;
|
||||||
|
|
||||||
CREATE TABLE `blade_procurement_plan` (
|
CREATE TABLE `zc_bill_code` (
|
||||||
|
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||||
|
`bill_code` varchar(64) NOT NULL COMMENT '单据号',
|
||||||
|
`bill_type` varchar(64) DEFAULT NULL COMMENT '单据类型',
|
||||||
|
`status` int(2) DEFAULT '1' COMMENT '状态',
|
||||||
|
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||||
|
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_user` bigint(20) DEFAULT NULL COMMENT '更新人',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`is_deleted` int(2) DEFAULT '0' COMMENT '是否已删除',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE KEY `uk_bill_code` (`bill_code`) USING BTREE,
|
||||||
|
KEY `idx_bill_type` (`bill_type`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='单据号码表';
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for zc_procurement_plan
|
||||||
|
-- 年度招采计划主表
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `zc_procurement_plan`;
|
||||||
|
|
||||||
|
CREATE TABLE `zc_procurement_plan` (
|
||||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||||
`tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
|
`tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
|
||||||
`applicant` varchar(64) DEFAULT NULL COMMENT '申请人',
|
`applicant` varchar(64) DEFAULT NULL COMMENT '申请人',
|
||||||
@ -16,11 +40,13 @@ CREATE TABLE `blade_procurement_plan` (
|
|||||||
`company` varchar(128) DEFAULT NULL COMMENT '所属公司',
|
`company` varchar(128) DEFAULT NULL COMMENT '所属公司',
|
||||||
`bill_no` varchar(64) DEFAULT NULL COMMENT '单据号',
|
`bill_no` varchar(64) DEFAULT NULL COMMENT '单据号',
|
||||||
`year` varchar(4) DEFAULT NULL COMMENT '年度',
|
`year` varchar(4) DEFAULT NULL COMMENT '年度',
|
||||||
`dept` varchar(128) DEFAULT NULL COMMENT '所属部门',
|
`dept` varchar(128) DEFAULT NULL COMMENT '需求部门',
|
||||||
`apply_company` varchar(128) DEFAULT NULL COMMENT '申请所属公司',
|
`apply_company` varchar(128) DEFAULT NULL COMMENT '需求公司',
|
||||||
`estimated_amount` decimal(18,2) DEFAULT '0.00' COMMENT '预估总金额(万元)',
|
`estimated_amount` decimal(18,2) DEFAULT '0.00' COMMENT '年度预估总金额(万元)',
|
||||||
`amount_upper` varchar(256) DEFAULT NULL COMMENT '预估总金额大写',
|
`amount_upper` varchar(256) DEFAULT NULL COMMENT '预估总金额大写',
|
||||||
`remark` text COMMENT '备注',
|
`remark` text COMMENT '备注',
|
||||||
|
`flow_status` varchar(64) DEFAULT NULL COMMENT '流程当前节点',
|
||||||
|
`process_instance_id` varchar(64) DEFAULT NULL COMMENT '流程实例ID',
|
||||||
`status` int(2) DEFAULT '1' COMMENT '状态',
|
`status` int(2) DEFAULT '1' COMMENT '状态',
|
||||||
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||||
@ -32,29 +58,35 @@ CREATE TABLE `blade_procurement_plan` (
|
|||||||
UNIQUE KEY `uk_bill_no` (`bill_no`) USING BTREE,
|
UNIQUE KEY `uk_bill_no` (`bill_no`) USING BTREE,
|
||||||
KEY `idx_year` (`year`) USING BTREE,
|
KEY `idx_year` (`year`) USING BTREE,
|
||||||
KEY `idx_applicant` (`applicant`) USING BTREE
|
KEY `idx_applicant` (`applicant`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='招采计划主表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='年度招采计划主表';
|
||||||
|
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for blade_procurement_plan_detail
|
-- Table structure for zc_procurement_plan_project
|
||||||
|
-- 年度招采计划项目明细表
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `blade_procurement_plan_detail`;
|
DROP TABLE IF EXISTS `zc_procurement_plan_project`;
|
||||||
|
|
||||||
CREATE TABLE `blade_procurement_plan_detail` (
|
CREATE TABLE `zc_procurement_plan_project` (
|
||||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||||
`tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
|
`tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
|
||||||
`plan_id` bigint(20) NOT NULL COMMENT '主表ID',
|
`plan_id` bigint(20) NOT NULL COMMENT '主表ID',
|
||||||
`year` varchar(4) DEFAULT NULL COMMENT '年度',
|
`year` varchar(4) DEFAULT NULL COMMENT '年度',
|
||||||
`plan` varchar(128) DEFAULT NULL COMMENT '计划',
|
`plan_no` varchar(64) DEFAULT NULL COMMENT '计划号',
|
||||||
`plan_type` varchar(64) DEFAULT NULL COMMENT '计划类型',
|
|
||||||
`sort_no` int(11) DEFAULT '0' COMMENT '序号',
|
`sort_no` int(11) DEFAULT '0' COMMENT '序号',
|
||||||
`project_name` varchar(256) DEFAULT NULL COMMENT '项目名称',
|
`project_name` varchar(100) DEFAULT NULL COMMENT '项目名称',
|
||||||
`project_type` varchar(64) DEFAULT NULL COMMENT '项目类型',
|
`project_type` varchar(64) DEFAULT NULL COMMENT '项目类型',
|
||||||
`contact_person` varchar(64) DEFAULT NULL COMMENT '项目对接人',
|
`contact_person` varchar(64) DEFAULT NULL COMMENT '项目对接人',
|
||||||
|
`contact_person_id` bigint(20) DEFAULT NULL COMMENT '项目对接人ID',
|
||||||
`apply_date` date DEFAULT NULL COMMENT '计划申请日期',
|
`apply_date` date DEFAULT NULL COMMENT '计划申请日期',
|
||||||
`expect_date` date DEFAULT NULL COMMENT '期望使用/完成日期',
|
`expect_date` date DEFAULT NULL COMMENT '期望使用/完成日期',
|
||||||
`project_attr` varchar(64) DEFAULT NULL COMMENT '项目属性',
|
`project_attr` varchar(64) DEFAULT NULL COMMENT '项目属性',
|
||||||
`material_detail` varchar(512) DEFAULT NULL COMMENT '采购物料明细',
|
`purchase_requirement` varchar(512) DEFAULT NULL COMMENT '采购需求',
|
||||||
|
`budget_amount` decimal(18,2) DEFAULT '0.00' COMMENT '预算金额(万元)',
|
||||||
|
`bidding_method` varchar(64) DEFAULT NULL COMMENT '招标方式',
|
||||||
|
`project_intro` text COMMENT '项目简介',
|
||||||
|
`remark` text COMMENT '备注',
|
||||||
|
`material_detail` text COMMENT '物料明细冗余汇总',
|
||||||
`status` int(2) DEFAULT '1' COMMENT '状态',
|
`status` int(2) DEFAULT '1' COMMENT '状态',
|
||||||
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
@ -63,5 +95,47 @@ CREATE TABLE `blade_procurement_plan_detail` (
|
|||||||
`is_deleted` int(2) DEFAULT '0' COMMENT '是否已删除',
|
`is_deleted` int(2) DEFAULT '0' COMMENT '是否已删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
KEY `idx_plan_id` (`plan_id`) USING BTREE,
|
KEY `idx_plan_id` (`plan_id`) USING BTREE,
|
||||||
|
KEY `idx_plan_no` (`plan_no`) USING BTREE,
|
||||||
KEY `idx_year` (`year`) USING BTREE
|
KEY `idx_year` (`year`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='招采计划明细表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='年度招采计划项目明细表';
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for zc_procurement_plan_material
|
||||||
|
-- 年度招采计划物料明细表
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `zc_procurement_plan_material`;
|
||||||
|
|
||||||
|
CREATE TABLE `zc_procurement_plan_material` (
|
||||||
|
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||||
|
`tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
|
||||||
|
`plan_id` bigint(20) NOT NULL COMMENT '主表ID',
|
||||||
|
`project_id` bigint(20) NOT NULL COMMENT '项目明细ID',
|
||||||
|
`sort_no` int(11) DEFAULT '0' COMMENT '序号',
|
||||||
|
`material_name` varchar(100) DEFAULT NULL COMMENT '物料名称',
|
||||||
|
`material_code` varchar(64) DEFAULT NULL COMMENT '物料编码',
|
||||||
|
`specification` varchar(256) DEFAULT NULL COMMENT '规格型号',
|
||||||
|
`brand` varchar(128) DEFAULT NULL COMMENT '品牌',
|
||||||
|
`unit` varchar(64) DEFAULT NULL COMMENT '计量单位',
|
||||||
|
`reference_price` decimal(18,2) DEFAULT '0.00' COMMENT '参考价',
|
||||||
|
`quantity` int(11) DEFAULT '0' COMMENT '预计数量',
|
||||||
|
`estimated_amount` decimal(18,2) DEFAULT '0.00' COMMENT '预估金额(元)',
|
||||||
|
`contact_person` varchar(64) DEFAULT NULL COMMENT '对接人',
|
||||||
|
`contact_person_id` bigint(20) DEFAULT NULL COMMENT '对接人ID',
|
||||||
|
`apply_date` date DEFAULT NULL COMMENT '计划申请日期',
|
||||||
|
`expect_date` date DEFAULT NULL COMMENT '期望使用/完成日期',
|
||||||
|
`last_year_total` int(11) DEFAULT '0' COMMENT '去年总量',
|
||||||
|
`last_year_avg_price` decimal(18,2) DEFAULT '0.00' COMMENT '去年均价',
|
||||||
|
`last_year_total_amount` decimal(18,2) DEFAULT '0.00' COMMENT '去年总金额',
|
||||||
|
`requirement_intro` text COMMENT '需求简介',
|
||||||
|
`remark` text COMMENT '备注',
|
||||||
|
`status` int(2) DEFAULT '1' COMMENT '状态',
|
||||||
|
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_user` bigint(20) DEFAULT NULL COMMENT '更新人',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`is_deleted` int(2) DEFAULT '0' COMMENT '是否已删除',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `idx_plan_id` (`plan_id`) USING BTREE,
|
||||||
|
KEY `idx_project_id` (`project_id`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='年度招采计划物料明细表';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user