综合查询-维修查询

This commit is contained in:
hayu 2024-04-02 17:52:06 +08:00
parent 9f030677a0
commit 91a60339bc
8 changed files with 285 additions and 72 deletions

View File

@ -0,0 +1,59 @@
package com.bonus.sgzb.material.controller;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.material.domain.BackRecord;
import com.bonus.sgzb.material.domain.RepairRecord;
import com.bonus.sgzb.material.service.BackRecordService;
import com.bonus.sgzb.material.service.RepairRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @description 综合查询--维修记录查询
* @author hay
* @date 2024/2/26 14:15
*/
@Api(tags = "综合查询--维修记录查询")
@RestController
@RequestMapping("/repairRecord")
public class RepairRecordController extends BaseController {
@Autowired
private RepairRecordService repairRecordService;
/**
* 维修记录列表
*/
@ApiOperation(value = "综合查询--维修记录列表")
@GetMapping("/getRepairRecordList")
public AjaxResult getRepairRecordList(RepairRecord bean) {
startPage();
List<RepairRecord> list = repairRecordService.getRepairRecordList(bean);
return AjaxResult.success(getDataTable(list));
}
/**
* 导出综合查询维修记录列表
*/
@ApiOperation("导出综合查询维修记录列表")
@Log(title = "导出综合查询维修记录列表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RepairRecord bean)
{
List<RepairRecord> list = repairRecordService.getRepairRecordList(bean);
ExcelUtil<RepairRecord> util = new ExcelUtil<RepairRecord>(RepairRecord.class);
util.exportExcel(response, list, "综合查询--维修记录");
}
}

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.domain; package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -90,16 +91,7 @@ public class RepairRecord implements Serializable {
*/ */
@ApiModelProperty(value = "返厂名称") @ApiModelProperty(value = "返厂名称")
private String supplier; private String supplier;
/**
* 配件数量
*/
@ApiModelProperty(value = "配件数量")
private int partNum;
/**
* 配件单价
*/
@ApiModelProperty(value = "配件单价")
private String partPrice;
/** /**
* 维修内容 * 维修内容
*/ */
@ -110,11 +102,7 @@ public class RepairRecord implements Serializable {
*/ */
@ApiModelProperty(value = "类型0不收费1收费") @ApiModelProperty(value = "类型0不收费1收费")
private String partType; private String partType;
/**
* 配件名称
*/
@ApiModelProperty(value = "配件名称")
private String partName;
/** /**
* 维修人 * 维修人
*/ */
@ -127,4 +115,75 @@ public class RepairRecord implements Serializable {
*/ */
@ApiModelProperty(value = "损坏照片id") @ApiModelProperty(value = "损坏照片id")
private String fileIds; private String fileIds;
/**
* 维修单号
*/
@Excel(name = "维修单号")
private String code;
/**
* 机具类型
*/
@Excel(name = "机具类型")
private String typeName;
/**
* 规格型号
*/
@Excel(name = "规格型号")
private String typeModelName;
/**
* 配件名称
*/
@ApiModelProperty(value = "配件名称")
@Excel(name = "配件名称")
private String partName;
/**
* 配件数量
*/
@ApiModelProperty(value = "配件数量")
@Excel(name = "配件数量",cellType = Excel.ColumnType.NUMERIC)
private int partNum;
/**
* 配件单价
*/
@ApiModelProperty(value = "配件单价")
@Excel(name = "配件单价")
private String partPrice;
/**
* 工程名称
*/
@ApiModelProperty(value = "工程名称")
@Excel(name = "退料工程")
private String proName;
/**
* 单位名称
*/
@ApiModelProperty(value = "单位名称")
@Excel(name = "退料单位")
private String unitName;
/**
* 关键字
*/
@ApiModelProperty(value = "关键字")
private String keyWord;
/**
* unitId
*/
@ApiModelProperty(value = "unitId")
private Integer unitId;
/**
* proId
*/
@ApiModelProperty(value = "proId")
private Integer proId;
} }

View File

@ -0,0 +1,27 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.material.domain.BackApplyInfo;
import com.bonus.sgzb.material.domain.BackRecord;
import com.bonus.sgzb.material.domain.RepairRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description 综合查询--维修记录查询
* @author hay
* @date 2024/2/26 14:19
*/
@Mapper
public interface RepairRecordMapper {
/**
* 综合查询--维修记录列表
* @param bean
* @return List<RepairRecord>
*/
List<RepairRecord> getRepairRecordList(RepairRecord bean);
}

View File

@ -0,0 +1,21 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.BackRecord;
import com.bonus.sgzb.material.domain.RepairRecord;
import java.util.List;
/**
* @description 综合查询--维修记录查询
* @author hay
* @date 2024/2/26 14:19
*/
public interface RepairRecordService {
/**
* 综合查询--维修记录列表
* @param bean
* @return List<RepairRecord>
*/
List<RepairRecord> getRepairRecordList(RepairRecord bean);
}

View File

@ -0,0 +1,29 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.material.domain.BackRecord;
import com.bonus.sgzb.material.domain.RepairRecord;
import com.bonus.sgzb.material.mapper.BackRecordMapper;
import com.bonus.sgzb.material.mapper.RepairRecordMapper;
import com.bonus.sgzb.material.service.BackRecordService;
import com.bonus.sgzb.material.service.RepairRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author hay
* @date 2023/12/20 14:55
*/
@Service
public class RepairRecordServiceImpl implements RepairRecordService {
@Autowired
private RepairRecordMapper repairRecordMapper;
@Override
public List<RepairRecord> getRepairRecordList(RepairRecord bean) {
return repairRecordMapper.getRepairRecordList(bean);
}
}

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.material.mapper.RepairRecordMapper">
<select id="getRepairRecordList" resultType="com.bonus.sgzb.material.domain.RepairRecord">
SELECT tt.`code`,
mt2.type_name as typeName,
mt.type_name as typeModelName,
CASE rar.repair_type
WHEN 1 THEN
mpt2.pa_name
ELSE
rar.part_name
END partName,
CASE rar.repair_type
WHEN 1 THEN
rpd.part_num
ELSE
rar.part_num
END partNum,
CASE rar.repair_type
WHEN 1 THEN
rpd.part_cost
ELSE
rar.part_price
END partPrice,
bpl.lot_name as proName,
bui.unit_name as unitName
FROM repair_apply_record rar
LEFT JOIN tm_task tt on tt.task_id = rar.task_id
LEFT JOIN ma_type mt on mt.type_id = rar.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN repair_part_details rpd on rpd.task_id = rar.task_id
and rpd.type_id = rar.type_id
and rar.repair_type = '1'
LEFT JOIN ma_part_type mpt on mpt.pa_id = rpd.part_id
LEFT JOIN ma_part_type mpt2 on mpt2.pa_id = mpt.parent_id
LEFT JOIN repair_apply_details rad on rad.task_id = rar.task_id and rad.type_id = rar.type_id
LEFT JOIN back_apply_info bai on bai.id = rad.back_id
LEFT JOIN tm_task_agreement tta on tta.task_id = bai.task_id
LEFT JOIN bm_agreement_info baif on baif.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl on bpl.lot_id = baif.project_id
LEFT JOIN bm_unit_info bui on bui.unit_id = baif.unit_id
where 1 = 1
<if test="keyWord != null and keyWord != ''">
and (tt.`code` like concat('%',#{keyWord},'%') or
mt2.type_name like concat('%',#{keyWord},'%') or
mt.type_name like concat('%',#{keyWord},'%'))
</if>
<if test="unitId != null">
and bui.unit_id = #{unitId}
</if>
<if test="proId != null">
and bpl.lot_id = #{proId}
</if>
</select>
</mapper>

View File

@ -1,10 +1,10 @@
import request from '@/utils/request' import request from '@/utils/request'
//综合查询 //综合查询
// 查询领料记录列表 // 查询维修记录列表
export function backRecord(query) { export function repairRecord(query) {
return request({ return request({
url: '/material/backRecord/getBackRecordList', url: '/material/repairRecord/getRepairRecordList',
method: 'get', method: 'get',
params: query params: query
}) })
@ -13,7 +13,7 @@ export function backRecord(query) {
// 列表导出 // 列表导出
export function exportList(params = {}){ export function exportList(params = {}){
return request({ return request({
url: '/material/backRecord/export', url: '/material/repairRecord/export',
method: 'post', method: 'post',
data: params data: params
}) })

View File

@ -1,16 +1,6 @@
<template> <template>
<div class="app-container" id="backRecord"> <div class="app-container" id="repairRecord">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="退料日期">
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="往来单位"> <el-form-item label="往来单位">
<el-select v-model="queryParams.unitId" clearable @change="GetProData" style="width: 240px" placeholder="请选择"> <el-select v-model="queryParams.unitId" clearable @change="GetProData" style="width: 240px" placeholder="请选择">
<el-option <el-option
@ -31,36 +21,6 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="协议号" prop="agreementCode">
<el-input
v-model="queryParams.agreementCode"
placeholder="请输入协议号"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="机具名称" prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="请输入机具名称"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="typeModelName">
<el-input
v-model="queryParams.typeModelName"
placeholder="请输入规格型号"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord"> <el-form-item label="关键字" prop="keyWord">
<el-input <el-input
v-model="queryParams.keyWord" v-model="queryParams.keyWord"
@ -96,13 +56,12 @@
<el-table v-loading="loading" :data="leaseAuditList"> <el-table v-loading="loading" :data="leaseAuditList">
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" /> <el-table-column label="序号" align="center" type="index" />
<el-table-column label="机具名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="维修单号" align="center" prop="code" :show-overflow-tooltip="true" />
<el-table-column label="机具规格" align="center" prop="typeModelName" :show-overflow-tooltip="true" /> <el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="退料单号" align="center" prop="code" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" /> <el-table-column label="配件名称" align="center" prop="partName" :show-overflow-tooltip="true" />
<el-table-column label="退料数量" align="center" prop="backNum" :show-overflow-tooltip="true" /> <el-table-column label="使用数量" align="center" prop="partNum" :show-overflow-tooltip="true" />
<el-table-column label="退料人" align="center" prop="backPerson" :show-overflow-tooltip="true" /> <el-table-column label="单价" align="center" prop="partPrice" :show-overflow-tooltip="true" />
<el-table-column label="退料日期" align="center" prop="createTime" :show-overflow-tooltip="true" />
<el-table-column label="退料单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> <el-table-column label="退料单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="退料工程" align="center" prop="proName" :show-overflow-tooltip="true" /> <el-table-column label="退料工程" align="center" prop="proName" :show-overflow-tooltip="true" />
</el-table> </el-table>
@ -122,10 +81,10 @@
</template> </template>
<script> <script>
import { backRecord,exportList,getUnitData,getProData } from "@/api/stquery/backRecord"; import { repairRecord,exportList,getUnitData,getProData } from "@/api/stquery/deviceFixQuery";
export default { export default {
name: "backRecord", name: "repairRecord",
dicts: ['sys_normal_disable'], dicts: ['sys_normal_disable'],
data() { data() {
return { return {
@ -186,7 +145,7 @@ export default {
pageNum: this.queryParams.pageNum pageNum: this.queryParams.pageNum
} }
const res = await backRecord(params) const res = await repairRecord(params)
this.loading = false; this.loading = false;
this.leaseAuditList = res.data.rows; this.leaseAuditList = res.data.rows;
this.total = res.data.total; this.total = res.data.total;
@ -238,9 +197,9 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('material/backRecord/export', { this.download('material/repairRecord/export', {
...this.queryParams ...this.queryParams
}, `综合查询_退料记录_${new Date().getTime()}.xlsx`) }, `综合查询_维修记录_${new Date().getTime()}.xlsx`)
} }
} }