#
vincentlu
2025-04-01 b3555b47e4977e88f5a32e41e103092746357d8f
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/LocServiceImpl.java
@@ -6,11 +6,14 @@
import com.zy.acs.manager.manager.entity.Sta;
import com.zy.acs.manager.manager.entity.Task;
import com.zy.acs.manager.manager.enums.LocStsType;
import com.zy.acs.manager.manager.enums.StaStsType;
import com.zy.acs.manager.manager.enums.TaskStsType;
import com.zy.acs.manager.manager.enums.TaskTypeType;
import com.zy.acs.manager.manager.mapper.LocMapper;
import com.zy.acs.manager.manager.service.LocService;
import com.zy.acs.manager.manager.service.StaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@@ -21,6 +24,9 @@
@Slf4j
@Service("locService")
public class LocServiceImpl extends ServiceImpl<LocMapper, Loc> implements LocService {
    @Autowired
    private StaService staService;
    @Override
    public Loc selecatByLocNo(String locNo) {
@@ -80,8 +86,26 @@
                        log.error("Loc [{}] 库位修改状态失败", task.getOriLoc$());
                    }
                }
                destSta = staService.getById(task.getDestSta());
                if (destSta.getStaSts().equals(StaStsType.READY_RELEASE.val())) {
                    destSta.setStaSts(StaStsType.STOCK.val());
                    destSta.setUpdateTime(now);
                    if (!staService.updateById(destSta)) {
                        log.error("Sta [{}] 站点修改状态失败", task.getDestSta$());
                    }
                }
                break;
            case STA_TO_LOC:
                oriSta = staService.getById(task.getOriSta());
                if (oriSta.getStaSts().equals(StaStsType.READY_TAKE.val())) {
                    oriSta.setStaSts(StaStsType.IDLE.val());
                    oriSta.setUpdateTime(now);
                    if (!staService.updateById(oriSta)) {
                        log.error("Sta [{}] 站点修改状态失败", task.getOriSta$());
                    }
                }
                destLoc = this.getById(task.getDestLoc());
                if (destLoc.getLocSts().equals(LocStsType.PAKIN.val())) {
                    destLoc.setLocSts(LocStsType.STOCK.val());
@@ -92,6 +116,23 @@
                }
                break;
            case STA_TO_STA:
                oriSta = staService.getById(task.getOriSta());
                if (oriSta.getStaSts().equals(StaStsType.READY_TAKE.val())) {
                    oriSta.setStaSts(StaStsType.IDLE.val());
                    oriSta.setUpdateTime(now);
                    if (!staService.updateById(oriSta)) {
                        log.error("Sta [{}] 站点修改状态失败", task.getOriSta$());
                    }
                }
                destSta = staService.getById(task.getDestSta());
                if (destSta.getStaSts().equals(StaStsType.READY_RELEASE.val())) {
                    destSta.setStaSts(StaStsType.STOCK.val());
                    destSta.setUpdateTime(now);
                    if (!staService.updateById(destSta)) {
                        log.error("Sta [{}] 站点修改状态失败", task.getDestSta$());
                    }
                }
                break;
            case TO_CHARGE:
            case TO_STANDBY: