| | |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | private LocDetlMapper locDetlMapper; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Autowired |
| | | private LocOwnerService locOwnerService; |
| | |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | if (entry.getKey().equals("locNo")) { |
| | | wrapper.like("loc_no", String.valueOf(entry.getValue())); |
| | | if (entry.getKey().equals("locNo") || entry.getKey().equals("loc_no")) { |
| | | List<String> locNos = locMastService.selectLocNosByNoOrAlias(String.valueOf(entry.getValue())); |
| | | if (locNos.isEmpty()) { |
| | | wrapper.eq("loc_no", "__NO_MATCH__"); |
| | | } else { |
| | | wrapper.in("loc_no", locNos); |
| | | } |
| | | } else { |
| | | wrapper.like(entry.getKey(), String.valueOf(entry.getValue())); |
| | | } |
| | |
| | | import com.zy.asrs.entity.param.LocMastInitParam; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | if (entry.getKey().equals("loc_type1")){ |
| | | sign=true; |
| | | } |
| | | wrapper.like(entry.getKey(), val); |
| | | if (entry.getKey().equals("loc_no")){ |
| | | wrapper.andNew().like("loc_no", val).or().like("loc_alias", val); |
| | | } else if (entry.getKey().equals("area_id")) { |
| | | wrapper.eq(entry.getKey(), val); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | if (sign){ |
| | |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setAppeUser(getUserId()); |
| | | locMast.setAppeTime(new Date()); |
| | | locMastService.prepareAreaAlias(locMast); |
| | | locMastService.insert(locMast); |
| | | return R.ok(); |
| | | } |
| | |
| | | } |
| | | |
| | | LocMast oldLocMast = locMastService.selectById(locMast.getLocNo()); |
| | | if (locMast.getAreaId() == null && oldLocMast != null) { |
| | | locMast.setAreaId(oldLocMast.getAreaId()); |
| | | } |
| | | if (locMast.getFrozen() == null && oldLocMast != null) { |
| | | locMast.setFrozen(oldLocMast.getFrozen()); |
| | | } |
| | | if (locMast.getFrozenMemo() == null && oldLocMast != null) { |
| | | locMast.setFrozenMemo(oldLocMast.getFrozenMemo()); |
| | | } |
| | | if (locMast.getLocSts().equals("F") && (oldLocMast.getLocSts().equals("D") || oldLocMast.getLocSts().equals("O"))) { |
| | | return R.error("当前操作已被阻止,请联系管理员"); |
| | | } |
| | |
| | | } |
| | | locMast.setModiUser(getUserId()); |
| | | locMast.setModiTime(now); |
| | | locMastService.prepareAreaAlias(locMast); |
| | | AdjDetl adjDetl = new AdjDetl(); |
| | | adjDetl.setLocNo(locMast.getLocNo()); |
| | | adjDetl.setMatnr("原库位状态:" + oldLocMast.getLocSts()); |
| | |
| | | throw new CoolException("库位调整记录失败"); |
| | | } |
| | | // 库位冻结->冻结所有库存 |
| | | if (locMast.getFrozen() == 1 && oldLocMast.getFrozen() == 0 && locMast.getLocSts().equals("F") && oldLocMast.getLocSts().equals("F")) { |
| | | if (Integer.valueOf(1).equals(locMast.getFrozen()) |
| | | && Integer.valueOf(0).equals(oldLocMast.getFrozen()) |
| | | && locMast.getLocSts().equals("F") |
| | | && oldLocMast.getLocSts().equals("F")) { |
| | | locDetlMapper.updateDetlFrozenByLocNo(oldLocMast.getLocNo()); |
| | | } |
| | | if(!locMastService.updateById(locMast)) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/locMast/batch/area/auth") |
| | | @ManagerAuth(memo = "批量修改库区") |
| | | public R batchArea(@RequestBody JSONObject param) { |
| | | if (Cools.isEmpty(param) || Cools.isEmpty(param.getJSONArray("locNos"))) { |
| | | return R.error("请选择库位"); |
| | | } |
| | | List<String> locNos = JSONObject.parseArray(param.getJSONArray("locNos").toJSONString(), String.class); |
| | | Integer areaId = param.getInteger("areaId"); |
| | | locMastService.batchUpdateArea(locNos, areaId, getUserId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("loc_no", condition); |
| | | wrapper.andNew().like("loc_no", condition).or().like("loc_alias", condition); |
| | | Page<LocMast> page = locMastService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (LocMast locMast : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", locMast.getLocNo()); |
| | | map.put("value", locMast.getLocNo()); |
| | | map.put("value", LocAliasUtils.displayLocNo(locMast)); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | } |
| | | } |
| | | } |
| | | locMastService.fillAreaAlias(list); |
| | | if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1){ |
| | | locMastService.delete(new EntityWrapper<>()); |
| | | } |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/wrkMast/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | if (entry.getKey().equals("loc_no") || entry.getKey().equals("source_loc_no")) { |
| | | List<String> locNos = locMastService.selectLocNosByNoOrAlias(val); |
| | | if (locNos.isEmpty()) { |
| | | wrapper.eq(entry.getKey(), "__NO_MATCH__"); |
| | | } else { |
| | | wrapper.in(entry.getKey(), locNos); |
| | | } |
| | | } else if (entry.getKey().equals("area_id")) { |
| | | wrapper.eq(entry.getKey(), val); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.asrs.service.BasWrkStatusService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import lombok.Data; |
| | |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)) { |
| | | return String.valueOf(locMast.getLocNo()); |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return null; |
| | | return this.locNo; |
| | | } |
| | | |
| | | public String getSourceLocNo$() { |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.sourceLocNo); |
| | | if (!Cools.isEmpty(locMast)) { |
| | | return String.valueOf(locMast.getLocNo()); |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return null; |
| | | return this.sourceLocNo; |
| | | } |
| | | |
| | | public String getIoTime$() { |
| | |
| | | import com.zy.asrs.service.BasQualityTestingService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | |
| | | private Integer frozen; |
| | | |
| | | public String getLocNo$(){ |
| | | return getLocAlias(); |
| | | } |
| | | |
| | | public String getLocAlias(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return null; |
| | | return this.locNo; |
| | | } |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.zy.asrs.service.BasLocStsService; |
| | | import com.zy.asrs.service.BasWhsService; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import com.core.common.Cools; |
| | |
| | | @ApiModelProperty(value= "堆垛机号") |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | /** |
| | | * 库区:1=A区,2=B区,3=C区 |
| | | */ |
| | | @ApiModelProperty(value= "库区") |
| | | @TableField("area_id") |
| | | private Integer areaId; |
| | | |
| | | /** |
| | | * 库位别名 |
| | | */ |
| | | @ApiModelProperty(value= "库位别名") |
| | | @TableField("loc_alias") |
| | | private String locAlias; |
| | | |
| | | /** |
| | | * 排 |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String getAreaId$() { |
| | | return LocAliasUtils.areaName(this.areaId); |
| | | } |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.asrs.service.NodeService; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import com.zy.system.entity.Host; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.HostService; |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return this.locNo; |
| | | } |
| | | |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | | LocOwner locOwner = service.selectById(this.owner); |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import com.core.common.Cools; |
| | |
| | | @ApiModelProperty(value= "堆垛机") |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | /** |
| | | * 库区:1=A区,2=B区,3=C区 |
| | | */ |
| | | @ApiModelProperty(value= "库区") |
| | | @TableField("area_id") |
| | | private Integer areaId; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("sheet_no") |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String getAreaId$(){ |
| | | return LocAliasUtils.areaName(this.areaId); |
| | | } |
| | | |
| | | public String getWrkDate$(){ |
| | | if (Cools.isEmpty(this.wrkDate)){ |
| | | return ""; |
| | |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return null; |
| | | return this.locNo; |
| | | } |
| | | |
| | | public String getStaNo$(){ |
| | |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.sourceLocNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return null; |
| | | return this.sourceLocNo; |
| | | } |
| | | |
| | | public String getIoTime$(){ |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import com.core.common.Cools; |
| | |
| | | @ApiModelProperty(value= "堆垛机号") |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | /** |
| | | * 库区:1=A区,2=B区,3=C区 |
| | | */ |
| | | @ApiModelProperty(value= "库区") |
| | | @TableField("area_id") |
| | | private Integer areaId; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("sheet_no") |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String getAreaId$(){ |
| | | return LocAliasUtils.areaName(this.areaId); |
| | | } |
| | | |
| | | public String getWrkDate$(){ |
| | | if (Cools.isEmpty(this.wrkDate)){ |
| | | return ""; |
| | |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return null; |
| | | return this.locNo; |
| | | } |
| | | |
| | | public String getStaNo$(){ |
| | |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.sourceLocNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | return LocAliasUtils.displayLocNo(locMast); |
| | | } |
| | | return null; |
| | | return this.sourceLocNo; |
| | | } |
| | | |
| | | public String getIoTime$(){ |
| | |
| | | @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and loc_type1 = #{locType1} and crn_no = #{crnNo}") |
| | | Integer selectEmptyLocCount(@Param("locType1") Short locType1, @Param("crnNo") Integer crnNo,@Param("whsType") Long whsType); |
| | | |
| | | @Select("select min(row1) from asr_loc_mast where area_id = #{areaId}") |
| | | Integer selectMinRowByArea(@Param("areaId") Integer areaId); |
| | | |
| | | List<LocMast> queryShallowLocFMast(@Param("crnNo") Integer crnNo,@Param("whsType") Long whsType); |
| | | |
| | | List<LocMast> selectLocShuttleMoveUnilateralY(@Param("bay")Integer bay,@Param("lev")Integer lev,@Param("whsType") Long whsType); |
| | |
| | | public interface WrkMastLogMapper extends BaseMapper<WrkMastLog> { |
| | | |
| | | @Insert("INSERT INTO asr_wrk_mast_log (" + |
| | | "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " + |
| | | "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, area_id, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " + |
| | | "picking, link_mis, online_yn, upd_mk, exit_mk, plt_type, batch_seq, empty_mk, io_time, ctn_type, packed, ove_mk, mtn_type, user_no, crn_str_time, " + |
| | | "crn_end_time, plc_str_time, crn_pos_time, load_time, exp_time, cost_time, ref_wrkno, ref_iotime, modi_user, modi_time, appe_user, appe_time, pause_mk, " + |
| | | "error_time, error_memo, ctn_kind, manu_type, memo_m, sc_weight, log_mk, log_err_time, log_err_memo, barcode, Pdc_type, container_no, teu, plate_no, train_no, freq_type, cube_number, ctn_no, full_plt, pre_have, take_none) " + |
| | | "SELECT " + |
| | | "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " + |
| | | "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, area_id, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " + |
| | | "picking, link_mis, online_yn, upd_mk, exit_mk, plt_type, batch_seq, empty_mk, io_time, ctn_type, packed, ove_mk, mtn_type, user_no, crn_str_time, " + |
| | | "crn_end_time, plc_str_time, crn_pos_time, load_time, exp_time, DATEDIFF(MINUTE, appe_time, GETDATE()), ref_wrkno, ref_iotime, modi_user, modi_time, appe_user, appe_time, pause_mk, " + |
| | | "error_time, error_memo, ctn_kind, manu_type, memo, sc_weight, log_mk, log_err_time, log_err_memo, barcode, Pdc_type, container_no, teu, plate_no, train_no, freq_type, cube_number, ctn_no, full_plt, pre_have, take_none " + |
| | |
| | | List<LocMast> asrLocMastNotInDetl2(); |
| | | List<LocMast> asrLocMastNotInDetl3(); |
| | | List<ErrorDeviceParam> adjacentLocMast(); |
| | | |
| | | /** |
| | | * 按库区和库位坐标补齐单个库位别名。 |
| | | */ |
| | | void prepareAreaAlias(LocMast locMast); |
| | | |
| | | /** |
| | | * 按列表内的库区最小排批量补齐库位别名,主要用于初始化。 |
| | | */ |
| | | void fillAreaAlias(List<LocMast> locMasts); |
| | | |
| | | /** |
| | | * 批量修改库区并重算相关库区别名。 |
| | | */ |
| | | void batchUpdateArea(List<String> locNos, Integer areaId, Long userId); |
| | | |
| | | /** |
| | | * 按原库位号或别名查找原始 loc_no。 |
| | | */ |
| | | List<String> selectLocNosByNoOrAlias(String condition); |
| | | |
| | | /** |
| | | * 检索可用库位 |
| | | */ |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.ErrorDeviceParam; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.RowLastnoService; |
| | | import com.zy.asrs.utils.LocAliasUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | @Service("locMastService") |
| | | public class LocMastServiceImpl extends ServiceImpl<LocMastMapper, LocMast> implements LocMastService { |
| | |
| | | return this.baseMapper.adjacentLocMast(); |
| | | } |
| | | |
| | | @Override |
| | | public void prepareAreaAlias(LocMast locMast) { |
| | | if (locMast == null) { |
| | | return; |
| | | } |
| | | Integer areaId = locMast.getAreaId(); |
| | | if (areaId == null) { |
| | | areaId = LocAliasUtils.areaIdByCrnNo(locMast.getCrnNo()); |
| | | locMast.setAreaId(areaId); |
| | | } |
| | | Integer minRow = minRowByArea(areaId, locMast.getRow1()); |
| | | locMast.setLocAlias(LocAliasUtils.buildAlias( |
| | | areaId, |
| | | locMast.getRow1(), |
| | | locMast.getBay1(), |
| | | locMast.getLev1(), |
| | | minRow)); |
| | | } |
| | | |
| | | @Override |
| | | public void fillAreaAlias(List<LocMast> locMasts) { |
| | | if (Cools.isEmpty(locMasts)) { |
| | | return; |
| | | } |
| | | Map<Integer, Integer> minRowByArea = new HashMap<>(); |
| | | for (LocMast locMast : locMasts) { |
| | | if (locMast.getAreaId() == null) { |
| | | locMast.setAreaId(LocAliasUtils.areaIdByCrnNo(locMast.getCrnNo())); |
| | | } |
| | | Integer areaId = locMast.getAreaId(); |
| | | Integer row = locMast.getRow1(); |
| | | if (areaId == null || row == null) { |
| | | continue; |
| | | } |
| | | Integer minRow = minRowByArea.get(areaId); |
| | | if (minRow == null || row < minRow) { |
| | | minRowByArea.put(areaId, row); |
| | | } |
| | | } |
| | | for (LocMast locMast : locMasts) { |
| | | locMast.setLocAlias(LocAliasUtils.buildAlias( |
| | | locMast.getAreaId(), |
| | | locMast.getRow1(), |
| | | locMast.getBay1(), |
| | | locMast.getLev1(), |
| | | minRowByArea.get(locMast.getAreaId()))); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void batchUpdateArea(List<String> locNos, Integer areaId, Long userId) { |
| | | if (Cools.isEmpty(locNos)) { |
| | | throw new CoolException("请选择库位"); |
| | | } |
| | | if (LocAliasUtils.areaCode(areaId) == null) { |
| | | throw new CoolException("库区参数错误"); |
| | | } |
| | | List<LocMast> oldLocMasts = this.selectBatchIds(locNos); |
| | | if (Cools.isEmpty(oldLocMasts)) { |
| | | throw new CoolException("未找到要修改的库位"); |
| | | } |
| | | Set<Integer> affectedAreaIds = new HashSet<>(); |
| | | affectedAreaIds.add(areaId); |
| | | List<LocMast> updates = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | for (LocMast oldLocMast : oldLocMasts) { |
| | | if (oldLocMast.getAreaId() != null) { |
| | | affectedAreaIds.add(oldLocMast.getAreaId()); |
| | | } |
| | | LocMast update = new LocMast(); |
| | | update.setLocNo(oldLocMast.getLocNo()); |
| | | update.setAreaId(areaId); |
| | | update.setModiUser(userId); |
| | | update.setModiTime(now); |
| | | updates.add(update); |
| | | } |
| | | if (!this.updateBatchById(updates)) { |
| | | throw new CoolException("批量修改库区失败"); |
| | | } |
| | | rebuildAliasByAreas(affectedAreaIds, userId); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> selectLocNosByNoOrAlias(String condition) { |
| | | List<String> locNos = new ArrayList<>(); |
| | | if (Cools.isEmpty(condition)) { |
| | | return locNos; |
| | | } |
| | | List<LocMast> locMasts = this.selectList(new EntityWrapper<LocMast>() |
| | | .andNew() |
| | | .like("loc_no", condition) |
| | | .or() |
| | | .like("loc_alias", condition)); |
| | | for (LocMast locMast : locMasts) { |
| | | locNos.add(locMast.getLocNo()); |
| | | } |
| | | return locNos; |
| | | } |
| | | |
| | | private Integer minRowByArea(Integer areaId, Integer currentRow) { |
| | | if (areaId == null) { |
| | | return null; |
| | | } |
| | | Integer minRow = this.baseMapper.selectMinRowByArea(areaId); |
| | | if (currentRow != null && (minRow == null || currentRow < minRow)) { |
| | | return currentRow; |
| | | } |
| | | return minRow; |
| | | } |
| | | |
| | | private void rebuildAliasByAreas(Set<Integer> areaIds, Long userId) { |
| | | if (Cools.isEmpty(areaIds)) { |
| | | return; |
| | | } |
| | | List<LocMast> locMasts = this.selectList(new EntityWrapper<LocMast>().in("area_id", areaIds)); |
| | | if (Cools.isEmpty(locMasts)) { |
| | | return; |
| | | } |
| | | Map<Integer, Integer> minRowByArea = new HashMap<>(); |
| | | for (LocMast locMast : locMasts) { |
| | | Integer areaId = locMast.getAreaId(); |
| | | Integer row = locMast.getRow1(); |
| | | if (areaId == null || row == null) { |
| | | continue; |
| | | } |
| | | Integer minRow = minRowByArea.get(areaId); |
| | | if (minRow == null || row < minRow) { |
| | | minRowByArea.put(areaId, row); |
| | | } |
| | | } |
| | | List<LocMast> updates = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | for (LocMast locMast : locMasts) { |
| | | LocMast update = new LocMast(); |
| | | update.setLocNo(locMast.getLocNo()); |
| | | update.setLocAlias(LocAliasUtils.buildAlias( |
| | | locMast.getAreaId(), |
| | | locMast.getRow1(), |
| | | locMast.getBay1(), |
| | | locMast.getLev1(), |
| | | minRowByArea.get(locMast.getAreaId()))); |
| | | update.setModiUser(userId); |
| | | update.setModiTime(now); |
| | | updates.add(update); |
| | | } |
| | | if (!updates.isEmpty() && !this.updateBatchById(updates)) { |
| | | throw new CoolException("重算库位别名失败"); |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private RowLastnoService rowLastnoService; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.InventoryFlowDto; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | |
| | | |
| | | @Service("wrkMastLogService") |
| | | public class WrkMastLogServiceImpl extends ServiceImpl<WrkMastLogMapper, WrkMastLog> implements WrkMastLogService { |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Override |
| | | public boolean insert(WrkMastLog entity) { |
| | | fillAreaId(entity); |
| | | return super.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public boolean save(Integer workNo) { |
| | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | private void fillAreaId(WrkMastLog wrkMastLog) { |
| | | if (wrkMastLog == null) { |
| | | return; |
| | | } |
| | | LocMast locMast = resolveAreaLocMast(wrkMastLog); |
| | | if (locMast != null) { |
| | | wrkMastLog.setAreaId(locMast.getAreaId()); |
| | | } |
| | | } |
| | | |
| | | private LocMast resolveAreaLocMast(WrkMastLog wrkMastLog) { |
| | | boolean outbound = wrkMastLog.getIoType() != null && wrkMastLog.getIoType() >= 100; |
| | | LocMast primary = outbound |
| | | ? selectLocMast(wrkMastLog.getSourceLocNo()) |
| | | : selectLocMast(wrkMastLog.getLocNo()); |
| | | if (primary != null) { |
| | | return primary; |
| | | } |
| | | return outbound |
| | | ? selectLocMast(wrkMastLog.getLocNo()) |
| | | : selectLocMast(wrkMastLog.getSourceLocNo()); |
| | | } |
| | | |
| | | private LocMast selectLocMast(String locNo) { |
| | | if (Cools.isEmpty(locNo)) { |
| | | return null; |
| | | } |
| | | return locMastService.selectById(locNo); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.InboundCameraCaptureService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private WrkMastLogMapper wrkMastLogMapper; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Override |
| | | public boolean insert(WrkMast entity) { |
| | | fillAreaId(entity); |
| | | return super.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateById(WrkMast entity) { |
| | | fillAreaId(entity); |
| | | return super.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int getWorkingMast(Integer devpNo) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void fillAreaId(WrkMast wrkMast) { |
| | | if (wrkMast == null) { |
| | | return; |
| | | } |
| | | LocMast locMast = resolveAreaLocMast(wrkMast); |
| | | if (locMast != null) { |
| | | wrkMast.setAreaId(locMast.getAreaId()); |
| | | } |
| | | } |
| | | |
| | | private LocMast resolveAreaLocMast(WrkMast wrkMast) { |
| | | boolean outbound = wrkMast.getIoType() != null && wrkMast.getIoType() >= 100; |
| | | LocMast primary = outbound |
| | | ? selectLocMast(wrkMast.getSourceLocNo()) |
| | | : selectLocMast(wrkMast.getLocNo()); |
| | | if (primary != null) { |
| | | return primary; |
| | | } |
| | | return outbound |
| | | ? selectLocMast(wrkMast.getLocNo()) |
| | | : selectLocMast(wrkMast.getSourceLocNo()); |
| | | } |
| | | |
| | | private LocMast selectLocMast(String locNo) { |
| | | if (Cools.isEmpty(locNo)) { |
| | | return null; |
| | | } |
| | | return locMastService.selectById(locNo); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.zy.asrs.entity.LocMast; |
| | | |
| | | /** |
| | | * 库位别名规则:不改变原始 loc_no,只按库区和重排排号生成展示别名。 |
| | | */ |
| | | public final class LocAliasUtils { |
| | | |
| | | private LocAliasUtils() { |
| | | } |
| | | |
| | | public static Integer areaIdByCrnNo(Integer crnNo) { |
| | | if (crnNo == null) { |
| | | return null; |
| | | } |
| | | if (crnNo >= 1 && crnNo <= 6) { |
| | | return 1; |
| | | } |
| | | if (crnNo >= 7 && crnNo <= 18) { |
| | | return 2; |
| | | } |
| | | if (crnNo >= 19 && crnNo <= 28) { |
| | | return 3; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String areaCode(Integer areaId) { |
| | | if (areaId == null) { |
| | | return null; |
| | | } |
| | | switch (areaId) { |
| | | case 1: |
| | | return "A"; |
| | | case 2: |
| | | return "B"; |
| | | case 3: |
| | | return "C"; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String areaName(Integer areaId) { |
| | | String areaCode = areaCode(areaId); |
| | | if (areaCode == null) { |
| | | return areaId == null ? "" : String.valueOf(areaId); |
| | | } |
| | | return areaCode + "区"; |
| | | } |
| | | |
| | | public static String buildAlias(Integer areaId, Integer row, Integer bay, Integer lev, Integer minAreaRow) { |
| | | String areaCode = areaCode(areaId); |
| | | if (areaCode == null || row == null || bay == null || lev == null || minAreaRow == null) { |
| | | return null; |
| | | } |
| | | int aliasRow = row - minAreaRow + 1; |
| | | if (aliasRow <= 0) { |
| | | return null; |
| | | } |
| | | return areaCode + "-" + String.format("%02d%03d%02d", aliasRow, bay, lev); |
| | | } |
| | | |
| | | public static String displayLocNo(LocMast locMast) { |
| | | if (locMast == null) { |
| | | return null; |
| | | } |
| | | if (locMast.getLocAlias() != null && locMast.getLocAlias().trim().length() > 0) { |
| | | return locMast.getLocAlias(); |
| | | } |
| | | return locMast.getLocNo(); |
| | | } |
| | | } |
| | |
| | | |
| | | <sql id="stockOutCondition"> |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and a.loc_no like '%' + #{loc_no} + '%' |
| | | and (a.loc_no like '%' + #{loc_no} + '%' or b.loc_alias like '%' + #{loc_no} + '%') |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and a.matnr like '%' + #{matnr} + '%' |
| | |
| | | <result column="loc_sts" property="locSts" /> |
| | | <result column="sheet_no" property="sheetNo" /> |
| | | <result column="crn_no" property="crnNo" /> |
| | | <result column="area_id" property="areaId" /> |
| | | <result column="loc_alias" property="locAlias" /> |
| | | <result column="row1" property="row1" /> |
| | | <result column="bay1" property="bay1" /> |
| | | <result column="lev1" property="lev1" /> |
| | | <result column="gro1" property="gro1" /> |
| | | <result column="full_plt" property="fullPlt" /> |
| | | <result column="loc_type" property="locType" /> |
| | | <result column="loc_type1" property="locType1" /> |
| | |
| | | and mld.host_id = #{host_id} |
| | | </if> |
| | | <if test="loc_no != null and loc_no != ''"> |
| | | and mld.loc_no like concat('%',#{loc_no},'%') |
| | | and ( |
| | | mld.loc_no like concat('%',#{loc_no},'%') |
| | | or exists ( |
| | | select 1 from asr_loc_mast alm |
| | | where alm.loc_no = mld.loc_no |
| | | and alm.loc_alias like concat('%',#{loc_no},'%') |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="locNo != null and locNo != ''"> |
| | | and mld.loc_no like concat('%',#{loc_no},'%') |
| | | and ( |
| | | mld.loc_no like concat('%',#{locNo},'%') |
| | | or exists ( |
| | | select 1 from asr_loc_mast alm |
| | | where alm.loc_no = mld.loc_no |
| | | and alm.loc_alias like concat('%',#{locNo},'%') |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mld.matnr like concat('%',#{matnr},'%') |
| | |
| | | and v.host_id = #{host_id} |
| | | </if> |
| | | <if test="loc_no != null and loc_no != ''"> |
| | | and v.loc_no like concat('%',#{loc_no},'%') |
| | | and ( |
| | | v.loc_no like concat('%',#{loc_no},'%') |
| | | or exists ( |
| | | select 1 from asr_loc_mast alm |
| | | where alm.loc_no = v.loc_no |
| | | and alm.loc_alias like concat('%',#{loc_no},'%') |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="locNo != null and locNo != ''"> |
| | | and v.loc_no like concat('%',#{loc_no},'%') |
| | | and ( |
| | | v.loc_no like concat('%',#{locNo},'%') |
| | | or exists ( |
| | | select 1 from asr_loc_mast alm |
| | | where alm.loc_no = v.loc_no |
| | | and alm.loc_alias like concat('%',#{locNo},'%') |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and v.matnr like concat('%',#{matnr},'%') |
| | |
| | | and a.node_id like '%' + #{node_id} + '%' |
| | | </if> |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and a.loc_no like '%' + #{loc_no} + '%' |
| | | and ( |
| | | a.loc_no like '%' + #{loc_no} + '%' |
| | | or exists ( |
| | | select 1 from asr_loc_mast alm |
| | | where alm.loc_no = a.loc_no |
| | | and alm.loc_alias like '%' + #{loc_no} + '%' |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and a.matnr like '%' + #{matnr} + '%' |
| | |
| | | <result column="wrk_sts" property="wrkSts" /> |
| | | <result column="io_type" property="ioType" /> |
| | | <result column="crn_no" property="crnNo" /> |
| | | <result column="area_id" property="areaId" /> |
| | | <result column="sheet_no" property="sheetNo" /> |
| | | <result column="io_pri" property="ioPri" /> |
| | | <result column="wrk_date" property="wrkDate" /> |
| | |
| | | <result column="wrk_sts" property="wrkSts" /> |
| | | <result column="io_type" property="ioType" /> |
| | | <result column="crn_no" property="crnNo" /> |
| | | <result column="area_id" property="areaId" /> |
| | | <result column="sheet_no" property="sheetNo" /> |
| | | <result column="io_pri" property="ioPri" /> |
| | | <result column="wrk_date" property="wrkDate" /> |
| New file |
| | |
| | | IF COL_LENGTH('dbo.asr_loc_mast', 'area_id') IS NULL |
| | | BEGIN |
| | | ALTER TABLE [dbo].[asr_loc_mast] |
| | | ADD [area_id] INT NULL; |
| | | END; |
| | | |
| | | IF COL_LENGTH('dbo.asr_loc_mast', 'loc_alias') IS NULL |
| | | BEGIN |
| | | ALTER TABLE [dbo].[asr_loc_mast] |
| | | ADD [loc_alias] NVARCHAR(32) NULL; |
| | | END; |
| | | |
| | | EXEC sys.sp_executesql N' |
| | | UPDATE [dbo].[asr_loc_mast] |
| | | SET [area_id] = |
| | | CASE |
| | | WHEN [crn_no] BETWEEN 1 AND 6 THEN 1 |
| | | WHEN [crn_no] BETWEEN 7 AND 18 THEN 2 |
| | | WHEN [crn_no] BETWEEN 19 AND 28 THEN 3 |
| | | ELSE [area_id] |
| | | END |
| | | WHERE [area_id] IS NULL |
| | | AND [crn_no] BETWEEN 1 AND 28; |
| | | '; |
| | | |
| | | EXEC sys.sp_executesql N' |
| | | ;WITH area_min AS ( |
| | | SELECT [area_id], MIN([row1]) AS [min_row] |
| | | FROM [dbo].[asr_loc_mast] |
| | | WHERE [area_id] IN (1, 2, 3) |
| | | AND [row1] IS NOT NULL |
| | | GROUP BY [area_id] |
| | | ) |
| | | UPDATE lm |
| | | SET [loc_alias] = |
| | | CASE lm.[area_id] |
| | | WHEN 1 THEN N''A-'' |
| | | WHEN 2 THEN N''B-'' |
| | | WHEN 3 THEN N''C-'' |
| | | END |
| | | + RIGHT(''00'' + CAST(lm.[row1] - area_min.[min_row] + 1 AS VARCHAR(10)), 2) |
| | | + RIGHT(''000'' + CAST(lm.[bay1] AS VARCHAR(10)), 3) |
| | | + RIGHT(''00'' + CAST(lm.[lev1] AS VARCHAR(10)), 2) |
| | | FROM [dbo].[asr_loc_mast] lm |
| | | INNER JOIN area_min ON lm.[area_id] = area_min.[area_id] |
| | | WHERE lm.[area_id] IN (1, 2, 3) |
| | | AND lm.[row1] IS NOT NULL |
| | | AND lm.[bay1] IS NOT NULL |
| | | AND lm.[lev1] IS NOT NULL; |
| | | '; |
| New file |
| | |
| | | IF COL_LENGTH('dbo.asr_loc_mast', 'area_id') IS NULL |
| | | BEGIN |
| | | ALTER TABLE [dbo].[asr_loc_mast] |
| | | ADD [area_id] INT NULL; |
| | | END; |
| | | |
| | | EXEC sys.sp_executesql N' |
| | | UPDATE [dbo].[asr_loc_mast] |
| | | SET [area_id] = |
| | | CASE |
| | | WHEN [crn_no] BETWEEN 1 AND 6 THEN 1 |
| | | WHEN [crn_no] BETWEEN 7 AND 18 THEN 2 |
| | | WHEN [crn_no] BETWEEN 19 AND 28 THEN 3 |
| | | ELSE [area_id] |
| | | END |
| | | WHERE [area_id] IS NULL |
| | | AND [crn_no] BETWEEN 1 AND 28; |
| | | '; |
| | | |
| | | IF COL_LENGTH('dbo.asr_wrk_mast', 'area_id') IS NULL |
| | | BEGIN |
| | | ALTER TABLE [dbo].[asr_wrk_mast] |
| | | ADD [area_id] INT NULL; |
| | | END; |
| | | |
| | | EXEC sys.sp_executesql N' |
| | | UPDATE m |
| | | SET area_id = CASE |
| | | WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id) |
| | | ELSE COALESCE(target_loc.area_id, source_loc.area_id) |
| | | END |
| | | FROM dbo.asr_wrk_mast m |
| | | LEFT JOIN dbo.asr_loc_mast target_loc ON target_loc.loc_no = m.loc_no |
| | | LEFT JOIN dbo.asr_loc_mast source_loc ON source_loc.loc_no = m.source_loc_no |
| | | WHERE m.area_id IS NULL |
| | | AND CASE |
| | | WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id) |
| | | ELSE COALESCE(target_loc.area_id, source_loc.area_id) |
| | | END IS NOT NULL; |
| | | '; |
| | | |
| | | IF OBJECT_ID('dbo.asr_wrk_mast_log', 'U') IS NOT NULL |
| | | BEGIN |
| | | IF COL_LENGTH('dbo.asr_wrk_mast_log', 'area_id') IS NULL |
| | | BEGIN |
| | | ALTER TABLE [dbo].[asr_wrk_mast_log] |
| | | ADD [area_id] INT NULL; |
| | | END; |
| | | |
| | | EXEC sys.sp_executesql N' |
| | | UPDATE m |
| | | SET area_id = CASE |
| | | WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id) |
| | | ELSE COALESCE(target_loc.area_id, source_loc.area_id) |
| | | END |
| | | FROM dbo.asr_wrk_mast_log m |
| | | LEFT JOIN dbo.asr_loc_mast target_loc ON target_loc.loc_no = m.loc_no |
| | | LEFT JOIN dbo.asr_loc_mast source_loc ON source_loc.loc_no = m.source_loc_no |
| | | WHERE m.area_id IS NULL |
| | | AND CASE |
| | | WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id) |
| | | ELSE COALESCE(target_loc.area_id, source_loc.area_id) |
| | | END IS NOT NULL; |
| | | '; |
| | | END; |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'}, |
| | | {field: 'locNo$', align: 'center',title: '库位号'} |
| | | {field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位别名'} |
| | | ,{field: 'storeDate', align: 'center',title: '库龄(天)', hide: true, sort:true} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号', hide: false, sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', hide: false, sort:true} |
| | |
| | | var pageCurr; |
| | | var batchAreaLocNos = []; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | |
| | | {type: 'checkbox', fixed: 'left'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'locNo', align: 'center',title: '库位号',sort:true, hide:false} |
| | | ,{field: 'areaId$', align: 'center',title: '库区',sort:true, hide:false} |
| | | ,{field: 'locAlias', align: 'center',title: '库位别名',sort:true, hide:false} |
| | | ,{field: 'locSts$', align: 'center',title: '库位状态',width:200, hide:false} |
| | | ,{field: 'whsType$', align: 'center',title: '库位类型',width:200, hide:false} |
| | | ,{field: 'frozen$', align: 'center',title: '冻结状态', |
| | | templet: function(d) { |
| | | // 根据条件判断字体颜色 |
| | | if (d.frozen$ === '已冻结') { |
| | | return '<span style="color: #34a8de;">' +d.frozen$ + '</span>'; |
| | | } else { |
| | | return '<span">' +d.frozen$ + '</span>'; |
| | | } |
| | | }} |
| | | ,{field: 'frozenMemo', align: 'center',title: '冻结原因'} |
| | | // ,{field: 'pltType', align: 'center',title: ''} |
| | | // ,{field: 'ctnType', align: 'center',title: ''} |
| | | // ,{field: 'locSts', align: 'center',title: ''} |
| | |
| | | ,{field: 'bay1', align: 'center',title: '列', sort:true, hide:false} |
| | | ,{field: 'lev1', align: 'center',title: '层', sort:true, hide:false} |
| | | ,{field: 'gro1', align: 'center',title: '组', sort:true, hide:false} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' disabled table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.fullPlt === 'Y'){html += " checked ";} |
| | | html += ">"; |
| | | return html; |
| | | },width:80, hide:false} |
| | | // ,{field: 'outEnable', align: 'center',title: ''} |
| | | ,{field: 'ioTime$', align: 'center',title: 'ioTime', hide:true} |
| | | // ,{field: 'firstTime$', align: 'center',title: '', hide:true} |
| | |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'batchArea': |
| | | var areaData = checkStatus.data; |
| | | if (areaData.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | batchAreaLocNos = areaData.map(function (item) { |
| | | return item.locNo; |
| | | }); |
| | | $('#batchAreaId').val(''); |
| | | layer.open({ |
| | | type: 1, |
| | | title: '批量修改库区', |
| | | area: ["360px"], |
| | | maxmin: true, |
| | | shadeClose: true, |
| | | content: $("#batchAreaDiv"), |
| | | success: function () { |
| | | form.render('select'); |
| | | } |
| | | }) |
| | | } |
| | | break; |
| | | case 'exportData': |
| | |
| | | } |
| | | }); |
| | | break; |
| | | case 'whsType': |
| | | var param = top.reObject(data).whsType; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '库位详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: '../basWhs/basWhs_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/basWhs/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'modiUser': |
| | | var param = top.reObject(data).modiUser; |
| | | if (param === undefined) { |
| | |
| | | }) |
| | | }); |
| | | |
| | | // 批量修改库区 |
| | | form.on('submit(batchAreaDo)', function (data) { |
| | | if (batchAreaLocNos.length === 0) { |
| | | layer.msg('请选择数据'); |
| | | return false; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/batch/area/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | locNos: batchAreaLocNos, |
| | | areaId: data.field.areaId |
| | | }), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null){ |
| | |
| | | var data = { |
| | | // id: $('#id').val(), |
| | | locNo: $('#locNo').val(), |
| | | areaId: $('#areaId').val(), |
| | | locAlias: $('#locAlias').val(), |
| | | whsType: $('#whsType').val(), |
| | | pltType: $('#pltType').val(), |
| | | ctnType: $('#ctnType').val(), |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 复选框事件 |
| | | form.on('checkbox(detailCheckbox)', function (data) { |
| | | var el = data.elem; |
| | | if (el.checked) { |
| | | $(el).val('Y'); |
| | | } else { |
| | | $(el).val('N'); |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号', hide:false} |
| | | ,{field: 'locAlias', align: 'center',title: '库位别名', hide:false} |
| | | ,{field: 'areaId$', align: 'center',title: '库区', hide:false} |
| | | ,{field: 'locSts$', align: 'center',title: '库位状态', width: 180, style: 'color: #8E2323', hide:false} |
| | | ,{field: 'whsType$', align: 'center',title: '库位类型', width: 180, style: 'color: #8E2323', hide:false} |
| | | ,{field: 'frozen$', align: 'center',title: '冻结状态', |
| | | templet: function(d) { |
| | | // 根据条件判断字体颜色 |
| | | if (d.frozen$ === '已冻结') { |
| | | return '<span style="color: #34a8de;">' +d.frozen$ + '</span>'; |
| | | } else { |
| | | return '<span">' +d.frozen$ + '</span>'; |
| | | } |
| | | }} |
| | | ,{field: 'frozenMemo', align: 'center',title: '冻结原因'} |
| | | ,{field: 'crnNo', align: 'center',title: '堆垛机号', sort:true, hide:false} |
| | | ,{field: 'row1', align: 'center',title: '排', sort:true, hide:true} |
| | | ,{field: 'bay1', align: 'center',title: '列', sort:true, hide:true} |
| | | ,{field: 'lev1', align: 'center',title: '层', sort:true, hide:true} |
| | | ,{field: 'row1', align: 'center',title: '排', sort:true, hide:false} |
| | | ,{field: 'bay1', align: 'center',title: '列', sort:true, hide:false} |
| | | ,{field: 'lev1', align: 'center',title: '层', sort:true, hide:false} |
| | | ,{field: 'gro1', align: 'center',title: '组', sort:true, hide:true} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.fullPlt === 'Y'){html += " checked ";} |
| | | html += "disabled='disabled' >"; |
| | | return html; |
| | | },width:80} |
| | | ,{field: 'barcode', align: 'center',title: '条码号', hide:false} |
| | | ,{field: 'locType1$', align: 'center',title: '高低类型', hide:true} |
| | | ,{field: 'locType2$', align: 'center',title: '宽窄类型', hide:true} |
| | | ,{field: 'locType3$', align: 'center',title: '轻重类型', hide:true} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', width: 180, hide:false} |
| | | ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate'} |
| | | ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | } |
| | | locDetlToLayer(data.locNo); |
| | | break; |
| | | case 'viewPhoto': |
| | | $.ajax({ |
| | | url: baseUrl + "/photo/loc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {locNo: data.locNo}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | showPhotoViewer(layer, res.data); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型'} |
| | | ,{field: 'ioPri', align: 'center',title: '优先级'} |
| | | ,{field: 'crnNo$', align: 'center',title: '堆垛机'} |
| | | ,{field: 'areaId$', align: 'center',title: '库区'} |
| | | ,{field: 'sourceStaNo$', align: 'center',title: '源站'} |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone$', align: 'center', title: 'AGV锁定',hide: false} |
| | | ,{field: 'takeNone$', align: 'center', title: 'AGV锁定', hide: true} |
| | | |
| | | // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){ |
| | | // var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | |
| | | wrkSts: $('#wrkSts').val(), |
| | | ioType: $('#ioType').val(), |
| | | crnNo: $('#crnNo').val(), |
| | | areaId: $('#areaId').val(), |
| | | sheetNo: $('#sheetNo').val(), |
| | | ioPri: $('#ioPri').val(), |
| | | wrkDate: top.strToDate($('#wrkDate\\$').val()), |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="货位" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="货位/别名" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | ,{field: 'locNo', align: 'center',title: '货位'} |
| | | ,{field: 'locNo', align: 'center',title: '货位', hide: true} |
| | | ,{field: 'locNo$', align: 'center',title: '货位'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="area_id" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">库区</option> |
| | | <option value="1">A区</option> |
| | | <option value="2">B区</option> |
| | | <option value="3">C区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <select class="cool-auto-complete-window-select" data-key="basLocStsQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="whsType" name="whs_type" class="layui-input" type="text" style="display: none"> |
| | | <input id="whsType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位类型" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basWhsQueryBywhsType" onkeyup="autoLoad2(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basWhsQueryBywhsTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="loc_type1" id="loc_type1" class="layui-input" type="text" placeholder="库位类型" autocomplete="off"> |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value="">库位类型</option> |
| | | <option value="1">低库位</option> |
| | | <option value="2">高库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <!-- <input class="layui-input" type="text" name="lev1" placeholder="层" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-input-inline"> |
| | | <select name="frozen" class="layui-input" type="text" autocomplete="off"> |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value="">冻结否</option> |
| | | <option value="0">未冻结</option> |
| | | <option value="1">已冻结</option> |
| | | </select> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-sm" id="btn-batch-area" lay-event="batchArea">批量修改库区</button> |
| | | <button class="layui-btn layui-btn-primary" id="btn-init" lay-event="init">初始化</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-convertSize" lay-event="convertSize">大小库位转换</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 批量修改库区弹窗 --> |
| | | <div id="batchAreaDiv" style="margin: 20px 0 10px 30px; display: none"> |
| | | <div class="layui-form layui-form-pane"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">库区</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="batchAreaId" name="areaId" lay-verify="required"> |
| | | <option value="">请选择</option> |
| | | <option value="1">A区</option> |
| | | <option value="2">B区</option> |
| | | <option value="3">C区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div style="text-align: center; margin-top: 20px"> |
| | | <button class="layui-btn layui-btn-radius layui-btn-normal" id="batchAreaDo" lay-submit lay-filter="batchAreaDo">确定</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | <input id="locNo" class="layui-input" type="text" onkeyup="check(this.id, 'locMast')"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">库 区:</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="areaId" name="areaId" disabled="disabled"> |
| | | <option style="display: none"></option> |
| | | <option value="1">A区</option> |
| | | <option value="2">B区</option> |
| | | <option value="3">C区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">库位别名:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="locAlias" class="layui-input" type="text" autocomplete="off" disabled="disabled"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;display: none"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="locType" class="layui-input" type="text" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>库位类型:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="whsType" class="layui-input" type="text" style="display: none"> |
| | | <input id="whsType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur() disabled="disabled"> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basWhsQueryBywhsType" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basWhsQueryBywhsTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <input id="whsType" type="hidden"> |
| | | <div class="layui-inline" style="width:31%;display: none"> |
| | | <label class="layui-form-label">:</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | <input id="sheetNo" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <!-- 冻结 --> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">冻结</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="frozen" name="frozen"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未冻结</option> |
| | | <option value="1">已冻结</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">冻结原因:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="frozenMemo" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <input id="frozen" type="hidden"> |
| | | <input id="frozenMemo" type="hidden"> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">堆垛机号:</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | <input id="gro1" class="layui-input" type="text" autocomplete="off" disabled="disabled"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;display: none"> |
| | | <label class="layui-form-label">满 板:</label> |
| | | <div class="layui-input-inline" style="text-align: left"> |
| | | <input id="fullPlt" class="layui-input" type="checkBox" lay-skin="primary" lay-filter='detailCheckbox'> |
| | | </div> |
| | | </div> |
| | | <input id="fullPlt" type="hidden"> |
| | | <div class="layui-inline" style="width:31%;display: none"> |
| | | <label class="layui-form-label">:</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | function getCol() { |
| | | let cols = [ |
| | | {type: 'checkbox', merge: ['locNo']} |
| | | ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号', hide: true} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox', merge: ['locNo']} |
| | | ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | // ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号', hide: true} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="whsType" name="whs_type" class="layui-input" type="text" style="display: none"> |
| | | <input id="whsType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位类型" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basWhsQueryBywhsType" onkeyup="autoLoad2(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basWhsQueryBywhsTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="loc_type1" id="loc_type1" class="layui-input" type="text" placeholder="库位类型" autocomplete="off"> |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value=""></option> |
| | | <option value="1">小库位</option> |
| | | <option value="2">大库位</option> |
| | | <select name="area_id" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">库区</option> |
| | | <option value="1">A区</option> |
| | | <option value="2">B区</option> |
| | | <option value="3">C区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <!-- <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-input-inline"> |
| | | <select name="frozen" class="layui-input" type="text" autocomplete="off"> |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value="">冻结否</option> |
| | | <option value="0">未冻结</option> |
| | | <option value="1">已冻结</option> |
| | | </select> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | |
| | | <table class="layui-hide" id="stoQue" lay-filter="stoQue"></table> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="viewPhoto">查看照片</a> |
| | | <a class="layui-btn layui-btn-xs loc-detl" lay-event="locDetl">查看明细</a> |
| | | </script> |
| | | |
| | |
| | | <input class="layui-input" type="text" name="crn_no" placeholder="堆垛机号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="area_id" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">库区</option> |
| | | <option value="1">A区</option> |
| | | <option value="2">B区</option> |
| | | <option value="3">C区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">库 区:</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="areaId" name="areaId" disabled="disabled"> |
| | | <option style="display: none"></option> |
| | | <option value="1">A区</option> |
| | | <option value="2">B区</option> |
| | | <option value="3">C区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">优 先 级:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="ioPri" class="layui-input" type="text"> |
| New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.zy.asrs.entity.LocMast; |
| | | import org.junit.jupiter.api.Test; |
| | | |
| | | import static org.junit.jupiter.api.Assertions.assertEquals; |
| | | import static org.junit.jupiter.api.Assertions.assertNull; |
| | | |
| | | class LocAliasUtilsTest { |
| | | |
| | | @Test |
| | | void areaIdByCrnNo_shouldUseConfiguredBoundaries() { |
| | | assertEquals(Integer.valueOf(1), LocAliasUtils.areaIdByCrnNo(1)); |
| | | assertEquals(Integer.valueOf(1), LocAliasUtils.areaIdByCrnNo(6)); |
| | | assertEquals(Integer.valueOf(2), LocAliasUtils.areaIdByCrnNo(7)); |
| | | assertEquals(Integer.valueOf(2), LocAliasUtils.areaIdByCrnNo(18)); |
| | | assertEquals(Integer.valueOf(3), LocAliasUtils.areaIdByCrnNo(19)); |
| | | assertEquals(Integer.valueOf(3), LocAliasUtils.areaIdByCrnNo(28)); |
| | | assertNull(LocAliasUtils.areaIdByCrnNo(29)); |
| | | } |
| | | |
| | | @Test |
| | | void buildAlias_shouldReindexRowsByAreaMinimumRow() { |
| | | assertEquals("A-0100201", LocAliasUtils.buildAlias(1, 1, 2, 1, 1)); |
| | | assertEquals("B-0100201", LocAliasUtils.buildAlias(2, 13, 2, 1, 13)); |
| | | assertEquals("C-0301204", LocAliasUtils.buildAlias(3, 21, 12, 4, 19)); |
| | | } |
| | | |
| | | @Test |
| | | void buildAlias_shouldReturnNullWhenRuleCannotApply() { |
| | | assertNull(LocAliasUtils.buildAlias(null, 1, 2, 1, 1)); |
| | | assertNull(LocAliasUtils.buildAlias(4, 1, 2, 1, 1)); |
| | | assertNull(LocAliasUtils.buildAlias(1, null, 2, 1, 1)); |
| | | assertNull(LocAliasUtils.buildAlias(1, 1, 2, 1, null)); |
| | | } |
| | | |
| | | @Test |
| | | void displayLocNo_shouldPreferAliasAndFallbackToOriginalLocNo() { |
| | | LocMast locMast = new LocMast(); |
| | | locMast.setLocNo("0100201"); |
| | | assertEquals("0100201", LocAliasUtils.displayLocNo(locMast)); |
| | | |
| | | locMast.setLocAlias("A-0100201"); |
| | | assertEquals("A-0100201", LocAliasUtils.displayLocNo(locMast)); |
| | | } |
| | | } |