代码提交
This commit is contained in:
parent
6183fc5163
commit
1e6400c0de
|
|
@ -4,10 +4,7 @@ import com.bonus.common.core.exception.ServiceException;
|
|||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.material.push.domain.CostPushBean;
|
||||
import com.bonus.material.push.domain.MachineInfoBean;
|
||||
import com.bonus.material.push.domain.ProIdsBean;
|
||||
import com.bonus.material.push.domain.StaticsNumsBean;
|
||||
import com.bonus.material.push.domain.*;
|
||||
import com.bonus.material.push.service.ProDataUseInfoService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
|
@ -15,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -28,6 +27,7 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
|
||||
@Resource
|
||||
private ProDataUseInfoService service;
|
||||
|
||||
/**
|
||||
* 查询推送数据使用信息
|
||||
*
|
||||
|
|
@ -44,6 +44,7 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询每个分类机具详情
|
||||
*
|
||||
|
|
@ -60,6 +61,7 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
// 查询七大类设备保有量、在用量、再修量、库存量
|
||||
@GetMapping(value = "getNumsByStatics")
|
||||
public AjaxResult getNumsByStatics(ProIdsBean bean) {
|
||||
|
|
@ -71,6 +73,7 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
// 检验临期和检验超期数量
|
||||
@GetMapping(value = "getApproachingAndTimeout")
|
||||
public AjaxResult getApproachingAndTimeout(ProIdsBean bean) {
|
||||
|
|
@ -82,6 +85,7 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
// 临期、超期设备详情
|
||||
@GetMapping(value = "getApproachingDetails")
|
||||
public TableDataInfo getApproachingDetails(ProIdsBean bean) {
|
||||
|
|
@ -94,4 +98,45 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
@GetMapping(value = "getCompletionNotRefunded")
|
||||
public AjaxResult getCompletionNotRefunded(ProIdsBean bean) {
|
||||
try {
|
||||
List<MachineInfoBean> results = service.getCompletionNotRefunded(bean);
|
||||
return AjaxResult.success(results);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping(value = "getCompletionNotRefundedDetails")
|
||||
public AjaxResult getCompletionNotRefundedDetails(ProIdsBean bean) {
|
||||
try {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
List<MachineInfoBean> results = service.getCompletionNotRefundedDetails(bean);
|
||||
BigDecimal totalNum = new BigDecimal(0);
|
||||
for (MachineInfoBean completionNotRefundedDetail : results) {
|
||||
totalNum.add(completionNotRefundedDetail.getNum());
|
||||
}
|
||||
map.put("results", results);
|
||||
map.put("totalNum", totalNum);
|
||||
return AjaxResult.success(map);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
// 施工机具库存预警 (7大类)
|
||||
@GetMapping(value = "getInventoryAlert")
|
||||
public AjaxResult getInventoryAlert(ProIdsBean bean) {
|
||||
try {
|
||||
List<InventoryAlertBean> results = service.getInventoryAlert(bean);
|
||||
return AjaxResult.success(results);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.material.push.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/8/24 - 11:09
|
||||
*/
|
||||
@Data
|
||||
public class InventoryAlertBean {
|
||||
private String typeName;
|
||||
private String typeModelName;
|
||||
|
||||
// 预警值
|
||||
private BigDecimal warnNum;
|
||||
|
||||
// 库存
|
||||
private BigDecimal num;
|
||||
|
||||
// 差值
|
||||
private BigDecimal poorNum;
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.push.domain;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -10,6 +11,8 @@ import java.util.List;
|
|||
*/
|
||||
@Data
|
||||
public class MachineInfoBean {
|
||||
// 设备id
|
||||
private String typeId;
|
||||
// 设备名称
|
||||
private String typeName;
|
||||
// 规格型号
|
||||
|
|
@ -17,7 +20,7 @@ public class MachineInfoBean {
|
|||
// 计量单位
|
||||
private String unit;
|
||||
// 数量
|
||||
private Integer num;
|
||||
private BigDecimal num;
|
||||
// 固定资产编号
|
||||
private String assetsCode;
|
||||
//租赁价格
|
||||
|
|
@ -28,6 +31,8 @@ public class MachineInfoBean {
|
|||
private String status;
|
||||
// 实施组织
|
||||
private String deptName;
|
||||
// 实施组织id
|
||||
private Integer deptId;
|
||||
// 工程名称
|
||||
private String proName;
|
||||
// 项目管理部
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.push.domain;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -15,7 +16,7 @@ public class ProIdsBean {
|
|||
private String proName;
|
||||
private Integer typeId;
|
||||
private String typeName;
|
||||
private Integer typeNum;
|
||||
private BigDecimal typeNum;
|
||||
// 1 牵张设备 2 抱杆 3动力设备 4 变电专业设备 5安全工器具 6自主创新设备 7其他
|
||||
private Integer isStatics;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,4 +29,10 @@ public interface ProDataUseInfoMapper {
|
|||
List<StaticsNumsBean> getApproachingAndTimeout(ProIdsBean bean);
|
||||
|
||||
List<MachineInfoBean> getApproachingDetails(ProIdsBean bean);
|
||||
|
||||
List<MachineInfoBean> getCompletionNotRefunded(ProIdsBean bean);
|
||||
|
||||
List<MachineInfoBean> getCompletionNotRefundedDetails(ProIdsBean bean);
|
||||
|
||||
List<InventoryAlertBean> getInventoryAlert(ProIdsBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.push.service;
|
||||
|
||||
import com.bonus.material.push.domain.InventoryAlertBean;
|
||||
import com.bonus.material.push.domain.ProIdsBean;
|
||||
import com.bonus.material.push.domain.MachineInfoBean;
|
||||
import com.bonus.material.push.domain.StaticsNumsBean;
|
||||
|
|
@ -20,4 +21,10 @@ public interface ProDataUseInfoService {
|
|||
List<StaticsNumsBean> getApproachingAndTimeout(ProIdsBean bean);
|
||||
|
||||
List<MachineInfoBean> getApproachingDetails(ProIdsBean bean);
|
||||
|
||||
List<MachineInfoBean> getCompletionNotRefunded(ProIdsBean bean);
|
||||
|
||||
List<MachineInfoBean> getCompletionNotRefundedDetails(ProIdsBean bean);
|
||||
|
||||
List<InventoryAlertBean> getInventoryAlert(ProIdsBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.push.service.impl;
|
||||
|
||||
import com.bonus.material.push.domain.InventoryAlertBean;
|
||||
import com.bonus.material.push.domain.MachineInfoBean;
|
||||
import com.bonus.material.push.domain.ProIdsBean;
|
||||
|
||||
|
|
@ -9,6 +10,7 @@ import com.bonus.material.push.service.ProDataUseInfoService;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -58,4 +60,19 @@ public class ProDataUseInfoImpl implements ProDataUseInfoService {
|
|||
public List<MachineInfoBean> getApproachingDetails(ProIdsBean bean) {
|
||||
return proDataUseInfoMapper.getApproachingDetails(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachineInfoBean> getCompletionNotRefunded(ProIdsBean bean) {
|
||||
return proDataUseInfoMapper.getCompletionNotRefunded(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachineInfoBean> getCompletionNotRefundedDetails(ProIdsBean bean) {
|
||||
return proDataUseInfoMapper.getCompletionNotRefundedDetails(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventoryAlertBean> getInventoryAlert(ProIdsBean bean) {
|
||||
return proDataUseInfoMapper.getInventoryAlert(bean);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,4 +137,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
GROUP BY bp.pro_id
|
||||
</select>
|
||||
<select id="getCompletionNotRefunded" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
||||
select
|
||||
bp.pro_name as proName,
|
||||
sum(sai.num) num,
|
||||
mt2.type_id as typeId,
|
||||
sd.dept_name as deptName,
|
||||
sd.dept_id
|
||||
from slt_agreement_info sai
|
||||
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 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 mt2 on mt.parent_id = mt2.type_id
|
||||
where sai.is_slt = 0 and sai.end_time is null and bp.actual_end_date is not null
|
||||
<if test="proId != null">
|
||||
AND bp.pro_id = #{proId}
|
||||
</if>
|
||||
GROUP BY bp.pro_id,bp.imp_unit
|
||||
</select>
|
||||
<select id="getCompletionNotRefundedDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
||||
select
|
||||
bp.pro_name as proName,
|
||||
sum(sai.num) num,
|
||||
mt2.type_id as typeId,
|
||||
sd.dept_name as deptName
|
||||
from slt_agreement_info sai
|
||||
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 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 mt2 on mt.parent_id = mt2.type_id
|
||||
where sai.is_slt = 0 and sai.end_time is null and bp.actual_end_date is not null
|
||||
and sd.dept_id = #{deptId}
|
||||
<if test="proId != null">
|
||||
AND bp.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName !=''">
|
||||
AND sd.dept_name like concat ('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="proCenter != null and proCenter !=''">
|
||||
AND bp.pro_center like concat ('%', #{proCenter}, '%')
|
||||
</if>
|
||||
<if test="proName != null and proName !=''">
|
||||
AND bp.pro_name like concat ('%', #{proName}, '%')
|
||||
</if>
|
||||
<if test="typeName != null and typeName !=''">
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
<if test="typeModelName != null and typeModelName !=''">
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
GROUP BY bp.pro_id,bp.imp_unit
|
||||
</select>
|
||||
<select id="getInventoryAlert" resultType="com.bonus.material.push.domain.InventoryAlertBean">
|
||||
select
|
||||
mt.type_name as typeModelName,
|
||||
mt2.type_name as typeName,
|
||||
mt.warn_num as warnNum,
|
||||
mt.storage_num as num,
|
||||
mt.warn_num - mt.storage_num as poorNum
|
||||
from ma_type mt
|
||||
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
where mt2.is_statics in (1,2,3,4,5,6,7)
|
||||
<if test="typeName != null and typeName !=''">
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue