| | |
| | | } |
| | | |
| | | public Double getEnableQty() { |
| | | if (null != this.anfme && this.workQty != null) { |
| | | return this.anfme - this.workQty; |
| | | |
| | | if (null != this.anfme && this.qty != null) { |
| | | return this.anfme - this.qty; |
| | | } |
| | | // if (null != this.anfme && this.qty != null) { |
| | | // return this.anfme - this.qty; |
| | | // } |
| | | return null; |
| | | } |
| | | |
| | |
| | | int increaseQtyByOrderNo(@Param("orderNo")String orderNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("qty")Double qty); |
| | | |
| | | int increaseWorkQty(@Param("orderId")Long orderId, @Param("matnr")String matnr, @Param("batch")String batch, @Param("workQty")Double workQty); |
| | | |
| | | Integer checkAllDetlFinish(@Param("orderNo") String orderNo); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | List<WrkMast> selectToBeHistoryData(); |
| | | |
| | | Integer checkFinishByOrder(@Param("orderNo") String orderNo); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | boolean increaseWorkQty(Long orderId, String matnr, String batch, Double workQty); |
| | | |
| | | Boolean checkAllDetlFinish(String orderNo); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | int getStoreCount(Integer crnNo); |
| | | |
| | | Boolean checkFinishByOrder(String orderNo); |
| | | |
| | | } |
| | |
| | | } |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | |
| | | for (CombParam.CombMat elem : param.getCombMats()) { |
| | | // 订单明细数量校验 |
| | | OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); |
| | | if(orderDetl == null){ |
| | | throw new CoolException("该单据中不存在该物料明细:" + elem); |
| | | } |
| | | if (elem.getAnfme() > orderDetl.getEnableQty()) { |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); |
| | | } |
| | |
| | | } else { |
| | | detlDtos.add(detlDto); |
| | | } |
| | | }); |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setBatch(detlDto.getBatch()); |
| | | orderDetl.setBatch(detlDto.getBatch() == null ? "" : detlDto.getBatch()); |
| | | orderDetl.setAnfme(detlDto.getAnfme()); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | |
| | | public boolean increaseWorkQty(Long orderId, String matnr, String batch, Double workQty) { |
| | | return this.baseMapper.increaseWorkQty(orderId, matnr, batch, workQty) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkAllDetlFinish(String orderNo) { |
| | | return this.baseMapper.checkAllDetlFinish(orderNo) <= 0 ; |
| | | } |
| | | } |
| | |
| | | for (LocDto locDto : taskDto.getLocDtos()) { |
| | | if (locDto.getAnfme()==null || locDto.getAnfme() <= 0.0D) { continue; } |
| | | OrderDetl orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch()); |
| | | if (orderDetl == null) { |
| | | orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), null); |
| | | } |
| | | // if (orderDetl == null) { |
| | | // orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), null); |
| | | // } |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(orderDetl); |
| | | wrkDetl.setZpallet(wrkMast.getBarcode()); |
| | |
| | | .last(" and (wrk_sts in (1,2) or (wrk_sts=3 and wrk_no in (select wrk_no from asr_bas_devp)))")); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkFinishByOrder(String orderNo) { |
| | | return this.baseMapper.checkFinishByOrder(orderNo) <= 0; |
| | | } |
| | | |
| | | } |
| | |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | // 4.入库完成 |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全板出库 ===>> 工作明细档为空; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); |
| | | } |
| | | for (WrkDetl wrkDetl : wrkDetls101) { |
| | | // 更新订单完成数量 |
| | | OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | try { |
| | | if(!Cools.isEmpty(orderDetl)){ |
| | | if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | wrkDetl.getBatch(),wrkDetl.getAnfme())){ |
| | | // exceptionHandle("全板出库 ===>> 更新订单完成数量失败;[workNo={0}],[locNo={1}]", |
| | | // wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全板出库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); |
| | | } |
| | | } |
| | | } catch (Exception ignore){} |
| | | |
| | | Boolean finsihed = orderDetlService.checkAllDetlFinish(wrkDetls101.get(0).getOrderNo()); |
| | | if (finsihed) { |
| | | Boolean mastFinished = wrkMastService.checkFinishByOrder(wrkDetls101.get(0).getOrderNo()); |
| | | if (mastFinished) { |
| | | Order order = orderService.selectByNo(wrkDetls101.get(0).getOrderNo()); |
| | | orderService.updateSettle(order.getId(),4L,1L); |
| | | } |
| | | } |
| | | |
| | | // 删除工作档源库位的库存明细 |
| | | if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo()))) { |
| | | // exceptionHandle("全板出库 ===>> 删除库存明细失败;[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | |
| | | private RowLastnoService rowLastnoService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | |
| | | @PostMapping("/pakin/loc/v1") |
| | | @ResponseBody |
| | |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | List<String> matNos = waitPakins.stream().map(WaitPakin::getMatnr).distinct().collect(Collectors.toList()); |
| | | Integer integer = rowLastnoService.selectNextWhsType(); |
| | | int rowCount = rowLastnoService.selectCount(null); |
| | | Integer integer = 1; |
| | | for (int i = 1; i <= rowCount; i++) { |
| | | integer = rowLastnoService.selectNextWhsType(); |
| | | BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() |
| | | .eq("crn_no", i)); |
| | | if (crn_no.getInEnable().equals("Y")){ |
| | | break; |
| | | } |
| | | } |
| | | |
| | | StartupDto dto = commonService.getLocNo(integer, 1, devpNo, matNos, locTypeDto,0); |
| | | int workNo = dto.getWorkNo(); |
| | | Date now = new Date(); |
| | |
| | | and mdt.pakout = 1 |
| | | <include refid="pakOutPageCondition"></include> |
| | | </select> |
| | | <select id="checkAllDetlFinish" resultType="java.lang.Integer"> |
| | | SELECT count(*) From man_order_detl WHERE qty < anfme and order_no = #{orderNo} |
| | | </select> |
| | | |
| | | <update id="increase"> |
| | | update man_order_detl |
| | |
| | | or (wrk_sts=15 and crn_end_time is null and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | order by io_time,wrk_no asc |
| | | </select> |
| | | <select id="checkFinishByOrder" resultType="java.lang.Integer"> |
| | | select Count(*) FROM asr_wrk_detl d left join asr_wrk_mast m on d.wrk_no = m.wrk_no WHERE d.order_no = #{orderNo} and m.wrk_sts < 14 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | // {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | // ,{field: 'anfme', align: 'center',title: '数量'} |
| | | // ,{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: 'orderNo', title: '单据编号', merge: true, align: 'center'}, |
| | | {field: 'title', title: '商品', merge: true, align: 'center', width: 350}, |
| | | {field: 'batch', title: '序列码', align: 'center'}, |
| | | { title: '需求数量', align: 'center' , width: 90, toolbar: '#checkNeedQty'}, |
| | | { title: '剩余需求量', align: 'center' , width: 120, toolbar: '#checkNeedQty'}, |
| | | // {field: 'anfme', title: '实际数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | { title: '实际数量', align: 'center', width: 90, toolbar: '#checkAnfme'}, |
| | | { title: '立库余量', align: 'center', width: 90, toolbar: '#checkAnfme'}, |
| | | {field: 'locNo', title: '货位', align: 'center', width: 100, templet: '#locNoTpl'}, |
| | | {field: 'staNos', align: 'center', title: '出库站', merge: ['locNo'], templet: '#tbBasicTbStaNos'}, |
| | | {type: 'checkbox', merge: ['locNo']}, |