| | |
| | | <relativePath/> |
| | | </parent> |
| | | <groupId>com.zy</groupId> |
| | | <artifactId>asrs</artifactId> |
| | | <artifactId>asrs</artifactId>t |
| | | <version>1.1.1</version> |
| | | <packaging>war</packaging> |
| | | |
| | |
| | | public R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId, Long userId) { |
| | | //判断库位状态 |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getLocNo())); |
| | | if (Cools.isEmpty(locMast)){ |
| | | if (Cools.isEmpty(locMast)) { |
| | | return R.error("该库位不存在"); |
| | | } |
| | | if (!locMast.getLocSts().equals("P")){ |
| | | return R.error("该库位状态为:"+locMast.getLocSts()+",不满足拣料途中并板条件!!!"); |
| | | if (!locMast.getLocSts().equals("P")) { |
| | | return R.error("该库位状态为:" + locMast.getLocSts() + ",不满足拣料途中并板条件!!!"); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | |
| | | wrkMastService.insert(wrkMast); |
| | | |
| | | for (OrderDetl orderDetl : param.getCombMats()) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr",orderDetl.getMatnr())); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", orderDetl.getMatnr())); |
| | | if (mat == null) { |
| | | throw new CoolException("保存工作档失败,物料信息不存在:" + orderDetl.getMatnr()); |
| | | } |
| | |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setZpallet(wrkMast.getBarcode()); |
| | | wrkDetl.setBatch(orderDetl.getBatch()); |
| | | if(Cools.isEmpty(orderDetl.getBatch())){ |
| | | if (Cools.isEmpty(orderDetl.getBatch())) { |
| | | wrkDetl.setBatch(""); |
| | | } |
| | | wrkDetl.setBoxType1(orderDetl.getBoxType1()); |
| | |
| | | |
| | | if (!Cools.isEmpty(orderDetl.getOrderNo())) { |
| | | OrderPakin order = orderPakinService.selectByNo(orderDetl.getOrderNo()); |
| | | if (Cools.isEmpty(order)){ |
| | | if (Cools.isEmpty(order)) { |
| | | continue; |
| | | } |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | if (Cools.isEmpty(orderDetlPakin)){ |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(), orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); |
| | | if (Cools.isEmpty(orderDetlPakin)) { |
| | | continue; |
| | | } |
| | | if (orderDetlPakin.getAnfme() < (orderDetlPakin.getWorkQty() + orderDetl.getAnfme())) { |
| | |
| | | } |
| | | // 修改订单明细作业数量 |
| | | if (!orderDetlPakinService.increaseWorkQty(orderDetlPakin.getOrderId(), orderDetlPakin.getMatnr(), orderDetlPakin.getBatch(), orderDetlPakin.getBrand(), |
| | | orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(),orderDetl.getAnfme())) { |
| | | orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(), orderDetl.getAnfme())) { |
| | | throw new CoolException("修改单据明细工作数量失败"); |
| | | } |
| | | |
| | | if (order.getSettle() == 1){ |
| | | if (order.getSettle() == 1) { |
| | | orderPakinService.updateSettle(order.getId(), 2L, userId); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R pickConfirm(PickConfirmParam param,Long userId) { |
| | | public R pickConfirm(PickConfirmParam param, Long userId) { |
| | | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", param.getLocNo())); |
| | |
| | | //检验传参是否和订单明细匹配 |
| | | for (PickMatParam matParam : param.getList()) { |
| | | orderDetlPakin = orderDetlPakinService.selectItem |
| | | (matParam.getOrderNo(), matParam.getMatnr(),matParam.getBatch(),matParam.getBrand(), |
| | | matParam.getStandby1(),matParam.getStandby2(),matParam.getStandby3(), |
| | | matParam.getBoxType1(),matParam.getBoxType2(),matParam.getBoxType3()); |
| | | (matParam.getOrderNo(), matParam.getMatnr(), matParam.getBatch(), matParam.getBrand(), |
| | | matParam.getStandby1(), matParam.getStandby2(), matParam.getStandby3(), |
| | | matParam.getBoxType1(), matParam.getBoxType2(), matParam.getBoxType3()); |
| | | if (orderDetlPakin == null) { |
| | | return R.error("物料数据不存在"); |
| | | } |
| | |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setZpallet(wrkMast.getBarcode()); |
| | | if(Cools.isEmpty(matParam.getBatch())){ |
| | | if (Cools.isEmpty(matParam.getBatch())) { |
| | | wrkDetl.setBatch(""); |
| | | } |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | |
| | | |
| | | //更新订单工作数量 |
| | | orderDetlPakinService.increaseWorkQty(orderDetlPakin.getOrderId(), matParam.getMatnr(), |
| | | matParam.getBatch(),matParam.getBrand(),matParam.getStandby1(),matParam.getStandby2(),matParam.getStandby3(), |
| | | matParam.getBoxType1(),matParam.getBoxType2(),matParam.getBoxType3(),matParam.getUseCount()); |
| | | matParam.getBatch(), matParam.getBrand(), matParam.getStandby1(), matParam.getStandby2(), matParam.getStandby3(), |
| | | matParam.getBoxType1(), matParam.getBoxType2(), matParam.getBoxType3(), matParam.getUseCount()); |
| | | // 更新工作档状态 |
| | | orderPakinService.updateSettle(orderDetlPakin.getOrderId(),2L,userId); |
| | | orderPakinService.updateSettle(orderDetlPakin.getOrderId(), 2L, userId); |
| | | } |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getLocNo())); |
| | |
| | | public R WarehouseOutV1(CombParam combParam, Long hostId, Long userId) { |
| | | //判断库位状态 |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", combParam.getLocNo())); |
| | | if (Cools.isEmpty(locMast)){ |
| | | if (Cools.isEmpty(locMast)) { |
| | | return R.error("该库位不存在"); |
| | | } |
| | | if (!locMast.getLocSts().equals("P")){ |
| | | return R.error("该库位状态为:"+locMast.getLocSts()+",不满足并板途中拣选条件!!!"); |
| | | if (!locMast.getLocSts().equals("P")) { |
| | | return R.error("该库位状态为:" + locMast.getLocSts() + ",不满足并板途中拣选条件!!!"); |
| | | } |
| | | //查询库存数据 |
| | | for (CombParam.CombMat combMat :combParam.getCombMats()){ |
| | | for (CombParam.CombMat combMat : combParam.getCombMats()) { |
| | | List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", combParam.getLocNo()) |
| | | .eq("matnr", combMat.getMatnr()) |
| | | .eq("loc_no", combParam.getLocNo()) |
| | | .eq("matnr", combMat.getMatnr()) |
| | | ); |
| | | if (locDetlList.isEmpty()){ |
| | | if (locDetlList.isEmpty()) { |
| | | return R.error("未查询到库存数据"); |
| | | } |
| | | if (locDetlList.size()>1){ |
| | | if (locDetlList.size() > 1) { |
| | | return R.error("库存数据大于1条,为保证数据准确性,请用正常流程出库!!!"); |
| | | } |
| | | LocDetl locDetl = locDetlList.get(0); |
| | | if (combMat.getAnfme() > locDetl.getAnfme()){ |
| | | if (combMat.getAnfme() > locDetl.getAnfme()) { |
| | | return R.error("拣选数量错误,超出库存数量"); |
| | | } |
| | | if (!Cools.isEmpty(combMat.getOrderNo())){ |
| | | if (!Cools.isEmpty(combMat.getOrderNo())) { |
| | | OrderPakout orderPakout = orderPakoutService.selectByNo(combMat.getOrderNo()); |
| | | if (Cools.isEmpty(orderPakout)){ |
| | | if (Cools.isEmpty(orderPakout)) { |
| | | continue; |
| | | } |
| | | if (orderPakout.getSettle() == 1){ |
| | | OrderInAndOutUtil.updateOrder(false,orderPakout.getId(), 2L, 9527L); |
| | | if (orderPakout.getSettle() == 1) { |
| | | OrderInAndOutUtil.updateOrder(false, orderPakout.getId(), 2L, 9527L); |
| | | } |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderPakout.getId(), combMat.getMatnr(), combMat.getBatch(), |
| | | combMat.getBrand(), combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3()); |
| | | if (Cools.isEmpty(orderDetlPakout)){ |
| | | if (Cools.isEmpty(orderDetlPakout)) { |
| | | continue; |
| | | } |
| | | if (orderDetlPakout.getAnfme() < (orderDetlPakout.getWorkQty()+combMat.getAnfme())){ |
| | | if (orderDetlPakout.getAnfme() < (orderDetlPakout.getWorkQty() + combMat.getAnfme())) { |
| | | throw new CoolException("拣选数量出错,订单剩余出库数量小于已出库数量与将拣选数量之和!!!"); |
| | | } |
| | | // 修改订单明细作业数量 |
| | | if (!orderDetlPakoutService.increaseWorkQty(orderDetlPakout.getOrderId(), combMat.getMatnr(), combMat.getBatch(), combMat.getBrand(), |
| | | combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3(),combMat.getAnfme())) { |
| | | combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3(), combMat.getAnfme())) { |
| | | throw new CoolException("修改单据明细工作数量失败"); |
| | | } |
| | | // // 修改订单明细完成数量 |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMastService.insert(wrkMast); |
| | | |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr",combMat.getMatnr())); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", combMat.getMatnr())); |
| | | if (mat == null) { |
| | | throw new CoolException("保存工作档失败,物料信息不存在:" + combMat.getMatnr()); |
| | | } |
| | |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setZpallet(wrkMast.getBarcode()); |
| | | wrkDetl.setBatch(combMat.getBatch()); |
| | | if(Cools.isEmpty(combMat.getBatch())){ |
| | | if (Cools.isEmpty(combMat.getBatch())) { |
| | | wrkDetl.setBatch(""); |
| | | } |
| | | wrkDetl.setBoxType1(combMat.getBoxType1()); |
| | |
| | | wrkDetlService.insert(wrkDetl); |
| | | System.out.println("正常"); |
| | | |
| | | }catch (Exception e) { |
| | | throw new CoolException("操作数据异常:"+e.getMessage()); |
| | | } catch (Exception e) { |
| | | throw new CoolException("操作数据异常:" + e.getMessage()); |
| | | } |
| | | } |
| | | return R.ok("操作成功!"); |
| | |
| | | Wrapper<OrderDetl> wrapper1 = new EntityWrapper<>(); |
| | | wrapper1.eq("status", 1); |
| | | wrapper1.in("order_id", orderIds); |
| | | wrapper1.orderBy("create_time",false); |
| | | wrapper1.orderBy("create_time", false); |
| | | if (!Cools.isEmpty(matnr)) { |
| | | wrapper1.like("matnr", matnr); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void comb(CombParam param, Long userId) { |
| | | if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | if(param.getCombMats().size()>1){ |
| | | if (param.getCombMats().size() > 1) { |
| | | throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | } |
| | | // 判断是否有相同条码的数据 |
| | |
| | | throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | } |
| | | |
| | | if(param.getBarcode().length()!=8){ |
| | | if (param.getBarcode().length() != 8) { |
| | | throw new CoolException("条码长度不是8位===>>" + param.getBarcode()); |
| | | } |
| | | if (param.getCombMats().size()>1){ |
| | | if (param.getCombMats().size() > 1) { |
| | | throw new CoolException("不允许混料===>>" + param.getBarcode()); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode())); |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0 || countwait > 0) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | } |
| | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), |
| | | elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | assert one != null; |
| | |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | } |
| | | // 关联组托 |
| | | // 关联组托 |
| | | } else { |
| | | // Order order = orderService.selectByNo(param.getOrderNo()); |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, param.getOrderNo()); |
| | |
| | | |
| | | // 订单明细数量校验 |
| | | // OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); |
| | | OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), |
| | | elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3()); |
| | | OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3()); |
| | | if (elem.getAnfme() > orderDetl.getEnableQty()) { |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); |
| | | } |
| | |
| | | // if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme())) { |
| | | // throw new CoolException("修改单据作业数量失败"); |
| | | // } |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE,order.getId(), elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), |
| | | elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), |
| | | elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | assert one != null; |
| | |
| | | } |
| | | } |
| | | // orderService.updateSettle(order.getId(), 2L, userId); |
| | | OrderInAndOutUtil.updateOrder(Boolean.TRUE,order.getId(), 2L, userId); |
| | | OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | // 获取商品列表 |
| | | for(CombParam.CombMat combMat : param.getCombMats()){ |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | Mat mat = matService.selectByMatnr(combMat.getMatnr()); |
| | | if (Cools.isEmpty(mat)){ |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(combMat.getMatnr() + ":商品档案不存在!"); |
| | | } |
| | | if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme()==0){ |
| | | if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme() == 0) { |
| | | throw new CoolException(combMat.getMatnr() + ":商品数量有误!"); |
| | | } |
| | | if (Cools.isEmpty(combMat.getBatch())){ |
| | | if (Cools.isEmpty(combMat.getBatch())) { |
| | | // throw new CoolException(combMat.getMatnr() + ":商品批号有误!"); |
| | | } |
| | | ManLocDetl manLocDetl = new ManLocDetl(); |
| | |
| | | @Override |
| | | public void offSale(OffSaleParam offSaleParam) { |
| | | ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); |
| | | if (Cools.isEmpty(manLocDetl)){ |
| | | if (Cools.isEmpty(manLocDetl)) { |
| | | throw new CoolException("无此商品!"); |
| | | } |
| | | double anfme = manLocDetl.getAnfme() - offSaleParam.getAnfme(); |
| | | if (anfme < 0) { |
| | | throw new CoolException("商品库存不足!"); |
| | | } else if (anfme == 0){ |
| | | } else if (anfme == 0) { |
| | | manLocDetlMapper.deleteLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); |
| | | } |
| | | manLocDetlMapper.updateAnfme0(anfme,manLocDetl.getNodeId()); |
| | | manLocDetlMapper.updateAnfme0(anfme, manLocDetl.getNodeId()); |
| | | } |
| | | |
| | | // 查找商品 |
| | |
| | | |
| | | // 添加明细 |
| | | for (WrkDetl wrkDetl : list) { |
| | | if (wrkDetl.getAnfme() == 0.0D) { continue; } |
| | | if (wrkDetl.getAnfme() == 0.0D) { |
| | | continue; |
| | | } |
| | | // todo 盘点记录、保存调整记录 |
| | | String orderNo = wrkDetl.getOrderNo(); |
| | | Mat mat = matService.selectByMatnr(wrkDetl.getMatnr()); |
| | |
| | | } |
| | | |
| | | // 修改盘点任务主档状态 |
| | | wrkMast.setFullPlt(wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()).size() != 0?"Y":"N"); |
| | | wrkMast.setFullPlt(wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()).size() != 0 ? "Y" : "N"); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | |
| | | } |
| | | Mat analyse = MatUtils.analyseMat(elem.getMatnr()); |
| | | // 条码、物料代码、序列号、数量 |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),analyse.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), |
| | | elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), analyse.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | |
| | | // DetlDto detlDto = new DetlDto(elem.getMatnr(), analyse.getMatnr(), analyse.getBarcode(), elem.getAnfme()); |
| | | // DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); |
| | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | success = true; |
| | | } else if (jsonObject.getInteger("code").equals(500)) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException(jsonObject.getString("msg")); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | // 修改作业数量 ---------------------------------------- |
| | | // 订单明细数量校验 |
| | | // OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), detlDto.getMatnr(), detlDto.getBatch()); |
| | | OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3() |
| | | ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3()); |
| | | OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3() |
| | | , detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3()); |
| | | if (detlDto.getAnfme() > orderDetl.getEnableQty()) { |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); |
| | | } |
| | |
| | | // if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) { |
| | | // throw new CoolException("修改单据作业数量失败"); |
| | | // } |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE,order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3() |
| | | ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme()); |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3() |
| | | , detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme()); |
| | | // 保存入库通知档 |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | |
| | | //根据订单号生成出库任务工作档 |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, orderNo); |
| | | // Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", orderNo)); |
| | | if (order.getSettle() != 1 && order.getSettle() != 2){ |
| | | if (order.getSettle() != 1 && order.getSettle() != 2) { |
| | | throw new CoolException("该订单已处理"); |
| | | } |
| | | |
| | |
| | | List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); |
| | | |
| | | Date now = new Date(); |
| | | for(OrderDetl orderDetl : orderDetls){ |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | //查询所有库位状态为F的库位信息 |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(),orderDetl.getBatch(),null,null); |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null, null); |
| | | if (locDetls.size() == 0) { |
| | | throw new CoolException("库存中没有该物料"); |
| | | } |
| | | for(LocDetl locDetl : locDetls){ |
| | | for (LocDetl locDetl : locDetls) { |
| | | //如果该库位出库路线所用的堆垛机out_enable不为Y,跳过该循环 |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", locDetl.getLocNo())); |
| | |
| | | } |
| | | BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() |
| | | .eq("crn_no", locMast.getCrnNo())); |
| | | if (Cools.isEmpty(crn_no) || !crn_no.getOutEnable().equals("Y")){ |
| | | if (Cools.isEmpty(crn_no) || !crn_no.getOutEnable().equals("Y")) { |
| | | continue; |
| | | } |
| | | |
| | | //可出库数量 = 订单数量 - 作业中数量 |
| | | Double outQty = orderDetl.getAnfme() - orderDetl.getWorkQty(); |
| | | if(outQty <= 0){ |
| | | if (outQty <= 0) { |
| | | break; |
| | | } |
| | | // 判断入出库类型:101.全板出库 or 103.拣料出库 |
| | |
| | | // if(!orderService.update(order, new EntityWrapper<Order>().eq("order_no", orderNo))){ |
| | | // throw new CoolException("更新订单状态失败"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),2L,userId); |
| | | OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 2L, userId); |
| | | orderDetl.setWorkQty(orderDetl.getWorkQty() + curOutQty); |
| | | orderDetl.setUpdateBy(userId); |
| | | orderDetl.setUpdateTime(now); |
| | | Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo) |
| | | .eq("matnr",orderDetl.getMatnr()); |
| | | if(!Cools.isEmpty(orderDetl.getBatch())){ |
| | | .eq("matnr", orderDetl.getMatnr()); |
| | | if (!Cools.isEmpty(orderDetl.getBatch())) { |
| | | wrapper.eq("batch", orderDetl.getBatch()); |
| | | } |
| | | // if(!orderDetlService.update(orderDetl, wrapper)){ |
| | | // throw new CoolException("更新订单明细失败"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrderDetl(order.getPakinPakoutStatus$(),order,orderDetl); |
| | | OrderInAndOutUtil.updateOrderDetl(order.getPakinPakoutStatus$(), order, orderDetl); |
| | | |
| | | } |
| | | |
| | |
| | | return casual.getDeclaredMethod(OrderMethodVo.INCREASE_QTY_BY_ORDER_NO.getCode(), String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,Double.class); |
| | | case INCREASE_WORKING_QTY: |
| | | return casual.getDeclaredMethod(OrderMethodVo.INCREASE_WORKING_QTY.getCode(), Long.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,Double.class); |
| | | default: |
| | | break; |
| | | } |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getCause().getMessage()); |
| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.utils.Http; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.web.cors.CorsConfiguration; |
| | | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
| | | import org.springframework.web.filter.CorsFilter; |
| | | import org.springframework.web.servlet.AsyncHandlerInterceptor; |
| | | import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-13 |
| | |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(adminInterceptor) |
| | | .addPathPatterns("/**") |
| | | ; |
| | | ; |
| | | } |
| | | |
| | | @Override |
| | | public void addCorsMappings(CorsRegistry registry) { |
| | | registry.addMapping("/**") |
| | | .allowedOrigins("*") // 使用 allowedOriginPatterns 而不是 allowedOrigins |
| | | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") |
| | | .allowedHeaders("*") |
| | | .allowCredentials(true) |
| | | .maxAge(3600); |
| | | } |
| | | |
| | | /** |
| | | * 方式二:使用 Filter(更全面,优先级更高) |
| | | */ |
| | | @Bean |
| | | public FilterRegistrationBean<CorsFilter> corsFilter() { |
| | | CorsConfiguration config = new CorsConfiguration(); |
| | | |
| | | // 允许所有域名 |
| | | config.addAllowedOrigin("*"); |
| | | |
| | | // 允许任何头 |
| | | config.addAllowedHeader("*"); |
| | | |
| | | // 允许任何方法(GET, POST, PUT, DELETE, OPTIONS等) |
| | | config.addAllowedMethod("*"); |
| | | |
| | | // 允许凭证(如果需要cookie等凭证,设置为true,但需要指定具体域名) |
| | | config.setAllowCredentials(false); |
| | | |
| | | // 预检请求的有效期,单位为秒 |
| | | config.setMaxAge(3600L); |
| | | |
| | | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); |
| | | source.registerCorsConfiguration("/**", config); |
| | | |
| | | FilterRegistrationBean<CorsFilter> bean = new FilterRegistrationBean<>(new CorsFilter(source)); |
| | | |
| | | // 设置优先级最高 |
| | | bean.setOrder(Ordered.HIGHEST_PRECEDENCE); |
| | | |
| | | return bean; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | public static final String PAKOUT_URL = "wmsFinprd/api/zy/v1/packOut/sendList"; |
| | | |
| | | |
| | | /** |
| | | * token通过header传递的名称 |
| | | */ |
| | | public static final String TOKEN_HEADER_NAME = "Authorization"; |
| | | |
| | | /** |
| | | * token通过参数传递的名称 |
| | | */ |
| | | public static final String TOKEN_PARAM_NAME = "access_token"; |
| | | |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.R; |
| | | import com.zy.common.constant.MesConstant; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void cors(HttpServletResponse response){ |
| | | // 跨域设置 |
| | | response.setHeader("Access-Control-Max-Age", "3600"); |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "*"); |
| | | response.setHeader("Access-Control-Allow-Headers", "*"); |
| | | response.setHeader("Access-Control-Expose-Headers", MesConstant.TOKEN_HEADER_NAME); |
| | | } |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private LicenseTimer licenseTimer; |
| | | |
| | | @RequestMapping("/login.action") |
| | | @PostMapping("/login.action") |
| | | @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "登录") |
| | | public R loginAction(String username, String password){ |
| | | public R loginAction(@RequestBody Map<String, String> param) { |
| | | //验证许可证是否有效 |
| | | if (!licenseTimer.getSystemSupport()){ |
| | | if (!licenseTimer.getSystemSupport()) { |
| | | return R.parse(CodeRes.SYSTEM_20001); |
| | | } |
| | | EntityWrapper<User> userWrapper = new EntityWrapper<>(); |
| | | userWrapper.eq("username", username); |
| | | userWrapper.eq("username", param.get("username")); |
| | | User user = userService.selectOne(userWrapper); |
| | | if (Cools.isEmpty(user)){ |
| | | if (username.equals("super") && password.equals(Cools.md5(superPwd))) { |
| | | if (Cools.isEmpty(user)) { |
| | | if (param.get("username").equals("super") && param.get("password").equals(Cools.md5(superPwd))) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | res.put("username", username); |
| | | res.put("token", Cools.enToken(System.currentTimeMillis() + username, superPwd)); |
| | | res.put("username", param.get("username")); |
| | | res.put("token", Cools.enToken(System.currentTimeMillis() + param.get("username"), superPwd)); |
| | | return R.ok(res); |
| | | } |
| | | return R.parse(CodeRes.USER_10001); |
| | | } |
| | | if (user.getStatus()!=1){ |
| | | if (user.getStatus() != 1) { |
| | | return R.parse(CodeRes.USER_10002); |
| | | } |
| | | if (!user.getPassword().equals(password)){ |
| | | if (!user.getPassword().equals(param.get("password"))) { |
| | | return R.parse(CodeRes.USER_10003); |
| | | } |
| | | String token = Cools.enToken(System.currentTimeMillis() + username, user.getPassword()); |
| | | String token = Cools.enToken(System.currentTimeMillis() + param.get("username"), user.getPassword()); |
| | | userLoginService.delete(new EntityWrapper<UserLogin>().eq("user_id", user.getId())); |
| | | UserLogin userLogin = new UserLogin(); |
| | | userLogin.setUserId(user.getId()); |
| | |
| | | int time = 0; |
| | | while (time < 3000) { |
| | | code = RandomValidateCodeUtil.code.get(sd); |
| | | if (!Cools.isEmpty(code)){ |
| | | if (!Cools.isEmpty(code)) { |
| | | break; |
| | | } else { |
| | | Thread.sleep(10); |
| | |
| | | |
| | | @RequestMapping("/user/detail/auth") |
| | | @ManagerAuth |
| | | public R userDetail(){ |
| | | public R userDetail() { |
| | | return R.ok(userService.selectById(getUserId())); |
| | | } |
| | | |
| | | @RequestMapping("/menu/auth") |
| | | @ManagerAuth |
| | | public R menu(){ |
| | | public R menu() { |
| | | // 获取所有一级菜单 |
| | | List<Resource> oneLevel; |
| | | User user = null; |
| | |
| | | List<RoleResource> roleResources = roleResourceService.selectList(new EntityWrapper<RoleResource>().eq("role_id", user.getRoleId())); |
| | | List<Long> resourceIds = new ArrayList<>(); |
| | | roleResources.forEach(roleResource -> resourceIds.add(roleResource.getResourceId())); |
| | | if (resourceIds.isEmpty()){ |
| | | if (resourceIds.isEmpty()) { |
| | | return R.ok(); |
| | | } |
| | | resourceWrapper = new EntityWrapper<Resource>().in("id", resourceIds).eq("level", 2).eq("status", 1).orderBy("sort"); |
| | |
| | | // 是否拥有查看权限 |
| | | if (getUserId() != 9527) { |
| | | Resource view = resourceService.selectOne(new EntityWrapper<Resource>().eq("resource_id", resource.getId()).like("code", "#view")); |
| | | if (!Cools.isEmpty(view)){ |
| | | if (!Cools.isEmpty(view)) { |
| | | RoleResource param = new RoleResource(); |
| | | param.setResourceId(view.getId()); |
| | | param.setRoleId(user.getRoleId()); |
| | | if (null == roleResourceService.selectOne(new EntityWrapper<>(param))){ |
| | | if (null == roleResourceService.selectOne(new EntityWrapper<>(param))) { |
| | | continue; |
| | | } |
| | | } |
| | |
| | | |
| | | @RequestMapping("/power/list/auth") |
| | | @ManagerAuth |
| | | public R powerList(){ |
| | | public R powerList() { |
| | | List<Resource> oneLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy("sort")); |
| | | List<Map> result = new ArrayList<>(); |
| | | // 一级 |
| | | for (Resource oneLevel : oneLevels){ |
| | | for (Resource oneLevel : oneLevels) { |
| | | List<Map> twoLevelsList = new ArrayList<>(); |
| | | Map<String, Object> oneLevelMap = new HashMap<>(); |
| | | oneLevelMap.put("title", oneLevel.getName()); |
| | |
| | | oneLevelMap.put("children", twoLevelsList); |
| | | List<Resource> twoLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("resource_id", oneLevel.getId()).eq("level", 2).eq("status", 1).orderBy("sort")); |
| | | // 二级 |
| | | for (Resource twoLevel : twoLevels){ |
| | | for (Resource twoLevel : twoLevels) { |
| | | Map<String, Object> twoLevelMap = new HashMap<>(); |
| | | twoLevelMap.put("title", twoLevel.getName()); |
| | | twoLevelMap.put("id", twoLevel.getId()); |
| | |
| | | twoLevelMap.put("children", threeLevelsList); |
| | | // 三级 |
| | | List<Resource> threeLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("resource_id", twoLevel.getId()).eq("level", 3).eq("status", 1).orderBy("sort")); |
| | | for (Resource threeLevel : threeLevels){ |
| | | for (Resource threeLevel : threeLevels) { |
| | | Map<String, Object> threeLevelMap = new HashMap<>(); |
| | | threeLevelMap.put("title", threeLevel.getName()); |
| | | threeLevelMap.put("id", threeLevel.getId()); |
| | |
| | | List<Object> result = new ArrayList<>(); |
| | | // 菜单 |
| | | List<RoleResource> roleResources = roleResourceService.selectList(new EntityWrapper<RoleResource>().eq("role_id", roleId)); |
| | | for (RoleResource roleResource : roleResources){ |
| | | for (RoleResource roleResource : roleResources) { |
| | | Resource resource = resourceService.selectById(roleResource.getResourceId()); |
| | | if (!Cools.isEmpty(resource)){ |
| | | if (resource.getLevel() == 3){ |
| | | if (!Cools.isEmpty(resource)) { |
| | | if (resource.getLevel() == 3) { |
| | | result.add(resource.getId()); |
| | | } |
| | | } |
| | | } |
| | | // 功能 |
| | | List<RolePermission> rolePermissions = rolePermissionService.selectList(new EntityWrapper<RolePermission>().eq("role_id", roleId)); |
| | | for (RolePermission rolePermission : rolePermissions){ |
| | | for (RolePermission rolePermission : rolePermissions) { |
| | | Permission permission = permissionService.selectById(rolePermission.getPermissionId()); |
| | | if (!Cools.isEmpty(permission)){ |
| | | if (!Cools.isEmpty(permission)) { |
| | | result.add(permission.getAction()); |
| | | } |
| | | } |
| | |
| | | @RequestMapping("/power/auth") |
| | | @ManagerAuth(memo = "授权") |
| | | @Transactional |
| | | public R power(Long roleId, String powers){ |
| | | public R power(Long roleId, String powers) { |
| | | Role role = roleService.selectById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | roleResourceService.delete(new EntityWrapper<RoleResource>().eq("role_id", roleId)); |
| | | rolePermissionService.delete(new EntityWrapper<RolePermission>().eq("role_id", roleId)); |
| | | if (!Cools.isEmpty(powers)){ |
| | | if (!Cools.isEmpty(powers)) { |
| | | List<PowerDto> dtos = JSON.parseArray(powers, PowerDto.class); |
| | | for (PowerDto dto : dtos) { |
| | | Resource resource = resourceService.selectOne(new EntityWrapper<Resource>().eq("id", dto.getTwo()).eq("level", 2)); |
| | |
| | | roleResourceService.insert(roleResource); |
| | | } else { |
| | | Permission permission = permissionService.selectOne(new EntityWrapper<Permission>().eq("action", dto.getTwo())); |
| | | if (!Cools.isEmpty(permission)){ |
| | | if (!Cools.isEmpty(permission)) { |
| | | RolePermission rolePermission = new RolePermission(); |
| | | rolePermission.setRoleId(roleId); |
| | | rolePermission.setPermissionId(permission.getId()); |
| | | rolePermissionService.insert(rolePermission); |
| | | } |
| | | } |
| | | for (String three : dto.getThree()){ |
| | | for (String three : dto.getThree()) { |
| | | Resource resource1 = resourceService.selectOne(new EntityWrapper<Resource>().eq("id", three).eq("level", 3)); |
| | | if (!Cools.isEmpty(resource1)) { |
| | | // 校验上级权限 |
| | |
| | | return R.error("激活失败"); |
| | | } |
| | | SystemProperties.SYSTEM_ACTIVATION = Boolean.TRUE; |
| | | return R.ok("激活成功,有效期至"+DateUtils.convert(exprTime)); |
| | | return R.ok("激活成功,有效期至" + DateUtils.convert(exprTime)); |
| | | } |
| | | |
| | | } |
| | |
| | | # global-config: |
| | | # field-strategy: 0 |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | map-underscore-to-camel-case: true |
| | | cache-enabled: true |
| | | call-setters-on-nulls: true |
| | |
| | | // http请求 |
| | | !function (n) { |
| | | "use strict"; |
| | | |
| | | var http = { |
| | | toAjax: function (params) { |
| | | $.ajax(params); |
| | |
| | | var pageCurr; |
| | | |
| | | function getCol() { |
| | | var cols = [ {type: 'checkbox'} ]; |
| | | var cols = [{type: 'checkbox'}]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'status', align: 'center',title: '数据状态', templet:function(row){ |
| | | var html = "<input value='status' type='checkbox' lay-skin='switch' lay-text='正常|锁定'' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.status === 'Y'){html += " checked ";} |
| | | cols.push({field: 'locNo', align: 'center', title: '库位号'} |
| | | , { |
| | | field: 'status', align: 'center', title: '数据状态', templet: function (row) { |
| | | var html = "<input value='status' type='checkbox' lay-skin='switch' lay-text='正常|锁定'' lay-filter='tableCheckbox' disabled='disabled' table-index='" + row.LAY_TABLE_INDEX + "'"; |
| | | if (row.status === 'Y') { |
| | | html += " checked "; |
| | | } |
| | | html += ">"; |
| | | return html; |
| | | }, hide: true} |
| | | ,{field: 'ioStatus', align: 'center',title: '入出状态', templet:function(row){ |
| | | var html = "<input value='ioStatus' type='checkbox' lay-skin='switch' lay-text='入库中|待入库' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.ioStatus === 'Y'){html += " checked ";} |
| | | }, hide: true |
| | | } |
| | | , { |
| | | field: 'ioStatus', align: 'center', title: '入出状态', templet: function (row) { |
| | | var html = "<input value='ioStatus' type='checkbox' lay-skin='switch' lay-text='入库中|待入库' lay-filter='tableCheckbox' disabled='disabled' table-index='" + row.LAY_TABLE_INDEX + "'"; |
| | | if (row.ioStatus === 'Y') { |
| | | html += " checked "; |
| | | } |
| | | html += ">"; |
| | | return html; |
| | | }} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true}) |
| | | } |
| | | } |
| | | , {field: 'modiUser$', align: 'center', title: '修改人员', hide: true} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间', hide: true}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'tableMerge'], function(){ |
| | | }).use(['table', 'laydate', 'form', 'tableMerge'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | |
| | | tableIns = table.render({ |
| | | elem: '#waitPakin', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/waitPakin/list/auth', |
| | | url: baseUrl + '/waitPakin/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | done: function (res, curr, count) { |
| | | // tableMerge.render(this); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | var _index = $(data.elem).attr('table-index') || 0; |
| | | if (data.elem.checked) { |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | } else { |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | |
| | | // 监听排序事件 |
| | | table.on('sort(locMast)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | limit(); |
| | | } |
| | | }); |
| | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(waitPakin)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | switch (obj.event) { |
| | | case 'addWrk': |
| | | if (checkStatus.data.length === 0){ |
| | | if (checkStatus.data.length === 0) { |
| | | layer.msg('请至少选择一条数据', {icon: 2}); |
| | | } else { |
| | | layer.confirm('确定生成工作档任务吗', function(){ |
| | | layer.confirm('确定生成工作档任务吗', function () { |
| | | $.ajax({ |
| | | url: baseUrl+"/create/waitPain/wrkMast/start", |
| | | url: baseUrl + "/create/waitPain/wrkMast/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(checkStatus.data), |
| | | contentType:'application/json;charset=UTF-8', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | traditional:true, |
| | | traditional: true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | layer.msg(res.msg, {icon: 1}) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'waitPakin_detail.html', |
| | | success: function(layero, index){ |
| | | success: function (layero, index) { |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | if (data.length === 0) { |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | layer.confirm('确定删除' + (data.length === 1 ? '此' : data.length) + '条数据吗', function () { |
| | | $.ajax({ |
| | | url: baseUrl+"/waitPakin/delete/auth", |
| | | url: baseUrl + "/waitPakin/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(data)}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | traditional: true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | layer.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); |
| | |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/waitPakin/export/auth", |
| | | url: baseUrl + "/waitPakin/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | 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'); |
| | | table.exportFile(titles, res.data, 'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(waitPakin)', function(obj){ |
| | | table.on('tool(waitPakin)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'waitPakin_detail.html', |
| | | success: function(layero, index){ |
| | | success: function (layero, index) { |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'waitPakin_detail.html', |
| | | success: function(layero, index){ |
| | | success: function (layero, index) { |
| | | layer.getChildFrame('#data-detail-submit-save', index).hide(); |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | top.convertDisabled(layer.getChildFrame('#id', index), true); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: "baseUrl+/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function (layero, index) { |
| | | $.ajax({ |
| | | url: "baseUrl+/user/" + param + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'appeUser': |
| | |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '创建者详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: "baseUrl+/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '创建者详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function (layero, index) { |
| | | $.ajax({ |
| | | url: "baseUrl+/user/" + param + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null){ |
| | | if (banMsg != null) { |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | |
| | | method("update") |
| | | }); |
| | | |
| | | function method(name){ |
| | | function method(name) { |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | shade: [0.5, '#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | // id: $('#id').val(), |
| | |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/waitPakin/"+name+"/auth", |
| | | url: baseUrl + "/waitPakin/" + name + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | parent.layer.closeAll(); |
| | | parent.$(".layui-laypage-btn")[0].click(); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | |
| | | }); |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | , type: 'datetime' |
| | | , range: true |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | $(document).on('click', '#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | curr: pageCurr - 1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | if (find[0]!=null){ |
| | | if (find[0].type === 'checkbox'){ |
| | | if (data[val]==='Y'){ |
| | | find.attr("checked","checked"); |
| | | if (find[0] != null) { |
| | | if (find[0].type === 'checkbox') { |
| | | if (data[val] === 'Y') { |
| | | find.attr("checked", "checked"); |
| | | find.val('Y'); |
| | | } else { |
| | | find.remove("checked"); |
| | |
| | | } |
| | | } |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | if (showImg) { |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0)) { |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.8); |
| | | var height = detail.height() + 60; |
| | | if (height > ($(window).height() * 0.9)) { |
| | | height = ($(window).height() * 0.8); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | height: height + 'px' |
| | | }); |
| | | } |
| | | |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <title>中扬 │ login of zoneyung wms</title> |
| | |
| | | <meta name="theme-color" content="#111111"> |
| | | <meta name="msapplication-TileImage" content="/sketch-threejs/img/common/ms_tileimage.png"> |
| | | <meta name="msapplication-TileColor" content="#111111"> |
| | | <link rel="icon" type="image/x-icon" href="../static/image/favicon.ico" /> |
| | | <link rel="icon" type="image/x-icon" href="../static/image/favicon.ico"/> |
| | | <link rel="stylesheet" href="../static/css/font/font-awesome-4.7.0/css/font-awesome.css"> |
| | | <link rel="stylesheet" href="../static/css/main.min.css"> |
| | | <link rel="stylesheet" href="../static/css/login.css"> |
| | | <style> |
| | | #sidebar{ |
| | | /*定位*/ |
| | | position: absolute; |
| | | top: 50%; |
| | | right: 1%; |
| | | transform: translateY(-50%); |
| | | width: 20%; |
| | | height: 95%; |
| | | /*特效*/ |
| | | background: rgba(255,255,255,0.6); |
| | | border-radius: 5px; |
| | | color: #ffffff; |
| | | z-index: 99; |
| | | box-shadow: 3px 3px 6px 3px rgba(0, 0, 0, .3); |
| | | } |
| | | #sidebar { |
| | | /*定位*/ |
| | | position: absolute; |
| | | top: 50%; |
| | | right: 1%; |
| | | transform: translateY(-50%); |
| | | width: 20%; |
| | | height: 95%; |
| | | /*特效*/ |
| | | background: rgba(255, 255, 255, 0.6); |
| | | border-radius: 5px; |
| | | color: #ffffff; |
| | | z-index: 99; |
| | | box-shadow: 3px 3px 6px 3px rgba(0, 0, 0, .3); |
| | | } |
| | | |
| | | .login-contain { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | .login-box { |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | width: 100%; |
| | | text-align: center; |
| | | } |
| | | .login-contain { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .login-box { |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | width: 100%; |
| | | text-align: center; |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div class="l-page l-page--white" data-id="instancing"> |
| | | <div style="position: fixed; |
| | | </head> |
| | | <body> |
| | | <div class="l-page l-page--white" data-id="instancing"> |
| | | <div style="position: fixed; |
| | | z-index: 100; |
| | | top: 22px; |
| | | left: 20px;"> |
| | | <img src="../static/image/logo_light_colour.png" alt="" style="width: 20%"> |
| | | </div> |
| | | <div class="p-sketch-outline"> |
| | | </div> |
| | | <div class="p-sketch-outline"> |
| | | <h2 class="p-sketch-outline__title">Automatic Storage and Retrieval System</h2> |
| | | <p class="p-sketch-outline__date">posted: 2018.01.01 / update: 2022.09.21 |
| | | </p> |
| | | <p class="p-sketch-outline__description">wms made with various simple objects.</p> |
| | | </div> |
| | | <canvas class="p-canvas-webgl" id="canvas-webgl"></canvas> |
| | | </div> |
| | | <!-- 侧边栏 --> |
| | | <div id="sidebar"> |
| | | <div class="login-contain"> |
| | | <canvas class="p-canvas-webgl" id="canvas-webgl"></canvas> |
| | | </div> |
| | | <!-- 侧边栏 --> |
| | | <div id="sidebar"> |
| | | <div class="login-contain"> |
| | | <div class="login-box"> |
| | | <img src="../static/image/zy_logo_dark_color.png" alt="" style="width: 80%"> |
| | | <!-- <span class="login100-form-title p-t-20 p-b-45">中扬立库</span>--> |
| | | <!-- <span class="login100-form-title p-t-20 p-b-45" style="margin: 15px 0;color: #868686;font-size: 24px">WMS</span>--> |
| | | <div class="wrap-input100 validate-input m-b-10" data-validate="请输入用户名"> |
| | | <input id="username" class="input100" type="text" name="username" placeholder="username" autocomplete="off"> |
| | | <span class="focus-input100"></span> |
| | | <span class="symbol-input100"> |
| | | <img src="../static/image/zy_logo_dark_color.png" alt="" style="width: 80%"> |
| | | <!-- <span class="login100-form-title p-t-20 p-b-45">中扬立库</span>--> |
| | | <!-- <span class="login100-form-title p-t-20 p-b-45" style="margin: 15px 0;color: #868686;font-size: 24px">WMS</span>--> |
| | | <div class="wrap-input100 validate-input m-b-10" data-validate="请输入用户名"> |
| | | <input id="username" class="input100" type="text" name="username" placeholder="username" |
| | | autocomplete="off"> |
| | | <span class="focus-input100"></span> |
| | | <span class="symbol-input100"> |
| | | <i class="fa fa-user"></i> |
| | | </span> |
| | | </div> |
| | | <div class="wrap-input100 validate-input m-b-10" data-validate="请输入密码"> |
| | | <input id="password" class="input100" type="password" name="pass" placeholder="password"> |
| | | <span class="focus-input100"></span> |
| | | <span class="symbol-input100"> |
| | | </div> |
| | | <div class="wrap-input100 validate-input m-b-10" data-validate="请输入密码"> |
| | | <input id="password" class="input100" type="password" name="pass" placeholder="password"> |
| | | <span class="focus-input100"></span> |
| | | <span class="symbol-input100"> |
| | | <i class="fa fa-lock"></i> |
| | | </span> |
| | | </div> |
| | | <div class="container-login100-form-btn p-t-10"> |
| | | <button class="login100-form-btn login-btn">Login</button> |
| | | </div> |
| | | <div class="container-login100-form-btn p-t-10" style="display: none;margin-top: 50px;" id="updateLicense"> |
| | | <form enctype="multipart/form-data" style="display: none;"> |
| | | <input id="license" type="file" name="file" > |
| | | </form> |
| | | <button class="login100-form-btn" id="submitLicense">更新许可证</button> |
| | | </div> |
| | | </div> |
| | | <div class="container-login100-form-btn p-t-10"> |
| | | <button class="login100-form-btn login-btn">Login</button> |
| | | </div> |
| | | <div class="container-login100-form-btn p-t-10" style="display: none;margin-top: 50px;" id="updateLicense"> |
| | | <form enctype="multipart/form-data" style="display: none;"> |
| | | <input id="license" type="file" name="file"> |
| | | </form> |
| | | <button class="login100-form-btn" id="submitLicense">更新许可证</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../static/js/tools/main.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript" src="../static/layer/layer.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script> |
| | | // remember pwd |
| | | $(function () { |
| | | <script type="text/javascript" src="../static/js/tools/main.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript" src="../static/layer/layer.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script> |
| | | // remember pwd |
| | | $(function () { |
| | | var oldUserName = localStorage.getItem('oldUserName'); |
| | | var oldPass = localStorage.getItem('oldPass'); |
| | | if(oldUserName){ |
| | | $('#username').val(oldUserName); |
| | | if (oldUserName) { |
| | | $('#username').val(oldUserName); |
| | | } |
| | | if(oldPass){ |
| | | $('#password').val(oldPass); |
| | | if (oldPass) { |
| | | $('#password').val(oldPass); |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | window.onload = function(){document.getElementById("username").focus();} |
| | | window.onload = function () { |
| | | document.getElementById("username").focus(); |
| | | } |
| | | |
| | | $(document).on('click','.login-btn', function () { |
| | | $(document).on('click', '.login-btn', function () { |
| | | let username = $("#username").val(); |
| | | if (username === "") { |
| | | layer.tips('请输入登录账号', '#username', {tips: [4, '#ff0000']}); |
| | | return; |
| | | layer.tips('请输入登录账号', '#username', {tips: [4, '#ff0000']}); |
| | | return; |
| | | } |
| | | let password = $("#password").val(); |
| | | if (password === "") { |
| | | layer.tips('请输入密码', '#password', {tips: [4, '#ff0000']}); |
| | | return; |
| | | layer.tips('请输入密码', '#password', {tips: [4, '#ff0000']}); |
| | | return; |
| | | } |
| | | let params = {username: username, password: hex_md5(password)} |
| | | $.ajax({ |
| | | url: baseUrl+"/login.action", |
| | | data: { |
| | | username: username, |
| | | password: hex_md5(password) |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | localStorage.setItem("token", res.data.token); |
| | | localStorage.setItem("username", res.data.username); |
| | | window.location.href = "index.html"; |
| | | } else if (res.code === 10001) { |
| | | layer.tips(res.msg, '#username', {tips: [4, '#ff0000']}); |
| | | } else if (res.code === 10002) { |
| | | layer.tips(res.msg, '#username', {tips: [4, '#ff0000']}); |
| | | } else if (res.code === 10003) { |
| | | layer.tips(res.msg, '#password', {tips: [4, '#ff0000']}); |
| | | } else if (res.code == 20001) { |
| | | layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']}); |
| | | $("#updateLicense").show() |
| | | } else { |
| | | layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']}); |
| | | url: baseUrl + "/login.action", |
| | | headers: {'Content-Type': 'application/json'}, |
| | | data: JSON.stringify(params), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | localStorage.setItem("token", res.data.token); |
| | | localStorage.setItem("username", res.data.username); |
| | | window.location.href = "index.html"; |
| | | } else if (res.code === 10001) { |
| | | layer.tips(res.msg, '#username', {tips: [4, '#ff0000']}); |
| | | } else if (res.code === 10002) { |
| | | layer.tips(res.msg, '#username', {tips: [4, '#ff0000']}); |
| | | } else if (res.code === 10003) { |
| | | layer.tips(res.msg, '#password', {tips: [4, '#ff0000']}); |
| | | } else if (res.code == 20001) { |
| | | layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']}); |
| | | $("#updateLicense").show() |
| | | } else { |
| | | layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']}); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | $('body').keydown(function () { |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $(".login-btn").click(); |
| | | $(".login-btn").click(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | |
| | | //更新许可证 |
| | | $("#submitLicense").on("click",() => { |
| | | //更新许可证 |
| | | $("#submitLicense").on("click", () => { |
| | | $("#license").click() |
| | | }) |
| | | }) |
| | | |
| | | //上传并更新许可证 |
| | | $("#license").on("change",(evt) => { |
| | | //上传并更新许可证 |
| | | $("#license").on("change", (evt) => { |
| | | var files = evt.target.files; |
| | | let formData = new FormData(); |
| | | formData.append("file", files[0]) |
| | | $.ajax({ |
| | | url: baseUrl+"/license/updateLicense", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: formData, |
| | | method: 'POST', |
| | | cache: false, |
| | | processData: false, |
| | | contentType: false, |
| | | success: function (res) { |
| | | if (res.code == 200) { |
| | | layer.msg('更新成功', {time: 1000}, () => { |
| | | parent.location.reload() |
| | | }); |
| | | }else{ |
| | | layer.msg(res.msg,{time:2000},() => { |
| | | parent.location.reload() |
| | | }) |
| | | url: baseUrl + "/license/updateLicense", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: formData, |
| | | method: 'POST', |
| | | cache: false, |
| | | processData: false, |
| | | contentType: false, |
| | | success: function (res) { |
| | | if (res.code == 200) { |
| | | layer.msg('更新成功', {time: 1000}, () => { |
| | | parent.location.reload() |
| | | }); |
| | | } else { |
| | | layer.msg(res.msg, {time: 2000}, () => { |
| | | parent.location.reload() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | </script> |
| | | </body> |
| | | }) |
| | | </script> |
| | | </body> |
| | | </html> |