| | |
| | | @Autowired |
| | | private InventoryCheckOrderService inventoryCheckOrderService; |
| | | |
| | | @RequestMapping("/inventoryCheckOrder/select/status/1") |
| | | @ManagerAuth() |
| | | public R availableTakeCheckSite(){ |
| | | return R.ok().add(inventoryCheckOrderService.selectList(new EntityWrapper<InventoryCheckOrder>().eq("status", "1"))); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/inventoryCheckOrder/nav/list/auth") |
| | | @ManagerAuth |
| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.InventoryCheckOrder; |
| | | import com.zy.asrs.entity.InventoryCheckOrderDetl; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.InventoryCheckOrderDetlService; |
| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.service.InventoryCheckOrderService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private InventoryCheckOrderDetlService inventoryCheckOrderDetlService; |
| | | @Autowired |
| | | private InventoryCheckOrderService inventoryCheckOrderService; |
| | | |
| | | @RequestMapping(value = "/inventoryCheckOrderDetl/pakout/list/auth") |
| | | @ManagerAuth |
| | | public R pakoutList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | if (null == param.get("order_id")|| param.get("order_id").equals("9999999999")){ |
| | | return R.ok(inventoryCheckOrderDetlService.selectPage(new Page<>(curr, limit), new EntityWrapper<InventoryCheckOrderDetl>().eq("order_no",null))); |
| | | } |
| | | InventoryCheckOrder inventoryCheckOrder = inventoryCheckOrderService.selectById(Integer.parseInt(param.get("order_id").toString())); |
| | | |
| | | EntityWrapper<InventoryCheckOrderDetl> inventoryCheckOrderDetlEntityWrapper = new EntityWrapper<>(); |
| | | // convert(param, inventoryCheckOrderDetlEntityWrapper); |
| | | inventoryCheckOrderDetlEntityWrapper.eq("order_no",param.get("order_id")); |
| | | inventoryCheckOrderDetlEntityWrapper.eq("order_no",inventoryCheckOrder.getOrderNo()); |
| | | |
| | | return R.ok(inventoryCheckOrderDetlService.selectPage(new Page<>(curr, limit), inventoryCheckOrderDetlEntityWrapper)); |
| | | } |
| | | |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.StaDesc; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.StaDescService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | private WorkService workService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | |
| | | @RequestMapping("/available/put/site") |
| | | @ManagerAuth() |
| | |
| | | return R.ok().add(basDevpService.getAvailableOutSite(107)); |
| | | } |
| | | |
| | | @RequestMapping("/available/take/check/site/crn") |
| | | @ManagerAuth() |
| | | public R availableTakeCheckSiteCrn(){ |
| | | EntityWrapper<StaDesc> staDescEntityWrapper = new EntityWrapper<>(); |
| | | staDescEntityWrapper.eq("type_no",107); |
| | | staDescEntityWrapper.setSqlSelect("DISTINCT stn_no as stnNo"); |
| | | staDescEntityWrapper.in("crn_no",1,2,3,4,5,6,7); |
| | | return R.ok().add(staDescService.selectList(staDescEntityWrapper)); |
| | | } |
| | | |
| | | @RequestMapping("/available/take/check/site/ctu") |
| | | @ManagerAuth() |
| | | public R availableTakeCheckSiteCtu(){ |
| | | return R.ok().add(basDevpService.getAvailableOutSite(107)); |
| | | } |
| | | |
| | | @RequestMapping("/available/take/check/site/shuttle") |
| | | @ManagerAuth() |
| | | public R availableTakeCheckSiteShuttle(){ |
| | | return R.ok().add(basDevpService.getAvailableOutSite(107)); |
| | | } |
| | | |
| | | @RequestMapping("/available/empty/take/site") |
| | | @ManagerAuth() |
| | | public R availableEmptyTakeSite(){ |
| | |
| | | private String area; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("check_anfme") |
| | | private String checkAnfme; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("io_time") |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime); |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (Cools.isEmpty(this.status)){ |
| | | return ""; |
| | | } |
| | | switch (this.status){ |
| | | case "1": |
| | | return "待盘"; |
| | | case "2": |
| | | return "已盘"; |
| | | default: |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | // 出站口 |
| | | private Integer outSite; |
| | | |
| | | private String orderNo; |
| | | |
| | | // 物料编号集合 |
| | | private List<LocDetl> locDetls; |
| | | |
| | |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private InventoryCheckOrderDetlService inventoryCheckOrderDetlService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号 |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount(); |
| | | wrkDetl.setAnfme(anfme); // 数量 |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(userId); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void inventoryCheckStockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId,StockOutParam param) { |
| | | Date now = new Date(); |
| | | // 合并同类项 |
| | | Set<String> locNos = new HashSet<>(); |
| | | List<OutLocDto> dtos = new ArrayList<>(); |
| | | for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | String locNo = locDetlDto.getLocDetl().getLocNo(); |
| | | if (locNos.contains(locNo)) { |
| | | for (OutLocDto dto : dtos) { |
| | | if (dto.getLocNo().equals(locNo)) { |
| | | dto.getLocDetlDtos().add(locDetlDto); |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | locNos.add(locNo); |
| | | dtos.add(new OutLocDto(locNo, locDetlDto)); |
| | | } |
| | | } |
| | | Integer ioType = null; |
| | | // 生成工作档 |
| | | for (OutLocDto dto : dtos) { |
| | | // 判断入出库类型:101.全板出库 or 103.拣料出库 |
| | | if (ioWorkType == null) { |
| | | ioType = dto.isAll() ? 101 : 103; |
| | | } else if (ioWorkType.equals(IoWorkType.CHECK_OUT)) { |
| | | ioType = 107; |
| | | } |
| | | assert ioType != null; |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | |
| | | Integer outSta = staNo.getDevNo(); |
| | | // //2号堆垛机全板出库站指定为204站,拣料站指定为202 |
| | | // if(locMast.getCrnNo()==2){ |
| | | // outSta = ioType == 101 ? 204 : 202; |
| | | // } |
| | | |
| | | // 获取路径 |
| | | StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta); |
| | | |
| | | |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(ioType); // 入出库状态 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo()); // 目标站 |
| | | wrkMast.setSourceLocNo(dto.getLocNo()); // 源库位 |
| | | 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 (ioType == 107){ |
| | | wrkMast.setSheetNo(param.getOrderNo()); |
| | | } |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | |
| | | InventoryCheckOrderDetl inventoryCheckOrderDetl = new InventoryCheckOrderDetl(); |
| | | inventoryCheckOrderDetl.setOrderNo(param.getOrderNo()); |
| | | inventoryCheckOrderDetl.setMatnr(detlDto.getLocDetl().getMatnr()); |
| | | inventoryCheckOrderDetl.setMaktx(detlDto.getLocDetl().getMaktx()); |
| | | inventoryCheckOrderDetl.setBatch(detlDto.getLocDetl().getBatch()); |
| | | inventoryCheckOrderDetl.setLocNo(detlDto.getLocDetl().getLocNo()); |
| | | inventoryCheckOrderDetl.setArea(wrkMast.getCrnNo$()); |
| | | inventoryCheckOrderDetl.setAnfme(detlDto.getLocDetl().getAnfme()); |
| | | inventoryCheckOrderDetl.setIoTime(now); |
| | | inventoryCheckOrderDetl.setStatus("1"); |
| | | if (!inventoryCheckOrderDetlService.insert(inventoryCheckOrderDetl)) { |
| | | throw new CoolException("保存盘点明细失败"); |
| | | } |
| | | |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F")){ |
| | | // 启动出库开始 107.盘点出库 |
| | | stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId); |
| | | inventoryCheckStockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId,param); |
| | | }else { |
| | | throw new CoolException("所选库位存在状态不为F的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$()); |
| | | } |
| | |
| | | <result column="area" property="area" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | |
| | | <result column="status" property="status" /> |
| | | <result column="check_anfme" property="checkAnfme" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | {type: 'checkbox'} |
| | | ,{type: 'numbers', title: '#'} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 160} |
| | | ,{field: 'locNo', align: 'center',title: '库位'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编码', width: 160} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} |
| | | ,{field: 'batch', align: 'center',title: '序列码'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | // ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'batch', align: 'center',title: '批次'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'checkAnfme', align: 'center',title: '盘点数量', style: 'font-weight: bold'} |
| | | // ,{field: 'qty', align: 'center',title: '作业数量', style: 'font-weight: bold'} |
| | | ,{field: 'enableQty', align: 'center',title: '待出数量', style: 'font-weight: bold'} |
| | | // ,{field: 'enableQty', align: 'center',title: '待出数量', style: 'font-weight: bold'} |
| | | // ,{field: 'name', align: 'center',title: '名称'} |
| | | // ,{field: 'model', align: 'center',title: '型号'} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | |
| | | // ,{field: 'itemNum', align: 'center',title: '品项数'} |
| | | // ,{field: 'count', align: 'center',title: '数量'} |
| | | // ,{field: 'weight', align: 'center',title: '重量'} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | // ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 160} |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 160} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | tableMerge.render(this); |
| | | limit(); |
| | | getOutBound(); |
| | | getOutBoundOrder(); |
| | | } |
| | | }); |
| | | |
| | |
| | | if (locDetlData.length === 0){ |
| | | layer.msg('请先添加盘点库存', {icon: 2}); |
| | | } else { |
| | | var orderNo = $("#orderSelect").val(); |
| | | if (orderNo === "" || orderNo === null){ |
| | | layer.msg("请选择盘点单", {icon: 2}); |
| | | return; |
| | | } |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择盘点站", {icon: 2}); |
| | |
| | | } |
| | | let param = { |
| | | outSite: staNo, |
| | | locDetls: locDetlData |
| | | locDetls: locDetlData, |
| | | orderNo: orderNo |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/locCheck/out/start", |
| | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/check/site", |
| | | url: baseUrl+"/available/take/check/site/crn", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | |
| | | // 获取出库口 |
| | | function getOutBoundOrder(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/check/site", |
| | | url: baseUrl+"/inventoryCheckOrder/select/status/1", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var tpl = $("#orderSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | $('#orderSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'sheetNo', align: 'center',title: '单据'} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone', align: 'center',title: '空操作', hide: true} |
| | | // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){ |
| | |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | <option value="{{stnNo}}">{{stnNo}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <script type="text/template" id="orderSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{orderNo}}">{{orderNo}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |