| | |
| | | Wrapper wrapper = new EntityWrapper<OutStockBillEntry>().eq("FInterID",FInterI).eq("Fnumber",locNormals.getMatnr()); |
| | | OutStockBillEntry outStockBillEntry = outStockService.selectOne(wrapper); |
| | | outStockBillEntry.setFAuxCommitQty(outStockBillEntry.getFAuxCommitQty().add(locNormals.getAnfme())); |
| | | outStockBillEntry.setFAmount(outStockBillEntry.getFAmount().add(locNormals.getAnfme())); //借用amount字段,控制下发出库任务数量 |
| | | outStockBillEntry.setFAmount(outStockBillEntry.getFAmount().add(locNormals.getAnfme())); //借用famount字段,控制下发出库任务数量 |
| | | outStockBillEntry.setFAuxQty(outStockBillEntry.getFAuxQty().subtract(locNormals.getAnfme())); |
| | | if(!outStockService.update(outStockBillEntry,wrapper)){ |
| | | throw new CoolException("更新出库通知档明细失败[FInterID="+FInterI+",Fnumber="+locNormals.getMatnr()+"]"); |
| | | } |
| | |
| | | } |
| | | } |
| | | if (complete) { |
| | | if (!completeCPakOut(FBillNo)) { |
| | | log.error("{}出库单标记完成失败", FBillNo); |
| | | } |
| | | List<OutStockBillEntry> select1 = this.selectList(new EntityWrapper<OutStockBillEntry>().eq("FInterID", FInterID)); |
| | | if(select1.size()==1){ |
| | | if (!completeCPakOut(FBillNo) ) { |
| | | log.error("{}出库单标记完成失败", FBillNo); |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } else { |
| | |
| | | Integer FInterI = outStockService.queryOutStockFInterID(fbillNo); // 获取出库单主表主键 |
| | | Wrapper wrapper1 = new EntityWrapper<OutStockBillEntry>().eq("FInterID",FInterI).eq("Fnumber",detlDto.getLocDetl().getMatnr()); |
| | | OutStockBillEntry outStockBillEntry = outStockService.selectOne(wrapper1); |
| | | outStockBillEntry.setFAmount(outStockBillEntry.getFAmount().add(BigDecimal.valueOf(anfme))); //借用amount字段,控制下发出库任务数量 |
| | | outStockBillEntry.setFAmount(outStockBillEntry.getFAmount().add(BigDecimal.valueOf(anfme))); //借用famount字段,控制下发出库任务数量 |
| | | outStockBillEntry.setFAuxQty(outStockBillEntry.getFAuxQty().subtract(BigDecimal.valueOf(anfme))); |
| | | if(!outStockService.update(outStockBillEntry,wrapper1)){ |
| | | throw new CoolException("更新出库通知档明细FAmount失败[FInterID="+FInterI+",Fnumber="+detlDto.getLocDetl().getMatnr()+"]"); |
| | | } |
| | |
| | | package com.zy.common.service.erp; |
| | | |
| | | import com.baomidou.mybatisplus.MybatisSqlSessionTemplate; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | } |
| | | } |
| | | if (complete) { |
| | | if (!completeCPakOut(FBillNo)) { |
| | | log.error("{}出库单标记完成失败", FBillNo); |
| | | } |
| | | int updateCount = jdbcTemplate.update("update OutStockbill set Fflag_finish=1 where FBillNo='" + FBillNo + "'"); |
| | | if(updateCount<=0){ |
| | | throw new CoolException("更新出库通知档完成标记失败[FBillNo="+FBillNo+"]"); |
| | | sql = "select * from OutStockbillEntry where 1=1 and FInterID = {1,number,#} and FAuxCommitQty != FQty"; |
| | | sql = MessageFormat.format(sql, Fnumber, FInterID); |
| | | List<OutStockBillEntry> select1 = erpSqlServer.select(sql, OutStockBillEntry.class); |
| | | if(select1.size()<1){ |
| | | if (!completeCPakOut(FBillNo) ) { |
| | | log.error("{}出库单标记完成失败", FBillNo); |
| | | |
| | | } |
| | | int updateCount = jdbcTemplate.update("update OutStockbill set Fflag_finish=1 where FBillNo='" + FBillNo + "'"); |
| | | if(updateCount<=0){ |
| | | throw new CoolException("更新出库通知档完成标记失败[FBillNo="+FBillNo+"]"); |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | |
| | | BEGIN |
| | | <foreach collection="list" item="item" index="index"> |
| | | update asr_loc_normal set anfme = #{item.anfme,jdbcType=DECIMAL} |
| | | where supplier = #{item.supplier,jdbcType=VARCHAR} and state = '1' and warehouse = #{item.warehouse,jdbcType=VARCHAR} |
| | | where supplier = #{item.supplier,jdbcType=VARCHAR} and state = '1' and warehouse = #{item.warehouse,jdbcType=VARCHAR} and matnr = #{item.matnr,jdbcType=VARCHAR} |
| | | </foreach> |
| | | END; |
| | | </update> |