#
vincentlu
8 天以前 efabc6ba991acfd01d38bb0bf4e8cfd772416617
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/TaskServiceImpl.java
@@ -98,7 +98,7 @@
        if (null == task) {
            return Boolean.FALSE;
        }
        this.maintainLocSts(task, Boolean.TRUE);
        this.maintainLocAndStaHandler(task, Boolean.TRUE);
        task.setTaskSts(TaskStsType.COMPLETE.val());
        task.setUpdateTime(new Date());
@@ -117,7 +117,7 @@
        if (null == task) {
            return Boolean.FALSE;
        }
        this.maintainLocSts(task, Boolean.FALSE);
        this.maintainLocAndStaHandler(task, Boolean.FALSE);
        task.setTaskSts(TaskStsType.CANCEL.val());
        task.setUpdateTime(new Date());
@@ -300,7 +300,7 @@
    @Transactional
    public void maintainLocSts(Task task, Boolean complete) {
    public void maintainLocAndStaHandler(Task task, Boolean complete) {
        Loc oriLoc = null; Loc destLoc = null;
        Sta oriSta = null; Sta destSta = null;
        Date now = new Date();
@@ -331,18 +331,18 @@
                }
                destSta = staService.getById(task.getDestSta());
                destSta.setStaSts(complete?StaStsType.STOCK.val():StaStsType.IDLE.val());
                destSta.setUpdateTime(now);
                if (!staService.updateById(destSta)) {
                    throw new BusinessException("Sta [" + destSta.getStaNo() + "] 站点修改状态失败 !!!");
                if (complete) {
                    staReserveService.confirmStaReserve(destSta, task, 1, StaReserveType.IN);
                } else {
                    staReserveService.cancelStaReserve(destSta, task, 1, StaReserveType.IN);
                }
                break;
            case STA_TO_LOC:
                oriSta = staService.getById(task.getOriSta());
                oriSta.setStaSts(complete?StaStsType.IDLE.val():StaStsType.STOCK.val());
                oriSta.setUpdateTime(now);
                if (!staService.updateById(oriSta)) {
                    throw new BusinessException("Sta [" + oriSta.getStaNo() + "] 站点修改状态失败 !!!");
                if (complete) {
                    staReserveService.confirmStaReserve(oriSta, task, 1, StaReserveType.OUT);
                } else {
                    staReserveService.cancelStaReserve(oriSta, task, 1, StaReserveType.OUT);
                }
                destLoc = locService.getById(task.getDestLoc());
@@ -354,17 +354,17 @@
                break;
            case STA_TO_STA:
                oriSta = staService.getById(task.getOriSta());
                oriSta.setStaSts(complete?StaStsType.IDLE.val():StaStsType.STOCK.val());
                oriSta.setUpdateTime(now);
                if (!staService.updateById(oriSta)) {
                    throw new BusinessException("Sta [" + oriSta.getStaNo() + "] 站点修改状态失败 !!!");
                if (complete) {
                    staReserveService.confirmStaReserve(oriSta, task, 1, StaReserveType.OUT);
                } else {
                    staReserveService.cancelStaReserve(oriSta, task, 1, StaReserveType.OUT);
                }
                destSta = staService.getById(task.getDestSta());
                destSta.setStaSts(complete?StaStsType.STOCK.val():StaStsType.IDLE.val());
                destSta.setUpdateTime(now);
                if (!staService.updateById(destSta)) {
                    throw new BusinessException("Sta [" + destSta.getStaNo() + "] 站点修改状态失败 !!!");
                if (complete) {
                    staReserveService.confirmStaReserve(destSta, task, 1, StaReserveType.IN);
                } else {
                    staReserveService.cancelStaReserve(destSta, task, 1, StaReserveType.IN);
                }
                break;
            case TO_CHARGE: