代码提交
This commit is contained in:
parent
8b50866190
commit
4c9133c563
|
|
@ -59,6 +59,11 @@ public class BmProjectLot {
|
|||
@Excel(name = "所属工程")
|
||||
@ApiModelProperty(value = "所属工程")
|
||||
private String ownPro;
|
||||
/**
|
||||
* 所属工程
|
||||
*/
|
||||
@ApiModelProperty(value = "所属工程")
|
||||
private String proName;
|
||||
/**
|
||||
* 所属上级
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/3/11 - 13:26
|
||||
*/
|
||||
@Data
|
||||
public class RepairContent {
|
||||
private String repairRemark;
|
||||
private String repairContent;
|
||||
|
||||
}
|
||||
|
|
@ -88,6 +88,15 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
List<RepairAuditDetails> list = repairAuditDetailsService.getRepairAuditList(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查看保养记录表
|
||||
*/
|
||||
@ApiOperation("查看修饰审核任务详细列表")
|
||||
@GetMapping("/getMaintenanceRecords")
|
||||
public AjaxResult getMaintenanceRecords(RepairAuditDetails repairAuditDetails) {
|
||||
ScrapApplyDetailsVO vo = repairAuditDetailsService.getMaintenanceRecords(repairAuditDetails);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看维修记录
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package com.bonus.sgzb.material.domain;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.FileInfo;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
|
|
@ -99,6 +101,9 @@ public class RepairAuditDetails extends BaseEntity
|
|||
private String keyword;
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "维修审核附件上传")
|
||||
private List<FileInfo> fileList;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.FileInfo;
|
||||
import com.bonus.sgzb.base.domain.RepairApplyRecord;
|
||||
import com.bonus.sgzb.base.domain.RepairContent;
|
||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||
import com.bonus.sgzb.material.domain.RepairPart;
|
||||
import com.bonus.sgzb.material.domain.RepairRecord;
|
||||
|
|
@ -149,4 +152,10 @@ public interface RepairAuditDetailsMapper
|
|||
List<String> getRepairApplyRecordId(Long repairId);
|
||||
|
||||
void updateRecodeStatus(String id);
|
||||
|
||||
ScrapApplyDetailsVO getMaintenanceRecords(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
List<RepairContent> getRepairContent(ScrapApplyDetailsVO scrapApplyDetailsVO);
|
||||
|
||||
List<FileInfo> getfileList(RepairAuditDetails auditDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,5 +97,7 @@ public interface IRepairAuditDetailsService
|
|||
List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
List<RepairPart> getPartRecord(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
ScrapApplyDetailsVO getMaintenanceRecords(RepairAuditDetails repairAuditDetails);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,12 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||
import com.bonus.sgzb.base.api.domain.FileInfo;
|
||||
import com.bonus.sgzb.base.domain.RepairApplyRecord;
|
||||
import com.bonus.sgzb.base.domain.RepairContent;
|
||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||
|
|
@ -20,6 +25,7 @@ import com.bonus.sgzb.material.vo.GlobalContants;
|
|||
import com.bonus.sgzb.material.vo.RepairAuditDetailsVO;
|
||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -49,6 +55,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
@Resource
|
||||
private RepairTestInputMapper repairTestInputMapper;
|
||||
|
||||
@Resource
|
||||
private BackReceiveMapper backReceiveMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询修试审核详细repair_apply_details
|
||||
|
|
@ -154,6 +163,26 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScrapApplyDetailsVO getMaintenanceRecords(RepairAuditDetails repairAuditDetails) {
|
||||
ScrapApplyDetailsVO scrapApplyDetailsVO = repairAuditDetailsMapper.getMaintenanceRecords(repairAuditDetails);
|
||||
if (scrapApplyDetailsVO != null) {
|
||||
// 查询技术鉴定情况和维修处理情况
|
||||
if (StringUtils.isNotBlank(scrapApplyDetailsVO.getMaId())) {
|
||||
List<RepairContent> records = new ArrayList<>();
|
||||
for (String s : scrapApplyDetailsVO.getMaId().split(",")) {
|
||||
scrapApplyDetailsVO.setMaId(s);
|
||||
records.addAll(repairAuditDetailsMapper.getRepairContent(scrapApplyDetailsVO));
|
||||
}
|
||||
scrapApplyDetailsVO.setRecords(records);
|
||||
} else {
|
||||
List<RepairContent> repairContent = repairAuditDetailsMapper.getRepairContent(scrapApplyDetailsVO);
|
||||
scrapApplyDetailsVO.setRecords(repairContent);
|
||||
}
|
||||
}
|
||||
return scrapApplyDetailsVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param repairAuditDetails
|
||||
* @return
|
||||
|
|
@ -161,6 +190,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
@Override
|
||||
public List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails) {
|
||||
List<RepairAuditDetails> repairAuditDetailsList = repairAuditDetailsMapper.selectRepairAuditDetailsList(repairAuditDetails);
|
||||
for (RepairAuditDetails auditDetails : repairAuditDetailsList) {
|
||||
List<FileInfo> fileList= repairAuditDetailsMapper.getfileList(auditDetails);
|
||||
auditDetails.setFileList(fileList);
|
||||
}
|
||||
return repairAuditDetailsList;
|
||||
}
|
||||
|
||||
|
|
@ -175,6 +208,22 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
public int auditRepair(ScrapAudit scrapAudit) throws Exception {
|
||||
String checkResult = scrapAudit.getCheckResult();
|
||||
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
|
||||
for (RepairAuditDetails repairAuditDetails : auditDetailList) {
|
||||
// 添加附件
|
||||
List<FileInfo> fileList = repairAuditDetails.getFileList();
|
||||
if (fileList != null) {
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
fileInfo.setModelId(repairAuditDetails.getTaskId());
|
||||
fileInfo.setTypeId(fileInfo.getTypeId());
|
||||
if (fileInfo.getMaId() != null) {
|
||||
fileInfo.setMaId(fileInfo.getMaId());
|
||||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
||||
Integer b = 0;
|
||||
for (Long taskId : taskIdList) {
|
||||
|
|
@ -206,6 +255,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// 批量审核
|
||||
// 获取维修列表
|
||||
repairInputList = repairAuditDetailsMapper.selectRepairInputByTaskId(taskId);
|
||||
//获取维修报废列表
|
||||
scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
|
||||
|
|
@ -221,8 +272,6 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
taskType = 50;
|
||||
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
for (RepairAuditDetails inputDetails : repairInputList) {
|
||||
Long typeId = inputDetails.getTypeId();
|
||||
Long maId = inputDetails.getMaId();
|
||||
Integer repairNum = inputDetails.getRepairedNum();
|
||||
// 创建修饰后入库任务
|
||||
if (repairNum.compareTo(b) > 0) {
|
||||
|
|
@ -392,7 +441,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
|
||||
|
||||
/**采购单号编码生成规则*/
|
||||
/**
|
||||
* 采购单号编码生成规则
|
||||
*/
|
||||
private String purchaseCodeRule(String code, Integer taskType) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.bonus.sgzb.material.vo;
|
||||
|
||||
import com.bonus.sgzb.base.domain.RepairContent;
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.material.domain.ScrapAuditorSet;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
|
@ -19,6 +22,12 @@ public class ScrapApplyDetailsVO {
|
|||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
private Integer typeId;
|
||||
private String maId;
|
||||
/**
|
||||
* 维修任务id
|
||||
*/
|
||||
private Long repairTaskId;
|
||||
|
||||
/**
|
||||
* 报废审核单号
|
||||
|
|
@ -31,6 +40,10 @@ public class ScrapApplyDetailsVO {
|
|||
*/
|
||||
@Excel(name = "单位名称",sort = 2)
|
||||
private String unitName;
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String checkMan;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
|
|
@ -59,6 +72,10 @@ public class ScrapApplyDetailsVO {
|
|||
*/
|
||||
@Excel(name = "维修单号",sort = 6)
|
||||
private String repairNum;
|
||||
/**
|
||||
* 维修前备注
|
||||
*/
|
||||
private String repairRemark;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
|
|
@ -118,6 +135,14 @@ public class ScrapApplyDetailsVO {
|
|||
* 处置
|
||||
*/
|
||||
private Integer disposition;
|
||||
/**
|
||||
* 维修合格数量
|
||||
*/
|
||||
private Integer repairedNum;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private String auditTime;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
|
|
@ -128,4 +153,8 @@ public class ScrapApplyDetailsVO {
|
|||
* 文件名称
|
||||
*/
|
||||
private String dispositionFileName;
|
||||
/**
|
||||
* 维修记录文档备注
|
||||
*/
|
||||
private List<RepairContent> records;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.vo;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.FileInfo;
|
||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
|
|||
|
|
@ -1102,6 +1102,7 @@
|
|||
LEFT JOIN sys_user su on mtk.user_id = su.user_id
|
||||
WHERE
|
||||
lad.parennt_id = #{id}
|
||||
and mt.is_storage = 1
|
||||
<if test="userId != 1">
|
||||
and mtk.user_id = #{userId}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -46,8 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<!--<include refid="bmProjectInfo"/>-->
|
||||
select a.lot_id, a.pro_id, a.lot_name, a.status, a.type_id, a.link_man, a.telphone, a.own_pro, a.dept_id, a.is_share,
|
||||
a.lon, a.lat, a.del_flag, a.create_by, a.create_time,a.remark,a.company_id ,b.dept_name, c.name,a.cost_indicators,
|
||||
a.longitude, a.latitude, a.address, a.province,a.details_address,a.completion_date,a.start_date
|
||||
a.longitude, a.latitude, a.address, a.province,a.details_address,a.completion_date,a.start_date,bpi.pro_name
|
||||
from bm_project_lot a
|
||||
left join bm_project_info bpi on a.pro_id = bpi.pro_id
|
||||
left join sys_dept b on a.dept_id = b.dept_id
|
||||
left join sys_dic c on a.type_id = c.id
|
||||
where a.del_flag ='0'
|
||||
|
|
@ -237,7 +238,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="lotName != null and lotName != ''">lot_name = #{lotName},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="typeId != null and typeId != ''">type_id = #{typeId},</if>
|
||||
<if test="ownPro != null and ownPro != '' ">own_pro = #{ownPro},</if>
|
||||
<if test="proId != null and proId != '' ">pro_id = #{proId},</if>
|
||||
<if test="linkMan != null and linkMan != ''">link_man = #{linkMan},</if>
|
||||
<if test="telphone != null and telphone != ''">telphone = #{telphone},</if>
|
||||
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
|
||||
|
|
|
|||
|
|
@ -469,5 +469,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
rc.repair_id = #{repairId}
|
||||
</select>
|
||||
<select id="getMaintenanceRecords" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
|
||||
SELECT
|
||||
tk.task_id taskId,
|
||||
tk.CODE repairCode,
|
||||
bui.unit_name unitName,
|
||||
bpl.lot_name projectName,
|
||||
su.nick_name createBy,
|
||||
su1.nick_name as checkMan,
|
||||
rad.type_id,
|
||||
mt.type_name,
|
||||
mt1.type_name type,
|
||||
GROUP_CONCAT(rad.ma_id) as maId,
|
||||
rad.repaired_num,
|
||||
rad.audit_time,
|
||||
mm.ma_code,
|
||||
GROUP_CONCAT(COALESCE(mm.ma_code, ''), '-', COALESCE(rd.repair_remark, '')) AS repairRemark,
|
||||
rd.task_id repairTaskId
|
||||
FROM
|
||||
tm_task tk
|
||||
LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
|
||||
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
|
||||
LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id
|
||||
LEFT JOIN repair_apply_details rd ON rad.repair_id = rd.id
|
||||
LEFT JOIN ma_type mt ON rad.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_machine mm ON mt.type_id = mm.type_id
|
||||
AND rad.ma_id = mm.ma_id
|
||||
LEFT JOIN sys_user su ON su.user_id = tk.create_by
|
||||
LEFT JOIN sys_user su1 ON su1.user_id = rad.audit_by
|
||||
WHERE
|
||||
tk.task_type = 45
|
||||
AND tk.task_id = #{taskId}
|
||||
AND rad.repaired_num > 0
|
||||
GROUP BY rad.type_id
|
||||
ORDER BY
|
||||
tk.create_time DESC
|
||||
</select>
|
||||
<select id="getRepairContent" resultType="com.bonus.sgzb.base.domain.RepairContent">
|
||||
SELECT
|
||||
CONCAT(COALESCE ( mm.ma_code, '' ),COALESCE ( rar.repair_remark, '' )) as repairRemark,
|
||||
CONCAT(
|
||||
COALESCE ( mm.ma_code, '' ),
|
||||
COALESCE ( mpt.pa_name, '' ),
|
||||
COALESCE ( rar.repair_content, '' )) AS repairContent
|
||||
FROM
|
||||
repair_apply_record rar
|
||||
left join repair_part_details rpd on rar.part_id = rpd.part_id
|
||||
left join ma_part_type mpt ON mpt.pa_id = rpd.part_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = rar.ma_id
|
||||
WHERE
|
||||
rar.task_id = #{repairTaskId} and rar.type_id = #{typeId}
|
||||
<if test="maId != null">
|
||||
and rar.ma_id = #{maId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getfileList" resultType="com.bonus.sgzb.base.api.domain.FileInfo">
|
||||
SELECT
|
||||
fi.*
|
||||
FROM
|
||||
sys_file_info fi
|
||||
WHERE
|
||||
fi.model_id = #{taskId}
|
||||
and fi.type_id = #{typeId}
|
||||
<if test="maId != null">
|
||||
and fi.ma_id = #{maId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue