1
zhang
1 天以前 60edff747d52eb42aadb036e3fbd580252de4c05
1
7个文件已修改
91 ■■■■ 已修改文件
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/third/ReportThirdScheduler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/third/dto/TaskEvent.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/OpenController.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/TaskReport.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/TaskService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/TaskServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -1680,6 +1680,7 @@
        }
        TaskReport taskReport = new TaskReport();
        taskReport.setAgvId(task.getAgvId());
        taskReport.setAgvNo(task.getAgvId$());
        taskReport.setBusNo(task.getBusId$());
        taskReport.setCreateTime(new Date());
        taskReport.setCompleted(0);
zy-acs-manager/src/main/java/com/zy/acs/manager/core/third/ReportThirdScheduler.java
@@ -47,7 +47,7 @@
            List<TaskReport> list = taskReportService.list(new LambdaQueryWrapper<TaskReport>().eq(TaskReport::getCompleted, 0).le(TaskReport::getReportTimes, 3));
            for (TaskReport taskReport : list) {
                log.info("开始上报:{}", taskReport);
                if (report(new TaskEvent(taskReport.getSeqNum(), taskReport.getEventType()), wmsUrl, wmsPath)) {
                if (report(new TaskEvent(taskReport.getSeqNum(), taskReport.getEventType(), taskReport.getAgvId() + ""), wmsUrl, wmsPath)) {
                    taskReport.setReportTimes((Cools.isEmpty(taskReport.getReportTimes()) ? 0 : taskReport.getReportTimes()) + 1);
                    taskReport.setUpdateTime(new Date());
                    taskReport.setCompleted(1);
zy-acs-manager/src/main/java/com/zy/acs/manager/core/third/dto/TaskEvent.java
@@ -16,8 +16,13 @@
     */
    private String eventType;
    public TaskEvent(String seqNum, String eventType) {
    private String robotCode;
    public TaskEvent(String seqNum, String eventType,String robotCode) {
        this.seqNum = seqNum;
        this.eventType = eventType;
        this.robotCode = robotCode;
    }
}
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/OpenController.java
@@ -6,11 +6,13 @@
import com.zy.acs.manager.common.annotation.OperationLog;
import com.zy.acs.manager.common.domain.BaseParam;
import com.zy.acs.manager.common.domain.PageParam;
import com.zy.acs.manager.common.domain.TaskDto;
import com.zy.acs.manager.core.constant.LocGroupConstant;
import com.zy.acs.manager.core.service.MainService;
import com.zy.acs.manager.manager.controller.param.OpenBusSubmitParam;
import com.zy.acs.manager.manager.entity.Loc;
import com.zy.acs.manager.manager.entity.Sta;
import com.zy.acs.manager.manager.entity.Task;
import com.zy.acs.manager.manager.enums.StaStsType;
import com.zy.acs.manager.manager.service.LocService;
import com.zy.acs.manager.manager.service.StaService;
@@ -24,10 +26,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by vincent on 2023/6/12
@@ -76,9 +75,42 @@
        }
        List<Boolean> data = new ArrayList<>();
        for (String id : taskIds) {
            data.add(taskService.cancel(taskService.selectBySeqNum(id).getId(), 9527L));
            data.add(taskService.cancelCheckTaskSts(taskService.selectBySeqNum(id).getId(), 9527L));
        }
        return R.ok().add(data);
    }
    @OperationLog("updateTaskPriority")
    @PostMapping("/task/updateTaskPriority")
    public R update(@RequestBody List<TaskDto> taskDtos) {
        if (Cools.isEmpty(taskDtos)) {
            return R.error("task update error");
        }
        List<Boolean> data = new ArrayList<>();
        for (TaskDto taskDto : taskDtos) {
            Task task = taskService.selectBySeqNum(taskDto.getSeqNum());
            task.setPriority(taskDto.getPriority());
            task.setUpdateBy(9527L);
            task.setUpdateTime(new Date());
            data.add(taskService.updateById(task));
        }
        return R.ok("Update Success").add(data);
    }
    @PostMapping("/loc/sync")
    @OperationLog("sync loc")
    public R loc(@RequestBody(required = false) Map<String, Object> map) {
        if (map.get("current") == null) {
            map.put("current", 1);
        }
        if (map.get("pageSize") == null) {
            map.put("pageSize", 100);
        }
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<Loc, BaseParam> pageParam = new PageParam<>(baseParam, Loc.class);
        return R.ok().add(locService.page(pageParam, pageParam.buildWrapper(true)));
    }
@@ -105,14 +137,6 @@
        return R.error("update loc fail");
    }
    //@PreAuthorize("hasAuthority('open:bus:submit')")
    @PostMapping("/loc/sync")
    @OperationLog("sync loc")
    public R loc(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<Loc, BaseParam> pageParam = new PageParam<>(baseParam, Loc.class);
        return R.ok().add(locService.page(pageParam, pageParam.buildWrapper(true)));
    }
    @PostMapping("/loc/one")
    @OperationLog("one loc")
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/TaskReport.java
@@ -53,6 +53,12 @@
     */
    @ApiModelProperty(value = "AGV")
    private Long agvId;
    /**
     * AGV
     */
    @ApiModelProperty(value = "AGV")
    private String agvNo;
    /**
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/TaskService.java
@@ -34,6 +34,8 @@
    Boolean cancel(Long taskId, Long userId);
    Boolean cancelCheckTaskSts(Long taskId, Long userId);
    Lane checkoutOriginLane(Task task);
    Lane checkoutDestinationLane(Task task);
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/TaskServiceImpl.java
@@ -134,6 +134,29 @@
    }
    @Override
    @Transactional
    public Boolean cancelCheckTaskSts(Long taskId, Long userId) {
        Task task = this.getById(taskId);
        if (null == task) {
            return Boolean.FALSE;
        }
       if ( task.getTaskSts() >= TaskStsType.ASSIGN.val()){
           throw new BusinessException("任务已分配或执行,不能取消");
       }
        this.maintainLocSts(task, Boolean.FALSE);
        task.setTaskSts(TaskStsType.CANCEL.val());
        task.setUpdateTime(new Date());
        task.setUpdateBy(userId);
        if (!this.updateById(task)) {
            throw new CoolException(BaseRes.ERROR);
        }
        busService.checkoutComplete(task.getBusId());
        return Boolean.TRUE;
    }
    @Override
    public Lane checkoutOriginLane(Task task) {
        Long codeId = null;
        TaskTypeType typeType = TaskTypeType.get(task.getTaskTypeEl());