diff --git a/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/BmProject.java b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/BmProject.java index c0afcca..2710e38 100644 --- a/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/BmProject.java +++ b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/BmProject.java @@ -51,6 +51,12 @@ public class BmProject extends BaseEntity implements Serializable { @Min(value = 1, message = "项目类型不能为空") private Integer projectType; + /** + * 项目类型。 1:线路工程;2:变电工程;3:业务工程;4:其他工程 + */ + @ApiModelProperty(value = "工程类型名称") + private String projectTypeName; + /** * i8工程id */ @@ -97,6 +103,12 @@ public class BmProject extends BaseEntity implements Serializable { @ApiModelProperty(value = "项目性质") private String nature; + /** + * 项目性质 + */ + @ApiModelProperty(value = "项目性质名称") + private String natureName; + /** * 联系方式 */ @@ -112,6 +124,12 @@ public class BmProject extends BaseEntity implements Serializable { @Excel(name = "工程状态") private String stats; + /** + * 工程状态 + */ + @ApiModelProperty(value = "工程状态名称") + private String statsName; + /** * 传真 */ diff --git a/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/MaHouse.java b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/MaHouse.java new file mode 100644 index 0000000..f9b0c8e --- /dev/null +++ b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/MaHouse.java @@ -0,0 +1,36 @@ +package com.bonus.base.api.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * ma_house物资仓库(MaHouse)实体类 + * + * @author makejava + * @since 2024-08-14 09:22:54 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class MaHouse implements Serializable { + private static final long serialVersionUID = -11758888261312379L; + + private Integer id; + /** + * 0不启用,1启用 + */ + private String isActive; + /** + * 备注 + */ + private String remark; + /** + * 仓库名称 + */ + private String name; + +} + diff --git a/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/MaType.java b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/MaType.java index 4f2dcef..f99603b 100644 --- a/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/MaType.java +++ b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/MaType.java @@ -1,5 +1,6 @@ package com.bonus.base.api.domain; +import com.bonus.common.core.web.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AllArgsConstructor; import lombok.Data; @@ -18,7 +19,7 @@ import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor -public class MaType implements Serializable { +public class MaType extends BaseEntity implements Serializable { private static final long serialVersionUID = 135108051525707131L; /** * id @@ -32,6 +33,17 @@ public class MaType implements Serializable { * 名称 */ private String name; + + /** + * 父级名称 + */ + private String parentName; + + /** + * 编码 + */ + private String code; + /** * 层级 */ diff --git a/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/TreeSelect.java b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/TreeSelect.java index 92dc8d6..af660ad 100644 --- a/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/TreeSelect.java +++ b/bonus-api/bonus-api-system/src/main/java/com/bonus/base/api/domain/TreeSelect.java @@ -23,6 +23,11 @@ public class TreeSelect implements Serializable private Integer level; + /** + * 编码 + */ + private String code; + private Integer parentId; private String companyId; @@ -34,6 +39,7 @@ public class TreeSelect implements Serializable public TreeSelect(MaType maType) { this.parentId = maType.getParentId(); + this.code = maType.getCode(); this.level = Integer.valueOf(maType.getLevel()); this.id = maType.getId(); this.label = maType.getName(); @@ -50,6 +56,14 @@ public class TreeSelect implements Serializable this.parentId = parentId; } + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + public Integer getId() { diff --git a/bonus-common/bonus-common-core/src/main/java/com/bonus/common/core/web/domain/BaseEntity.java b/bonus-common/bonus-common-core/src/main/java/com/bonus/common/core/web/domain/BaseEntity.java index a9ab2e2..680b3c2 100644 --- a/bonus-common/bonus-common-core/src/main/java/com/bonus/common/core/web/domain/BaseEntity.java +++ b/bonus-common/bonus-common-core/src/main/java/com/bonus/common/core/web/domain/BaseEntity.java @@ -45,6 +45,8 @@ public class BaseEntity implements Serializable /** 创建人 */ private String creator; + private String keyWord; + /** 请求参数 */ @JsonInclude(JsonInclude.Include.NON_EMPTY) private Map params; @@ -113,6 +115,14 @@ public class BaseEntity implements Serializable this.creator = creator; } + public String getKeyWord() { + return keyWord; + } + + public void setKeyWord(String keyWord) { + this.keyWord = keyWord; + } + public Map getParams() { diff --git a/bonus-modules/bonus-base/src/main/resources/mapper/BmProjectMapper.xml b/bonus-modules/bonus-base/src/main/resources/mapper/BmProjectMapper.xml index ae6378d..637fd85 100644 --- a/bonus-modules/bonus-base/src/main/resources/mapper/BmProjectMapper.xml +++ b/bonus-modules/bonus-base/src/main/resources/mapper/BmProjectMapper.xml @@ -34,17 +34,23 @@ - id, project_type, `name`, num, manager, nature, telphone, phone, fax, address, remark, - material_clerk, company_id, `time`, - is_active, lon, lat, company, imp_unit, dept_name, pro_id, dept_id, cvo, stats, htzt, is_match + bmp.id, bmp.project_type, sda1.dict_label AS projectTypeName, bmp.name, bmp.num, bmp.manager,bmp.nature, + sda2.dict_label AS natureName, bmp.telphone, bmp.phone, bmp.fax, bmp.address, + bmp.remark, bmp.material_clerk, bmp.company_id, bmp.time, + bmp.is_active, bmp.lon, bmp.lat, bmp.company, bmp.imp_unit, + bmp.dept_name, bmp.pro_id, bmp.dept_id, bmp.cvo, bmp.stats, sda3.dict_label AS statsName, + bmp.htzt, bmp.is_match + select + is_active, remark, name, id + from ma_house + where id = #{id} + + + + + + + + + + insert into ma_house(is_active, remark, name) + values (1, #{remark}, #{name}) + + + + + update ma_house + + + remark = #{remark}, + + + name = #{name}, + + + where id = #{id} + + + + + update ma_house + set is_active = '0' + where id = #{id} + + + + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/MaTypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/MaTypeMapper.xml index a17c296..65234d2 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/MaTypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/MaTypeMapper.xml @@ -68,127 +68,144 @@ where id = #{id} + + update ma_type set is_active = '0' where id = #{id} + - - select id, parent_id, name, level, storage_num, unit_id, buy_price, lease_price, manage_type, is_active, rate_load, test_load, hold_time, file_url, company_id from ma_type - - - and id = #{id} - - - and parent_id = #{parentId} - - - and name = #{name} - - - and level = #{level} - - - and storage_num = #{storageNum} - - - and unit_id = #{unitId} - - - and buy_price = #{buyPrice} - - - and lease_price = #{leasePrice} - - - and manage_type = #{manageType} - - - and is_active = #{isActive} - - - and rate_load = #{rateLoad} - - - and test_load = #{testLoad} - - - and hold_time = #{holdTime} - - - and file_url = #{fileUrl} - - - and company_id = #{companyId} - - - limit #{pageable.offset}, #{pageable.pageSize} + where name = #{name} and is_active = '1' - - - - select - id, parent_id, name, level, storage_num, unit_id, buy_price, lease_price, manage_type, is_active, rate_load, test_load, hold_time, file_url, company_id + id, code, parent_id, name, level, storage_num, unit_id, buy_price, lease_price, manage_type, is_active, rate_load, test_load, hold_time, file_url, company_id from ma_type - where name = #{name} + where level != '4' and is_active = '1' - + SELECT + t.* + FROM + ( + SELECT + mt.id, + mt.`name` AS specificationCode, + mt.`level`, + mtp.`name` AS materialName, + s.`name` AS materialType, + f.`name` AS constructionType, + mt.`code`, + mt.is_active + FROM + ma_type mt + LEFT JOIN ma_type mtp ON mtp.id = mt.parent_id + LEFT JOIN ma_type s ON s.id = mtp.parent_id + LEFT JOIN ma_type f ON f.id = s.parent_id + WHERE + mt.`LEVEL` = 4 UNION + SELECT + mt.id, + NULL AS `NAME`, + mt.`level`, + mt.`name` AS materialName, + mtp.`name` AS materialType, + s.`name` AS constructionType, + mt.`CODE`, + mt.is_active + FROM + ma_type mt + LEFT JOIN ma_type mtp ON mtp.id = mt.PARENT_ID + LEFT JOIN ma_type s ON s.id = mtp.PARENT_ID + WHERE + mt.`LEVEL` = 3 UNION + SELECT + mt.id AS id, + NULL AS `NAME`, + mt.`level`, + NULL AS materialName, + mt.`NAME` AS materialType, + mtp.`NAME` AS constructionType, + mt.`CODE`, + mt.IS_ACTIVE AS enabled + FROM + ma_type mt + LEFT JOIN ma_type mtp ON mtp.id = mt.PARENT_ID + WHERE + mt.`LEVEL` = 2 UNION + SELECT + mt.id AS id, + NULL AS `NAME`, + mt.`level`, + NULL AS materialName, + NULL AS materialType, + mt.`NAME` AS constructionType, + mt.`CODE`, + mt.IS_ACTIVE AS enabled + FROM + ma_type mt + WHERE + mt.`LEVEL` = 1 + ) t + WHERE + t.IS_ACTIVE = '1' + + and ( + t.specificationCode like CONCAT('%',#{keyWord},'%') or + t.`CODE` like CONCAT('%',#{keyWord},'%') or + t.materialName like CONCAT('%',#{keyWord},'%') or + t.materialType like CONCAT('%',#{keyWord},'%') or + t.constructionType like CONCAT('%',#{keyWord},'%') + ) + + + and t.`CODE` like CONCAT(#{code},'%') + + ORDER BY t.`CODE` + + + + + - insert into ma_type(id, parent_id, name, level, storage_num, unit_id, buy_price, lease_price, manage_type, is_active, rate_load, test_load, hold_time, file_url, company_id) @@ -224,16 +241,16 @@ INSERT INTO ma_type - id, - parent_id, + parent_id, name, + code, level, storage_num, unit_id, buy_price, lease_price, manage_type, - is_active, + is_active, rate_load, test_load, hold_time, @@ -243,8 +260,8 @@ VALUES #{id}, - #{parentId}, #{name}, + #{code}, #{level}, #{storageNum}, #{unitId}, diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysProfileController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysProfileController.java index 16a7e33..6401af9 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysProfileController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysProfileController.java @@ -110,7 +110,7 @@ public class SysProfileController extends BaseController String username = SecurityUtils.getUsername(); SysUser user = userService.selectUserByUserName(username); String password = user.getPassword(); - String msg= ValidateUtils.isPwd(oldPassword); + String msg= ValidateUtils.isPwd(newPassword); if (StringUtils.isNotEmpty(msg)) { return error(msg); }