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.domain.enums.WmsWrkStatusType; |
| | | import com.zy.asrs.entity.WmsWrk; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.WmsWrkService; |
| | | 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 WmsWrkController extends BaseController { |
| | | |
| | | @Autowired |
| | | private WmsWrkService wmsWrkService; |
| | | |
| | | @RequestMapping(value = "/wmsWrk/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(wmsWrkService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrk/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 Map<String, Object> param){ |
| | | EntityWrapper<WmsWrk> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(wmsWrkService.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 = "/wmsWrk/add/auth") |
| | | @ManagerAuth |
| | | public R add(WmsWrk wmsWrk) { |
| | | wmsWrkService.insert(wmsWrk); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrk/update/auth") |
| | | @ManagerAuth |
| | | public R update(WmsWrk wmsWrk){ |
| | | if (Cools.isEmpty(wmsWrk) || null==wmsWrk.getWmsWrkNo()){ |
| | | return R.error(); |
| | | } |
| | | wmsWrkService.updateById(wmsWrk); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrk/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | wmsWrkService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrk/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<WmsWrk> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("wmsWrk")); |
| | | convert(map, wrapper); |
| | | List<WmsWrk> list = wmsWrkService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrkQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<WmsWrk> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<WmsWrk> page = wmsWrkService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (WmsWrk wmsWrk : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", wmsWrk.getWmsWrkNo()); |
| | | map.put("value", wmsWrk.getWmsWrkNo()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrk/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<WmsWrk> wrapper = new EntityWrapper<WmsWrk>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != wmsWrkService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(WmsWrk.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrk/add/pri/auth") |
| | | @ManagerAuth(memo = "任务增加优先级") |
| | | public R addPri(@RequestBody List<WmsWrk> list) { |
| | | if (list.isEmpty()) { |
| | | return R.error("请至少选择一行数据"); |
| | | } |
| | | for (WmsWrk entity : list){ |
| | | entity.setIoPri(entity.getIoPri() + 1); |
| | | } |
| | | wmsWrkService.updateBatchById(list); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wmsWrk/red/pri/auth") |
| | | @ManagerAuth(memo = "任务降低优先级") |
| | | public R redPri(@RequestBody List<WmsWrk> list) { |
| | | if (list.isEmpty()) { |
| | | return R.error("请至少选择一行数据"); |
| | | } |
| | | for (WmsWrk entity : list){ |
| | | entity.setIoPri(entity.getIoPri() - 1); |
| | | } |
| | | wmsWrkService.updateBatchById(list); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/wmsWrk/complete/auth") |
| | | @ManagerAuth(memo = "手动完成任务") |
| | | public R complete(@RequestParam Integer wmsWrkNo) { |
| | | WmsWrk wmsWrk = wmsWrkService.selectByWmsWrkNo(wmsWrkNo); |
| | | if (wmsWrk == null) { |
| | | return R.error(); |
| | | } |
| | | wmsWrk.setWmsStatus(WmsWrkStatusType.COMPLETE.id); |
| | | wmsWrk.setModiTime(new Date()); |
| | | wmsWrk.setModiUser(getUserId()); |
| | | wmsWrkService.updateById(wmsWrk); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/wmsWrk/cancel/auth") |
| | | @ManagerAuth(memo = "手动取消任务") |
| | | public R cancel(@RequestParam Integer wmsWrkNo) { |
| | | WmsWrk wmsWrk = wmsWrkService.selectByWmsWrkNo(wmsWrkNo); |
| | | if (wmsWrk == null) { |
| | | return R.error(); |
| | | } |
| | | wmsWrk.setWmsStatus(WmsWrkStatusType.CANCEL.id); |
| | | wmsWrk.setModiTime(new Date()); |
| | | wmsWrk.setModiUser(getUserId()); |
| | | wmsWrkService.updateById(wmsWrk); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/wmsWrk/distribute/auth") |
| | | @ManagerAuth(memo = "手动派发任务") |
| | | public R distribute(@RequestParam Integer wmsWrkNo) { |
| | | wmsWrkService.distribute(wmsWrkNo, getUserId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | import com.zy.core.enums.CrnForkPosType; |
| | | |
| | | public enum WmsWrkStatusType { |
| | | |
| | | RECEIVE(1,"接收"), |
| | | DISTRIBUTE(2,"派发"), |
| | | WORKING(3,"执行"), |
| | | COMPLETE(4,"完结"), |
| | | CANCEL(5,"取消"), |
| | | ; |
| | | |
| | | public Integer id; |
| | | public String desc; |
| | | |
| | | WmsWrkStatusType(Integer id,String desc){ |
| | | this.id = id; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static String get(Integer id) { |
| | | if (null == id) { |
| | | return null; |
| | | } |
| | | for (WmsWrkStatusType type : WmsWrkStatusType.values()) { |
| | | if (type.id.equals(id)) { |
| | | return type.desc; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
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 java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.zy.asrs.domain.enums.WmsWrkStatusType; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.entity.LocMast; |
| | | 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 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("wcs_wms_wrk") |
| | | public class WmsWrk implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * wms任务号 |
| | | */ |
| | | @ApiModelProperty(value= "wms任务号") |
| | | @TableId(value = "wms_wrk_no", type = IdType.INPUT) |
| | | @TableField("wms_wrk_no") |
| | | private Integer wmsWrkNo; |
| | | |
| | | /** |
| | | * wms任务状态 1: 接收 2: 派发 3: 执行 4: 完结 5: 取消 |
| | | */ |
| | | @ApiModelProperty(value= "wms任务状态 1: 接收 2: 派发 3: 执行 4: 完结 5: 取消") |
| | | @TableField("wms_status") |
| | | private Integer wmsStatus; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | @ApiModelProperty(value= "任务号") |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | /** |
| | | * 任务时间 |
| | | */ |
| | | @ApiModelProperty(value= "任务时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | @ApiModelProperty(value= "任务类型") |
| | | @TableField("io_type") |
| | | private Integer ioType; |
| | | |
| | | /** |
| | | * 优先级 |
| | | */ |
| | | @ApiModelProperty(value= "优先级") |
| | | @TableField("io_pri") |
| | | private Double ioPri; |
| | | |
| | | /** |
| | | * 目标库位 |
| | | */ |
| | | @ApiModelProperty(value= "目标库位") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 目标站 |
| | | */ |
| | | @ApiModelProperty(value= "目标站") |
| | | @TableField("sta_no") |
| | | private Integer staNo; |
| | | |
| | | /** |
| | | * 源站 |
| | | */ |
| | | @ApiModelProperty(value= "源站") |
| | | @TableField("source_sta_no") |
| | | private Integer sourceStaNo; |
| | | |
| | | /** |
| | | * 源库位 |
| | | */ |
| | | @ApiModelProperty(value= "源库位") |
| | | @TableField("source_loc_no") |
| | | private String sourceLocNo; |
| | | |
| | | /** |
| | | * 库位状态 |
| | | */ |
| | | @ApiModelProperty(value= "库位状态") |
| | | @TableField("loc_sts") |
| | | private String locSts; |
| | | |
| | | /** |
| | | * 拣料(checkBox) |
| | | */ |
| | | @ApiModelProperty(value= "拣料(checkBox)") |
| | | private String picking; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value= "创建者") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | @TableField("barcode") |
| | | private String barcode; |
| | | |
| | | public WmsWrk() {} |
| | | |
| | | public WmsWrk(Integer wmsWrkNo, Integer wmsStatus, Integer wrkNo, Date createTime, Integer ioType, Double ioPri, String locNo, Integer staNo, Integer sourceStaNo, String sourceLocNo, String locSts, String picking, Long modiUser, Date modiTime, Long appeUser, Date appeTime, String memo, String barcode) { |
| | | this.wmsWrkNo = wmsWrkNo; |
| | | this.wmsStatus = wmsStatus; |
| | | this.wrkNo = wrkNo; |
| | | this.createTime = createTime; |
| | | this.ioType = ioType; |
| | | this.ioPri = ioPri; |
| | | this.locNo = locNo; |
| | | this.staNo = staNo; |
| | | this.sourceStaNo = sourceStaNo; |
| | | this.sourceLocNo = sourceLocNo; |
| | | this.locSts = locSts; |
| | | this.picking = picking; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | this.memo = memo; |
| | | this.barcode = barcode; |
| | | } |
| | | |
| | | // WmsWrk wmsWrk = new WmsWrk( |
| | | // null, // wms任务号[非空] |
| | | // null, // wms任务状态 |
| | | // null, // 任务号 |
| | | // null, // 任务时间 |
| | | // null, // 入出库类型 |
| | | // null, // 堆垛机 |
| | | // null, // 优先级 |
| | | // null, // 目标库位 |
| | | // null, // 目标站 |
| | | // null, // 源站 |
| | | // null, // 源库位 |
| | | // null, // 库位状态 |
| | | // null, // 拣料(checkBox) |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 创建者 |
| | | // null, // 添加时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getWmsStatus$(){ |
| | | if (null == this.wmsStatus){ return null; } |
| | | return WmsWrkStatusType.get(this.wmsStatus); |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getIoType$(){ |
| | | BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class); |
| | | BasWrkIotype basWrkIotype = service.selectById(this.ioType); |
| | | if (!Cools.isEmpty(basWrkIotype)){ |
| | | return String.valueOf(basWrkIotype.getIoDesc()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getStaNo$(){ |
| | | BasDevpService service = SpringUtils.getBean(BasDevpService.class); |
| | | BasDevp basDevp = service.selectById(this.staNo); |
| | | if (!Cools.isEmpty(basDevp)){ |
| | | return String.valueOf(basDevp.getDevNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getSourceStaNo$(){ |
| | | BasDevpService service = SpringUtils.getBean(BasDevpService.class); |
| | | BasDevp basDevp = service.selectById(this.sourceStaNo); |
| | | if (!Cools.isEmpty(basDevp)){ |
| | | return String.valueOf(basDevp.getDevNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | 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 null; |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | /** |
| | | * 获取持续时间 |
| | | */ |
| | | public String getDurationTime() { |
| | | if (Cools.isEmpty(this.createTime)) { |
| | | return ""; |
| | | } |
| | | |
| | | Date endDate = new Date(); |
| | | |
| | | //用来获取两个时间相差的毫秒数 |
| | | long l = this.createTime.getTime() - endDate.getTime(); |
| | | |
| | | //分别计算相差的天、小时、分、秒 |
| | | long day = l / (24 * 60 * 60 * 1000); |
| | | long hour = (l / (60 * 60 * 1000) - day * 24); |
| | | long min = ((l / (60 * 1000)) - day * 24 * 60 - hour * 60); |
| | | long s = (l / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60); |
| | | |
| | | return Math.abs(day) + "天" + Math.abs(hour) + "小时" + Math.abs(min) + "分" + Math.abs(s) + "秒"; |
| | | } |
| | | |
| | | } |
| | |
| | | @TableField("full_plt") |
| | | private String fullPlt; |
| | | |
| | | /** |
| | | * 满板 |
| | | */ |
| | | @ApiModelProperty(value= "wms任务号") |
| | | @TableField("wms_wrk_no") |
| | | private Integer wmsWrkNo; |
| | | |
| | | public String getWrkSts$(){ |
| | | BasWrkStatusMapper mapper = SpringUtils.getBean(BasWrkStatusMapper.class); |
| | | BasWrkStatus entity = mapper.selectById(this.wrkSts); |
| | |
| | | @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); |
| | | |
| | | LocMast selectByLocNo(String locNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.WmsWrk; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WmsWrkMapper extends BaseMapper<WmsWrk> { |
| | | |
| | | WmsWrk selectByWmsWrkNo(Integer wmsWrkNo); |
| | | |
| | | } |
| | |
| | | */ |
| | | Boolean checkEmptyCount(LocMast locMast); |
| | | |
| | | LocMast selectByLocNo(String locNo); |
| | | |
| | | } |
| | |
| | | |
| | | public interface StaDescService extends IService<StaDesc> { |
| | | |
| | | StaDesc queryCrnStn(Integer typeNo, Integer crnNo, Integer stnNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.WmsWrk; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface WmsWrkService extends IService<WmsWrk> { |
| | | |
| | | WmsWrk selectByWmsWrkNo(Integer wmsWrkNo); |
| | | |
| | | //派发任务 |
| | | void distribute(Integer wmsWrkNo, Long userId); |
| | | |
| | | //入库 |
| | | void startup(WmsWrk wmsWrk, Long userId); |
| | | |
| | | //出库 |
| | | void stockOut(WmsWrk wmsWrk, Long userId); |
| | | |
| | | } |
| | |
| | | return this.baseMapper.selectEmptyLocCount(locMast.getLocType1(), locMast.getCrnNo()) > 1; |
| | | } |
| | | |
| | | @Override |
| | | public LocMast selectByLocNo(String locNo) { |
| | | return this.baseMapper.selectByLocNo(locNo); |
| | | } |
| | | } |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.WmsWrkStatusType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.BasCrnErrorMapper; |
| | | import com.zy.asrs.mapper.WaitPakinMapper; |
| | |
| | | private BasErrLogService basErrLogService; |
| | | @Autowired |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | @Autowired |
| | | private WmsWrkService wmsWrkService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("更新工作档失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | //更新WMS任务状态 |
| | | WmsWrk wmsWrk = wmsWrkService.selectByWmsWrkNo(wrkMast.getWmsWrkNo()); |
| | | wmsWrk.setWmsStatus(WmsWrkStatusType.WORKING.id);//执行中 |
| | | wmsWrk.setModiTime(new Date()); |
| | | wmsWrkService.updateById(wmsWrk); |
| | | |
| | | } else { |
| | | log.error("发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.StaDesc; |
| | | import com.zy.asrs.mapper.StaDescMapper; |
| | | import com.zy.asrs.service.StaDescService; |
| | |
| | | @Service("staDescService") |
| | | public class StaDescServiceImpl extends ServiceImpl<StaDescMapper, StaDesc> implements StaDescService { |
| | | |
| | | @Override |
| | | public StaDesc queryCrnStn(Integer typeNo, Integer crnNo, Integer stnNo) { |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", typeNo) |
| | | .eq("stn_no", stnNo) |
| | | .eq("crn_no", crnNo); |
| | | StaDesc staDesc = this.selectOne(wrapper); |
| | | if (staDesc == null) { |
| | | throw new CoolException("出库路径不存在"); |
| | | } |
| | | return staDesc; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.WmsWrkStatusType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.WmsWrkMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.common.service.CommonService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Service("wmsWrkService") |
| | | public class WmsWrkServiceImpl extends ServiceImpl<WmsWrkMapper, WmsWrk> implements WmsWrkService { |
| | | |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | |
| | | @Override |
| | | public WmsWrk selectByWmsWrkNo(Integer wmsWrkNo) { |
| | | return this.baseMapper.selectByWmsWrkNo(wmsWrkNo); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void distribute(Integer wmsWrkNo, Long userId) { |
| | | WmsWrk wmsWrk = this.selectByWmsWrkNo(wmsWrkNo); |
| | | if (wmsWrk == null) { |
| | | throw new CoolException("WMS任务不存在"); |
| | | } |
| | | |
| | | wmsWrk.setWmsStatus(WmsWrkStatusType.DISTRIBUTE.id);//派发状态 |
| | | wmsWrk.setModiTime(new Date()); |
| | | wmsWrk.setModiUser(userId); |
| | | this.updateById(wmsWrk); |
| | | |
| | | //创建任务 |
| | | if (wmsWrk.getIoType() == 1) { |
| | | //入库 |
| | | startup(wmsWrk, userId); |
| | | }else if(wmsWrk.getIoType() == 101){ |
| | | //出库 |
| | | stockOut(wmsWrk, userId); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void startup(WmsWrk wmsWrk, Long userId) { |
| | | Date now = new Date(); |
| | | LocMast locMast = locMastService.selectByLocNo(wmsWrk.getLocNo()); |
| | | if (locMast == null) { |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | |
| | | // 生成任务号 |
| | | int workNo = commonService.getWorkNo(0); |
| | | wmsWrk.setWrkNo(workNo); |
| | | this.baseMapper.updateById(wmsWrk); |
| | | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(wmsWrk.getSourceStaNo(), true); |
| | | |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setWmsWrkNo(wmsWrk.getWmsWrkNo()); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(1L); // 工作状态:生成入库ID |
| | | wrkMast.setIoType(1); // 入出库状态:1.入库 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(wmsWrk.getSourceStaNo()); |
| | | wrkMast.setStaNo(wmsWrk.getStaNo()); |
| | | wrkMast.setLocNo(wmsWrk.getLocNo()); |
| | | wrkMast.setBarcode(wmsWrk.getBarcode()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setCtnType(sourceStaNo.getCtnType()); // 容器类型 |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | // 更新源站点信息 |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiUser(userId); |
| | | sourceStaNo.setModiTime(now); |
| | | if (!basDevpService.updateById(sourceStaNo)) { |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | |
| | | // 更新目标库位状态 |
| | | if (locMast.getLocSts().equals("O")) { |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(wmsWrk.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void stockOut(WmsWrk wmsWrk, Long userId) { |
| | | Date now = new Date(); |
| | | LocMast locMast = locMastService.selectByLocNo(wmsWrk.getSourceLocNo()); |
| | | if (locMast == null) { |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | |
| | | // 生成任务号 |
| | | int workNo = commonService.getWorkNo(2); |
| | | wmsWrk.setWrkNo(workNo); |
| | | this.baseMapper.updateById(wmsWrk); |
| | | |
| | | // 获取路径 |
| | | StaDesc staDesc = staDescService.queryCrnStn(101, locMast.getCrnNo(), wmsWrk.getStaNo()); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(101); // 101.出库 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo()); // 目标站 |
| | | wrkMast.setSourceLocNo(wmsWrk.getSourceLocNo()); // 源库位 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMast.setAppeUser(userId); // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:" + wmsWrk.getSourceLocNo()); |
| | | } |
| | | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(wmsWrk.getSourceLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts("R"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:" + wmsWrk.getSourceLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(wmsWrk.getSourceLocNo() + "库位不是在库状态"); |
| | | } |
| | | } |
| | | } |
| | |
| | | private LocDetlService locDetlService; |
| | | |
| | | /** |
| | | * 生成工作号 |
| | | * 生成工作号 wrkMk 0:入库 1 - 3000 ; 1:拣料/并板/盘点 3001 - 6000 ; 2: 出库 6001 -9000 ; 3:其他 9001 -9999 |
| | | * @return workNo(工作号) |
| | | */ |
| | | public int getWorkNo(Integer wrkMk) { |
| | |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | <select id="selectByLocNo" resultMap="BaseResultMap"> |
| | | select * from asr_loc_mast |
| | | where loc_no = #{locNo} |
| | | </select> |
| | | |
| | | </mapper> |
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.WmsWrkMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.WmsWrk"> |
| | | <result column="wms_wrk_no" property="wmsWrkNo" /> |
| | | <result column="wms_status" property="wmsStatus" /> |
| | | <result column="wrk_no" property="wrkNo" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="io_type" property="ioType" /> |
| | | <result column="io_pri" property="ioPri" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="sta_no" property="staNo" /> |
| | | <result column="source_sta_no" property="sourceStaNo" /> |
| | | <result column="source_loc_no" property="sourceLocNo" /> |
| | | <result column="loc_sts" property="locSts" /> |
| | | <result column="picking" property="picking" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="barcode" property="barcode" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectByWmsWrkNo" resultMap="BaseResultMap"> |
| | | select * from wcs_wms_wrk |
| | | where wms_wrk_no = #{wmsWrkNo} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/wms/layui/lay/modules/" |
| | | }).extend({ |
| | | dropdown: 'dropdown/dropdown', |
| | | }).use(['table','laydate', 'form', 'admin', 'dropdown'], 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: '#wmsWrk', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/wmsWrk/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'wmsWrkNo', align: 'center',title: 'WMS任务号',width: 110} |
| | | ,{field: 'wmsStatus$', align: 'center',title: 'WMS任务状态',width: 130} |
| | | ,{field: 'wrkNo', align: 'center',title: '任务号'} |
| | | ,{field: 'createTime$', align: 'center',title: '任务时间',width: 170} |
| | | ,{field: 'durationTime', align: 'center',title: '持续时长',width: 150} |
| | | ,{field: 'ioType$', align: 'center',title: '任务类型'} |
| | | ,{field: 'ioPri', align: 'center',title: '优先级'} |
| | | ,{field: 'sourceStaNo$', align: 'center',title: '源站'} |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceLocNo', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo', align: 'center',title: '目标库位'} |
| | | ,{field: 'locSts', align: 'center',title: '库位状态'} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | // ,{field: 'picking', align: 'center',title: '拣料'} |
| | | // ,{field: 'modiUser$', align: 'center',title: '修改人员'} |
| | | // ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | // ,{field: 'appeUser$', align: 'center',title: '创建者'} |
| | | ,{field: 'appeTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 110} |
| | | ]], |
| | | 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+"/"; |
| | | } |
| | | $(".layui-table-body, .layui-table-box, .layui-table-cell").css('overflow','visible');//解决layui数据表格中嵌套下拉框显示问题 |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(wmsWrk)', 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(wmsWrk)', 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.wmsWrkNo; |
| | | })); |
| | | 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 = { |
| | | 'wmsWrk': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/wmsWrk/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; |
| | | // 增加优先级 |
| | | case 'priAdd': |
| | | var list = []; |
| | | checkStatus.map(function (track) { |
| | | list.push({ |
| | | wmsWrkNo: track.wmsWrkNo, |
| | | ioPri: track.ioPri |
| | | }); |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl + "/wmsWrk/add/pri/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify(list), |
| | | method: 'POST', |
| | | traditional: true, |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | break; |
| | | // 降低优先级 |
| | | case 'priRed': |
| | | var list = []; |
| | | checkStatus.map(function (track) { |
| | | list.push({ |
| | | wmsWrkNo: track.wmsWrkNo, |
| | | ioPri: track.ioPri |
| | | }); |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl + "/wmsWrk/red/pri/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify(list), |
| | | method: 'POST', |
| | | traditional: true, |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(wmsWrk)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'distribute'://派发 |
| | | layer.confirm('确认派发该笔任务?', {title: 'WMS任务号:' + data.wmsWrkNo, shadeClose: true}, function () { |
| | | $.ajax({ |
| | | url: baseUrl + "/wmsWrk/distribute/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | wmsWrkNo: data.wmsWrkNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg) |
| | | setTimeout(() => { |
| | | layer.closeAll(); |
| | | tableReload(); |
| | | }, 1000); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | break; |
| | | case "complete"://完结 |
| | | layer.confirm('确认完成该笔任务?', {title: 'WMS任务号:' + data.wmsWrkNo, shadeClose: true}, function () { |
| | | $.ajax({ |
| | | url: baseUrl + "/wmsWrk/complete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | wmsWrkNo: data.wmsWrkNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg) |
| | | setTimeout(() => { |
| | | layer.closeAll(); |
| | | tableReload(); |
| | | }, 1000); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | break; |
| | | case "cancel"://取消 |
| | | layer.confirm('确认取消该笔任务?', {title: 'WMS任务号:' + data.wmsWrkNo, shadeClose: true}, function () { |
| | | $.ajax({ |
| | | url: baseUrl + "/wmsWrk/cancel/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | wmsWrkNo: data.wmsWrkNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg) |
| | | setTimeout(() => { |
| | | layer.closeAll(); |
| | | tableReload(); |
| | | }, 1000); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | 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+"/wmsWrk/"+(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+"/wmsWrk/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: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['modiTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['appeTime\\$']: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} |
| | | }); |
| | | } |
| | |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | , {field: 'wmsWrkNo', align: 'center', title: 'WMS任务号', sort: true, width: 85} |
| | | , {field: 'wrkNo', align: 'center', title: '任务号', sort: true, width: 85} |
| | | , {field: 'ioTime$', align: 'center', title: '任务时间', sort: true, width: 160} |
| | | , {field: 'durationTime', align: 'center', title: '持续时长', width: 160} |
| | |
| | | // return html; |
| | | // }} |
| | | |
| | | , {fixed: 'right', title: '操作', align: 'left', toolbar: '#operate', width: 120} |
| | | , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 110} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
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/wms/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/wms/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/wms/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="wms_wrk_no" placeholder="WMS任务号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="wrk_no" 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="wmsWrk" lay-filter="wmsWrk"></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-normal" id="btn-pri-add" lay-event="priAdd"><i class="layui-icon"></i>增加优先级</button> |
| | | <button class="layui-btn layui-btn-normal" id="btn-pri-red" lay-event="priRed"><i class="layui-icon"></i>降低优先级</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"> |
| | | <!-- 商品/物料 数据中心 --> |
| | | <div class="dropdown-menu"> |
| | | <button class="layui-btn layui-btn-primary layui-border-black icon-btn layui-btn-sm"><i class="layui-icon layui-icon-drop"></i></button> |
| | | <ul class="dropdown-menu-nav" style="margin-left: -35px"> |
| | | {{#if (d.wmsStatus === 1 || d.wmsStatus === 0) { }} |
| | | <li><a lay-event="distribute">派发</a></li> |
| | | {{# } }} |
| | | <li><a lay-event="complete">完结</a></li> |
| | | <li><a lay-event="cancel">取消</a></li> |
| | | </ul> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/wms/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/wms/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/wmsWrk/wmsWrk.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">WMS任务号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="wmsWrkNo" placeholder="请输入WMS任务号" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">WMS任务状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="wmsStatus"> |
| | | <option value="">请选择WMS任务状态</option> |
| | | <option value="0">创建</option> |
| | | <option value="1">接收</option> |
| | | <option value="2">派发</option> |
| | | <option value="3">完结</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="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="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="ioType" placeholder="请输入入出库类型" style="display: none"> |
| | | <input id="ioType$" 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="basWrkIotypeQueryByioType" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basWrkIotypeQueryByioTypeSelect" 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 cool-auto-complete"> |
| | | <input class="layui-input" name="crnNo" placeholder="请输入堆垛机" style="display: none"> |
| | | <input id="crnNo$" 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="basCrnpQueryBycrnNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basCrnpQueryBycrnNoSelect" 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="ioPri" 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="locNo" placeholder="请输入目标库位" style="display: none"> |
| | | <input id="locNo$" 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="locMastQueryBylocNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locMastQueryBylocNoSelect" 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 cool-auto-complete"> |
| | | <input class="layui-input" name="staNo" placeholder="请输入目标站" style="display: none"> |
| | | <input id="staNo$" 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="basDevpQueryBystaNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basDevpQueryBystaNoSelect" 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 cool-auto-complete"> |
| | | <input class="layui-input" name="sourceStaNo" placeholder="请输入源站" style="display: none"> |
| | | <input id="sourceStaNo$" 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="basDevpQueryBysourceStaNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basDevpQueryBysourceStaNoSelect" 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 cool-auto-complete"> |
| | | <input class="layui-input" name="sourceLocNo" placeholder="请输入源库位" style="display: none"> |
| | | <input id="sourceLocNo$" 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="locMastQueryBysourceLocNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locMastQueryBysourceLocNoSelect" 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="locSts" placeholder="请输入库位状态"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">拣料(checkBox): </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="picking" placeholder="请输入拣料(checkBox)"> |
| | | </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="modiUser" placeholder="请输入修改人员" style="display: none"> |
| | | <input id="modiUser$" 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="userQueryBymodiUser" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryBymodiUserSelect" 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="modiTime" id="modiTime$" 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="appeUser" placeholder="请输入创建者" style="display: none"> |
| | | <input id="appeUser$" 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="userQueryByappeUser" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryByappeUserSelect" 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="appeTime" id="appeTime$" 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> |
| | | </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> |
| | | |
| | |
| | | <!-- 商品/物料 数据中心 --> |
| | | <div class="dropdown-menu"> |
| | | <button class="layui-btn layui-btn-primary layui-border-black icon-btn layui-btn-sm"><i class="layui-icon layui-icon-drop"></i></button> |
| | | <ul class="dropdown-menu-nav"> |
| | | <ul class="dropdown-menu-nav" style="margin-left: -35px"> |
| | | {{#if (d.preHave === 'Y' && d.wrkSts === 3) { }} |
| | | <li><a lay-event="preHave">先入品</a></li> |
| | | {{# } }} |