bug修复

This commit is contained in:
mashuai 2025-04-09 17:59:38 +08:00
parent 2f3e450bae
commit b231b658ee
19 changed files with 220 additions and 61 deletions

View File

@ -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}
</select>

View File

@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or mt2.type_name like concat('%',#{keyWord},'%'))
</if>
<if test="beginTime != null and endTime != null and beginTime != '' and endTime != null">
AND m.create_time between #{beginTime} and #{endTime}
AND DATE_FORMAT(m.create_time,'%Y-%m-%d') between #{beginTime} and #{endTime}
</if>
</where>
order by m.ma_id desc

View File

@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
<if test="status != null "> and status = #{status}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectMaSupplierInfoBySupplierId" parameterType="Long" resultMap="MaSupplierInfoResult">

View File

@ -114,7 +114,8 @@ public class PurchaseAccessoryController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, PurchasePartInfo bean)
{
List<PurchasePartInfo> list = purchaseAccessoryService.exportList(bean);
//List<PurchasePartInfo> list = purchaseAccessoryService.exportList(bean);
List<PurchasePartInfo> list = purchaseAccessoryService.selectPurchasePartInfoList(bean);
ExcelUtil<PurchasePartInfo> util = new ExcelUtil<PurchasePartInfo>(PurchasePartInfo.class);
util.exportExcel(response, list, "新购配件验收数据");
}

View File

@ -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<RepairRecord> list = repairRecordService.getRepairRecordList(bean);
return AjaxResult.success(getDataTable(list));
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
/**

View File

@ -47,8 +47,8 @@ public class ReturnOfMaterialsInfoController extends BaseController {
*/
@ApiOperation(value = "获取设备信息")
@GetMapping("/getTypeList")
public AjaxResult getTypeList(String level) {
List<ReturnOfMaterialsInfo> list = returnOfMaterialsInfoService.getTypeList(level);
public AjaxResult getTypeList(ReturnOfMaterialsInfo bean) {
List<ReturnOfMaterialsInfo> list = returnOfMaterialsInfoService.getTypeList(bean);
return AjaxResult.success(list);
}

View File

@ -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;
}

View File

@ -86,4 +86,7 @@ public class ReturnOfMaterialsInfo {
@ApiModelProperty(value = "关键字")
private String keyWord;
@ApiModelProperty(value = "层级")
private String level;
}

View File

@ -145,4 +145,6 @@ public interface RepairAuditDetailsMapper
List<RepairPart> getPartRecord(RepairAuditDetails bean);
int updateRepairCost(@Param("inputDetails")RepairAuditDetails inputDetails, @Param("status") String status);
List<RepairRecord> getPartDetailsList(RepairAuditDetails bean);
}

View File

@ -24,4 +24,10 @@ public interface RepairRecordMapper {
*/
List<RepairRecord> getRepairRecordList(RepairRecord bean);
/**
* 综合查询--维修记录详情
* @param repairRecord
* @return
*/
RepairRecord selectRepairRecordByTaskId(RepairRecord repairRecord);
}

View File

@ -22,10 +22,10 @@ public interface ReturnOfMaterialsInfoMapper {
/**
* 查询
* @param level
* @param bean
* @return
*/
List<ReturnOfMaterialsInfo> getTypeList(String level);
List<ReturnOfMaterialsInfo> getTypeList(ReturnOfMaterialsInfo bean);
List<ReturnOfMaterialsInfo> getInfoListByType(@Param("level")String level, @Param("parentId")String parentId);

View File

@ -18,10 +18,10 @@ public interface ReturnOfMaterialsInfoService {
/**
* 查询
* @param level
* @param bean
* @return
*/
List<ReturnOfMaterialsInfo> getTypeList(String level);
List<ReturnOfMaterialsInfo> getTypeList(ReturnOfMaterialsInfo bean);
List<ReturnOfMaterialsInfo> getMaTypeList(String level);
List<ReturnOfMaterialsInfo> getInfoListByType(String level,String parentId);

View File

@ -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<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails) {
RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
List<RepairRecord> list = repairAuditDetailsMapper.getRepairRecord(bean);
return list;
List<RepairRecord> infoList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(list)) {
// 内部维修数据从repair_part_details查询获取
for (RepairRecord info : list) {
if ("1".equals(info.getRepairType())) {
List<RepairRecord> 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

View File

@ -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<RepairRecord> getRepairRecordList(RepairRecord bean) {
return repairRecordMapper.getRepairRecordList(bean);
List<RepairRecord> 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;
}
}

View File

@ -23,8 +23,8 @@ public class ReturnOfMaterialsInfoServiceImpl implements ReturnOfMaterialsInfoSe
}
@Override
public List<ReturnOfMaterialsInfo> getTypeList(String level) {
return returnOfMaterialsInfoMapper.getTypeList(level);
public List<ReturnOfMaterialsInfo> getTypeList(ReturnOfMaterialsInfo bean) {
return returnOfMaterialsInfoMapper.getTypeList(bean);
}
@Override

View File

@ -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,

View File

@ -467,5 +467,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from repair_apply_details
where id = #{repairId}
</select>
<select id="getPartDetailsList" resultType="com.bonus.sgzb.material.domain.RepairRecord">
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}
<if test="maId != null and maId != ''">
and rad.ma_id = #{maId}
</if>
</select>
</mapper>

View File

@ -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
<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>
ORDER BY rar.create_time DESC
</select>
<select id="selectRepairRecordByTaskId" resultType="com.bonus.sgzb.material.domain.RepairRecord">
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}
<if test="maId != null">
AND rad.ma_id = #{maId}
</if>
</select>
</mapper>

View File

@ -43,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTypeList" resultType="com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo">
SELECT type_id as typeId,type_name as typeName FROM `ma_type`
WHERE `level` = #{level}
<if test="typeId != null">
and parent_id = #{typeId}
</if>
</select>
<select id="getInfoListByType" resultType="com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo">