维修审核修改
This commit is contained in:
parent
bff877e19b
commit
24c927baa2
|
|
@ -175,7 +175,6 @@ public class RepairServiceImpl implements RepairService {
|
|||
for (RepairTaskDetails details : detailsList){
|
||||
details.setCreateBy(loginUser.getUserid());
|
||||
details.setTaskId(task.getTaskId());
|
||||
details.setCompanyId(task.getCompanyId());
|
||||
mapper.addAuditDetails(details);
|
||||
}
|
||||
task.setAgreementId(agreementId);
|
||||
|
|
|
|||
|
|
@ -254,7 +254,8 @@
|
|||
type_id as typeId,
|
||||
repair_num as repairNum,
|
||||
repaired_num as repairedNum,
|
||||
scrap_num as scrapNum
|
||||
scrap_num as scrapNum,
|
||||
company_id as companyId
|
||||
from repair_apply_details
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class RepairTaskDetails {
|
|||
* 机具ID
|
||||
*/
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private String maId;
|
||||
private Long maId;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
|
|
@ -77,12 +77,14 @@ public class RepairTaskDetails {
|
|||
@ApiModelProperty(value = "维修人")
|
||||
private String repairer;
|
||||
private String keyword;
|
||||
private String typeId;
|
||||
private Long typeId;
|
||||
private Long companyId;
|
||||
private String remark;
|
||||
/**
|
||||
* 任务创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "任务创建人")
|
||||
private Long createBy;
|
||||
private Long backId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,4 +80,6 @@ public interface RepairAuditDetailsMapper
|
|||
int updateStatus(RepairAuditDetails bean);
|
||||
|
||||
int insertRepairDetails(RepairTaskDetails repairTaskDetails);
|
||||
|
||||
Long getBackId(Long repairId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
|
||||
if(repairInputList != null && repairInputList.size() > 0){
|
||||
if(repairInputList.get(0).getCompanyId() != null){
|
||||
companyId = repairInputList.get(0).getCompanyId();
|
||||
}
|
||||
|
||||
taskCode = purchaseCodeRule("R",50);
|
||||
taskStatus = 53;
|
||||
taskType = 50;
|
||||
|
|
@ -225,7 +228,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
}
|
||||
if(scrapNumList != null && scrapNumList.size() > 0){
|
||||
if(scrapNumList.get(0).getCompanyId() != null){
|
||||
companyId = scrapNumList.get(0).getCompanyId();
|
||||
}
|
||||
taskCode = purchaseCodeRule("BF",57);
|
||||
taskStatus = 58;
|
||||
taskType = 57;
|
||||
|
|
@ -276,23 +281,27 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
repairDetailList.addAll(auditAllList);
|
||||
}
|
||||
if(repairDetailList != null && repairDetailList.size() > 0){
|
||||
if (repairDetailList.get(0).getCompanyId() != null){
|
||||
companyId = repairDetailList.get(0).getCompanyId();
|
||||
}
|
||||
taskCode = purchaseCodeRule("WX",41);
|
||||
taskStatus = 42;
|
||||
taskType = 41;
|
||||
long inputTaskId = genTask(taskCode,taskType,taskStatus,tmTaskAgreement,companyId);
|
||||
for (RepairAuditDetails inputDetails : repairDetailList) {
|
||||
Long backId = repairAuditDetailsMapper.getBackId(inputDetails.getRepairId());
|
||||
// 添加驳回后维修详细表数据
|
||||
RepairTaskDetails repairTaskDetails = new RepairTaskDetails();
|
||||
repairTaskDetails.setTaskId(String.valueOf(inputTaskId));
|
||||
repairTaskDetails.setMaId(String.valueOf(inputDetails.getMaId()));
|
||||
repairTaskDetails.setTypeId(String.valueOf(inputDetails.getTypeId()));
|
||||
repairTaskDetails.setMaId(inputDetails.getMaId());
|
||||
repairTaskDetails.setTypeId(inputDetails.getTypeId());
|
||||
BigDecimal repairNum = inputDetails.getRepairNum();
|
||||
int i = repairNum.intValue(); // 直接转换
|
||||
repairTaskDetails.setRepairNum(i);
|
||||
repairTaskDetails.setStatus("0");
|
||||
repairTaskDetails.setCreateBy(SecurityUtils.getUserId());
|
||||
repairTaskDetails.setCompanyId((long) companyId);
|
||||
repairTaskDetails.setBackId(backId);
|
||||
repairAuditDetailsMapper.insertRepairDetails(repairTaskDetails);
|
||||
}
|
||||
}
|
||||
|
|
@ -309,12 +318,20 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
taskMapper.updateTmTask(tmTask);
|
||||
}
|
||||
if (scrapAudit.getAuditDetailList() != null && scrapAudit.getAuditDetailList().size() > 0){
|
||||
if (auditDetailList != null) {
|
||||
for (RepairAuditDetails bean : auditDetailList){
|
||||
bean.setAuditBy(SecurityUtils.getUserId());
|
||||
bean.setStatus(status);
|
||||
repairAuditDetailsMapper.updateStatus(bean);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
for (RepairAuditDetails bean : auditAllList){
|
||||
bean.setAuditBy(SecurityUtils.getUserId());
|
||||
bean.setStatus(status);
|
||||
repairAuditDetailsMapper.updateStatus(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
<if test="repairNum != null">
|
||||
repair_num,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
|
|
@ -144,13 +144,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
<if test="backId != null">
|
||||
back_id,
|
||||
</if>
|
||||
create_time
|
||||
|
|
@ -165,8 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
#{backNum},
|
||||
<if test="repairNum != null">
|
||||
#{repairNum},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status},
|
||||
|
|
@ -178,14 +175,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
<if test="backId != null">
|
||||
#{backId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
|
|
@ -383,5 +377,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId} and scrap_num > 0
|
||||
</select>
|
||||
<select id="getBackId" resultType="java.lang.Long">
|
||||
select back_id
|
||||
from repair_apply_details
|
||||
where id = #{repairId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue