Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9299c1c19b
|
|
@ -5,6 +5,11 @@ package com.bonus.common.biz.constant;
|
|||
* @author bonus
|
||||
*/
|
||||
public class BmConfigItems {
|
||||
|
||||
public static final String KU_GUAN_ROLE_IDS = "KuGuanRoleIDs";
|
||||
|
||||
public static final String WEI_XIU_ROLE_IDS = "KuGuanRoleIDs";
|
||||
|
||||
public static final String LEASE_TASK_AUDIT_ROLE_KEYS = "LeaseTaskAuditRoleKeys";
|
||||
|
||||
public static final String BACK_TASK_AUDIT_ROLE_KEYS = "BackTaskAuditRoleKeys";
|
||||
|
|
|
|||
|
|
@ -116,10 +116,37 @@ public class BmConfigServiceImpl implements IBmConfigService
|
|||
if (StringUtils.isEmpty(value1)) {
|
||||
return value2;
|
||||
} else {
|
||||
return value1;
|
||||
return value1.trim();
|
||||
}
|
||||
}
|
||||
|
||||
/**获取所设定的库管员role ids*/
|
||||
public List<String> getKuGuanRoleIds() {
|
||||
List<String> list = new ArrayList();
|
||||
BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.KU_GUAN_ROLE_IDS);
|
||||
if (Objects.nonNull(bmConfig)) {
|
||||
String value = getValueWithDefault(bmConfig.getItemValue(), "");
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
list = Arrays.asList(value.split(","));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**获取所设定的维修员role ids*/
|
||||
public List<String> getWeiXiuRoleIds() {
|
||||
List<String> list = new ArrayList();
|
||||
BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.WEI_XIU_ROLE_IDS);
|
||||
if (Objects.nonNull(bmConfig)) {
|
||||
String value = getValueWithDefault(bmConfig.getItemValue(), "");
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
list = Arrays.asList(value.split(","));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**获取所设定的领料审核角色列表*/
|
||||
public List<String> getLeaseTaskAuditRoleKeys() {
|
||||
List<String> list = new ArrayList();
|
||||
BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.LEASE_TASK_AUDIT_ROLE_KEYS);
|
||||
|
|
@ -132,6 +159,7 @@ public class BmConfigServiceImpl implements IBmConfigService
|
|||
return list;
|
||||
}
|
||||
|
||||
/**获取所设定的退料审核角色列表*/
|
||||
public List<String> getBackTaskAuditRoleKeys() {
|
||||
List<String> list = new ArrayList();
|
||||
BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.BACK_TASK_AUDIT_ROLE_KEYS);
|
||||
|
|
|
|||
|
|
@ -53,6 +53,14 @@ public class TypeController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询物资类型管理列表(无分页)")
|
||||
@RequiresPermissions("ma:type:list")
|
||||
@GetMapping("/listNoPage")
|
||||
public AjaxResult listNoPage(MaTypeListVo type) {
|
||||
List<MaTypeListVo> list = typeService.selectTypeListAndParentInfo(type);
|
||||
return typeService.getMyTypeAndBindUsers(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据左列表类型id查询右表格
|
||||
*
|
||||
|
|
|
|||
|
|
@ -72,6 +72,18 @@ public class TypeKeeperController extends BaseController {
|
|||
return success(typeKeeperService.selectTypeKeeperByID(ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库管员配置
|
||||
*/
|
||||
// @ApiOperation(value = "新增库管员配置")
|
||||
// @PreventRepeatSubmit
|
||||
// @RequiresPermissions("ma:keeper:add")
|
||||
// @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置")
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody TypeKeeper typeKeeper) {
|
||||
// return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增库管员配置
|
||||
*/
|
||||
|
|
@ -80,8 +92,8 @@ public class TypeKeeperController extends BaseController {
|
|||
@RequiresPermissions("ma:keeper:add")
|
||||
@SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TypeKeeper typeKeeper) {
|
||||
return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper));
|
||||
public AjaxResult add(@RequestBody List<TypeKeeper> typeKeepers) {
|
||||
return toAjax(typeKeeperService.insertTypeKeeper(typeKeepers));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -112,13 +124,23 @@ public class TypeKeeperController extends BaseController {
|
|||
/**
|
||||
* 删除单个库管员配置
|
||||
*/
|
||||
@ApiOperation(value = "删除单个库管员配置")
|
||||
// @ApiOperation(value = "删除单个库管员配置")
|
||||
// @PreventRepeatSubmit
|
||||
// @RequiresPermissions("ma:keeper:remove")
|
||||
// @SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置")
|
||||
// @DeleteMapping
|
||||
// public AjaxResult remove(@RequestBody TypeKeeper typeKeeper)
|
||||
// {
|
||||
// return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeeper));
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "删除库管员配置")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("ma:keeper:remove")
|
||||
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置")
|
||||
@DeleteMapping
|
||||
public AjaxResult remove(@RequestBody TypeKeeper typeKeeper)
|
||||
public AjaxResult remove(@RequestBody List<TypeKeeper> typeKeepers)
|
||||
{
|
||||
return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeeper));
|
||||
return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeepers));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ public interface TypeKeeperMapper {
|
|||
/**
|
||||
* 新增库管员配置
|
||||
*
|
||||
* @param typeKeeper 库管员配置
|
||||
* @param typeKeepers 库管员配置
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTypeKeeper(TypeKeeper typeKeeper);
|
||||
int insertTypeKeeper(List<TypeKeeper> typeKeepers);
|
||||
|
||||
/**
|
||||
* 修改库管员配置
|
||||
|
|
@ -59,11 +59,6 @@ public interface TypeKeeperMapper {
|
|||
*/
|
||||
int deleteTypeKeeperByID(Long ID);
|
||||
|
||||
/**
|
||||
* 根据用户ID和物资类型ID删除库管员配置
|
||||
*/
|
||||
int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper);
|
||||
|
||||
/**
|
||||
* 批量删除库管员配置
|
||||
*
|
||||
|
|
@ -71,4 +66,9 @@ public interface TypeKeeperMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
int deleteTypeKeeperByIDs(Long[] IDs);
|
||||
|
||||
/**
|
||||
* 根据用户ID和物资类型ID删除库管员配置
|
||||
*/
|
||||
int deleteTypeKeeperByUserIdAndTypeId(List<TypeKeeper> typeKeepers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ public interface ITypeKeeperService {
|
|||
/**
|
||||
* 新增库管员配置
|
||||
*
|
||||
* @param typeKeeper 库管员配置
|
||||
* @param typeKeepers 库管员配置
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTypeKeeper(TypeKeeper typeKeeper);
|
||||
int insertTypeKeeper(List<TypeKeeper> typeKeepers);
|
||||
|
||||
/**
|
||||
* 修改库管员配置
|
||||
|
|
@ -63,8 +63,8 @@ public interface ITypeKeeperService {
|
|||
/**
|
||||
* 根据用户ID和物资类型ID删除库管员配置信息
|
||||
*
|
||||
* @param typeKeeper
|
||||
* @param typeKeepers
|
||||
* @return
|
||||
*/
|
||||
int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper);
|
||||
int deleteTypeKeeperByUserIdAndTypeId(List<TypeKeeper> typeKeepers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,4 +99,6 @@ public interface ITypeService {
|
|||
List<Type> buildMaTypeTree(List<Type> maTypeList);
|
||||
|
||||
AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto);
|
||||
|
||||
AjaxResult getMyTypeAndBindUsers(List<MaTypeListVo> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,13 +54,13 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService {
|
|||
/**
|
||||
* 新增库管员配置
|
||||
*
|
||||
* @param typeKeeper 库管员配置
|
||||
* @param typeKeepers 库管员配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTypeKeeper(TypeKeeper typeKeeper) {
|
||||
typeKeeper.setCreateTime(DateUtils.getNowDate());
|
||||
return typeKeeperMapper.insertTypeKeeper(typeKeeper);
|
||||
public int insertTypeKeeper(List<TypeKeeper> typeKeepers) {
|
||||
typeKeepers.forEach(typeKeeper -> typeKeeper.setCreateTime(DateUtils.getNowDate()));
|
||||
return typeKeeperMapper.insertTypeKeeper(typeKeepers);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -101,11 +101,11 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService {
|
|||
/**
|
||||
* 根据用户ID和物资类型ID删除库管员配置信息
|
||||
*
|
||||
* @param typeKeeper
|
||||
* @param typeKeepers
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper) {
|
||||
return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeeper);
|
||||
public int deleteTypeKeeperByUserIdAndTypeId(List<TypeKeeper> typeKeepers) {
|
||||
return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeepers);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
// 1.外层 先对比维修班组
|
||||
for (TypeRepair typeRepair : typeRepairList) {
|
||||
// 2.判断当前维修配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
|
||||
if (typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) {
|
||||
if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) {
|
||||
// 3.如果相等,把维修员信息设置到物资类型配置信息中
|
||||
typeConfigVo1.setRepairUserId(typeRepair.getUserId());
|
||||
typeConfigVo1.setRepairUserName(typeRepair.getUserName());
|
||||
|
|
@ -480,7 +480,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
// 1.外层 再对比库管班组
|
||||
for (TypeKeeper typeKeeper : typeKeeperList) {
|
||||
// 2.判断当前库管配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
|
||||
if (typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) {
|
||||
if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) {
|
||||
// 3.如果相等,把库管员信息设置到物资类型配置信息中
|
||||
typeConfigVo1.setKeeperUserId(typeKeeper.getUserId());
|
||||
typeConfigVo1.setKeeperUserName(typeKeeper.getUserName());
|
||||
|
|
@ -493,7 +493,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
for (MaTypeConfigVo typeConfigVo2 : typeConfigVo1.getChildren()) {
|
||||
// 7.有维修配置信息,把维修员信息设置到子节点中
|
||||
for (TypeRepair typeRepair : typeRepairList) {
|
||||
if (typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) {
|
||||
if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) {
|
||||
typeConfigVo2.setRepairUserId(typeRepair.getUserId());
|
||||
typeConfigVo2.setRepairUserName(typeRepair.getUserName());
|
||||
}
|
||||
|
|
@ -504,7 +504,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
for (MaTypeConfigVo typeConfigVo3 : typeConfigVo1.getChildren()) {
|
||||
// 9.判断子节点是否有库管配置信息
|
||||
for (TypeKeeper typeKeeper : typeKeeperList) {
|
||||
if (typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) {
|
||||
if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) {
|
||||
typeConfigVo3.setKeeperUserId(typeKeeper.getUserId());
|
||||
typeConfigVo3.setKeeperUserName(typeKeeper.getUserName());
|
||||
}
|
||||
|
|
@ -546,4 +546,33 @@ public class TypeServiceImpl implements ITypeService {
|
|||
// 返回前端
|
||||
return AjaxResult.success(filteredList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getMyTypeAndBindUsers(List<MaTypeListVo> list) {
|
||||
List<TypeRepair> typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair());
|
||||
List<TypeKeeper> typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper());
|
||||
for (MaTypeListVo maTypeListVo : list) {
|
||||
if (CollectionUtils.isNotEmpty(typeRepairList)) {
|
||||
for (TypeRepair typeRepair : typeRepairList) {
|
||||
if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(maTypeListVo.getTypeId())) {
|
||||
maTypeListVo.setRepairUserId(typeRepair.getUserId());
|
||||
maTypeListVo.setRepairUserName(typeRepair.getUserName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(typeKeeperList)) {
|
||||
for (TypeKeeper typeKeeper : typeKeeperList) {
|
||||
if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(maTypeListVo.getTypeId())) {
|
||||
maTypeListVo.setKeeperUserId(typeKeeper.getUserId());
|
||||
maTypeListVo.setKeeperUserName(typeKeeper.getUserName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.bonus.material.ma.vo;
|
|||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
|
@ -30,4 +29,16 @@ public class MaTypeListVo extends Type {
|
|||
@ApiModelProperty(value = "物资名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty(value = "库管员id")
|
||||
private Long keeperUserId;
|
||||
|
||||
@ApiModelProperty(value = "库管员姓名")
|
||||
private String keeperUserName;
|
||||
|
||||
@ApiModelProperty(value = "维修员id")
|
||||
private Long repairUserId;
|
||||
|
||||
@ApiModelProperty(value = "维修员姓名")
|
||||
private String repairUserName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 18588
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
# namespace: sgzb_bns
|
||||
namespace: sgzb_bns
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
# namespace: sgzb_bns
|
||||
namespace: sgzb_bns
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
|
@ -149,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mtk.user_id as keeperId,
|
||||
mtr.user_id as repairId,
|
||||
baa.asset_name as assetName,
|
||||
ma.assets_id as assetsId,
|
||||
ma.remark as remark
|
||||
FROM
|
||||
ma_machine ma
|
||||
|
|
|
|||
|
|
@ -37,21 +37,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<insert id="insertTypeKeeper" parameterType="com.bonus.material.ma.domain.TypeKeeper" useGeneratedKeys="true" keyProperty="ID">
|
||||
insert into ma_type_keeper
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
</trim>
|
||||
insert into ma_type_keeper (type_id,user_id,create_time,update_time,company_id)
|
||||
values
|
||||
<foreach collection="typeKeepers" item="item" separator=",">
|
||||
(
|
||||
#{item.typeId},
|
||||
#{item.userId},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.companyId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateTypeKeeper" parameterType="com.bonus.material.ma.domain.TypeKeeper">
|
||||
|
|
@ -90,6 +86,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<delete id="deleteTypeKeeperByUserIdAndTypeId">
|
||||
delete from ma_type_keeper where user_id = #{userId} and type_id = #{typeId}
|
||||
delete from ma_type_keeper where
|
||||
type_id in
|
||||
<foreach collection="typeKeepers" item="item" separator=",">
|
||||
(
|
||||
#{item.typeId}
|
||||
)
|
||||
</foreach>
|
||||
and
|
||||
user_id in
|
||||
<foreach collection="typeKeepers" item="item" separator=",">
|
||||
(
|
||||
#{item.userId}
|
||||
)
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -115,12 +115,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectListByMaType" resultMap="WhHouseSetResult">
|
||||
SELECT
|
||||
mhs.house_id, mhs.type_id, mhs.ma_id, mhs.num, mhs.status, mhs.dept_id, mhs.del_flag,
|
||||
mhi.house_id, mhs.type_id, mhs.ma_id, mhs.num, mhs.status, mhs.dept_id, mhs.del_flag,
|
||||
mhs.create_by, mhs.create_time, mhs.update_by,mhs.update_time,mhs.remark,mhs.company_id,mhi.house_name
|
||||
from wh_house_set mhs
|
||||
left join ma_type mt on mt.type_id = mhs.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
||||
left join wh_house_info mhi on mhs.house_id = mhi.house_id
|
||||
right join wh_house_info mhi on mhs.house_id = mhi.house_id
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue