New file |
| | |
| | | -- save basShuttle record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basShuttle/basShuttle.html', 'basShuttle管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basShuttle#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basShuttle#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basShuttle#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basShuttle#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basShuttle#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basShuttle/basShuttle.html', N'四向车管理', '40541', '2', '4', '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basShuttle#view', N'查询', '60584', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basShuttle#btn-add', N'新增', '60584', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basShuttle#btn-edit', N'编辑', '60584', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basShuttle#btn-delete', N'删除', '60584', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basShuttle#btn-export', N'导出', '60584', '3', '4', '1'); |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.service.BasShuttleService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class BasShuttleController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BasShuttleService basShuttleService; |
| | | |
| | | @RequestMapping(value = "/basShuttle/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basShuttleService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttle/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasShuttle> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasShuttle.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basShuttleService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttle/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasShuttle basShuttle) { |
| | | basShuttleService.insert(basShuttle); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttle/update/auth") |
| | | @ManagerAuth |
| | | public R update(BasShuttle basShuttle){ |
| | | if (Cools.isEmpty(basShuttle) || null==basShuttle.getShuttleNo()){ |
| | | return R.error(); |
| | | } |
| | | basShuttleService.updateById(basShuttle); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttle/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | basShuttleService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttle/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasShuttle> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basShuttle")); |
| | | convert(map, wrapper); |
| | | List<BasShuttle> list = basShuttleService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttleQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasShuttle> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("shuttle_no", condition); |
| | | Page<BasShuttle> page = basShuttleService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasShuttle basShuttle : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basShuttle.getShuttleNo()); |
| | | map.put("value", basShuttle.getShuttleNo()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttle/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasShuttle> wrapper = new EntityWrapper<BasShuttle>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basShuttleService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasShuttle.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
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 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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_bas_shuttle") |
| | | public class BasShuttle implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 四向穿梭车号 |
| | | */ |
| | | @ApiModelProperty(value= "四向穿梭车号") |
| | | @TableId(value = "shuttle_no", type = IdType.INPUT) |
| | | @TableField("shuttle_no") |
| | | private Integer shuttleNo; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 作业态 |
| | | */ |
| | | @ApiModelProperty(value= "作业态") |
| | | @TableField("shuttle_status") |
| | | private Integer shuttleStatus; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | @ApiModelProperty(value= "任务号") |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | /** |
| | | * 排 |
| | | */ |
| | | @ApiModelProperty(value= "排") |
| | | private Integer row; |
| | | |
| | | /** |
| | | * 列 |
| | | */ |
| | | @ApiModelProperty(value= "列") |
| | | private Integer bay; |
| | | |
| | | /** |
| | | * 层 |
| | | */ |
| | | @ApiModelProperty(value= "层") |
| | | private Integer lev; |
| | | |
| | | /** |
| | | * 历史排 |
| | | */ |
| | | @ApiModelProperty(value= "历史排") |
| | | @TableField("his_row") |
| | | private Integer hisRow; |
| | | |
| | | /** |
| | | * 历史列 |
| | | */ |
| | | @ApiModelProperty(value= "历史列") |
| | | @TableField("his_bay") |
| | | private Integer hisBay; |
| | | |
| | | /** |
| | | * 历史层 |
| | | */ |
| | | @ApiModelProperty(value= "历史层") |
| | | @TableField("his_lev") |
| | | private Integer hisLev; |
| | | |
| | | /** |
| | | * 暂存库位 |
| | | */ |
| | | @ApiModelProperty(value= "暂存库位") |
| | | @TableField("idle_loc") |
| | | private String idleLoc; |
| | | |
| | | /** |
| | | * 自动充电 |
| | | */ |
| | | @ApiModelProperty(value= "自动充电") |
| | | @TableField("auto_charge") |
| | | private Integer autoCharge; |
| | | |
| | | /** |
| | | * 电量线 |
| | | */ |
| | | @ApiModelProperty(value= "电量线") |
| | | @TableField("charge_line") |
| | | private Integer chargeLine; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 提升机号 |
| | | */ |
| | | @ApiModelProperty(value= "提升机号") |
| | | @TableField("lift_no") |
| | | private Integer liftNo; |
| | | |
| | | /** |
| | | * 标记 |
| | | */ |
| | | @ApiModelProperty(value= "标记") |
| | | @TableField("pak_mk") |
| | | private String pakMk; |
| | | |
| | | public BasShuttle() {} |
| | | |
| | | public BasShuttle(Integer shuttleNo,Integer status,Integer shuttleStatus,Integer wrkNo,Integer row,Integer bay,Integer lev,Integer hisRow,Integer hisBay,Integer hisLev,String idleLoc,Integer autoCharge,Integer chargeLine,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer liftNo,String pakMk) { |
| | | this.shuttleNo = shuttleNo; |
| | | this.status = status; |
| | | this.shuttleStatus = shuttleStatus; |
| | | this.wrkNo = wrkNo; |
| | | this.row = row; |
| | | this.bay = bay; |
| | | this.lev = lev; |
| | | this.hisRow = hisRow; |
| | | this.hisBay = hisBay; |
| | | this.hisLev = hisLev; |
| | | this.idleLoc = idleLoc; |
| | | this.autoCharge = autoCharge; |
| | | this.chargeLine = chargeLine; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | this.liftNo = liftNo; |
| | | this.pakMk = pakMk; |
| | | } |
| | | |
| | | // BasShuttle basShuttle = new BasShuttle( |
| | | // null, // 四向穿梭车号[非空] |
| | | // null, // 状态 |
| | | // null, // 作业态 |
| | | // null, // 任务号 |
| | | // null, // 排 |
| | | // null, // 列 |
| | | // null, // 层 |
| | | // null, // 历史排 |
| | | // null, // 历史列 |
| | | // null, // 历史层 |
| | | // null, // 暂存库位 |
| | | // null, // 自动充电 |
| | | // null, // 电量线 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 备注 |
| | | // null, // 提升机号 |
| | | // null // 标记 |
| | | // ); |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasShuttleMapper extends BaseMapper<BasShuttle> { |
| | | |
| | | } |
| | |
| | | @Update("update asr_loc_detl set loc_no = #{newLocNo}, modi_time=getDate() where loc_no = #{oldLocNo}") |
| | | int updateLocNo(String newLocNo, String oldLocNo); |
| | | |
| | | List<String> selectSameDetl(@Param("matnr") String matnr, @Param("start") Integer start, @Param("end") Integer end); |
| | | List<String> selectSameDetl(@Param("matnr") String matnr); |
| | | |
| | | @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.matnr = #{matnr} AND (lm.row1 >= #{start} AND lm.row1 <= #{end}) AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC") |
| | | List<String> selectSameDetlToday(@Param("matnr") String matnr, @Param("start") Integer start, @Param("end") Integer end); |
| | |
| | | |
| | | List<LocMast> queryFreeLocMast2(@Param("rows") List<Integer> rows, @Param("rowsLen") Integer rowsLen, @Param("locType1") Short locType1); |
| | | |
| | | LocMast selectAvailableNearLocDesc(@Param("groupLoc") List<String> groupOuterLoc); |
| | | |
| | | LocMast selectAvailableNearLocAsc(@Param("groupOuterLoc") List<String> groupOuterLoc); |
| | | |
| | | List<LocMast> selectAllPeakLoc(); |
| | | |
| | | List<LocMast> selectAllLocNotEmpty(@Param("groupLoc") List<String> groupOuterLoc); |
| | | |
| | | } |
| | |
| | | |
| | | WrkMast selectOfPick(@Param("wrkNo") Integer wrkNo, @Param("ioType") Integer ioType); |
| | | |
| | | List<WrkMast> selectSameMatnrs(@Param("matnr") String matnr); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasShuttleService extends IService<BasShuttle> { |
| | | |
| | | } |
| | |
| | | * @param matnr 产品号 |
| | | * @return locNo 库位号 |
| | | */ |
| | | List<String> getSameDetl(String matnr, Integer start, Integer end); |
| | | List<String> getSameDetl(String matnr); |
| | | |
| | | /** |
| | | * 获取当天相同规格货物的深库位号 |
| | |
| | | // 获取对应出库堆垛机号码 |
| | | Integer getOutCrnNo(LocMast locMast); |
| | | |
| | | LocMast findNearloc(String locNo); |
| | | |
| | | List<LocMast> selectAllPeakLoc(); |
| | | |
| | | Boolean checkAllLocEmpty(List<String> groupOuterLoc); |
| | | |
| | | } |
| | |
| | | Boolean setSteEmpty(Integer wrkNo); |
| | | |
| | | WrkMast selectOfPick(Integer wrkNo, Integer ioType); |
| | | |
| | | List<WrkMast> selectSameMatnrs(String s); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasShuttleMapper; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.service.BasShuttleService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basShuttleService") |
| | | public class BasShuttleServiceImpl extends ServiceImpl<BasShuttleMapper, BasShuttle> implements BasShuttleService { |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getSameDetl(String matnr, Integer start, Integer end) { |
| | | return this.baseMapper.selectSameDetl(matnr, start, end); |
| | | public List<String> getSameDetl(String matnr) { |
| | | return this.baseMapper.selectSameDetl(matnr); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public LocMast findNearloc(String locNo) { |
| | | int row = getRow(locNo); |
| | | LocMast locMast = null; |
| | | if (row>19) { |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocDesc(groupOuterLoc); |
| | | } |
| | | |
| | | }else { |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocAsc(groupOuterLoc); |
| | | } |
| | | } |
| | | return locMast; |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 排 |
| | | */ |
| | | public static int getRow(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(0, 2)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> selectAllPeakLoc() { |
| | | return this.baseMapper.selectAllPeakLoc(); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkAllLocEmpty(List<String> groupOuterLoc) { |
| | | List<LocMast> result = this.baseMapper.selectAllLocNotEmpty(groupOuterLoc); |
| | | return result.size() <= 0; |
| | | } |
| | | |
| | | } |
| | |
| | | return this.baseMapper.selectOfPick(wrkNo, ioType); |
| | | } |
| | | |
| | | @Override |
| | | public List<WrkMast> selectSameMatnrs(String matnr) { |
| | | return this.baseMapper.selectSameMatnrs(matnr); |
| | | } |
| | | |
| | | } |
| | |
| | | public static List<String> getGroupOuterLoc(String locNo){ |
| | | int row = getRow(locNo); |
| | | List<String> result = new ArrayList<>(); |
| | | if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer integer : CommonService.SECOND_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } else if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) { |
| | | if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) { |
| | | List<Integer> clone = Arrays.asList(new Integer[CommonService.FIRST_GROUP_ROW_LIST.size()]); |
| | | Collections.copy(clone, CommonService.FIRST_GROUP_ROW_LIST); |
| | | Collections.reverse(clone); |
| | |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | // throw new RuntimeException("库位解析异常"); |
| | | } else if (CommonService.FIRST_GROUP_ROW_LIST_SHORT.contains(row)){ |
| | | List<Integer> clone = Arrays.asList(new Integer[CommonService.FIRST_GROUP_ROW_LIST_SHORT.size()]); |
| | | Collections.copy(clone, CommonService.FIRST_GROUP_ROW_LIST_SHORT); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | if (integer > row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)){ |
| | | List<Integer> clone = Arrays.asList(new Integer[CommonService.SECOND_GROUP_ROW_LIST.size()]); |
| | | Collections.copy(clone, CommonService.SECOND_GROUP_ROW_LIST); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | if (integer > row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } else if (CommonService.THIRD_GROUP_ROW_LIST.contains(row)){ |
| | | for (Integer integer : CommonService.THIRD_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | |
| | | // generator.table="sys_host"; |
| | | // sqlserver |
| | | generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | generator.url="10.10.10.100:1433;databasename=bfasrs"; |
| | | generator.url="192.168.4.15:1433;databasename=xzjlasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="asr_bas_ste_err_log"; |
| | | generator.table="asr_bas_shuttle"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.build(); |
| | | } |
| | |
| | | public class CommonService { |
| | | |
| | | public static final List<Integer> FIRST_GROUP_ROW_LIST = new ArrayList<Integer>() {{ |
| | | add(1);add(2);add(3);add(4); |
| | | add(1);add(2);add(3);add(4);add(5);add(6);add(7);add(8);add(9);add(10); |
| | | }}; |
| | | public static final List<Integer> FIRST_GROUP_ROW_LIST_SHORT = new ArrayList<Integer>() {{ |
| | | add(8);add(9);add(10); |
| | | }}; |
| | | public static final List<Integer> SECOND_GROUP_ROW_LIST = new ArrayList<Integer>() {{ |
| | | add(5);add(6);add(7);add(8);add(9);add(10);add(11); |
| | | add(12);add(13);add(14);add(15);add(16);add(17);add(18); |
| | | }}; |
| | | public static final List<Integer> FIRST_GROUP_ROW_LIST2 = new ArrayList<Integer>() {{ |
| | | add(2);add(3);add(4); |
| | | public static final List<Integer> THIRD_GROUP_ROW_LIST = new ArrayList<Integer>() {{ |
| | | add(20);add(21);add(22);add(23); |
| | | }}; |
| | | public static final List<Integer> SECOND_GROUP_ROW_LIST10 = new ArrayList<Integer>() {{ |
| | | add(5);add(6);add(7);add(8);add(9);add(10); |
| | | }}; |
| | | |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | |
| | | } |
| | | |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, int times) { |
| | | LocTypeDto oldLocType = locTypeDto.clone(); |
| | | return getLocNo(whsType, staDescId, sourceStaNo, matNos, locTypeDto, oldLocType, times); |
| | | return getLocNo(staDescId, sourceStaNo, matNos, locTypeDto, times); |
| | | } |
| | | |
| | | /** |
| | | * 检索库位号 |
| | | * @param whsType 类型 1:双深式货架 |
| | | * @param staDescId 路径ID |
| | | * @param sourceStaNo 源站 |
| | | * @param matNos 物料号集合 |
| | | * @return locNo 检索到的库位号 |
| | | */ |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) { |
| | | public StartupDto getLocNo(Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto,int times) { |
| | | |
| | | StartupDto startupDto = new StartupDto(); |
| | | whsType = 1; |
| | | // 生成工作号 |
| | | int workNo = getWorkNo(0); |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | if (Cools.isEmpty(rowLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | | int curRow = rowLastno.getCurrentRow(); // 当前列 |
| | | int sRow = rowLastno.getsRow(); // 起始列 |
| | | int eRow = rowLastno.geteRow(); // 终止列 |
| | | int crn_qty = rowLastno.getCrnQty(); // 堆垛机数量(巷道数量) |
| | | int rowCount = eRow - sRow + 1; // 库排总数 |
| | | // 目标堆垛机号 |
| | | int crnNo = 0; |
| | | |
| | | // 目标库位 |
| | | LocMast locMast = null; |
| | | |
| | | // 靠近摆放规则 --- 同天同规格物料 |
| | | if (!Cools.isEmpty(matNos) && matNos.size() == 1) { |
| | | List<String> locNos = locDetlService.getSameDetl(matNos.get(0), sRow, eRow); |
| | | for (String locNo : locNos) { |
| | | LocMast locMast0 = locMastService.findOutMost(locNo); |
| | | // 靠近摆放规则 --- 相同订单号, 同天同规格物料 |
| | | if (!Cools.isEmpty(matNos) && matNos.size() == 1 && staDescId == 1) { |
| | | //先判断工作档,查找主档IOType=1, wrkSts < 10的工作明细,料号相同的明细库位 |
| | | List<WrkMast> wrkMasts = wrkMastService.selectSameMatnrs(matNos.get(0)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | LocMast locMast0 = locMastService.findNearloc(wrkMast.getLocNo()); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | // 浅库位对应堆垛机必须可用且无异常 |
| | | if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) { |
| | | crnNo = locMast0.getCrnNo(); |
| | | locMast = locMast0; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locMast)) { |
| | | //再判断库存明细档,料号相同的明细库位 |
| | | List<String> locNos = locDetlService.getSameDetl(matNos.get(0)); |
| | | for (String locNo : locNos) { |
| | | LocMast locMast0 = locMastService.findNearloc(locNo); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | locMast = locMast0; |
| | | break; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 靠近摆放规则 --- 空托 |
| | | if (staDescId == 10) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow)); |
| | | .eq("loc_sts", "D")); |
| | | if (locMasts.size() > 0) { |
| | | for (LocMast loc : locMasts) { |
| | | LocMast locMast0 = locMastService.findOutMost(loc.getLocNo()); |
| | | LocMast locMast0 = locMastService.findNearloc(loc.getLocNo()); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | // 浅库位对应堆垛机必须可用且无异常 |
| | | if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) { |
| | | crnNo = locMast0.getCrnNo(); |
| | | locMast = locMast0; |
| | | break; |
| | | } |
| | | locMast = locMast0; |
| | | break; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // 如果没有相近物料,则按规则轮询货架 |
| | | if (null == locMast) { |
| | | if (curRow == 1) { |
| | | curRow = 11; |
| | | } else { |
| | | curRow = 1; |
| | | } |
| | | if (basCrnpService.checkSiteError(1, true)) { |
| | | crnNo = 1; |
| | | } |
| | | } |
| | | |
| | | if (crnNo == 0) { |
| | | throw new CoolException("没有可用的堆垛机"); |
| | | } |
| | | |
| | | // 获取目标站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", crnNo); |
| | | .eq("stn_no", sourceStaNo); |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | log.error("入库路径不存在, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, crnNo); |
| | | log.error("入库路径不存在, staDescId={}, sourceStaNo={}", staDescId, sourceStaNo); |
| | | throw new CoolException("入库路径不存在"); |
| | | } |
| | | |
| | | // 检测目标站 |
| | | BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn()); |
| | | if (!staNo.getAutoing().equals("Y")) { |
| | | throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用"); |
| | | throw new CoolException("目标站" + staDesc.getCrnStn() + "不可用"); |
| | | } |
| | | |
| | | // 更新库位排号 |
| | | rowLastno.setCurrentRow(curRow); |
| | | rowLastnoService.updateById(rowLastno); |
| | | |
| | | // 开始查找库位 ==============================>> |
| | | |
| | | // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排 |
| | | if (locMast == null) { |
| | | List<Integer> rows = Utils.getGroupLoc(curRow); |
| | | |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast(rows, rows.size(), locTypeDto.getLocType1()); |
| | | if (!Cools.isEmpty(locMasts)) { |
| | | Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo()); |
| | | for (LocMast one : locMasts) { |
| | | if (one.getRow1().equals(innermostRow)) { |
| | | locMast = one; |
| | | break; |
| | | } |
| | | List<LocMast> peakLocs = locMastService.selectAllPeakLoc(); |
| | | for (LocMast peakLoc : peakLocs) { |
| | | List<String> groupInsideLoc = Utils.getGroupInsideLoc(peakLoc.getLocNo()); |
| | | if (!Cools.isEmpty(groupInsideLoc)){ |
| | | if (!locMastService.checkAllLocEmpty(groupInsideLoc)) continue; |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", groupInsideLoc.get(0))); |
| | | break; |
| | | }else { |
| | | locMast=peakLoc; |
| | | break; |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locMast)){ |
| | | if (rows.equals(FIRST_GROUP_ROW_LIST)){ |
| | | rows=FIRST_GROUP_ROW_LIST2; |
| | | }else if (rows.equals(SECOND_GROUP_ROW_LIST)){ |
| | | rows=SECOND_GROUP_ROW_LIST10; |
| | | } |
| | | List<LocMast> locMasts1 = locMastService.queryFreeLocMast2(rows, rows.size(), locTypeDto.getLocType1()); |
| | | if (!Cools.isEmpty(locMasts1)) { |
| | | Integer innermostRow = Utils.getInnermostRow(locMasts1.get(0).getLocNo()); |
| | | if (rows.equals(FIRST_GROUP_ROW_LIST2)){ |
| | | innermostRow=innermostRow+1; |
| | | }else if (rows.equals(SECOND_GROUP_ROW_LIST10)){ |
| | | innermostRow=innermostRow-1; |
| | | } |
| | | for (LocMast one : locMasts1) { |
| | | if (one.getRow1().equals(innermostRow)) { |
| | | locMast = one; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast, 10)) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | |
| | | // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | if (Cools.isEmpty(locMast)) { |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount) { |
| | | times = times + 1; |
| | | return getLocNo(whsType, staDescId, sourceStaNo, matNos, locTypeDto, oldLocType, times); |
| | | } else { |
| | | times = 0; |
| | | List<LocMast> peakLocs = locMastService.selectAllPeakLoc(); |
| | | for (LocMast peakLoc : peakLocs) { |
| | | List<String> groupOuterLoc = Utils.getGroupInsideLoc(peakLoc.getLocNo()); |
| | | if (!Cools.isEmpty(groupOuterLoc)){ |
| | | if (!locMastService.checkAllLocEmpty(groupOuterLoc)) continue; |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", groupOuterLoc.get(0))); |
| | | }else { |
| | | locMast = peakLoc; |
| | | } |
| | | |
| | | } |
| | | // 货物检索低库位仓失败,兼容高库位仓后继续执行 |
| | | // if (locTypeDto.getLocType1() == 1) { |
| | | // locTypeDto.setLocType1((short) 2); |
| | | // return getLocNo(1, staDescId, sourceStaNo, matNos, locTypeDto, oldLocType, times); |
| | | // } |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |
| | | if (Cools.isEmpty(locMast)) { |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | |
| | | // 生成工作号 |
| | | int workNo = getWorkNo(0); |
| | | // 返回dto |
| | | startupDto.setWorkNo(workNo); |
| | | startupDto.setCrnNo(crnNo); |
| | | startupDto.setSourceStaNo(sourceStaNo); |
| | | startupDto.setStaNo(staNo.getDevNo()); |
| | | startupDto.setLocNo(locNo); |
| | | return startupDto; |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count) { |
| | | if (msg.length() == count) { |
| | | return msg; |
| | | } else if (msg.length() > count) { |
| | | return msg.substring(0, 16); |
| | | } else { |
| | | StringBuilder msgBuilder = new StringBuilder(msg); |
| | | for(int i = 0; i < count - msg.length(); ++i) { |
| | | msgBuilder.insert(0, "0"); |
| | | } |
| | | return msgBuilder.toString(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://localhost:1433;databasename=szfzasrs |
| | | url: jdbc:sqlserver://192.168.4.15:1433;databasename=xzjlasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.BasShuttleMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasShuttle"> |
| | | <result column="shuttle_no" property="shuttleNo" /> |
| | | <result column="status" property="status" /> |
| | | <result column="shuttle_status" property="shuttleStatus" /> |
| | | <result column="wrk_no" property="wrkNo" /> |
| | | <result column="row" property="row" /> |
| | | <result column="bay" property="bay" /> |
| | | <result column="lev" property="lev" /> |
| | | <result column="his_row" property="hisRow" /> |
| | | <result column="his_bay" property="hisBay" /> |
| | | <result column="his_lev" property="hisLev" /> |
| | | <result column="idle_loc" property="idleLoc" /> |
| | | <result column="auto_charge" property="autoCharge" /> |
| | | <result column="charge_line" property="chargeLine" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="lift_no" property="liftNo" /> |
| | | <result column="pak_mk" property="pakMk" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | ) dual on dual.loc_no = lm.loc_no |
| | | WHERE 1 = 1 |
| | | AND ld.matnr = #{matnr} |
| | | AND (lm.row1 >= #{start} AND lm.row1 <= #{end}) |
| | | AND (lm.loc_sts = 'F') |
| | | AND dual.count = 1 |
| | | ORDER BY lm.modi_time ASC |
| | |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | <select id="selectAvailableNearLocDesc" resultMap="BaseResultMap"> |
| | | SELECT TOP 1 * FROM asr_loc_mast WHERE loc_sts IN ('O') |
| | | <foreach collection="groupLoc" item="loc" index="index" open="AND loc_no IN (" close=")" separator=","> |
| | | #{loc} |
| | | </foreach> |
| | | ORDER BY |
| | | row1 DESC |
| | | </select> |
| | | <select id="selectAvailableNearLocAsc" resultMap="BaseResultMap"> |
| | | SELECT TOP 1 * FROM asr_loc_mast WHERE loc_sts IN ('O') AND loc_no IN |
| | | <foreach collection="groupOuterLoc" item="loc" index="index" open="(" close=")" separator=","> |
| | | #{loc} |
| | | </foreach> |
| | | ORDER BY |
| | | row1 ASC |
| | | </select> |
| | | |
| | | <select id="selectAllPeakLoc" resultMap="BaseResultMap"> |
| | | SELECT a.* |
| | | from( |
| | | SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 1 |
| | | UNION ALL |
| | | SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 8 and bay1 > 7 |
| | | UNION ALL |
| | | SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 12 |
| | | UNION ALL |
| | | SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 23 |
| | | UNION ALL |
| | | SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 18 AND (bay1 = 1 or bay1 = 3 ) |
| | | ) a ORDER BY a.lev1,a.bay1 ASC |
| | | </select> |
| | | |
| | | <select id="selectAllLocNotEmpty" resultMap="BaseResultMap"> |
| | | SELECT * FROM asr_loc_mast WHERE loc_sts != 'O' AND loc_no in |
| | | <foreach collection="groupLoc" item="loc" index="index" open="(" close=")" separator=","> |
| | | #{loc} |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | select top 1 * from asr_wrk_mast where wrk_no=#{wrkNo} and wrk_sts=17 and io_type = #{ioType} |
| | | </select> |
| | | |
| | | <select id="selectSameMatnrs" resultMap="BaseResultMap"> |
| | | select loc_no from asr_wrk_mast m,asr_wrk_detl d |
| | | where m.wrk_no=d.wrk_no and io_type=1 and wrk_sts < 11 and d.matnr = #{matnr} ORDER BY m.wrk_no desc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basShuttle', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basShuttle/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'shuttleNo', align: 'center',title: '四向穿梭车号'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'shuttleStatus', align: 'center',title: '作业态'} |
| | | ,{field: 'wrkNo', align: 'center',title: '任务号'} |
| | | ,{field: 'row', align: 'center',title: '排'} |
| | | ,{field: 'bay', align: 'center',title: '列'} |
| | | ,{field: 'lev', align: 'center',title: '层'} |
| | | ,{field: 'hisRow', align: 'center',title: '历史排'} |
| | | ,{field: 'hisBay', align: 'center',title: '历史列'} |
| | | ,{field: 'hisLev', align: 'center',title: '历史层'} |
| | | ,{field: 'idleLoc', align: 'center',title: '暂存库位'} |
| | | ,{field: 'autoCharge', align: 'center',title: '自动充电'} |
| | | ,{field: 'chargeLine', align: 'center',title: '电量线'} |
| | | ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'liftNo', align: 'center',title: '提升机号'} |
| | | ,{field: 'pakMk', align: 'center',title: '标记'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(basShuttle)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(basShuttle)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.shuttleNo; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'basShuttle': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basShuttle/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(basShuttle)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.shuttleNo]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basShuttle/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basShuttle/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['updateTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="basShuttle" lay-filter="basShuttle"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <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 layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basShuttle/basShuttle.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">四向穿梭车号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="shuttleNo" placeholder="请输入四向穿梭车号" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="status"> |
| | | <option value="">请选择状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="0">禁用</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">作业态: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="shuttleStatus" placeholder="请输入作业态"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">任务号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="wrkNo" placeholder="请输入任务号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">排: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="row" placeholder="请输入排"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">列: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="bay" placeholder="请输入列"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">层: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="lev" placeholder="请输入层"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">历史排: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="hisRow" placeholder="请输入历史排"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">历史列: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="hisBay" placeholder="请输入历史列"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">历史层: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="hisLev" placeholder="请输入历史层"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">暂存库位: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="idleLoc" placeholder="请输入暂存库位"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">自动充电: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="autoCharge" placeholder="请输入自动充电"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">电量线: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="chargeLine" placeholder="请输入电量线"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">添加人员: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="createBy" placeholder="请输入添加人员" style="display: none"> |
| | | <input id="createBy$" name="createBy$" 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="userQueryBycreateBy" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryBycreateBySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">添加时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="createTime" id="createTime$" placeholder="请输入添加时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改人员: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="updateBy" placeholder="请输入修改人员" style="display: none"> |
| | | <input id="updateBy$" name="updateBy$" 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="userQueryByupdateBy" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryByupdateBySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="updateTime" id="updateTime$" placeholder="请输入修改时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="memo" placeholder="请输入备注"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">提升机号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="liftNo" placeholder="请输入提升机号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">标记: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="pakMk" placeholder="请输入标记"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |