diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml
index c46f5745..0e3faea1 100644
--- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml
+++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml
@@ -1460,15 +1460,13 @@
WHEN 0 THEN
IFNULL( subquery0.num, 0 ) ELSE IFNULL( mt.num, 0 )
END AS num,
- subquery0.typeName,
- subquery0.typeModelName as modelName
+ mt1.type_name AS typeName,
+ mt.type_name AS modelName
FROM
ma_type mt
LEFT JOIN (
SELECT
- mt.type_id,
- mt2.type_name AS typeName,
- mt.type_name AS typeModelName,
+ mt.type_id type_id,
count( mm.ma_id ) num
FROM
ma_machine mm
@@ -1480,6 +1478,7 @@
GROUP BY
mt.type_id
) AS subquery0 ON subquery0.type_id = mt.type_id
+ LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
WHERE
mt.type_id = #{typeId}
diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml
index da794c5e..da9f62b3 100644
--- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml
+++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or mt2.type_name like concat('%',#{keyWord},'%'))
- AND m.create_time between #{beginTime} and #{endTime}
+ AND DATE_FORMAT(m.create_time,'%Y-%m-%d') between #{beginTime} and #{endTime}
order by m.ma_id desc
diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml
index b68ca5ee..9d8a5747 100644
--- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml
+++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml
@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and company_id = #{companyId}
and status = #{status}
+ ORDER BY create_time DESC
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseAccessoryController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseAccessoryController.java
index 5d968199..a4fa384c 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseAccessoryController.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseAccessoryController.java
@@ -114,7 +114,8 @@ public class PurchaseAccessoryController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, PurchasePartInfo bean)
{
- List list = purchaseAccessoryService.exportList(bean);
+ //List list = purchaseAccessoryService.exportList(bean);
+ List list = purchaseAccessoryService.selectPurchasePartInfoList(bean);
ExcelUtil util = new ExcelUtil(PurchasePartInfo.class);
util.exportExcel(response, list, "新购配件验收数据");
}
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairRecordController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairRecordController.java
index 421e6502..3b239a4f 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairRecordController.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairRecordController.java
@@ -1,13 +1,14 @@
package com.bonus.sgzb.material.controller;
+import cn.hutool.core.convert.Convert;
+import com.bonus.sgzb.common.core.utils.ListPagingUtil;
+import com.bonus.sgzb.common.core.utils.ServletUtils;
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;
@@ -38,9 +39,10 @@ public class RepairRecordController extends BaseController {
@ApiOperation(value = "综合查询--维修记录列表")
@GetMapping("/getRepairRecordList")
public AjaxResult getRepairRecordList(RepairRecord bean) {
- startPage();
+ Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
List list = repairRecordService.getRepairRecordList(bean);
- return AjaxResult.success(getDataTable(list));
+ return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
/**
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java
index 83a73fd6..d67614d2 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java
@@ -47,8 +47,8 @@ public class ReturnOfMaterialsInfoController extends BaseController {
*/
@ApiOperation(value = "获取设备信息")
@GetMapping("/getTypeList")
- public AjaxResult getTypeList(String level) {
- List list = returnOfMaterialsInfoService.getTypeList(level);
+ public AjaxResult getTypeList(ReturnOfMaterialsInfo bean) {
+ List list = returnOfMaterialsInfoService.getTypeList(bean);
return AjaxResult.success(list);
}
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchasePartInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchasePartInfo.java
index 1dab06e4..4a9ee0bb 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchasePartInfo.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchasePartInfo.java
@@ -2,10 +2,12 @@ package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
+import java.util.Date;
import java.util.List;
/**
@@ -13,7 +15,7 @@ import java.util.List;
* @author hay
* @date 2024/1/16 13:52
*/
-public class PurchasePartInfo extends BaseEntity
+public class PurchasePartInfo
{
private static final long serialVersionUID = 1L;
@@ -45,12 +47,12 @@ public class PurchasePartInfo extends BaseEntity
/** 采购机具设备名称 */
@ApiModelProperty(value = "采购机具设备")
- @Excel(name = "配件名称")
+ @Excel(name = "采购配件")
private String purchasingTypeName;
/** 采购机具设备型号 */
@ApiModelProperty(value = "规格型号")
- @Excel(name = "配件规格")
+ //@Excel(name = "配件规格")
private String purchasingTypeCode;
/** 采购员名称 */
@@ -64,17 +66,17 @@ public class PurchasePartInfo extends BaseEntity
/** 采购单价 */
@ApiModelProperty(value = "采购单价")
- @Excel(name = "采购单价")
+ //@Excel(name = "采购单价")
private String purchasePrice;
/** 采购数量 */
@ApiModelProperty(value = "采购数量")
- @Excel(name = "采购数量")
+ //@Excel(name = "采购数量")
private String purchaseNum;
/** 配件厂家 */
@ApiModelProperty(value = "配件厂家")
- @Excel(name = "配件厂家")
+ //@Excel(name = "配件厂家")
private String supplier;
/** 验收数量 */
@@ -83,7 +85,7 @@ public class PurchasePartInfo extends BaseEntity
/** 采购状态 */
@ApiModelProperty(value = "采购状态")
- @Excel(name = "状态")
+ @Excel(name = "采购状态")
private String purchasingStatus;
/** 入库人员 */
@@ -142,6 +144,74 @@ public class PurchasePartInfo extends BaseEntity
private Integer taskStatus;
private String keyWord;
+ /** 创建者 */
+ private String createBy;
+
+ /** 创建时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /** 更新者 */
+ private String updateBy;
+
+ /** 更新时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+
+ /** 备注 */
+ @Excel(name = "备注")
+ private String remark;
+
+ public String getCreateBy()
+ {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy)
+ {
+ this.createBy = createBy;
+ }
+
+ public Date getCreateTime()
+ {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime)
+ {
+ this.createTime = createTime;
+ }
+
+ public String getUpdateBy()
+ {
+ return updateBy;
+ }
+
+ public void setUpdateBy(String updateBy)
+ {
+ this.updateBy = updateBy;
+ }
+
+ public Date getUpdateTime()
+ {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime)
+ {
+ this.updateTime = updateTime;
+ }
+
+ public String getRemark()
+ {
+ return remark;
+ }
+
+ public void setRemark(String remark)
+ {
+ this.remark = remark;
+ }
+
public Long getId() {
return id;
}
@@ -155,34 +225,34 @@ public class PurchasePartInfo extends BaseEntity
this.taskId = taskId;
}
- public Long getTaskId()
+ public Long getTaskId()
{
return taskId;
}
- public void setPurchaseTime(String purchaseTime)
+ public void setPurchaseTime(String purchaseTime)
{
this.purchaseTime = purchaseTime;
}
- public String getPurchaseTime()
+ public String getPurchaseTime()
{
return purchaseTime;
}
- public void setArrivalTime(String arrivalTime)
+ public void setArrivalTime(String arrivalTime)
{
this.arrivalTime = arrivalTime;
}
- public String getArrivalTime()
+ public String getArrivalTime()
{
return arrivalTime;
}
- public void setPurchaser(Long purchaser)
+ public void setPurchaser(Long purchaser)
{
this.purchaser = purchaser;
}
- public Long getPurchaser()
+ public Long getPurchaser()
{
return purchaser;
}
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ReturnOfMaterialsInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ReturnOfMaterialsInfo.java
index 5d0f0955..2446ccca 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ReturnOfMaterialsInfo.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ReturnOfMaterialsInfo.java
@@ -86,4 +86,7 @@ public class ReturnOfMaterialsInfo {
@ApiModelProperty(value = "关键字")
private String keyWord;
+ @ApiModelProperty(value = "层级")
+ private String level;
+
}
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairAuditDetailsMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairAuditDetailsMapper.java
index 7573f386..03eba880 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairAuditDetailsMapper.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairAuditDetailsMapper.java
@@ -145,4 +145,6 @@ public interface RepairAuditDetailsMapper
List getPartRecord(RepairAuditDetails bean);
int updateRepairCost(@Param("inputDetails")RepairAuditDetails inputDetails, @Param("status") String status);
+
+ List getPartDetailsList(RepairAuditDetails bean);
}
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairRecordMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairRecordMapper.java
index c60abeda..1c47cef4 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairRecordMapper.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/RepairRecordMapper.java
@@ -24,4 +24,10 @@ public interface RepairRecordMapper {
*/
List getRepairRecordList(RepairRecord bean);
+ /**
+ * 综合查询--维修记录详情
+ * @param repairRecord
+ * @return
+ */
+ RepairRecord selectRepairRecordByTaskId(RepairRecord repairRecord);
}
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ReturnOfMaterialsInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ReturnOfMaterialsInfoMapper.java
index a117a196..aac4ae2b 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ReturnOfMaterialsInfoMapper.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ReturnOfMaterialsInfoMapper.java
@@ -22,10 +22,10 @@ public interface ReturnOfMaterialsInfoMapper {
/**
* 查询
- * @param level
+ * @param bean
* @return
*/
- List getTypeList(String level);
+ List getTypeList(ReturnOfMaterialsInfo bean);
List getInfoListByType(@Param("level")String level, @Param("parentId")String parentId);
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/ReturnOfMaterialsInfoService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/ReturnOfMaterialsInfoService.java
index 900ab78d..b09448bc 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/ReturnOfMaterialsInfoService.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/ReturnOfMaterialsInfoService.java
@@ -18,10 +18,10 @@ public interface ReturnOfMaterialsInfoService {
/**
* 查询
- * @param level
+ * @param bean
* @return
*/
- List getTypeList(String level);
+ List getTypeList(ReturnOfMaterialsInfo bean);
List getMaTypeList(String level);
List getInfoListByType(String level,String parentId);
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java
index 893996a8..af4afc52 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java
@@ -6,6 +6,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import com.alibaba.nacos.common.utils.CollectionUtils;
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
@@ -164,7 +165,26 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
public List getRepairRecord(RepairAuditDetails repairAuditDetails) {
RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
List list = repairAuditDetailsMapper.getRepairRecord(bean);
- return list;
+ List infoList = new ArrayList<>();
+ if (CollectionUtils.isNotEmpty(list)) {
+ // 内部维修数据从repair_part_details查询获取
+ for (RepairRecord info : list) {
+ if ("1".equals(info.getRepairType())) {
+ List partDetailsList = repairAuditDetailsMapper.getPartDetailsList(bean);
+ if (CollectionUtils.isNotEmpty(partDetailsList)) {
+ for (RepairRecord repairRecord : partDetailsList) {
+ repairRecord.setRepairer(StringUtils.isNotBlank(info.getRepairer()) ? info.getRepairer() : null);
+ repairRecord.setRepairNum(info.getRepairNum());
+ repairRecord.setRepairType(info.getRepairType());
+ }
+ }
+ infoList.addAll(partDetailsList);
+ } else {
+ infoList.add(info);
+ }
+ }
+ }
+ return infoList;
}
@Override
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java
index 1f79b313..86542865 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java
@@ -1,15 +1,15 @@
package com.bonus.sgzb.material.service.impl;
-import com.bonus.sgzb.material.domain.BackRecord;
+import com.alibaba.nacos.common.utils.CollectionUtils;
+import com.alibaba.nacos.common.utils.StringUtils;
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;
+import java.util.stream.Collectors;
/**
* @author hay
@@ -24,6 +24,34 @@ public class RepairRecordServiceImpl implements RepairRecordService {
@Override
public List getRepairRecordList(RepairRecord bean) {
- return repairRecordMapper.getRepairRecordList(bean);
+ List list = repairRecordMapper.getRepairRecordList(bean);
+ if (CollectionUtils.isNotEmpty(list)) {
+ for (RepairRecord repairRecord : list) {
+ // 根据查询信息查询单位和工程相关信息
+ RepairRecord info = repairRecordMapper.selectRepairRecordByTaskId(repairRecord);
+ if (info != null) {
+ repairRecord.setUnitName(info.getUnitName());
+ repairRecord.setProName(info.getProName());
+ repairRecord.setProId(info.getProId());
+ repairRecord.setUnitId(info.getUnitId());
+ }
+ }
+ if (bean.getUnitId() != null) {
+ // 将list集合中的单位id与查询条件单位id进行比较,如果相同则返回该条数据
+ list = list.stream().filter(item -> item.getUnitId().equals(bean.getUnitId())).collect(Collectors.toList());
+ }
+ if (bean.getProId() != null) {
+ // 将list集合中的工程id与查询条件工程id进行比较,如果相同则返回该条数据
+ list = list.stream().filter(item -> item.getProId().equals(bean.getProId())).collect(Collectors.toList());
+ }
+ if (bean.getKeyWord() != null) {
+ // 将list集合中的关键字与查询条件关键字进行比较,如果相同则返回该条数据
+ list = list.stream().filter(item -> StringUtils.isNotBlank(item.getCode()) && item.getCode().contains(bean.getKeyWord()) ||
+ StringUtils.isNotBlank(item.getTypeName()) && item.getTypeName().contains(bean.getKeyWord()) ||
+ StringUtils.isNotBlank(item.getTypeModelName()) && item.getTypeModelName().contains(bean.getKeyWord()) ||
+ StringUtils.isNotBlank(item.getPartName()) && item.getPartName().contains(bean.getKeyWord())).collect(Collectors.toList());
+ }
+ }
+ return list;
}
}
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ReturnOfMaterialsInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ReturnOfMaterialsInfoServiceImpl.java
index 3ffeacae..25cee519 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ReturnOfMaterialsInfoServiceImpl.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ReturnOfMaterialsInfoServiceImpl.java
@@ -23,8 +23,8 @@ public class ReturnOfMaterialsInfoServiceImpl implements ReturnOfMaterialsInfoSe
}
@Override
- public List getTypeList(String level) {
- return returnOfMaterialsInfoMapper.getTypeList(level);
+ public List getTypeList(ReturnOfMaterialsInfo bean) {
+ return returnOfMaterialsInfoMapper.getTypeList(bean);
}
@Override
diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseAccessoryMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseAccessoryMapper.xml
index b8b0fc9a..8113ec68 100644
--- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseAccessoryMapper.xml
+++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseAccessoryMapper.xml
@@ -370,7 +370,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ppi.arrival_time as arrivalTime,
mpt2.pa_name as purchasingTypeName,
mpt.pa_name as purchasingTypeCode,
- su.user_name purchaserName,
+ su.nick_name purchaserName,
ppd.purchase_price as purchasePrice,
ppd.purchase_num as purchaseNum,
msi.supplier,
diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairAuditDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairAuditDetailsMapper.xml
index 4fed9f44..1525d057 100644
--- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairAuditDetailsMapper.xml
+++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairAuditDetailsMapper.xml
@@ -467,5 +467,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from repair_apply_details
where id = #{repairId}
-
+
+ SELECT
+ rad.repair_content AS repairContent,
+ concat( mpt2.pa_name, '-', mpt1.pa_name, '-', mpt.pa_name ) AS partName,
+ rad.part_num AS partNum,
+ rad.part_cost AS partPrice,
+ rad.part_type AS partType
+ FROM
+ repair_part_details rad
+ LEFT JOIN ma_part_type mpt ON mpt.pa_id = rad.part_id
+ and mpt.del_flag = '0'
+ LEFT JOIN ma_part_type mpt1 ON mpt.parent_id = mpt1.pa_id
+ and mpt1.del_flag = '0'
+ LEFT JOIN ma_part_type mpt2 ON mpt2.pa_id = mpt1.parent_id
+ and mpt2.del_flag = '0'
+ WHERE rad.task_id = #{taskId} and rad.type_id = #{typeId}
+
+ and rad.ma_id = #{maId}
+
+
+
\ No newline at end of file
diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml
index e6f540f8..ccae1406 100644
--- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml
+++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml
@@ -25,35 +25,39 @@
ELSE
rar.part_price
END partPrice,
- bpl.lot_name as proName,
- bui.unit_name as unitName
+ rar.task_id as taskId,
+ rar.type_id as typeId,
+ rar.ma_id as maId
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 rpd.type_id = rar.type_id and rar.ma_id = rpd.ma_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
-
- and (tt.`code` like concat('%',#{keyWord},'%') or
- mt2.type_name like concat('%',#{keyWord},'%') or
- mt.type_name like concat('%',#{keyWord},'%'))
-
-
- and bui.unit_id = #{unitId}
-
-
- and bpl.lot_id = #{proId}
-
+ ORDER BY rar.create_time DESC
+
+
+ SELECT
+ bpl.lot_id AS proId,
+ bui.unit_id AS unitId,
+ bpl.lot_name AS proName,
+ bui.unit_name AS unitName
+ FROM
+ repair_apply_details rad
+ 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
+ rad.task_id = #{taskId}
+ AND rad.type_id = #{typeId}
+
+ AND rad.ma_id = #{maId}
+
\ No newline at end of file
diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml
index ec548ac1..51540ea7 100644
--- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml
+++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml
@@ -43,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT type_id as typeId,type_name as typeName FROM `ma_type`
WHERE `level` = #{level}
+
+ and parent_id = #{typeId}
+