| | |
| | | |
| | | |
| | | <build> |
| | | <finalName>xgmFlwms</finalName> |
| | | <finalName>tzglasrs</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | import org.apache.ibatis.session.ExecutorType; |
| | | import org.apache.ibatis.session.SqlSession; |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @RestController |
| | | public class StaDescController extends BaseController { |
| | | private static final Logger log = LoggerFactory.getLogger(StaDescController.class); |
| | | |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | |
| | | @RequestMapping(value = "/staDesc/init/auth") |
| | | @ManagerAuth(memo = "初始化站点路径") |
| | | public R init(StaDescInitParam param) { |
| | | SqlSession sqlSession = null; |
| | | try{ |
| | | if (param.getTypeDesc()==1){ |
| | | staDescService.delete(new EntityWrapper<>()); |
| | |
| | | String[] startStaList = param.getStartStaList().split(";"); |
| | | String[] endStaList = param.getEndStaList().split(";"); |
| | | List<StaDesc> staDescList = new ArrayList<>(); |
| | | sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH,false); |
| | | SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH,false); |
| | | StaDescMapper sqlSessionMapper = sqlSession.getMapper(StaDescMapper.class); |
| | | for (String startSta : startStaList){ |
| | | for (String endSta : endStaList){ |
| | |
| | | staDesc.setModiTime(new Date()); |
| | | staDesc.setAppeUser(getUserId()); |
| | | staDesc.setAppeTime(new Date()); |
| | | sqlSessionMapper.insert(staDesc); |
| | | // staDescList.add(staDesc); |
| | | } |
| | | } |
| | | } |
| | | sqlSession.flushStatements(); |
| | | sqlSession.clearCache(); |
| | | sqlSessionMapper.insert(staDesc); |
| | | |
| | | } |
| | | } |
| | | } |
| | | try{ |
| | | sqlSession.commit(); |
| | | sqlSession.close(); |
| | | }catch (Exception e){ |
| | | log.error("初始化站点路径异常===>sql异常:{}",e.getMessage()); |
| | | } |
| | | // staDescService.insertBatch(staDescList); |
| | | }catch (Exception e){ |
| | | return R.error(e.getMessage()); |
| | | }finally { |
| | | sqlSession.close(); |
| | | log.error("初始化站点路径异常:{}",e.getMessage()); |
| | | return R.error("初始化站点路径异常:"+e.getMessage()); |
| | | } |
| | | |
| | | return R.ok("ok1").add("ok2"); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/staDesc/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | |
| | | map.put("desc", siteId + "(全板出库口)"); |
| | | result.add(map); |
| | | } |
| | | // List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103); |
| | | // for (Integer siteId : pickOutSite) { |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // map.put("siteId", siteId); |
| | | // map.put("desc", siteId + "(拣料出库口)"); |
| | | // result.add(map); |
| | | // } |
| | | List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103); |
| | | for (Integer siteId : pickOutSite) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("siteId", siteId); |
| | | map.put("desc", siteId + "(拣料出库口)"); |
| | | result.add(map); |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_row_lastno_type") |
| | | public class RowLastnoType implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 类别 |
| | | */ |
| | | @ApiModelProperty(value= "类别") |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 规则简述 |
| | | */ |
| | | @ApiModelProperty(value= "规则简述") |
| | | @TableField("type_name") |
| | | private String typeName; |
| | | |
| | | /** |
| | | * 补充 |
| | | */ |
| | | @ApiModelProperty(value= "补充") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 创建人员 |
| | | */ |
| | | @ApiModelProperty(value= "创建人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | /** |
| | | * 库型 1: 标准堆垛机库 2: 平库 3: 穿梭板 4: 四向车 5: AGV 0: 未知 |
| | | */ |
| | | @ApiModelProperty(value= "库型 1: 标准堆垛机库 2: 平库 3: 穿梭板 4: 四向车 5: AGV 0: 未知 ") |
| | | private Integer type; |
| | | |
| | | public RowLastnoType() {} |
| | | |
| | | public RowLastnoType(Integer id,String typeName,String memo,Long modiUser,Date modiTime,Long appeUser,Date appeTime,Integer type) { |
| | | this.id = id; |
| | | this.typeName = typeName; |
| | | this.memo = memo; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | this.type = type; |
| | | } |
| | | |
| | | // RowLastnoType rowLastnoType = new RowLastnoType( |
| | | // null, // 类别[非空] |
| | | // null, // 规则简述 |
| | | // null, // 补充 |
| | | // null, // 创建人员 |
| | | // null, // 创建时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null // 库型 |
| | | // ); |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public String getType$(){ |
| | | if (null == this.type){ return null; } |
| | | switch (this.type){ |
| | | case 0: |
| | | return "标准堆垛机库"; |
| | | case 1: |
| | | return "平库"; |
| | | case 2: |
| | | return "穿梭板"; |
| | | case 3: |
| | | return "四向车"; |
| | | case 4: |
| | | return "AGV"; |
| | | case 5: |
| | | return "未知"; |
| | | default: |
| | | return String.valueOf(this.type); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.RowLastnoType; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface RowLastnoTypeService extends IService<RowLastnoType> { |
| | | |
| | | } |
| | |
| | | Date now = new Date(); |
| | | |
| | | // 无单组托 |
| | | // if (Cools.isEmpty(param.getOrderNo())) { |
| | | // |
| | | // // 生成入库通知档 |
| | | // List<DetlDto> detlDtos = new ArrayList<>(); |
| | | // param.getCombMats().forEach(elem -> { |
| | | // DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); |
| | | // if (DetlDto.has(detlDtos, detlDto)) { |
| | | // DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | // assert one != null; |
| | | // one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | // } else { |
| | | // detlDtos.add(detlDto); |
| | | // } |
| | | // }); |
| | | // |
| | | // |
| | | // for (DetlDto detlDto : detlDtos) { |
| | | // Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | // if (Cools.isEmpty(mat)) { |
| | | // throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | // } |
| | | // WaitPakin waitPakin = new WaitPakin(); |
| | | // waitPakin.sync(mat); |
| | | // waitPakin.setBatch(detlDto.getBatch()); |
| | | // waitPakin.setZpallet(param.getBarcode()); // 托盘码 |
| | | // waitPakin.setIoStatus("N"); // 入出状态 |
| | | // waitPakin.setAnfme(detlDto.getAnfme()); // 数量 |
| | | // waitPakin.setStatus("Y"); // 状态 |
| | | // waitPakin.setAppeUser(userId); |
| | | // waitPakin.setAppeTime(now); |
| | | // waitPakin.setModiUser(userId); |
| | | // waitPakin.setModiTime(now); |
| | | // if (!waitPakinService.insert(waitPakin)) { |
| | | // throw new CoolException("保存入库通知档失败"); |
| | | // } |
| | | // } |
| | | // // 关联组托 |
| | | // } else { |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | assert one != null; |
| | | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | } else { |
| | | detlDtos.add(detlDto); |
| | | } |
| | | }); |
| | | |
| | | |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | | waitPakin.setZpallet(param.getBarcode()); // 托盘码 |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | | waitPakin.setAnfme(detlDto.getAnfme()); // 数量 |
| | | waitPakin.setStatus("Y"); // 状态 |
| | | waitPakin.setAppeUser(userId); |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | } |
| | | // 关联组托 |
| | | } else { |
| | | |
| | | Order order = orderService.selectOne(new EntityWrapper<Order>().eq("temp1", param.getOrderNo())); |
| | | if (Cools.isEmpty(order) || order.getSettle() > 2) { |
| | |
| | | }); |
| | | |
| | | orderService.updateSettle(order.getId(), 2L, userId); |
| | | // } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | .eq("stn_no", param.getOutSite()) |
| | | .eq("crn_no", locMast.getCrnNo()); |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | Integer sourceStaNo = staDesc.getCrnStn(); |
| | | if (Cools.isEmpty(sourceStaNo)) { |
| | | throw new CoolException("检索源站失败"); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | throw new CoolException("不存在该空板出库路径,请更换站点"); |
| | | } |
| | | Integer sourceStaNo = staDesc.getCrnStn(); |
| | | Date now = new Date(); |
| | | // 保存工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | |
| | | return necessaryParameters; |
| | | } |
| | | |
| | | // //经典单伸库位 |
| | | // public static int[] LocNecessaryParametersDoubleExtension2(Integer whsType, Integer curRow, Integer crnNumber) { |
| | | // int[] necessaryParameters = new int[]{0, 0, 0, 0}; |
| | | // RowLastnoService rowLastnoService = SpringUtils.getBean(RowLastnoService.class); |
| | | // RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | // Integer sRow = rowLastno.getsRow(); |
| | | // Integer sCrnNo = rowLastno.getsCrnNo(); |
| | | // if (BooleanWhsTypeSta(whsType)) { |
| | | // necessaryParameters[0] = crnNumber; // 轮询次数 |
| | | // //满板正常入库 |
| | | // if (curRow.equals(crnNumber * 2 + sRow - 1)) { |
| | | // necessaryParameters[1] = sRow; //curRow 最深库位排 |
| | | // necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | // necessaryParameters[3] = sRow; //nearRow 最浅库位排 |
| | | // } else if (curRow.equals((crnNumber - 1) * 2 + sRow)) { |
| | | // necessaryParameters[1] = sRow+1; //curRow 最深库位排 |
| | | // necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | // necessaryParameters[3] = sRow+1; //nearRow 最浅库位排 |
| | | // } else { |
| | | // curRow = curRow + 2; |
| | | // if (curRow < sRow || curRow > (crnNumber * 2 + sRow - 1)) { |
| | | // throw new CoolException("库位排号异常:排号:" + curRow); |
| | | // } |
| | | // if ((curRow - sRow) % 2 == 0) { |
| | | // necessaryParameters[1] = curRow; //curRow 最深库位排 |
| | | // necessaryParameters[2] = (curRow - sRow) / 2 + sCrnNo ; //crnNo 堆垛机号 |
| | | // necessaryParameters[3] = curRow ; //nearRow 最浅库位排 |
| | | // } else if ((curRow - sRow + 1) % 2 == 0) { |
| | | // necessaryParameters[1] = curRow; //curRow 最深库位排 |
| | | // necessaryParameters[2] = (curRow - sRow - 1) / 2 + sCrnNo; //crnNo 堆垛机号 |
| | | // necessaryParameters[3] = curRow ; //nearRow 最浅库位排 |
| | | // } else { |
| | | // throw new CoolException("库位排号异常:排号:" + curRow); |
| | | // } |
| | | // } |
| | | // } |
| | | // return necessaryParameters; |
| | | // } |
| | | |
| | | //经典单伸库位 |
| | | public static int[] LocNecessaryParametersDoubleExtension2(Integer whsType, Integer curRow, Integer crnNumber) { |
| | | int[] necessaryParameters = new int[]{0, 0, 0, 0}; |
| | |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | Integer sRow = rowLastno.getsRow(); |
| | | Integer sCrnNo = rowLastno.getsCrnNo(); |
| | | |
| | | // 判断仓库类型是否满足要求 |
| | | if (BooleanWhsTypeSta(whsType)) { |
| | | necessaryParameters[0] = crnNumber; // 轮询次数 |
| | | //满板正常入库 |
| | | if (curRow.equals(crnNumber * 2 + sRow - 1)) { |
| | | necessaryParameters[1] = sRow; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = sRow; //nearRow 最浅库位排 |
| | | } else if (curRow.equals((crnNumber - 1) * 2 + sRow)) { |
| | | necessaryParameters[1] = sRow+1; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = sRow+1; //nearRow 最浅库位排 |
| | | } else { |
| | | curRow = curRow + 2; |
| | | if (curRow < sRow || curRow > (crnNumber * 2 + sRow - 1)) { |
| | | |
| | | // 计算最深库位排和最浅库位排 |
| | | int minRow = sRow; // 起始排号 |
| | | int maxRow = sRow + 7; // 终止排号 (8排) |
| | | |
| | | // 检查排号范围是否合法 |
| | | if (curRow < minRow || curRow > maxRow) { |
| | | throw new CoolException("库位排号异常:排号:" + curRow); |
| | | } |
| | | if ((curRow - sRow) % 2 == 0) { |
| | | necessaryParameters[1] = curRow; //curRow 最深库位排 |
| | | necessaryParameters[2] = (curRow - sRow) / 2 + sCrnNo ; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = curRow ; //nearRow 最浅库位排 |
| | | } else if ((curRow - sRow + 1) % 2 == 0) { |
| | | necessaryParameters[1] = curRow; //curRow 最深库位排 |
| | | necessaryParameters[2] = (curRow - sRow - 1) / 2 + sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = curRow ; //nearRow 最浅库位排 |
| | | } else { |
| | | throw new CoolException("库位排号异常:排号:" + curRow); |
| | | |
| | | // 计算堆垛机号和对应排号 |
| | | int crnOffset = (curRow - minRow) / 2; // 计算当前堆垛机偏移量 |
| | | necessaryParameters[1] = curRow; // curRow: 当前货架排号 |
| | | necessaryParameters[2] = sCrnNo + crnOffset; // crnNo: 堆垛机号 |
| | | necessaryParameters[3] = curRow; // nearRow: 当前货架排号 |
| | | } |
| | | } |
| | | } |
| | | |
| | | return necessaryParameters; |
| | | } |
| | | |
| | | |
| | | //经典单双伸库位 左单右双(小单大双) |
| | | public static int[] LocNecessaryParametersDoubleExtension3(Integer whsType, Integer curRow, Integer crnNumber) { |
| | | int[] necessaryParameters = new int[]{0, 0, 0, 0}; |
| | |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.utils.MatCompareUtils; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | private Double anfme; |
| | | |
| | | private String sPgNO; |
| | | |
| | | private String outOrderNo; |
| | | |
| | | private String luHao; |
| | | |
| | | private String packing; |
| | | |
| | | private String proType; |
| | | |
| | | |
| | | public DetlDto(LocDto locDto) { |
| | | this.matnr = locDto.getMatnr(); |
| | | this.batch = locDto.getBatch(); |
| | | this.sPgNO = locDto.getSPgNO(); |
| | | this.outOrderNo = locDto.getOutOrderNo(); |
| | | this.luHao = locDto.getLuHao(); |
| | | this.packing = locDto.getPacking(); |
| | | this.proType = locDto.getProType(); |
| | | this.orderNo = locDto.getOrderNo(); |
| | | this.anfme = locDto.getAnfme(); |
| | | |
| | | public DetlDto() { |
| | | } |
| | | |
| | | public DetlDto(String matnr, Double anfme) { |
| | | this.matnr = matnr; |
| | | this.anfme = anfme; |
| | | } |
| | | |
| | | public DetlDto(String matnr, String batch) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | } |
| | | |
| | | public DetlDto(String matnr, String batch, Double anfme) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.anfme = anfme; |
| | | } |
| | | |
| | | public DetlDto(String orderNo, String matnr, String batch, Double anfme) { |
| | | this.orderNo = orderNo; |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.anfme = anfme; |
| | | } |
| | | |
| | | public static boolean hasList(Set<DetlDto> detlDtos, OrderDetl orderDetl) { |
| | | for (DetlDto dto : detlDtos) { |
| | | boolean compare = MatCompareUtils.compare(dto, orderDetl); |
| | | if (compare) { |
| | | if (Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(orderDetl.getBatch())) { |
| | | if (dto.getMatnr().equals(orderDetl.getMatnr())) { |
| | | return true; |
| | | } |
| | | // if (Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(orderDetl.getBatch())) { |
| | | // if (dto.getMatnr().equals(orderDetl.getMatnr())) { |
| | | // return true; |
| | | // } |
| | | // } else { |
| | | // if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(orderDetl.getBatch())) { |
| | | // if (dto.getMatnr().equals(orderDetl.getMatnr()) && dto.getBatch().equals(orderDetl.getBatch())) { |
| | | // return true; |
| | | // } |
| | | // } |
| | | // } |
| | | } else { |
| | | if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(orderDetl.getBatch())) { |
| | | if (dto.getMatnr().equals(orderDetl.getMatnr()) && dto.getBatch().equals(orderDetl.getBatch())) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static boolean has(List<DetlDto> detlDtos, DetlDto detlDto) { |
| | | for (DetlDto dto : detlDtos) { |
| | | boolean compare = MatCompareUtils.compare(dto, detlDto); |
| | | if (compare) { |
| | | if (dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch())) { |
| | | return true; |
| | | } |
| | | // if (dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch())) { |
| | | // return true; |
| | | // } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static DetlDto find(List<DetlDto> detlDtos, LocDto locDto) { |
| | | if (Cools.isEmpty(locDto)) { |
| | | public static DetlDto find(List<DetlDto> detlDtos, String matnr, String batch) { |
| | | if (Cools.isEmpty(matnr)) { |
| | | return null; |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | boolean compare = MatCompareUtils.compare(detlDto, locDto); |
| | | if (compare) { |
| | | if (matnr.equals(detlDto.getMatnr()) && Cools.eq(batch, detlDto.getBatch())) { |
| | | return detlDto; |
| | | } |
| | | } |
| | |
| | | private String locNo; |
| | | |
| | | private Integer staNo; |
| | | private List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | |
| | | private List<LocDto> locDtos; |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | // public boolean isAll(){ |
| | | // // 汇总不考虑序列码 |
| | | // List<DetlDto> detlDtos = new ArrayList<>(); |
| | | // for (LocDto locDto : this.getLocDtos()) { |
| | | // DetlDto dto = new DetlDto(locDto); |
| | | // if (DetlDto.has(detlDtos, dto)) { |
| | | // DetlDto detlDto = DetlDto.find(detlDtos, locDto); |
| | | // assert detlDto != null; |
| | | // detlDto.setAnfme(detlDto.getAnfme() + locDto.getAnfme()); |
| | | // } else { |
| | | // detlDtos.add(new DetlDto(locDto)); |
| | | // } |
| | | // } |
| | | // |
| | | // // 查询当前库位号所有的库存明细 |
| | | // LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); |
| | | // List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", this.locNo)); |
| | | // if (locDetls == null || locDetls.isEmpty()){ |
| | | // throw new CoolException("检索库存明细失败,库位号=" + this.locNo); |
| | | // } |
| | | // int sameNumber = 0; |
| | | // for (LocDetl locDetl : locDetls) { |
| | | // Iterator<DetlDto> iterator = detlDtos.iterator(); |
| | | // while (iterator.hasNext()) { |
| | | // DetlDto dto = iterator.next(); |
| | | // if (!dto.getMatnr().equals(locDetl.getMatnr())) { |
| | | // continue; |
| | | // } |
| | | // if (Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(locDetl.getBatch())) { |
| | | // continue; |
| | | // } |
| | | // if (!Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(locDetl.getBatch())) { |
| | | // continue; |
| | | // } |
| | | // if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(locDetl.getBatch())) { |
| | | // if (!dto.getBatch().equals(locDetl.getBatch())) { |
| | | // continue; |
| | | // } |
| | | // } |
| | | // if (dto.getAnfme() > locDetl.getAnfme()) { |
| | | // throw new CoolException("服务器内部错误"); |
| | | // } |
| | | // if (dto.getAnfme().equals(locDetl.getAnfme())) { |
| | | // sameNumber++; |
| | | // iterator.remove(); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // return sameNumber == locDetls.size(); |
| | | // } |
| | | public boolean isAll(){ |
| | | // 汇总不考虑序列码 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | for (LocDto locDto : this.getLocDtos()) { |
| | | DetlDto dto = new DetlDto(locDto); |
| | | if (DetlDto.has(detlDtos, dto)) { |
| | | DetlDto detlDto = DetlDto.find(detlDtos, locDto); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + locDto.getAnfme()); |
| | | } else { |
| | | detlDtos.add(new DetlDto(locDto)); |
| | | } |
| | | } |
| | | |
| | | List<LocDetlDto> locDetlDtosCp = new ArrayList<>(this.locDetlDtos); |
| | | // 查询当前库位号所有的库存明细 |
| | | LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", this.locNo)); |
| | |
| | | } |
| | | int sameNumber = 0; |
| | | for (LocDetl locDetl : locDetls) { |
| | | Iterator<DetlDto> iterator = detlDtos.iterator(); |
| | | Iterator<LocDetlDto> iterator = locDetlDtosCp.iterator(); |
| | | while (iterator.hasNext()) { |
| | | DetlDto dto = iterator.next(); |
| | | if (!dto.getMatnr().equals(locDetl.getMatnr())) { |
| | | LocDetlDto next = iterator.next(); |
| | | if (!next.getLocDetl().getMatnr().equals(locDetl.getMatnr())) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(locDetl.getBatch())) { |
| | | if (!Cools.eq(next.getLocDetl().getBatch(), locDetl.getBatch())) { |
| | | continue; |
| | | } |
| | | if (!Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(locDetl.getBatch())) { |
| | | continue; |
| | | } |
| | | if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(locDetl.getBatch())) { |
| | | if (!dto.getBatch().equals(locDetl.getBatch())) { |
| | | continue; |
| | | } |
| | | } |
| | | if (dto.getAnfme() > locDetl.getAnfme()) { |
| | | if (next.getCount() > locDetl.getAnfme()) { |
| | | throw new CoolException("服务器内部错误"); |
| | | } |
| | | if (dto.getAnfme().equals(locDetl.getAnfme())) { |
| | | if (next.getCount().equals(locDetl.getAnfme())) { |
| | | sameNumber++; |
| | | iterator.remove(); |
| | | break; |
| | |
| | | if (!Cools.isEmpty(moveCrnNo) && moveCrnNo!=0){ |
| | | crnNumber = moveCrnNo; |
| | | if (times==0){ |
| | | curRow = moveCrnNo*4-1; |
| | | curRow = moveCrnNo*2-1; |
| | | }else { |
| | | curRow = moveCrnNo*4-2; |
| | | curRow = moveCrnNo*2-1; |
| | | } |
| | | } |
| | | |
| | |
| | | times++; |
| | | } |
| | | } |
| | | if (nearRow == 0) { |
| | | throw new CoolException("无可用堆垛机"); |
| | | } |
| | | // if (nearRow == 0) { |
| | | // throw new CoolException("无可用堆垛机"); |
| | | // } |
| | | |
| | | boolean signRule1 = false; |
| | | boolean signRule2 = false; |
| | |
| | | if (Utils.BooleanWhsTypeStaIoType(whsType)){ |
| | | // 靠近摆放规则 --- 同天同规格物料 //分离版 |
| | | if (!Cools.isEmpty(matnr) && staDescId == 1){ |
| | | signRule1 = true; |
| | | signRule1 = false; |
| | | } |
| | | // 靠近摆放规则 --- 同天同规格物料 //互通版 |
| | | if (!Cools.isEmpty(matnr) && staDescId == 1) { |
| | |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount*2) { |
| | | times = times + 1; |
| | | return getLocNoRun(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times); |
| | | return getLocNoRun(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo+1, locTypeDto, times); |
| | | } |
| | | // // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | // if (locTypeDto.getLocType1() < 2) { |
| | |
| | | // 检索库位 |
| | | List<String> matnrs = waitPakins.stream().map(WaitPakin::getMatnr).distinct().collect(Collectors.toList()); |
| | | List<String> batchs = waitPakins.stream().map(WaitPakin::getBatch).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(1, 1, devpNo, matnrs.get(0), batchs.get(0), null, locTypeDto); |
| | | StartupDto dto = commonService.getLocNo(2, 1, devpNo, matnrs.get(0), batchs.get(0), null, locTypeDto); |
| | | int workNo = dto.getWorkNo(); |
| | | Date now = new Date(); |
| | | // 生成工作档 |
| | |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=xgmFlasrs |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=tzglasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | |
| | | #License相关配置 |
| | | license: |
| | | subject: gdkyasrs |
| | | subject: tzglasrs |
| | | publicAlias: publicCert |
| | | storePass: public_zhongyang_123456789 |
| | | licensePath: license.lic |
| | |
| | | # 下位机配置 |
| | | wcs-slave: |
| | | # 双深 |
| | | doubleDeep: true |
| | | doubleDeep: false |
| | | # 双深库位排号 |
| | | doubleLocs: 1,4,5,8,9,12,13,16 |
| | | # 一个堆垛机负责的货架排数 |
| | |
| | | lcid: 2052 |
| | | |
| | | #ERP接口 |
| | | enabled: true |
| | | enabled: false |
| | | #enabled: false |
| | | #查看ERP中间表间隔 |
| | | refreshtime: 0/5 * * * * ? |
| | |
| | | var baseUrl = "/xgmFlwms"; |
| | | var baseUrl = "/tzglasrs"; |
| | | |
| | | // 详情窗口-高度 |
| | | var detailHeight = '80%'; |