diff --git a/blade-service-api/blade-zhaocai-api/src/main/java/org/springblade/zhaocai/pojo/entity/BillCode.java b/blade-service-api/blade-zhaocai-api/src/main/java/org/springblade/zhaocai/pojo/entity/BillCode.java new file mode 100644 index 0000000..678898b --- /dev/null +++ b/blade-service-api/blade-zhaocai-api/src/main/java/org/springblade/zhaocai/pojo/entity/BillCode.java @@ -0,0 +1,61 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *
+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *
+ * 1. This software is for development use only under a valid license + * from BladeX. + *
+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *
+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *
+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *
+ * 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; + +} diff --git a/blade-service-api/blade-zhaocai-api/src/main/java/org/springblade/zhaocai/pojo/entity/ProcurementPlanMaterial.java b/blade-service-api/blade-zhaocai-api/src/main/java/org/springblade/zhaocai/pojo/entity/ProcurementPlanMaterial.java new file mode 100644 index 0000000..1ed0221 --- /dev/null +++ b/blade-service-api/blade-zhaocai-api/src/main/java/org/springblade/zhaocai/pojo/entity/ProcurementPlanMaterial.java @@ -0,0 +1,176 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *
+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *
+ * 1. This software is for development use only under a valid license + * from BladeX. + *
+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *
+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *
+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *
+ * 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; + +} diff --git a/blade-service/blade-zhaocai/src/main/java/org/springblade/zhaocai/controller/UserDeptController.java b/blade-service/blade-zhaocai/src/main/java/org/springblade/zhaocai/controller/UserDeptController.java new file mode 100644 index 0000000..9a8a02b --- /dev/null +++ b/blade-service/blade-zhaocai/src/main/java/org/springblade/zhaocai/controller/UserDeptController.java @@ -0,0 +1,77 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *
+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *
+ * 1. This software is for development use only under a valid license + * from BladeX. + *
+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *
+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *
+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *
+ * 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
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * 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
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * 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
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * 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
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * 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
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * 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
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * 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