| | |
| | | // private Double price; |
| | | // |
| | | // //sku |
| | | // private String sku; |
| | | private String sku; |
| | | // |
| | | // //产地 |
| | | // private String origin; |
| | |
| | | .eq(LocDetl::getHostId, hostId) |
| | | .eq(LocDetl::getZpallet, combMat.getZpallet()) |
| | | .eq(LocDetl::getMatnr, combMat.getMatnr()) |
| | | .eq(LocDetl::getBatch, combMat.getBatch()) |
| | | // .eq(LocDetl::getBatch, combMat.getBatch()) |
| | | ); |
| | | if (Cools.isEmpty(locDetl)){ |
| | | return R.error("未查询到库存数据"); |
| | |
| | | continue; |
| | | } |
| | | if (orderDetl.getAnfme() < orderDetl.getWorkQty()+combMat.getAnfme()){ |
| | | throw new CoolException("下架数量出错"); |
| | | combMat.setAnfme(orderDetl.getAnfme()-orderDetl.getWorkQty()); |
| | | } |
| | | // 修改订单明细作业数量 |
| | | if (!orderDetlService.increaseWorkQtyByOrderNo(combParam.getOrderNo(), combMat.getMatnr(), combMat.getBatch(), combMat.getAnfme(), hostId)) { |
| | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | .eq(LocMast::getHostId, hostId)); |
| | | // 获取路径 |
| | | int ioType = taskDto.isAll() ? 101 : 103; |
| | | if(ioType==101){ |
| | | staNo=102; |
| | | } |
| | | // 获取路径 |
| | | StaDesc staDesc = staDescService.getOne(new LambdaQueryWrapper<StaDesc>().eq(StaDesc::getTypeNo, ioType).eq(StaDesc::getStnNo, staNo).eq(StaDesc::getHostId, hostId)); |
| | | // 生成工作号 |
| | |
| | | |
| | | @RequestMapping(value = "/locDetl/forlocNo/auth/v1") |
| | | @ManagerAuth |
| | | public R forlocNoV1(@RequestParam String locNo,@RequestParam String matnr) { |
| | | public R forlocNoV1(@RequestParam String locNo) { |
| | | LambdaQueryWrapper<LocDetl> locDetlLambdaQueryWrapper = new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getLocNo, locNo) |
| | | .eq(LocDetl::getHostId, getHostId()); |
| | | if (!Cools.isEmpty(matnr)) { |
| | | locDetlLambdaQueryWrapper.eq(LocDetl::getMatnr, matnr); |
| | | } |
| | | List<LocDetl> detls = locDetlService.list(locDetlLambdaQueryWrapper); |
| | | if (Cools.isEmpty(detls)){ |
| | | return R.error("未查询到库存数据"); |
| | |
| | | |
| | | @RequestMapping(value = "/stock/out/list/auth") |
| | | @ManagerAuth |
| | | public R stockOutList(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false) String timeRange, |
| | | @RequestParam Map<String, Object> param) { |
| | | QueryWrapper<LocDetl> wrapper = new QueryWrapper<>(); |
| | | |
| | | if (!Cools.isEmpty(param.get("decrees"))) { |
| | | ArrayList<String> mats = new ArrayList<>(); |
| | | List<Mat> decrees = matService.list(new LambdaQueryWrapper<Mat>().like(Mat::getDecrees, param.get("decrees"))); |
| | | if (decrees.isEmpty()) { |
| | | mats.add("-1"); |
| | | }else { |
| | | for (Mat mat : decrees) { |
| | | mats.add(mat.getMatnr()); |
| | | } |
| | | public R stockOutList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | if (!Cools.isEmpty(param.get("modi_time"))){ |
| | | String val = String.valueOf(param.get("modi_time")); |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | param.put("startTime", DateUtils.convert(dates[0])); |
| | | param.put("endTime", DateUtils.convert(dates[1])); |
| | | param.remove("modi_time"); |
| | | } |
| | | wrapper.in("matnr", mats); |
| | | param.remove("decrees"); |
| | | } |
| | | |
| | | convert(param,wrapper); |
| | | wrapper.eq("host_id", getHostId()); |
| | | // if (!Cools.isEmpty(condition)) { |
| | | // wrapper.like(LocDetl::getLocNo, condition); |
| | | // } |
| | | if (!Cools.isEmpty(timeRange)) { |
| | | String[] range = timeRange.split(RANGE_TIME_LINK); |
| | | wrapper.ge("appe_time", DateUtils.convert(range[0])); |
| | | wrapper.le("appe_time", DateUtils.convert(range[1])); |
| | | } |
| | | if (!Cools.isEmpty(param.get("locNo"))) { |
| | | wrapper.like("loc_no", param.get("locNo")); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(param.get("zpallet"))) { |
| | | wrapper.like("zpallet", param.get("zpallet")); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField)); |
| | | } |
| | | |
| | | param.remove("locNo"); |
| | | param.remove("owner"); |
| | | param.remove("matnr"); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | return R.ok(locDetlService.page(new Page<>(curr, limit), wrapper)); |
| | | param.put("hostId", getHostId()); |
| | | return R.ok(locDetlService.getStockOut(curr, limit, param)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/statis/export") |
| | |
| | | } |
| | | List<Mat> mats=matService.list(); |
| | | for (Mat mat:mats |
| | | ) { |
| | | ) { |
| | | List<LocDetl>locDetls=locDetlService.list(new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getMatnr,mat.getMatnr())); |
| | | for (LocDetl locDetl:locDetls |
| | | ) { |
| | | ) { |
| | | locDetl.setMaktx(mat.getMaktx()); |
| | | locDetl.setSpecs(mat.getSpecs()); |
| | | locDetl.setModel(mat.getModel()); |
| | | locDetl.setSku(mat.getSku()); |
| | | locDetl.setItemNum(mat.getImgNum());//图号 |
| | | locDetl.setWeight(Double.parseDouble(mat.getWeight())); |
| | | locDetl.setLength(Double.parseDouble(mat.getLength())); |
| | | |
| | | if(!Cools.isEmpty(mat.getSpecs())){ |
| | | locDetl.setSpecs(mat.getSpecs()); |
| | | }else{ |
| | | locDetl.setSpecs(""); |
| | | } |
| | | if(!Cools.isEmpty(mat.getModel())){ |
| | | locDetl.setModel(mat.getModel()); |
| | | }else { |
| | | locDetl.setModel(""); |
| | | } |
| | | if(!Cools.isEmpty(mat.getSku())){ |
| | | locDetl.setSku(mat.getSku()); |
| | | }else { |
| | | locDetl.setSku(""); |
| | | } |
| | | //图号 |
| | | if(!Cools.isEmpty(mat.getImgNum())){ |
| | | locDetl.setItemNum(mat.getImgNum()); |
| | | }else { |
| | | locDetl.setItemNum(""); |
| | | } |
| | | // if(!Cools.isEmpty(mat.getWeight())){ |
| | | // locDetl.setWeight(Double.parseDouble(mat.getWeight())); |
| | | // }else { |
| | | // locDetl.setWeight(0.0); |
| | | // } |
| | | // if(!Cools.isEmpty(mat.getLength())){ |
| | | // locDetl.setLength(Double.parseDouble(mat.getLength())); |
| | | // }else { |
| | | // locDetl.setLength(0.0); |
| | | // } |
| | | locDetlService.updateById(locDetl); |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | /** |
| | | * 平庫上架 |
| | | * |
| | | * @param locNo |
| | | * @param barcode |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 平庫下架 |
| | | * |
| | | * @param combParam |
| | | * @return |
| | | */ |
| | |
| | | .eq(OrderDetl::getMatnr, matnr) |
| | | .like(OrderDetl::getOrderNo, orderNo) |
| | | .orderByDesc(OrderDetl::getCreateTime)); |
| | | for (OrderDetl orderDetl:list |
| | | ) { |
| | | for (OrderDetl orderDetl : list |
| | | ) { |
| | | double count = orderDetl.getAnfme() - orderDetl.getWorkQty(); |
| | | PickMatParam matParam = new PickMatParam(); |
| | | matParam.setMatnr(orderDetl.getMatnr()); |
| | |
| | | @RequestMapping("/pda/WarehouseOutPickMerge/v1") |
| | | @ManagerAuth |
| | | public R WarehouseOutPickMergeV1(@RequestBody WarehouseOutPickMergeParam param) { |
| | | return mobileService.WarehouseOutPickMergeV1(param, getHostId(),getUserId()); |
| | | return mobileService.WarehouseOutPickMergeV1(param, getHostId(), getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 多次并板 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/pda/WarehouseOutMergeBoardMany/v1") |
| | | @ManagerAuth |
| | | public R WarehouseOutMergeBoardManyV1(@RequestBody WarehouseOutMergeBoardManyParam param) { |
| | | return mobileService.WarehouseOutMergeBoardMany(param, getHostId(),getUserId()); |
| | | return mobileService.WarehouseOutMergeBoardMany(param, getHostId(), getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/menu/pda/auth") |
| | |
| | | |
| | | @RequestMapping("/outBound/order/list") |
| | | @ManagerAuth(memo = "获取出库订单") |
| | | public R outBound(@RequestParam(required = false) String matnr,@RequestParam(required = false) String orderNo){ |
| | | public R outBound(@RequestParam(required = false) String matnr, @RequestParam(required = false) String orderNo) { |
| | | List<DocType> docTypes = docTypeService.list(new LambdaQueryWrapper<DocType>().like(DocType::getPakout, 1)); |
| | | ArrayList<Long> typeList = new ArrayList<>(); |
| | | for (DocType docType : docTypes) { |
| | |
| | | return R.ok().add(wrkMastArrayList); |
| | | } |
| | | |
| | | @PostMapping("/pda/OutLocNo") |
| | | @ManagerAuth(memo = "获得平库出库的对应库位号") |
| | | @Transactional |
| | | public R OutLocNo(@RequestParam Long orderId) { |
| | | List<OrderDetl> orderDetls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>() |
| | | .eq(OrderDetl::getOrderId, orderId) |
| | | .eq(OrderDetl::getHostId, getHostId()) |
| | | ); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.error("订单明细不存在"); |
| | | } |
| | | List<String> list = new ArrayList<>(); |
| | | for (OrderDetl o : orderDetls |
| | | ) { |
| | | if (o.getAnfme() <= o.getWorkQty()) { |
| | | continue; |
| | | } else { |
| | | //查看库位明细中有的物料 |
| | | List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getMatnr, o.getMatnr()).eq(LocDetl::getHostId, getHostId()) |
| | | ); |
| | | if (Cools.isEmpty(locDetls)) { |
| | | continue; |
| | | } else { |
| | | for (LocDetl l : locDetls |
| | | ) { |
| | | String s = l.getLocNo().substring(1, 2); |
| | | if (Integer.valueOf(s) > 4) { |
| | | list.add(l.getLocNo()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | List<String> myList = list.stream().distinct().collect(Collectors.toList()); |
| | | return R.ok(myList); |
| | | } |
| | | |
| | | @PostMapping("/pda/OrderDetlContrastLocDetl") |
| | | @ManagerAuth(memo = "获得订单明细对应的库存明细") |
| | | @Transactional |
| | | public R OrderDetlContrastLocDetl(@RequestParam Long orderId, @RequestParam String locNo) { |
| | | List<LocDetl> locDetlList = new ArrayList<LocDetl>(); |
| | | List<OrderDetl> orderDetls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>() |
| | | .eq(OrderDetl::getOrderId, orderId) |
| | | .eq(OrderDetl::getHostId, getHostId()) |
| | | ); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.error("订单明细不存在"); |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getLocNo, locNo)); |
| | | if (Cools.isEmpty(locDetls)) { |
| | | return R.error("库位为空"); |
| | | } |
| | | for (OrderDetl o : orderDetls |
| | | ) { |
| | | for (LocDetl l : locDetls |
| | | ) { |
| | | if (o.getMatnr().equals(l.getMatnr())) { |
| | | if (o.getAnfme() - o.getWorkQty() >= l.getAnfme()) { |
| | | |
| | | } else { |
| | | l.setAnfme(o.getAnfme() - o.getWorkQty()); |
| | | } |
| | | locDetlList.add(l); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(locDetlList); |
| | | } |
| | | |
| | | } |
| | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | dropdown: 'dropdown/dropdown', |
| | | }).use(['table','laydate', 'form', 'treeTable', 'admin', 'xmSelect', 'dropdown', 'element'], function(){ |
| | | dropdown: 'dropdown/dropdown',notice: 'notice/notice', |
| | | }).use(['table','laydate', 'form', 'treeTable','notice', 'admin', 'xmSelect', 'dropdown', 'element'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | |
| | | admin = layui.admin; |
| | | var treeTable = layui.treeTable; |
| | | var xmSelect = layui.xmSelect; |
| | | |
| | | var notice = layui.notice; |
| | | // 商品分类数据 |
| | | var insTb = treeTable.render({ |
| | | elem: '#tag', |
| | |
| | | // 同步庫存 |
| | | form.on('submit(synchronous)', function (data) { |
| | | layer.confirm('确认同步庫存?', function(){ |
| | | http.get(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:1}, function (res) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(data.wrkNo + res.msg); |
| | | notice.msg('正在同步庫存......', {icon: 4}); |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/synchronous", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | notice.destroy(); |
| | | // layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | layer.closeAll(); |
| | | |
| | | }); |
| | | }); |