配件查询,在修工程

This commit is contained in:
hongchao 2025-10-10 12:12:49 +08:00
parent a94f01e29b
commit 5a5b8c609f
11 changed files with 285 additions and 12 deletions

View File

@ -61,6 +61,10 @@ public class BmProject extends BaseEntity
@Excel(name = "实施单位")
private String impUnitName;
@ApiModelProperty(value = "项目部")
@Excel(name = "项目部", width = 25)
private String departName;
@ApiModelProperty(value = "工程类型")
@Excel(name = "工程类型")
private String proType;

View File

@ -27,6 +27,14 @@ public class TeamVo {
*/
private Long id;
@ApiModelProperty(value = "分公司")
@Excel(name = "分公司")
private String impUnitName;
@ApiModelProperty(value = "项目部")
@Excel(name = "项目部", width = 25)
private String departName;
/**
* 工程名称
*/

View File

@ -268,4 +268,6 @@ public class MaterialRetainedEquipmentInfo {
@ApiModelProperty(value = "协议id")
private String agreementIds;
private String projectId;
}

View File

@ -278,7 +278,7 @@ public class SelectServiceImpl implements SelectService {
"339", "340", "341", "342", "344", "345", "346", "347",
"348", "349"
));
if (teamData == null) {
if (teamData == null && bmProject.getImpUnitName() == null) {
if (targetUnits.contains(deptId)) {
bmProject.setImpUnit(deptId);
} else {

View File

@ -437,5 +437,30 @@ public class RepairController extends BaseController {
util.exportExcel(response, list, "在修工程维修列表");
}
/**
* 获取配件查询列表--分页
*
* @param bean
* @return
*/
@ApiOperation(value = "获取配件查询列表--分页")
@GetMapping("/getPartUsingList")
public TableDataInfo getPartUsingList(PartDetails bean) {
startPage();
List<PartDetails> list = service.getPartUsingList(bean);
return getDataTable(list);
}
/**
* 导出配件查询列表
* @param response
* @param bean
*/
@ApiOperation(value = "导出配件查询列表")
@PostMapping("/exportPartUsingList")
public void exportPartUsingList(HttpServletResponse response, PartDetails bean) {
List<PartDetails> list = service.getPartUsingList(bean);
ExcelUtil<PartDetails> util = new ExcelUtil<PartDetails>(PartDetails.class);
util.exportExcel(response, list, "配件查询列表");
}
}

View File

@ -0,0 +1,137 @@
package com.bonus.material.repair.domain;
import com.bonus.common.biz.domain.BmFileInfo;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.List;
/**
* 维修配件详细对象 repair_part_details
*
* @author xsheng
* @date 2024-10-16
*/
@Data
@ToString
@Accessors(chain = true)
public class PartDetails extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID")
private Long taskId;
/**
* 机具ID
*/
@ApiModelProperty(value = "机具ID")
private Long maId;
@Excel(name = "机具编号",sort = 8)
@ApiModelProperty(value = "机具编码")
private String maCode;
@Excel(name = "维修单号",sort = 3)
@ApiModelProperty(value = "维修单号")
private String code;
/**
* 规格ID
*/
@ApiModelProperty(value = "规格ID")
private Long typeId;
@Excel(name = "物资名称",sort = 4)
@ApiModelProperty(value = "物资名称")
private String typeModelName;
@Excel(name = "规格型号",sort = 5)
@ApiModelProperty(value = "规格型号")
private String typeName;
/**
* 配件ID
*/
@ApiModelProperty(value = "配件ID")
private Long partId;
/**
* 配件数量
*/
@Excel(name = "使用数量",sort = 10)
@ApiModelProperty(value = "配件数量")
private Integer partNum;
@ApiModelProperty(value = "配件库存数量")
private Integer storageNum;
/**
* 配件费用
*/
@Excel(name = "金额(元)",sort = 12)
@ApiModelProperty(value = "配件费用")
private BigDecimal partCost;
/**
* 类型0不收费1收费
*/
private Integer partType;
@Excel(name = "配件名称",sort = 6)
@ApiModelProperty(value = "配件名称")
private String partModelName;
@Excel(name = "配件规格",sort = 7)
@ApiModelProperty(value = "配件规格型号")
private String partName;
@Excel(name = "单价(元)",sort = 11)
@ApiModelProperty(value = "配件价格")
private BigDecimal partPrice;
/**
* 设备编码状态
*/
private String maStatus;
private String keyWord;
@Excel(name = "退料单位",sort = 1)
@ApiModelProperty(value = "单位名称")
private String unitName;
@Excel(name = "退料工程",sort = 2)
@ApiModelProperty(value = "工程名称")
private String projectName;
@Excel(name = "单位",sort = 9)
@ApiModelProperty(value = "配件单位")
private String partUnit;
@ApiModelProperty(value = "单位id")
private Long unitId;
@ApiModelProperty(value = "工程id")
private Long projectId;
@ApiModelProperty(value="开始时间")
private String startTime;
@ApiModelProperty(value="结束时间")
private String endTime;
}

View File

@ -441,4 +441,6 @@ public interface RepairMapper {
* @return
*/
List<RepairProjectInfo> getRepairProjectList(RepairProjectInfo bean);
List<PartDetails> getPartUsingList(PartDetails bean);
}

View File

@ -2,10 +2,7 @@ package com.bonus.material.repair.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.repair.domain.RepairApplyRecord;
import com.bonus.material.repair.domain.RepairPartDetails;
import com.bonus.material.repair.domain.RepairTask;
import com.bonus.material.repair.domain.RepairTaskDetails;
import com.bonus.material.repair.domain.*;
import com.bonus.material.repair.domain.vo.*;
import com.bonus.system.api.domain.SysUser;
@ -166,4 +163,11 @@ public interface RepairService {
* @return
*/
List<RepairProjectInfo> getRepairProjectList(RepairProjectInfo bean);
/**
* 获取配件查询列表
* @param bean
* @return
*/
List<PartDetails> getPartUsingList(PartDetails bean);
}

View File

@ -1914,4 +1914,17 @@ public class RepairServiceImpl implements RepairService {
(item.getRepairCode() != null && item.getRepairCode().contains(keyWord)) ||
(item.getMaCode() != null && item.getMaCode().contains(keyWord));
}
/**
* 获取配件查询列表
*
* @param bean
* @return
*/
@Override
public List<PartDetails> getPartUsingList(PartDetails bean) {
return repairMapper.getPartUsingList(bean);
}
}

View File

@ -488,17 +488,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getProjectInfo" resultType="com.bonus.material.basic.domain.BmProject">
SELECT
pro_id AS proId,
pro_name AS proName,
external_id AS projectId,
imp_unit AS impUnit
bp.pro_id AS proId,
bp.pro_name AS proName,
bp.external_id AS projectId,
bp.imp_unit AS impUnit
FROM
bm_project
bm_project bp
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id
WHERE
del_flag = '0'
bp.del_flag = '0'
<if test="impUnit != null and impUnit != ''">
and imp_unit = #{impUnit}
and bp.imp_unit = #{impUnit}
</if>
<if test="impUnitName != null and impUnitName != ''">
AND sd.dept_name like concat('%',#{impUnitName},'%')
</if>
<if test="departName != null and departName != ''">
AND bp.pro_center like concat('%',#{departName},'%')
</if>
ORDER BY sd.order_num,
CASE
WHEN df.voltage_level = '其他' THEN 999 -- 其他放在最后
WHEN df.voltage_level LIKE '%kV' THEN
CASE
WHEN df.voltage_level LIKE '±%' THEN
CAST(REPLACE(REPLACE(df.voltage_level, '±', ''), 'kV', '') AS DECIMAL) + 1000 -- 直流电压特殊处理
ELSE
CAST(REPLACE(df.voltage_level, 'kV', '') AS DECIMAL)
END
ELSE 998 -- 其他未知格式
END ASC
</select>
<!-- <select id="getTeamList" resultType="com.bonus.material.common.domain.vo.SelectVo">-->
<!-- /*根据工程id查询班组*/-->

View File

@ -1541,4 +1541,62 @@
)
</update>
<select id="getPartUsingList" resultType="com.bonus.material.repair.domain.PartDetails">
select
bu.unit_name as unitName,
bp.pro_name as projectName,
tt.code as code,
mt2.type_name as typeModelName,
mt1.type_name as typeName,
mpt2.pa_name as partModelName,
mpt1.pa_name as partName,
mm.ma_code as maCode,
mpt1.unit_name as partUnit,
mpt1.buy_price as partPrice,
rpd.part_num as partNum,
rpd.part_cost as partCost,
COALESCE(su.nick_name, rpd.create_by) as createBy
from
repair_part_details rpd
left join tm_task tt on rpd.task_id = tt.task_id
left join tm_task_agreement tta on tt.task_id = tta.task_id
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
left join bm_unit bu on bu.unit_id = bai.unit_id
left join bm_project bp on bp.pro_id = bai.project_id
left join ma_type mt1 on mt1.type_id = rpd.type_id
left join ma_type mt2 on mt2.type_id = mt1.parent_id
left join ma_machine mm on mm.ma_id = rpd.ma_id
left join ma_part_type mpt1 on mpt1.pa_id = rpd.part_id
left join ma_part_type mpt2 on mpt2.pa_id = mpt1.parent_id
left join sys_user su on (
-- 判断rpd.create_by是否为数字ID如果是则关联
rpd.create_by REGEXP '^[0-9]+$'
and su.user_id = rpd.create_by
)
where rpd.part_id is not null
<if test="keyWord != null and keyWord != ''">
AND (
tt.`code` like concat('%', #{keyWord}, '%')
OR bu.unit_name like concat('%', #{keyWord}, '%')
OR bp.pro_name like concat('%', #{keyWord}, '%')
OR mt2.type_name like concat('%', #{keyWord}, '%')
OR mt1.type_name like concat('%', #{keyWord}, '%')
OR mpt2.pa_name like concat('%', #{keyWord}, '%')
OR mpt1.pa_name like concat('%', #{keyWord}, '%')
OR mm.ma_code like concat('%', #{keyWord}, '%')
OR tt.code like concat('%', #{keyWord}, '%')
)
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[AND DATE_FORMAT( rpd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
<if test="unitId != null">
AND bu.unit_id = #{unitId}
</if>
<if test="projectId != null">
AND bp.pro_id = #{projectId}
</if>
order by rpd.create_time desc
</select>
</mapper>