bug修复

This commit is contained in:
mashuai 2025-05-28 12:10:45 +08:00
parent 4dc45ee46e
commit 8e00760338
5 changed files with 92 additions and 2 deletions

View File

@ -83,7 +83,14 @@ public class StorageStatusController extends BaseController {
public AjaxResult getUserRecords(StorageStatus bean) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
List<MaType> list = storageStatusMapper.getUserRecords(bean);
// 首先根据typeId查询managerType区分编码和数量设备
List<MaType> list = new ArrayList<>();
String managerType = storageStatusMapper.getMaType(bean.getTypeId());
if ("0".equals(managerType)) {
list = storageStatusMapper.getUserRecords(bean);
} else {
list = storageStatusMapper.getUserRecordsNum(bean);
}
// 针对于预报废驳回数据进行数据追加,待定
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}

View File

@ -79,4 +79,10 @@ public class ToDoBean extends BaseEntity {
*/
private Integer companyId;
@ApiModelProperty(value = "部门id")
private Long deptId;
@ApiModelProperty(value = "任务状态")
private String taskStatus;
}

View File

@ -44,4 +44,13 @@ public interface StorageStatusMapper {
* @return
*/
List<MaType> getTypeList(MaType maType);
/**
* 首先根据typeId查询managerType
* @param typeId
* @return
*/
String getMaType(Integer typeId);
List<MaType> getUserRecordsNum(StorageStatus bean);
}

View File

@ -365,5 +365,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ma_id = #{maId}
</if>
</select>
<select id="getMaType" resultType="java.lang.String">
SELECT
manage_type
FROM
ma_type
WHERE
type_id = #{typeId}
</select>
<select id="getUserRecordsNum" resultType="com.bonus.sgzb.base.api.domain.MaType">
SELECT
mm.ma_id as maId,
subquery1.proName as proName,
mm.ma_code as maCode,
mt.type_name as modelName,
mt2.type_name as typeName,
IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) as num
FROM
(
SELECT
lod.ma_id AS maId,
mt.type_id AS typeId,
SUM(IFNULL(lod.out_num, 0)) AS outNum,
bpl.lot_name proName
FROM
lease_out_details lod
LEFT JOIN ma_type mt ON mt.type_id = lod.type_id
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
LEFT JOIN tm_task_agreement tta on lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
WHERE
mt.type_id = #{typeId}
GROUP BY
lod.ma_id, mt.type_id, bpl.lot_name
) AS subquery1
LEFT JOIN
(
SELECT
bcd.ma_id AS maId,
mt.type_id AS typeId,
SUM(IFNULL(bcd.back_num, 0)) AS backNum,
bpl.lot_name proName
FROM
back_check_details bcd
LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id
LEFT JOIN back_apply_info ba ON bcd.parent_id = ba.id
LEFT JOIN tm_task_agreement tta on ba.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
WHERE
mt.type_id = #{typeId}
GROUP BY
bcd.ma_id, mt.type_id,bpl.lot_name
) AS subquery2
ON subquery1.typeId = subquery2.typeId
AND subquery1.proName = subquery2.proName
LEFT JOIN ma_type mt ON mt.type_id = subquery1.typeId
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
LEFT JOIN ma_machine mm ON mm.ma_id = subquery1.maId
WHERE
mt.del_flag = 0
AND IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) > 0
</select>
</mapper>

View File

@ -14,12 +14,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
us.nick_name as createName,
tt.create_by as createBy,
tt.company_id as companyId,
tt.create_time as createTime
tt.create_time as createTime,
lai.company_id as companyId,
su.dept_id as deptId,
tt.task_status as taskStatus
FROM
tm_task tt
LEFT JOIN sys_dic sd on sd.id=tt.task_status
LEFT JOIN sys_dic sd2 on sd2.id=tt.task_type
LEFT JOIN sys_user us on us.user_id=tt.create_by
LEFT JOIN lease_apply_info lai ON tt.task_id = lai.task_id
LEFT JOIN sys_user su ON lai.create_by = su.user_id
WHERE
tt.`status` = '1'
and tt.task_status in ('24','25','30','31','32','33','34','37','39','42','43','46','53','58','68','69')