bug修复

This commit is contained in:
mashuai 2025-03-28 15:57:12 +08:00
parent c0efe840d5
commit a19a79ecdd
9 changed files with 99 additions and 6 deletions

View File

@ -162,4 +162,13 @@ public interface TmTaskMapper {
String getParentNameById(Integer ctParentId);
String getAscriptionTypeByTypeId(TmTask tmTask);
/**
* 根据任务id获取任务协议id
* @param taskId
* @return
*/
String getLeaseInfoId(String taskId);
int deleteDetailsById(String id);
}

View File

@ -1014,9 +1014,16 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
public AjaxResult deleteByPrimaryKey(String taskId) {
// 根据taskId查询lease_apply_info的id
String id = tmTaskMapper.getLeaseInfoId(taskId);
int i = tmTaskMapper.deleteTaskByPrimaryKey(taskId);
int j = tmTaskMapper.deleteTaskInfoByTaskId(taskId);
int m = tmTaskMapper.deleteTaskAgreementByTaskId(taskId);
// 根据id 删除lease_apply_details表
int n = tmTaskMapper.deleteDetailsById(id);
if (n < 0) {
return AjaxResult.error("删除失败,lease_apply_details表数据未删除!");
}
if (i == 1 && j == 1 && m == 1) {
return AjaxResult.success("删除成功");
} else if (i < 1 || j < 1 || m < 1) {

View File

@ -27,6 +27,9 @@ public class RepairAuditDetails extends BaseEntity
/** $column.columnComment */
private Long id;
@ApiModelProperty(value = "配件id")
private Long partId;
/** 任务ID */
@Excel(name = "任务ID")
private Long taskId;

View File

@ -141,6 +141,9 @@ public class RepairRecord implements Serializable {
@Excel(name = "配件名称")
private String partName;
@ApiModelProperty(value = "配件id")
private Long partId;
/**
* 配件数量
*/

View File

@ -158,4 +158,8 @@ public interface RepairAuditDetailsMapper
List<RepairContent> getRepairContent(ScrapApplyDetailsVO scrapApplyDetailsVO);
List<FileInfo> getfileList(RepairAuditDetails auditDetails);
List<RepairPart> getRepairPartIdList(RepairAuditDetails repairAuditDetails);
List<RepairPart> getRepairCost(RepairAuditDetails repairAuditDetails);
}

View File

@ -156,11 +156,19 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
return list;
}
/**
* 查看配件记录
* @param repairAuditDetails
* @return
*/
@Override
public List<RepairPart> getPartRecord(RepairAuditDetails repairAuditDetails) {
RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
List<RepairPart> list = repairAuditDetailsMapper.getPartRecord(bean);
return list;
/*RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
List<RepairPart> list = repairAuditDetailsMapper.getPartRecord(bean);*/
if (repairAuditDetails.getPartId() != null && repairAuditDetails.getId() != null) {
return repairAuditDetailsMapper.getRepairPartIdList(repairAuditDetails);
}
return repairAuditDetailsMapper.getRepairCost(repairAuditDetails);
}
@Override

View File

@ -39,14 +39,39 @@
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByTaskIdAndCompId" resultType="com.bonus.sgzb.app.domain.LeaseApplyInfo">
select *
select
id as id,
code as code,
task_id as taskId,
lease_person as leasePerson,
phone as phone,
`type` as type,
company_audit_by as companyAuditBy,
company_audit_time as companyAuditTime,
company_audit_remark as companyAuditRemark,
dept_audit_by as deptAuditBy,
dept_audit_time as deptAuditTime,
dept_audit_remark as deptAuditRemark, create_by as createBy, create_time as createTime,
update_by as updateBy, update_time as updateTime, remark as remark, company_id as companyId
from lease_apply_info
where task_id = #{taskId}
and company_id = #{companyId}
</select>
<select id="selectByTaskIdAndCompIdCq" resultType="com.bonus.sgzb.app.domain.LeaseApplyInfo">
SELECT
*
id as id,
code as code,
task_id as taskId,
lease_person as leasePerson,
phone as phone,
`type` as type,
company_audit_by as companyAuditBy,
company_audit_time as companyAuditTime,
company_audit_remark as companyAuditRemark,
dept_audit_by as deptAuditBy,
dept_audit_time as deptAuditTime,
dept_audit_remark as deptAuditRemark, create_by as createBy, create_time as createTime,
update_by as updateBy, update_time as updateTime, remark as remark, company_id as companyId
FROM
lease_apply_info
WHERE

View File

@ -74,6 +74,9 @@
<delete id="deleteTaskAgreementByTaskId">
delete from tm_task_agreement where task_id = #{taskId}
</delete>
<delete id="deleteDetailsById">
delete from lease_apply_details where parennt_id = #{id}
</delete>
<insert id="insert" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.app.domain.TmTask" useGeneratedKeys="true">
insert into tm_task (task_type, task_status, code, create_by, create_time, update_by, update_time, remark, company_id)
@ -1334,4 +1337,7 @@
<select id="getAscriptionTypeByTypeId" resultType="java.lang.String">
select whole_type_name from ma_whole_set where parent_id = #{typeId} and ascription_type = 1 limit 1
</select>
<select id="getLeaseInfoId" resultType="java.lang.String">
select id from lease_apply_info where task_id = #{taskId}
</select>
</mapper>

View File

@ -436,7 +436,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
part_name as partName,
file_ids as fileIds,
su.nick_name as repairer,
rar.remark
rar.remark as remark,
rar.id as id,
rar.part_id as partId
from repair_apply_record rar
left join ma_supplier_info msi on msi.supplier_id = rar.supplier_id
left join sys_user su on su.user_id = rar.repairer
@ -538,5 +540,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and fi.ma_id = #{maId}
</if>
</select>
<select id="getRepairPartIdList" resultType="com.bonus.sgzb.material.domain.RepairPart">
SELECT
concat( mpt2.pa_name, '-', mpt1.pa_name, '-', mpt.pa_name ) AS partName,
IFNULL( rar.part_num, 0 ) AS partNum,
IFNULL( rar.part_num, 0 ) * IFNULL( rar.part_price, 0 ) AS partCost,
rar.repair_remark AS remark
FROM
repair_apply_record rar
LEFT JOIN ma_part_type mpt ON mpt.pa_id = rar.part_id
LEFT JOIN ma_part_type mpt1 ON mpt1.pa_id = mpt.parent_id
LEFT JOIN ma_part_type mpt2 ON mpt2.pa_id = mpt1.parent_id
WHERE
rar.id = #{id}
</select>
<select id="getRepairCost" resultType="com.bonus.sgzb.material.domain.RepairPart">
SELECT
part_name AS partName,
IFNULL( part_num, 0 ) AS partNum,
IFNULL( part_num, 0 ) * IFNULL( part_price, 0 ) AS partCost,
repair_remark AS remark
FROM
repair_apply_record
WHERE
id = #{id}
</select>
</mapper>