From 77e19d4d9df121ec50cc6f647d5c73665c37c5a3 Mon Sep 17 00:00:00 2001
From: syruan <321359594@qq.com>
Date: Fri, 18 Oct 2024 15:29:49 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/bonus/material/ma/domain/Type.java | 26 ++++++++++-
.../service/impl/SupplierInfoServiceImpl.java | 5 ++-
.../mapper/material/ma/TypeMapper.xml | 43 +++++++++++++++----
3 files changed, 64 insertions(+), 10 deletions(-)
diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java
index 6de6e0c2..a00ee6a4 100644
--- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java
+++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java
@@ -33,6 +33,10 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "类型名称")
private String typeName;
+ /** 仓库名称 */
+ @ApiModelProperty(value = "物资仓库名称")
+ private String houseName;
+
/** 上级ID */
@Excel(name = "上级ID")
@ApiModelProperty(value = "上级ID")
@@ -41,7 +45,15 @@ public class Type extends BaseEntity {
/** 实时库存 */
@Excel(name = "实时库存")
@ApiModelProperty(value = "实时库存")
- private Long storageNum;
+ private Long storageNum = 0L;
+
+ /** 是否扣费 */
+ @ApiModelProperty(value = "是否扣费,true:扣费, false:不")
+ private Boolean isCharging = false;
+
+ /** 检验周期 */
+ @ApiModelProperty(value = "检验周期,单位:月")
+ private Integer testCycle = 0;
/** 类型编号 */
@Excel(name = "类型编号")
@@ -58,6 +70,10 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "计量单位ID")
private Long unitId;
+ /** 计量单位名称 */
+ @ApiModelProperty(value = "计量单位名称")
+ private String unitName;
+
/** 管理方式(0编号 1计数) */
@Excel(name = "管理方式(0编号 1计数)")
@ApiModelProperty(value = "管理方式(0编号 1计数)")
@@ -89,6 +105,14 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "丢失赔偿比率")
private BigDecimal payRatio;
+ /** 丢失赔偿价 */
+ @ApiModelProperty(value = "丢失赔偿价")
+ private BigDecimal payPrice;
+
+ /** 税率 */
+ @ApiModelProperty(value = "税率")
+ private BigDecimal taxRatio;
+
/** 层级 */
@Excel(name = "层级")
@ApiModelProperty(value = "层级")
diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java
index 535dcbb0..e5dd6512 100644
--- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java
+++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java
@@ -66,6 +66,9 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService {
supplierInfo.setCreateTime(DateUtils.getNowDate());
int insertedSupplierInfoResult = supplierInfoMapper.insertSupplierInfo(supplierInfo);
if (insertedSupplierInfoResult > 0) {
+ if (supplierInfo.getBusinessLicenseFileList() == null) {
+ return AjaxResult.success("新增任务成功,无营业执照附件");
+ }
AtomicBoolean addFileInfoResult = new AtomicBoolean(false);
supplierInfo.getBusinessLicenseFileList().forEach(file -> {
BmFileInfo bmFileInfo = new BmFileInfo();
@@ -77,7 +80,7 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService {
bmFileInfo.setModelId(MODEL_ID);
addFileInfoResult.set(bmFileInfoMapper.insertBmFileInfo(bmFileInfo) > 0);
});
- return addFileInfoResult.get() ? AjaxResult.success("新增任务成功") : AjaxResult.error("新增任务失败,详情表插入0条");
+ return addFileInfoResult.get() ? AjaxResult.success("新增任务成功") : AjaxResult.error("新增任务失败,附件表插入0条");
} else {
return AjaxResult.error("新增任务失败,info表插入0条");
}
diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml
index 163568cd..022953d4 100644
--- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml
+++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml
@@ -12,12 +12,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
+
@@ -43,12 +46,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
+
@@ -68,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
@@ -75,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
@@ -83,8 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select
- type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, manage_type, lease_price,
- eff_time, rent_price, buy_price, pay_ratio, level, rated_load, test_load, holding_time, warn_num,
+ type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, unit_name, manage_type, lease_price,
+ eff_time, rent_price, buy_price, pay_ratio, pay_price, tax_ratio, level, rated_load, test_load, holding_time, warn_num,
create_by, create_time, update_by, update_time, is_plan,is_ancuo, remark, fac_model, intelligent_code
from ma_type
@@ -156,12 +165,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
type_code,
model_code,
unit_id,
+ unit_name,
manage_type,
lease_price,
eff_time,
rent_price,
buy_price,
pay_ratio,
+ pay_price,
+ tax_ratio,
`level`,
rated_load,
test_load,
@@ -184,12 +196,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{typeCode},
#{modelCode},
#{unitId},
+ #{unitName},
#{manageType},
#{leasePrice},
#{effTime},
#{rentPrice},
#{buyPrice},
#{payRatio},
+ #{payPrice},
+ #{taxRatio},
#{level},
#{ratedLoad},
#{testLoad},
@@ -216,12 +231,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
type_code = #{typeCode},
model_code = #{modelCode},
unit_id = #{unitId},
+ unit_name = #{unitName},
manage_type = #{manageType},
lease_price = #{leasePrice},
eff_time = #{effTime},
rent_price = #{rentPrice},
buy_price = #{buyPrice},
pay_ratio = #{payRatio},
+ pay_price = #{payPrice},
+ tax_ratio = #{taxRatio},
`level` = #{level},
rated_load = #{ratedLoad},
test_load = #{testLoad},
@@ -262,11 +280,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
a.*, -- 当前层级的所有字段
b.type_name AS parentThreeLevelName, -- 父层级名称
-
c.type_name AS parentTwoLevelName, -- 祖父层级名称
- d.type_name AS parentOneLevelName -- 曾祖父层级名称
+ d.type_name AS parentOneLevelName, -- 曾祖父层级名称
+ whi.house_name
FROM
ma_type a
+ LEFT JOIN
+ wh_house_set whs ON a.type_id = whs.type_id AND whs.del_flag = '0'
+ LEFT JOIN
+ wh_house_info whi ON whi.house_id = whs.house_id AND whs.del_flag = '0'
LEFT JOIN
ma_type b ON a.parent_id = b.type_id and b.del_flag = '0' -- 第一层,父类型
LEFT JOIN
@@ -352,15 +374,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.type_name AS parentFourLevelName, -- 当前层级名称
b.type_name AS parentThreeLevelName, -- 父层级名称
c.type_name AS parentTwoLevelName, -- 祖父层级名称
- d.type_name AS parentOneLevelName -- 曾祖父层级名称
+ d.type_name AS parentOneLevelName, -- 曾祖父层级名称
+ whs.house_id,whi.house_name
FROM
ma_type a
LEFT JOIN
- ma_type b ON a.parent_id = b.type_id and b.del_flag = '0' -- 第一层,父类型
+ wh_house_set whs ON a.type_id = whs.type_id AND whs.del_flag = '0'
LEFT JOIN
- ma_type c ON b.parent_id = c.type_id and c.del_flag = '0' -- 第二层,祖父类型
+ wh_house_info whi ON whi.house_id = whs.house_id AND whs.del_flag = '0'
LEFT JOIN
- ma_type d ON c.parent_id = d.type_id and d.del_flag = '0' -- 第三层,曾祖父类型
+ ma_type b ON a.parent_id = b.type_id AND b.del_flag = '0' -- 第一层,父类型
+ LEFT JOIN
+ ma_type c ON b.parent_id = c.type_id AND c.del_flag = '0' -- 第二层,祖父类型
+ LEFT JOIN
+ ma_type d ON c.parent_id = d.type_id AND d.del_flag = '0' -- 第三层,曾祖父类型
WHERE
a.del_flag = 0 AND a.`level` = '4'