Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit 5303fa0e7a

@ -159,6 +159,7 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
List<String> list = new ArrayList<>();
list.add("CJZR");
list.add("ADMINISTRATORS");
list.add("CJDD");
callItem.setCallType(Constants.CALL_TYPE_MATERIAL);
Integer cnt = userGroupMapper.findUserGroupByUser(site, user, list);
if (cnt > 0){

@ -175,7 +175,7 @@ public class ResourceInspectPlanController {
try {
resourceInspectPlanService.deleteInspectionPlanByHandle(resourceInspectPlan);
} catch (Exception e) {
R.failed("计划删除失败:" + e.getMessage());
return R.failed("计划删除失败:" + e.getMessage());
}
return R.ok();
}

@ -106,6 +106,12 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
returnStatus = true;
resourceInspectPlan.setStatus("401");
}else{
ResourceInspectTask resourceInspectTask = new ResourceInspectTask();
resourceInspectTask.setResourceInspectPlanBo(planHandle.getHandle());
List<ResourceInspectTask> resourceInspectTasks = resourceInspectTaskService.selectList(resourceInspectTask);
if (!planHandle.getScheduleType().equals(resourceInspectPlan.getScheduleType()) && resourceInspectTasks.size() > 0){
throw BusinessException.build("已创建任务的点检计划,不能修改排程方式!");
}
// 保留创建人员和创建时间
String createUser = planHandle.getCreateUser();
LocalDateTime createdDateTime = planHandle.getCreatedDateTime();
@ -209,6 +215,12 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
if (inspectPlanById == null){
throw BusinessException.build("点检计划删除失败!");
}
ResourceInspectTask resourceInspectTask = new ResourceInspectTask();
resourceInspectTask.setResourceInspectPlanBo(inspectPlanById.getHandle());
List<ResourceInspectTask> resourceInspectTasks = resourceInspectTaskService.selectList(resourceInspectTask);
if (resourceInspectTasks != null && resourceInspectTasks.size() > 0){
throw BusinessException.build("当前计划已创建任务,不允许删除!");
}
// 设备清单表数据删除
ResourceInspectResource resourceInspectResource = new ResourceInspectResource();
resourceInspectResource.setResourceInspectPlanBo(handle);
@ -294,6 +306,9 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
resourceInspectTaskList.add(equipInspectTask);
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
if (taskCreateDate.isAfter(indateEnd)){
break;
}
taskNum--;
}
}else{
@ -307,12 +322,18 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
resourceInspectTaskList.add(equipInspectTask);
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
if (taskCreateDate.isAfter(indateEnd)){
break;
}
}
}else {
while (taskCreateDate.isBefore(createdDateTime)){
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
}
for (int i = 0;i < taskNum;i++){
if (taskCreateDate.isAfter(indateEnd)){
break;
}
resourceInspectTask.setTaskCreateDate(taskCreateDate);
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
resourceInspectTaskList.add(equipInspectTask);

@ -231,9 +231,10 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl<ResourceInspectT
LocalDateTime compareEnd = compareStart.plusDays(1);
resourceInspectTaskDto.setCompareStartDate(compareStart.toString().substring(0,16).replace('T',' '));
resourceInspectTaskDto.setCompareEndDate(compareEnd.toString().substring(0,16).replace('T',' '));
resourceInspectTaskDto.setCategory("DM");
// 获取当日任务的handle
List<ResourceInspectTaskDto> resourceInspectTaskList = resourceInspectTaskMapper.findResourceInspectTaskList(resourceInspectTaskDto);
if (resourceInspectTaskList.size() == 1){
if (resourceInspectTaskList.size() > 0 ){
ResourceInspectTask resourceInspectTask = new ResourceInspectTask();
resourceInspectTask.setHandle(resourceInspectTaskList.get(0).getHandle());
ResourceInspectTask resourceInspectTaskAll = resourceInspectTaskService.getResourceInspectTaskAll(resourceInspectTask);
@ -241,9 +242,9 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl<ResourceInspectT
return resourceInspectTaskAll;
}
// 获取任务详情
if (resourceInspectTaskList.size() > 1){
/*if (resourceInspectTaskList.size() > 1){
throw BusinessException.build("当前设备当日点检任务不止一个!");
}
}*/
throw BusinessException.build("未找到当日的点检任务!");
}

@ -660,6 +660,7 @@
WHERE
(ZG.USER_GROUP_BO IS NULL OR (ZG.USER_GROUP_BO IS NOT NULL AND UGM.USER_OR_GROUP_GBO = #{currentUser}))
AND RIK.SITE = #{site}
AND TASK_CREATE_DATE &lt;= (SELECT TO_DATE(TO_CHAR(SYSDATE+1,'yyyy-mm-dd') || ' 00:00:00','yyyy-MM-dd hh24:mi-ss') -8/24 FROM DUAL)
<if test="taskNo != null and taskNo != ''">
AND RIK.TASK_NO = #{taskNo}
</if>
@ -687,7 +688,7 @@
<if test="workCenter != null and workCenter != ''">
AND WCM.WORK_CENTER_BO = #{workCenter}
</if>
ORDER BY RIK.TASK_NO ASC
ORDER BY RIK.TASK_CREATE_DATE DESC
</select>
<!--自定义sql条件查询根据检验计划handle及设备handle获取最新的创建任务时间-->
@ -711,9 +712,13 @@
<select id="getInspectTaskList" resultType="com.foreverwin.mesnac.equip.model.ResourceInspectTask">
SELECT * FROM WIP.Z_RESOURCE_INSPECT_TASK ZRIT
WHERE ZRIT.SITE = #{site}
AND ZRIT.RESOURCE_INSPECT_PLAN_BO = #{resourceInspectPlanBo}
AND ZRIT.RESRCE = #{resrce}
AND ZRIT.STATUS IN ('DOING','NEW')
AND ZRIT.STATUS IN ('DOING','NEW')
<if test="resourceInspectPlanBo != null and resourceInspectPlanBo != ''">
AND ZRIT.RESOURCE_INSPECT_PLAN_BO = #{resourceInspectPlanBo}
</if>
<if test="resrce != null and resrce != ''">
AND ZRIT.resrce = #{resrce}
</if>
</select>
<!--自定义sql-->

@ -160,7 +160,7 @@
</select>
<select id="resourceCheck" resultType="java.lang.Integer">
SELECT count(HANDLE) FROM Z_RESOURCE_INSPECT_TASK zrit WHERE site=#{site} and RESRCE=#{resrce} AND CATEGORY='DM' AND STATUS='COMPLETE' AND "RESULT"='OK' AND CREATED_DATE_TIME>=#{dateTime}
SELECT count(HANDLE) FROM Z_RESOURCE_INSPECT_TASK zrit WHERE site=#{site} and RESRCE=#{resrce} AND CATEGORY='DM' AND STATUS='COMPLETE' AND "RESULT"='OK' AND TASK_CREATE_DATE>=#{dateTime}
</select>
<select id="getInfoBySfc" resultType="com.foreverwin.mesnac.meapi.dto.SfcDto">

Loading…
Cancel
Save