代码提交

This commit is contained in:
liang.chao 2025-08-24 18:02:56 +08:00
parent e58a0cebd3
commit 877c06a088
4 changed files with 38 additions and 15 deletions

View File

@ -98,6 +98,7 @@ public class PushProDataUseInfoController extends BaseController {
} }
} }
// 竣工未退预警数量
@GetMapping(value = "getCompletionNotRefunded") @GetMapping(value = "getCompletionNotRefunded")
public AjaxResult getCompletionNotRefunded(ProIdsBean bean) { public AjaxResult getCompletionNotRefunded(ProIdsBean bean) {
try { try {
@ -110,14 +111,14 @@ public class PushProDataUseInfoController extends BaseController {
} }
//竣工未退预警 //竣工未退预警
@GetMapping(value = "getCompletionNotRefundedNum") @GetMapping(value = "getCompletionNotRefundedNum")
public AjaxResult getCompletionNotRefundedNum(ProIdsBean bean) { public AjaxResult getCompletionNotRefundedNum(ProIdsBean bean) {
try { try {
List<MachineInfoBean> results = service.getCompletionNotRefunded(bean); List<MachineInfoBean> results = service.getCompletionNotRefunded(bean);
BigDecimal totalNum = new BigDecimal(0); BigDecimal totalNum = new BigDecimal(0);
for (MachineInfoBean completionNotRefundedDetail : results) { for (MachineInfoBean completionNotRefundedDetail : results) {
totalNum.add(completionNotRefundedDetail.getNum()); totalNum = totalNum.add(completionNotRefundedDetail.getNum());
} }
return AjaxResult.success(totalNum); return AjaxResult.success(totalNum);
} catch (Exception e) { } catch (Exception e) {

View File

@ -45,5 +45,7 @@ public class MachineInfoBean {
private String maCode; private String maCode;
// 剩余到期天数 // 剩余到期天数
private Integer daysDiff; private Integer daysDiff;
// 竣工时间
private String actualEndDate;
} }

View File

@ -16,6 +16,10 @@ public class ProIdsBean {
private String proName; private String proName;
private Integer typeId; private Integer typeId;
private String typeName; private String typeName;
private String typeModelName;
private String deptName;
private String proCenter;
private Integer deptId;
private BigDecimal typeNum; private BigDecimal typeNum;
// 1 牵张设备 2 抱杆 3动力设备 4 变电专业设备 5安全工器具 6自主创新设备 7其他 // 1 牵张设备 2 抱杆 3动力设备 4 变电专业设备 5安全工器具 6自主创新设备 7其他
private Integer isStatics; private Integer isStatics;

View File

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bp.pro_name as proName, bp.pro_name as proName,
sum(sai.num) typeNum, sum(sai.num) typeNum,
mt2.type_id as typeId, mt2.type_id as typeId,
mt2.is_statics as isStatics,
bp.pro_id as proId bp.pro_id as proId
from slt_agreement_info sai from slt_agreement_info sai
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
@ -35,7 +36,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.num as num, sai.num as num,
mm.assets_code as assetsCode, mm.assets_code as assetsCode,
mt.rent_price as rentPrice, mt.rent_price as rentPrice,
mm.keeper_name as typeKeeperName,
'在用' as status '在用' as status
from slt_agreement_info sai from slt_agreement_info sai
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY bp.pro_id GROUP BY bp.pro_id
</select> </select>
<select id="getTypeKeeperName" resultType="java.lang.String"> <select id="getTypeKeeperName" resultType="java.lang.String">
select su.nick_name from ma_type_keeper mtk select group_concat(su.nick_name) from ma_type_keeper mtk
left join sys_user su on mtk.user_id = su.user_id left join sys_user su on mtk.user_id = su.user_id
where mtk.type_id = #{typeId} where mtk.type_id = #{typeId}
</select> </select>
@ -174,18 +174,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
LEFT JOIN ma_type mt ON sai.type_id = mt.type_id LEFT JOIN ma_type mt ON sai.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
where 1=1 where mm.next_check_time is not null
<if test="proId != null"> <if test="proId != null">
AND bp.pro_id = #{proId} AND bp.pro_id = #{proId}
</if> </if>
AND mm.next_check_time IS NOT NULL AND mm.next_check_time IS NOT NULL
GROUP BY bp.pro_id <if test="proId != null">
GROUP BY bp.pro_id
</if>
</select> </select>
<select id="getApproachingDetails" resultType="com.bonus.material.push.domain.MachineInfoBean"> <select id="getApproachingDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
SELECT SELECT
sd.dept_name, sd.dept_name as deptName,
bp.pro_center, bp.pro_center as proCenter,
bp.pro_name, bp.pro_name as proName,
mt2.type_name as typeName, mt2.type_name as typeName,
mt.type_name as typeModelName, mt.type_name as typeModelName,
mt.unit_name as unit, mt.unit_name as unit,
@ -204,9 +206,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_dept sd on bp.imp_unit = sd.dept_id LEFT JOIN sys_dept sd on bp.imp_unit = sd.dept_id
LEFT JOIN ma_type mt ON sai.type_id = mt.type_id LEFT JOIN ma_type mt ON sai.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
WHERE mm.next_check_time IS NOT NULL WHERE mm.next_check_time is not null
<if test="proId != null"> <if test="proId != null">
AND bp.pro_id = #{proId} AND bp.pro_id = #{proId}
</if> </if>
<if test="type != null and type == 0"> <if test="type != null and type == 0">
AND mm.next_check_time BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 30 DAY) AND mm.next_check_time BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 30 DAY)
@ -229,7 +231,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeModelName != null and typeModelName !=''"> <if test="typeModelName != null and typeModelName !=''">
AND mt.type_name = #{typeModelName} AND mt.type_name = #{typeModelName}
</if> </if>
GROUP BY bp.pro_id <if test="proId != null">
GROUP BY bp.pro_id
</if>
</select> </select>
<select id="getCompletionNotRefunded" resultType="com.bonus.material.push.domain.MachineInfoBean"> <select id="getCompletionNotRefunded" resultType="com.bonus.material.push.domain.MachineInfoBean">
select select
@ -237,7 +241,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum(sai.num) num, sum(sai.num) num,
mt2.type_id as typeId, mt2.type_id as typeId,
sd.dept_name as deptName, sd.dept_name as deptName,
sd.dept_id sd.dept_id as deptId
from slt_agreement_info sai from slt_agreement_info sai
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
left join bm_project bp on bai.project_id = bp.pro_id left join bm_project bp on bai.project_id = bp.pro_id
@ -248,14 +252,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="proId != null"> <if test="proId != null">
AND bp.pro_id = #{proId} AND bp.pro_id = #{proId}
</if> </if>
GROUP BY bp.pro_id,bp.imp_unit GROUP BY
<if test="proId != null">
bp.pro_id,
</if>
bp.imp_unit
</select> </select>
<select id="getCompletionNotRefundedDetails" resultType="com.bonus.material.push.domain.MachineInfoBean"> <select id="getCompletionNotRefundedDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
select select
bp.pro_name as proName, bp.pro_name as proName,
bp.pro_center as proCenter, bp.pro_center as proCenter,
bp.actual_end_date as actualEndDate,
DATEDIFF(NOW(), bp.actual_end_date) as daysDiff,
sum(sai.num) num, sum(sai.num) num,
mt.type_name as typeModelName, mt.type_name as typeModelName,
mt.unit_name as unit,
mt2.type_name as typeName, mt2.type_name as typeName,
sd.dept_name as deptName sd.dept_name as deptName
from slt_agreement_info sai from slt_agreement_info sai
@ -284,7 +295,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeModelName != null and typeModelName !=''"> <if test="typeModelName != null and typeModelName !=''">
AND mt.type_name = #{typeModelName} AND mt.type_name = #{typeModelName}
</if> </if>
GROUP BY bp.pro_id,bp.imp_unit GROUP BY
<if test="proId != null">
bp.pro_id,
</if>
bp.imp_unit
</select> </select>
<select id="getInventoryAlert" resultType="com.bonus.material.push.domain.InventoryAlertBean"> <select id="getInventoryAlert" resultType="com.bonus.material.push.domain.InventoryAlertBean">
select select
@ -296,6 +311,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ma_type mt from ma_type mt
left join ma_type mt2 on mt.parent_id = mt2.type_id left join ma_type mt2 on mt.parent_id = mt2.type_id
where mt2.is_statics in (1,2,3,4,5,6,7) where mt2.is_statics in (1,2,3,4,5,6,7)
and mt.warn_num - mt.storage_num > 0
<if test="typeName != null and typeName !=''"> <if test="typeName != null and typeName !=''">
AND mt2.type_name = #{typeName} AND mt2.type_name = #{typeName}
</if> </if>