| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/locDetl/selectPayment/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | if (param.get("owner$") != null && param.get("owner$") != ""){ |
| | | LocOwner locOwner = locOwnerService.selectOne(new EntityWrapper<LocOwner>().eq("owner", param.get("owner$"))); |
| | | param.remove("owner$"); |
| | | param.put("owner",locOwner.getId()); |
| | | } |
| | | |
| | | |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("payment",0); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | int increase(@Param("orderId")Long orderId, @Param("matnr")String matnr, @Param("batch")String batch, @Param("qty")Double qty); |
| | | |
| | | int decrease(@Param("orderNo")String orderNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("qty")Double qty); |
| | | int decrease(@Param("orderNo")String orderNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("workQty")Double workQty); |
| | | |
| | | int modifyStatus(@Param("orderId") Long orderId, @Param("status")Integer status); |
| | | |
| | |
| | | |
| | | boolean increase(Long orderId, String matnr, String batch, Double qty); |
| | | |
| | | boolean decrease(String orderNo, String matnr, String batch, Double qty); |
| | | boolean decrease(String orderNo, String matnr, String batch, Double workQty); |
| | | |
| | | boolean modifyStatus(Long orderId, Integer status); |
| | | |
| | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),elem.getWeight()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | assert one != null; |
| | |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setOwner(detlDto.getOwner()); |
| | | waitPakin.setUuid(uuid); |
| | | waitPakin.setWeight(param.getCombMats().get(0).getWeight()); |
| | | waitPakin.setWeight(detlDto.getWeight()); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | |
| | | } |
| | | |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),orderDetl.getOwner(),elem.getWeight()); |
| | | detlDto.setPayment(orderDetl.getPayment()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | assert one != null; |
| | |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setOwner(detlDto.getOwner()); |
| | | waitPakin.setPayment(detlDto.getPayment()); |
| | | waitPakin.setUuid(uuid); |
| | | waitPakin.setWeight(detlDto.getWeight()); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean decrease(String orderNo, String matnr, String batch, Double qty) { |
| | | int decrease = this.baseMapper.decrease(orderNo, matnr, batch, qty); |
| | | public boolean decrease(String orderNo, String matnr, String batch, Double workQty) { |
| | | int decrease = this.baseMapper.decrease(orderNo, matnr, batch, workQty); |
| | | if (decrease == 0) { |
| | | return this.baseMapper.decrease(orderNo, matnr, null, qty) > 0; |
| | | return this.baseMapper.decrease(orderNo, matnr, null, workQty) > 0; |
| | | } else { |
| | | return true; |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | // 订单关联 |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | if (!Cools.isEmpty(wrkDetl.getOrderNo())) { |
| | | if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { |
| | | throw new CoolException("订单数据回滚失败"); |
| | | } |
| | | // 生成新的出库作业 |
| | | // stockOutRe(wrkMast, wrkDetls); |
| | | } |
| | | } |
| | | // // 订单关联 |
| | | // List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | // for (WrkDetl wrkDetl : wrkDetls) { |
| | | // if (!Cools.isEmpty(wrkDetl.getOrderNo())) { |
| | | // if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { |
| | | // throw new CoolException("订单数据回滚失败"); |
| | | // } |
| | | // // 生成新的出库作业 |
| | | //// stockOutRe(wrkMast, wrkDetls); |
| | | // } |
| | | // } |
| | | |
| | | // 取消操作人员记录 |
| | | wrkMast.setManuType("手动取消"); |
| | |
| | | if (!locNos.contains(locDetl.getLocNo())){ |
| | | locNos.add(locDetl.getLocNo()); |
| | | locNos2[i][0]=locDetl.getLocNo(); |
| | | locNos2[i][1]=locDetl.getManu(); |
| | | if (locDetl.getLocNo().substring(0,2) == "DT"){ |
| | | locNos2[i][1]= "平库"; |
| | | }else { |
| | | locNos2[i][1]= "立库"; |
| | | } |
| | | |
| | | i++; |
| | | } |
| | | } |
| | |
| | | for (ManLocDetl manLocDetl:manLocDetls){ |
| | | manLocDetl.setPayment(1); |
| | | try{ |
| | | manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>().eq("loc_no", locNo).eq("uuid",manLocDetl.getMatnr())); |
| | | manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>().eq("loc_no", locNo).eq("matnr",manLocDetl.getMatnr())); |
| | | }catch (Exception e){ |
| | | throw new Exception("更新库存明细货物形态字段信息出错了"); |
| | | } |
| | |
| | | for (LocDetl locDetl:locDetls){ |
| | | locDetl.setPayment(1); |
| | | try{ |
| | | locDetlService.update(locDetl,new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("uuid",locDetl.getMatnr())); |
| | | locDetlService.update(locDetl,new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("matnr",locDetl.getMatnr())); |
| | | }catch (Exception e){ |
| | | throw new Exception("更新库存明细货物形态字段信息出错了"); |
| | | } |
| | |
| | | locDetl.setAppeTime(now); |
| | | locDetl.setOwner(wrkDetl.getOwner()); |
| | | locDetl.setPayment(wrkDetl.getPayment()); |
| | | locDetl.setWeight(wrkDetl.getWeight()); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | // exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | |
| | | private int owner; |
| | | |
| | | private int payment; |
| | | |
| | | private Double weight; |
| | | |
| | | public DetlDto() { |
| | |
| | | this.weight = weight; |
| | | } |
| | | |
| | | public DetlDto(String matnr, String batch, Double anfme,Double weight) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.anfme = anfme; |
| | | this.weight = weight; |
| | | } |
| | | |
| | | |
| | | public static boolean hasList(Set<DetlDto> detlDtos, OrderDetl orderDetl) { |
| | | for (DetlDto dto : detlDtos) { |
| | |
| | | |
| | | <update id="decrease"> |
| | | update man_order_detl |
| | | set qty = qty - #{qty} |
| | | set work_qty = work_qty - #{workQty} |
| | | where 1=1 |
| | | and order_no = #{orderNo} |
| | | and matnr = #{matnr} |
| | |
| | | {field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true} |
| | | ,{field: 'batch', align: 'center',title: '批号', width: 200, sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'specs', align: 'center',title: '配置'} |
| | | ,{field: 'specs', align: 'center',title: '配置',hide: true} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '重量', hide: false} |
| | | ,{field: 'owner$', align: 'center',title: '货主', hide: false} |
| | | ,{field: 'payment$', align: 'center',title: '货物状态', hide: false} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | {field: 'owner', title: '货主编号', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | {field: 'payment', title: '货主编号', style: 'color: blue;font-weight: bold', templet: '#payment'}, |
| | | {field: 'payment', title: '货物状态', style: 'color: blue;font-weight: bold', templet: '#payment'}, |
| | | // {field: 'payment', title: '货物状态',align: 'center', templet: '#payment'}, |
| | | {field: 'qty', title: '作业数量', minWidth: 100, width: 100}, |
| | | // {field: 'unit', title: '单位', width: 80}, |
| | |
| | | rightBoxLeft: "0px", |
| | | pointContainerWidth: 0, |
| | | currentLev: 1, |
| | | area:6, |
| | | area:1, |
| | | areaName:"立库", |
| | | crnList: null, |
| | | crnBox: false, |
| | |
| | | }else if (this.area == 6){ |
| | | if (rowData[i].locNo != undefined) { |
| | | let locNo = rowData[i].locNo; |
| | | return "#" + parseInt(locNo.substr(8, 2)); |
| | | return "#" + parseInt(locNo.substr(7, 2)); |
| | | } |
| | | } |
| | | else { |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="owner" placeholder="货主" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="owner$" placeholder="货主" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/turn/over/list/auth', |
| | | url: baseUrl+'/locDetl/selectPayment/list/auth', |
| | | page: true, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | limit: 16, |