设备点检、维修模块更新

zpl 4 years ago
parent 8eb343adde
commit e6d937ab17

@ -281,12 +281,12 @@ public class ResourceRepairTask extends Model<ResourceRepairTask> {
* *
*/ */
@TableField(exist = false) @TableField(exist = false)
private LocalDateTime compareStartTime; private String compareStartDate;
/** /**
* *
*/ */
@TableField(exist = false) @TableField(exist = false)
private LocalDateTime compareEndTime; private String compareEndDate;
/** /**
* *
*/ */
@ -387,20 +387,20 @@ public class ResourceRepairTask extends Model<ResourceRepairTask> {
this.workCenterDescription = workCenterDescription; this.workCenterDescription = workCenterDescription;
} }
public LocalDateTime getCompareStartTime() { public String getCompareStartDate() {
return compareStartTime; return compareStartDate;
} }
public void setCompareStartTime(LocalDateTime compareStartTime) { public void setCompareStartDate(String compareStartDate) {
this.compareStartTime = compareStartTime; this.compareStartDate = compareStartDate;
} }
public LocalDateTime getCompareEndTime() { public String getCompareEndDate() {
return compareEndTime; return compareEndDate;
} }
public void setCompareEndTime(LocalDateTime compareEndTime) { public void setCompareEndDate(String compareEndDate) {
this.compareEndTime = compareEndTime; this.compareEndDate = compareEndDate;
} }
public Integer getSeq() { public Integer getSeq() {

@ -200,12 +200,13 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
// 结束时间、等待时长 // 结束时间、等待时长
repairTask.setWaitEndDate(LocalDateTime.now()); repairTask.setWaitEndDate(LocalDateTime.now());
Duration betweenTime = Duration.between(repairTask.getWaitStartDate(), repairTask.getWaitEndDate()); Duration betweenTime = Duration.between(repairTask.getWaitStartDate(), repairTask.getWaitEndDate());
Long waitTime = betweenTime.toHours(); Long waitMinutes = betweenTime.toMinutes();
double v = waitTime.doubleValue(); double waitHours = waitMinutes.doubleValue()/60.00;
repairTask.setWaitTime(v); repairTask.setWaitTime(waitHours);
break; break;
} }
/*// 维修完成 /*
// 维修完成
if (status.equals("301")){ if (status.equals("301")){
// 耗用备品清单 // 耗用备品清单
List<ResourceInspectTaskSpare> spareList = resourceRepairTask.getSpareList(); List<ResourceInspectTaskSpare> spareList = resourceRepairTask.getSpareList();

@ -883,16 +883,20 @@
<!--批量获取维修任务--> <!--批量获取维修任务-->
<select id="findResourceRepairTaskList" resultType="com.foreverwin.mesnac.equip.model.ResourceRepairTask"> <select id="findResourceRepairTaskList" resultType="com.foreverwin.mesnac.equip.model.ResourceRepairTask">
SELECT DISTINCT RRT.*,R.DESCRIPTION AS RESOURCE_DESCRIPTION,R.RESRCE AS RESOURCE_NO, SELECT DISTINCT RRT.*,R.DESCRIPTION AS RESOURCE_DESCRIPTION,R.RESRCE AS RESOURCE_NO,
NCT.DESCRIPTION AS NC_CODE_DESCRIPTION,WCT.DESCRIPTION AS WORK_CENTER_DESCRIPTION NCT.DESCRIPTION AS NC_CODE_DESCRIPTION,
WCMA.WORK_CENTER_BO AS WORK_CENTER_BO,
WCT.DESCRIPTION AS WORK_CENTER_DESCRIPTION
FROM FROM
WIP.Z_RESOURCE_REPAIR_TASK RRT WIP.Z_RESOURCE_REPAIR_TASK RRT
INNER JOIN WIP.RESRCE R ON RRT.SITE = R.SITE AND R.RESRCE = RRT.RESOURCE_NO INNER JOIN WIP.RESRCE R ON RRT.SITE = R.SITE AND R.RESRCE = RRT.RESOURCE_NO
INNER JOIN WIP.NC_CODE NC ON RRT.SITE = NC.SITE AND NC.NC_CODE = RRT.NC_CODE_NO INNER JOIN WIP.NC_CODE NC ON RRT.SITE = NC.SITE AND NC.NC_CODE = RRT.NC_CODE_NO
LEFT JOIN WIP.NC_CODE_T NCT ON NCT.NC_CODE_BO = NC.HANDLE AND NCT.LOCALE = 'zh' LEFT JOIN WIP.NC_CODE_T NCT ON NCT.NC_CODE_BO = NC.HANDLE AND NCT.LOCALE = 'zh'
LEFT JOIN WIP.WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE LEFT JOIN WIP.WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCM.WORK_CENTER_BO LEFT JOIN WIP.WORK_CENTER_MEMBER WCMA ON WCMA.WORK_CENTER_OR_RESOURCE_GBO = WCM.WORK_CENTER_BO
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO
INNER JOIN WIP.RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = R.HANDLE INNER JOIN WIP.RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = R.HANDLE
WHERE RRT.SITE = #{site} WHERE RRT.SITE = #{site}
--AND WCT.LOCALE = 'zh'
<if test="resourceBo != null and resourceBo != ''"> <if test="resourceBo != null and resourceBo != ''">
AND RRT.RESOURCE_BO = #{resourceBo} AND RRT.RESOURCE_BO = #{resourceBo}
</if> </if>
@ -914,27 +918,28 @@
<if test="reportSource != null and reportSource != ''"> <if test="reportSource != null and reportSource != ''">
AND RRT.REPORT_SOURCE = #{reportSource} AND RRT.REPORT_SOURCE = #{reportSource}
</if> </if>
<if test="compareStartTime != null and compareStartTime != ''"> <if test="compareStartDate != null and compareStartDate != ''">
AND RRT.PLAN_START_DATE &gt; #{compareStartTime} AND RRT.PLAN_START_DATE &gt; TO_DATE( #{compareStartDate},'yyyy-MM-dd hh24:mi-ss' )
</if> </if>
<if test="compareEndTime != null and compareEndTime != ''"> <if test="compareEndDate != null and compareEndDate != ''">
AND RRT.PLAN_START_DATE &lt; #{compareEndTime} AND RRT.PLAN_START_DATE &lt; TO_DATE( #{compareEndDate},'yyyy-MM-dd hh24:mi-ss' )
</if> </if>
</select> </select>
<!--根据维修任务HANDLE获取维修任务详细数据--> <!--根据维修任务HANDLE获取维修任务详细数据-->
<select id="findResourceRepairTaskByHandleAndSite" resultType="com.foreverwin.mesnac.equip.model.ResourceRepairTask"> <select id="findResourceRepairTaskByHandleAndSite" resultType="com.foreverwin.mesnac.equip.model.ResourceRepairTask">
SELECT RRT.*,R.DESCRIPTION AS RESOURCE_DESCRIPTION,R.RESRCE AS RESOURCE_NO, SELECT RRT.*,R.DESCRIPTION AS RESOURCE_DESCRIPTION,R.RESRCE AS RESOURCE_NO,
NCT.DESCRIPTION AS NC_CODE_DESCRIPTION,WCT.DESCRIPTION AS WORK_CENTER_DESCRIPTION NCT.DESCRIPTION AS NC_CODE_DESCRIPTION,
WCMA.WORK_CENTER_BO AS WORK_CENTER_BO,WCT.DESCRIPTION AS WORK_CENTER_DESCRIPTION
FROM FROM
WIP.Z_RESOURCE_REPAIR_TASK RRT WIP.Z_RESOURCE_REPAIR_TASK RRT
LEFT JOIN WIP.RESRCE R ON R.RESRCE = RRT.RESOURCE_NO LEFT JOIN WIP.RESRCE R ON R.RESRCE = RRT.RESOURCE_NO AND R.SITE = RRT.SITE
LEFT JOIN WIP.NC_CODE NC ON NC.NC_CODE = RRT.NC_CODE_NO LEFT JOIN WIP.NC_CODE NC ON NC.NC_CODE = RRT.NC_CODE_NO AND NC.SITE = RRT.SITE
LEFT JOIN WIP.NC_CODE_T NCT ON NCT.NC_CODE_BO = NC.HANDLE LEFT JOIN WIP.NC_CODE_T NCT ON NCT.NC_CODE_BO = NC.HANDLE AND NC.LOCALE = 'zh'
LEFT JOIN WIP.WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE LEFT JOIN WIP.WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCM.WORK_CENTER_BO LEFT JOIN WIP.WORK_CENTER_MEMBER WCMA ON WCMA.WORK_CENTER_OR_RESOURCE_GBO = WCM.WORK_CENTER_BO
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO
INNER JOIN WIP.RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = R.HANDLE INNER JOIN WIP.RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = R.HANDLE
WHERE RRT.SITE = #{site} AND RRT.HANDLE = #{handle} WHERE RRT.SITE = #{site} AND RRT.HANDLE = #{handle}
AND R.SITE = #{site} AND NC.SITE = #{site}
</select> </select>
<!--自定义sql--> <!--自定义sql-->

Loading…
Cancel
Save