Merge remote-tracking branch 'origin/master'

This commit is contained in:
jjLv 2024-11-05 13:34:56 +08:00
commit 46da562015
8 changed files with 142 additions and 116 deletions

View File

@ -24,6 +24,11 @@ public class BmFileInfo extends BaseEntity
/** 主键id */
private Long id;
/** 任务类型, 参考数据字典 tm_task_type */
@Excel(name = "任务类型")
@ApiModelProperty(value = "任务类型")
private Long taskType;
/** 任务id */
@Excel(name = "任务id")
@ApiModelProperty(value = "任务id")
@ -44,6 +49,11 @@ public class BmFileInfo extends BaseEntity
@ApiModelProperty(value = "文件路径")
private String url;
/** 文件类型, 参考数据字典 bm_file_type */
@Excel(name = "文件类型")
@ApiModelProperty(value = "文件类型")
private Long fileType;
/** 数据字典 */
@Excel(name = "数据字典")
@ApiModelProperty(value = "数据字典")

View File

@ -53,13 +53,13 @@ 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);
}
// @ApiOperation(value = "查询物资类型管理列表(无分页)")
// @RequiresPermissions("ma:type:list")
// @GetMapping("/listNoPage")
// public AjaxResult listNoPage(MaTypeListVo type) {
// List<MaTypeListVo> list = typeService.selectTypeListAndParentInfo(type);
// return typeService.getMyTypeAndBindUsers(list);
// }
/**
* 根据左列表类型id查询右表格
@ -71,13 +71,14 @@ public class TypeController extends BaseController {
@GetMapping("/getListByMaType")
public AjaxResult getListByMaType(MaTypeListVo type) {
List<Integer> parentIds = typeService.selectParentId(type);
List<MaTypeListVo> listByMaType = new ArrayList<>();
List<MaTypeListVo> myTypeList = new ArrayList<>();
for (Integer parentId : parentIds) {
listByMaType.addAll(typeService.getListByParentId(parentId.longValue(), type));
myTypeList.addAll(typeService.getListByParentId(parentId.longValue(), type));
}
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, listByMaType));
List<MaTypeListVo> result = typeService.getMyTypeAndBindUsers(myTypeList);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, result));
}
/**
@ -190,13 +191,13 @@ public class TypeController extends BaseController {
/**
* 查询物资类型配置右侧列表
*/
@ApiOperation(value = "查询物资类型配置右侧列表")
@RequiresPermissions("ma:typeConfig:list")
@GetMapping("/getMaTypeConfigList")
public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) {
// 调用service处理业务逻辑
return typeService.getMaTypeConfigList(maTypeConfigDto);
}
// @ApiOperation(value = "查询物资类型配置右侧列表")
// @RequiresPermissions("ma:typeConfig:list")
// @GetMapping("/getMaTypeConfigList")
// public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) {
// // 调用service处理业务逻辑
// return typeService.getMaTypeConfigList(maTypeConfigDto);
// }
/**

View File

@ -98,7 +98,7 @@ public interface ITypeService {
*/
List<Type> buildMaTypeTree(List<Type> maTypeList);
AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto);
// AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto);
AjaxResult getMyTypeAndBindUsers(List<MaTypeListVo> list);
List<MaTypeListVo> getMyTypeAndBindUsers(List<MaTypeListVo> list);
}

View File

@ -454,101 +454,101 @@ public class TypeServiceImpl implements ITypeService {
return !getChildList(list, t).isEmpty();
}
@Override
public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) {
// 1.把所有物资类型查出来
List<MaTypeConfigVo> list = selectThreeFourLevelTypeListAndParent(new Type());
// 2.把维修配置信息查出来
List<TypeRepair> typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair());
// 3.把库管配置信息查出来
List<TypeKeeper> typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper());
// ------------------- 开启数据处理 ---------------------
// 4.循环所有物资类型,重型数据集合保障只循环一次减少性能损失
for (MaTypeConfigVo typeConfigVo1 : list) {
// 1.外层 先对比维修班组
for (TypeRepair typeRepair : typeRepairList) {
// 2.判断当前维修配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) {
// 3.如果相等把维修员信息设置到物资类型配置信息中
typeConfigVo1.setRepairUserId(typeRepair.getUserId());
typeConfigVo1.setRepairUserName(typeRepair.getUserName());
break;
}
}
// 1.外层 再对比库管班组
for (TypeKeeper typeKeeper : typeKeeperList) {
// 2.判断当前库管配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) {
// 3.如果相等把库管员信息设置到物资类型配置信息中
typeConfigVo1.setKeeperUserId(typeKeeper.getUserId());
typeConfigVo1.setKeeperUserName(typeKeeper.getUserName());
}
}
// 5.判断当前物资类型配置信息是否有子节点
if (typeConfigVo1.getChildren() != null) {
// 6.有子节点继续循环子节点判断子节点是否有维修配置信息
for (MaTypeConfigVo typeConfigVo2 : typeConfigVo1.getChildren()) {
// 7.有维修配置信息把维修员信息设置到子节点中
for (TypeRepair typeRepair : typeRepairList) {
if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) {
typeConfigVo2.setRepairUserId(typeRepair.getUserId());
typeConfigVo2.setRepairUserName(typeRepair.getUserName());
}
}
}
// 8.有子节点继续循环子节点
for (MaTypeConfigVo typeConfigVo3 : typeConfigVo1.getChildren()) {
// 9.判断子节点是否有库管配置信息
for (TypeKeeper typeKeeper : typeKeeperList) {
if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) {
typeConfigVo3.setKeeperUserId(typeKeeper.getUserId());
typeConfigVo3.setKeeperUserName(typeKeeper.getUserName());
}
}
}
}
}
// -------------------- 数据处理结束 ---------------------
// TODO: 先暂时取消后续过滤流程
if (true) {
return AjaxResult.success(list);
}
// ------------------- 数据过滤开始 ---------------------
if (maTypeConfigDto == null || maTypeConfigDto.getUserId() == null || maTypeConfigDto.getUserId() == 0L) {
// 如果参数无效则返回原始列表
return AjaxResult.success(list);
}
List<MaTypeConfigVo> filteredList = new ArrayList<>();
for (MaTypeConfigVo maTypeConfigVo : list) {
if (
maTypeConfigVo.getKeeperUserId().equals(maTypeConfigDto.getUserId()) ||
maTypeConfigVo.getRepairUserId().equals(maTypeConfigDto.getUserId())
)
{
filteredList.add(maTypeConfigVo);
}
}
// ------------------- 数据过滤结束 ---------------------
// 返回前端
return AjaxResult.success(filteredList);
}
// @Override
// public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) {
// // 1.把所有物资类型查出来
// List<MaTypeConfigVo> list = selectThreeFourLevelTypeListAndParent(new Type());
// // 2.把维修配置信息查出来
// List<TypeRepair> typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair());
// // 3.把库管配置信息查出来
// List<TypeKeeper> typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper());
//
// // ------------------- 开启数据处理 ---------------------
//
// // 4.循环所有物资类型,重型数据集合保障只循环一次减少性能损失
// for (MaTypeConfigVo typeConfigVo1 : list) {
// // 1.外层 先对比维修班组
// for (TypeRepair typeRepair : typeRepairList) {
// // 2.判断当前维修配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
// if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) {
// // 3.如果相等把维修员信息设置到物资类型配置信息中
// typeConfigVo1.setRepairUserId(typeRepair.getUserId());
// typeConfigVo1.setRepairUserName(typeRepair.getUserName());
// break;
// }
// }
// // 1.外层 再对比库管班组
// for (TypeKeeper typeKeeper : typeKeeperList) {
// // 2.判断当前库管配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
// if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) {
// // 3.如果相等把库管员信息设置到物资类型配置信息中
// typeConfigVo1.setKeeperUserId(typeKeeper.getUserId());
// typeConfigVo1.setKeeperUserName(typeKeeper.getUserName());
// }
// }
//
// // 5.判断当前物资类型配置信息是否有子节点
// if (typeConfigVo1.getChildren() != null) {
// // 6.有子节点继续循环子节点判断子节点是否有维修配置信息
// for (MaTypeConfigVo typeConfigVo2 : typeConfigVo1.getChildren()) {
// // 7.有维修配置信息把维修员信息设置到子节点中
// for (TypeRepair typeRepair : typeRepairList) {
// if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) {
// typeConfigVo2.setRepairUserId(typeRepair.getUserId());
// typeConfigVo2.setRepairUserName(typeRepair.getUserName());
// }
// }
// }
//
// // 8.有子节点继续循环子节点
// for (MaTypeConfigVo typeConfigVo3 : typeConfigVo1.getChildren()) {
// // 9.判断子节点是否有库管配置信息
// for (TypeKeeper typeKeeper : typeKeeperList) {
// if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) {
// typeConfigVo3.setKeeperUserId(typeKeeper.getUserId());
// typeConfigVo3.setKeeperUserName(typeKeeper.getUserName());
// }
// }
// }
// }
//
// }
//
// // -------------------- 数据处理结束 ---------------------
//
// // TODO: 先暂时取消后续过滤流程
// if (true) {
// return AjaxResult.success(list);
// }
//
//
// // ------------------- 数据过滤开始 ---------------------
// if (maTypeConfigDto == null || maTypeConfigDto.getUserId() == null || maTypeConfigDto.getUserId() == 0L) {
// // 如果参数无效则返回原始列表
// return AjaxResult.success(list);
// }
//
// List<MaTypeConfigVo> filteredList = new ArrayList<>();
//
// for (MaTypeConfigVo maTypeConfigVo : list) {
// if (
// maTypeConfigVo.getKeeperUserId().equals(maTypeConfigDto.getUserId()) ||
// maTypeConfigVo.getRepairUserId().equals(maTypeConfigDto.getUserId())
// )
// {
// filteredList.add(maTypeConfigVo);
// }
// }
//
// // ------------------- 数据过滤结束 ---------------------
//
//
// // 返回前端
// return AjaxResult.success(filteredList);
// }
@Override
public AjaxResult getMyTypeAndBindUsers(List<MaTypeListVo> list) {
public List<MaTypeListVo> getMyTypeAndBindUsers(List<MaTypeListVo> list) {
List<TypeRepair> typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair());
List<TypeKeeper> typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper());
for (MaTypeListVo maTypeListVo : list) {
@ -570,7 +570,7 @@ public class TypeServiceImpl implements ITypeService {
}
}
}
return AjaxResult.success(list);
return list;
}

View File

@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
@ -46,6 +47,7 @@ public class PurchaseCheckInfo extends BaseEntity {
/** 到货日期 */
@ApiModelProperty(value = "到货日期")
@NotNull(message = "到货日期不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "到货日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date arrivalTime;

View File

@ -5,26 +5,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.bonus.material.basic.mapper.BmFileInfoMapper">
<resultMap type="com.bonus.material.basic.domain.BmFileInfo" id="BmFileInfoResult">
<result property="id" column="id" />
<result property="taskType" column="task_type" />
<result property="taskId" column="task_id" />
<result property="modelId" column="model_id" />
<result property="name" column="name" />
<result property="url" column="url" />
<result property="fileType" column="file_type" />
<result property="dicId" column="dic_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBmFileInfoVo">
select id, task_id, model_id, name, url, dic_id, create_by, create_time from bm_file_info
select id, task_type, task_id, model_id, name, url, file_type, dic_id, create_by, create_time from bm_file_info
</sql>
<select id="selectBmFileInfoList" parameterType="com.bonus.material.basic.domain.BmFileInfo" resultMap="BmFileInfoResult">
<include refid="selectBmFileInfoVo"/>
<where>
<if test="taskType != null "> and task_type = #{taskType}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="url != null and url != ''"> and url = #{url}</if>
<if test="fileType != null "> and file_type = #{fileType}</if>
<if test="dicId != null "> and dic_id = #{dicId}</if>
</where>
</select>
@ -37,19 +41,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertBmFileInfo" parameterType="com.bonus.material.basic.domain.BmFileInfo" useGeneratedKeys="true" keyProperty="id">
insert into bm_file_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskType != null">task_type,</if>
<if test="taskId != null">task_id,</if>
<if test="modelId != null">model_id,</if>
<if test="name != null">name,</if>
<if test="url != null">url,</if>
<if test="fileType != null">file_type,</if>
<if test="dicId != null">dic_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskType != null">#{taskType},</if>
<if test="taskId != null">#{taskId},</if>
<if test="modelId != null">#{modelId},</if>
<if test="name != null">#{name},</if>
<if test="url != null">#{url},</if>
<if test="fileType != null">#{fileType},</if>
<if test="dicId != null">#{dicId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -59,10 +67,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateBmFileInfo" parameterType="com.bonus.material.basic.domain.BmFileInfo">
update bm_file_info
<trim prefix="SET" suffixOverrides=",">
<if test="taskType != null">task_type = #{taskType},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="modelId != null">model_id = #{modelId},</if>
<if test="name != null">name = #{name},</if>
<if test="url != null">url = #{url},</if>
<if test="fileType != null">file_type = #{fileType},</if>
<if test="dicId != null">dic_id = #{dicId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@ -84,8 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteBmFileInfoByBizInfo" parameterType="com.bonus.material.basic.domain.BmFileInfo">
delete from bm_file_info
<where>
<if test="taskType != null "> and task_type = #{taskType}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="fileType != null "> and file_type = #{fileType}</if>
<if test="dicId != null "> and dic_id = #{dicId}</if>
</where>
</delete>

View File

@ -109,11 +109,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWhHouseInfoByHouseId" parameterType="Long">
update wh_house_info set del_flag = '2' where house_id = #{houseId}
delete from wh_house_info where house_id = #{houseId}
</delete>
<delete id="deleteWhHouseInfoByHouseIds" parameterType="String">
update wh_house_info set del_flag = '2' where house_id in
delete from wh_house_info where house_id in
<foreach item="houseId" collection="array" open="(" separator="," close=")">
#{houseId}
</foreach>

View File

@ -122,5 +122,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
right join wh_house_info mhi on mhs.house_id = mhi.house_id
where mhi.del_flag=0
</select>
</mapper>