| | |
| | | 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; |
| | |
| | | @Slf4j |
| | | @Service("locService") |
| | | public class LocServiceImpl extends ServiceImpl<LocMapper, Loc> implements LocService { |
| | | |
| | | @Autowired |
| | | private StaService staService; |
| | | |
| | | @Override |
| | | public Loc selecatByLocNo(String locNo) { |
| | |
| | | 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()); |
| | |
| | | } |
| | | 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: |