| | |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.TaskInParam; |
| | | import com.vincent.rsf.server.api.entity.dto.InTaskMsgDto; |
| | | import com.vincent.rsf.server.api.entity.dto.LocTypeDto; |
| | | import com.vincent.rsf.server.manager.entity.DeviceBind; |
| | | import com.vincent.rsf.server.manager.entity.Loc; |
| | | import com.vincent.rsf.server.manager.service.DeviceBindService; |
| | | import com.vincent.rsf.server.manager.service.LocService; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.LocStsType; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.RegEx; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | public class LocUtils { |
| | | |
| | | public static final Logger logger = LoggerFactory.getLogger(LocUtils.class); |
| | | |
| | | private static List<Integer> doubleLocs; |
| | | |
| | | private static Boolean isDoubleDeep; |
| | | |
| | | @Autowired |
| | | private SlaveProperties slavePropertie; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | doubleLocs = slavePropertie.getDoubleLocs(); |
| | | isDoubleDeep = slavePropertie.isDoubleDeep(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取 浅库位对应的深库位号 |
| | |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | LocService locService = SpringUtils.getBean(LocService.class); |
| | | Loc depLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, deepLoc)); |
| | | int row = depLoc.getRow()-1; |
| | | int row; |
| | | if (depLoc.getRow() != 1) { |
| | | row = depLoc.getRow()-1; |
| | | } else { |
| | | row = depLoc.getRow(); |
| | | } |
| | | boolean contains = slaveProperties.getDoubleLocs().contains(row); |
| | | Loc shallowLoc = null; |
| | | if (!contains) { |
| | |
| | | |
| | | //库位排号分配 |
| | | public static int[] LocNecessaryParameters(DeviceBind deviceBind, Integer curRow, Integer crnNumber) { |
| | | |
| | | return LocNecessaryParametersDoubleExtension(curRow, crnNumber); //已完善 |
| | | |
| | | |
| | | } |
| | | |
| | | //经典双伸库位 |
| | | //经典双伸库位, 获取双深排 |
| | | public static int[] LocNecessaryParametersDoubleExtension( Integer curRow, Integer crnNumber) { |
| | | int[] necessaryParameters = new int[]{0, 0, 0, 0}; |
| | | |
| | |
| | | return dto.getLocType1().equals(Integer.parseInt(loc.getType())); |
| | | } |
| | | |
| | | public static String getCrnLoc() { |
| | | SlaveProperties bean = SpringUtils.getBean(SlaveProperties.class); |
| | | System.out.println(bean.getDoubleLocs()); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public static String zerofill(String msg, Integer count) { |
| | | if (msg.length() == count) { |
| | | return msg; |