| | |
| | | allLike(LocNormal.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } else { |
| | | wrapper.orderBy("appe_time", false); |
| | | } |
| | | if (Cools.isEmpty(param.get("state"))) { |
| | | wrapper.in("state", "1,2"); |
| | |
| | | // erp中间表更新数据 |
| | | if (!erpService.incrementCPakOut(FInterI, locNormals.getMatnr(), locNormals.getAnfme().doubleValue(), param.getSupplier())) { |
| | | log.error("更新ERP成品出库数据[matnr={},FBillNo={}]失败", locNormals.getMatnr(), param.getSupplier()); |
| | | throw new CoolException("更新ERP成品出库数据[matnr=" + locNormals.getMatnr() + ",FBillNo=" + param.getSupplier() + "]失败"); |
| | | } |
| | | |
| | | } |
| | |
| | | public void startupFullTakeStore(StockOutParam param, Long userId) { |
| | | //判断出库熟练是否大于库存数量 |
| | | for (StockOutParam.LocDetl detl : param.getLocDetls()) { |
| | | LocDetl locDetl = locDetlService.selectById(detl.getLocNo()); |
| | | // LocDetl locDetl = locDetlService.selectById(detl.getLocNo()); |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",detl.getLocNo())); |
| | | if(locDetl != null){ |
| | | if(detl.getCount() > locDetl.getAnfme()){ |
| | | throw new CoolException("出库数量超过了库存数量[locNo=" + detl.getLocNo() + "]"); |
| | |
| | | jdbcTemplate.update("delete from asr_wrk_mast_log where dateadd(day,360,appe_time) <= getdate();"); |
| | | jdbcTemplate.update("delete from cust_wait_pakin_log where dateadd(day,360,appe_time) <= getdate();"); |
| | | |
| | | //删除出库通知明细档数据,日期超过180天,或者已出库数量大于等于通知出库量,且日期超过7天 |
| | | String sql = "delete ise from OutStockBillEntry ise left join OutStockbill isb on isb.FInterID = ise.FInterID where 1=1 "; |
| | | sql += "and (dateadd(day,180,ise.FFetchDate) <= getdate() or (ise.FAuxCommitQty>=ise.FQty and dateadd(day,7,ise.FFetchDate) <= getdate()) )"; |
| | | jdbcTemplate.update(sql); |
| | | |
| | | //删除没有明细的出库通知主档数据 |
| | | sql = "delete OutStockbill from OutStockbill where FInterID not in (select FInterID from OutStockBillEntry)"; |
| | | jdbcTemplate.update(sql); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | Integer FInterI = outStockService.queryOutStockFInterID(wrkDetl.getSupplier()); // 获取出库单主表主键 |
| | | if (!Cools.isEmpty(FInterI)) { |
| | | if (!erpService.incrementCPakOut(FInterI, wrkDetl.getMatnr(), wrkDetl.getAnfme(), wrkDetl.getSupplier())) { |
| | | exceptionHandle("[xtyasrs_dual]更新ERP成品出库数据[matnr={0}]失败", wrkDetl.getMatnr()); |
| | | exceptionHandle("[xtyasrs_dual]更新ERP成品出库数据[matnr={0},FBillNo={1}]失败", wrkDetl.getMatnr(),wrkDetl.getSupplier()); |
| | | } |
| | | if (!outStockService.incrementCPakOut(FInterI, wrkDetl.getMatnr(), wrkDetl.getAnfme(), wrkDetl.getSupplier())) { |
| | | exceptionHandle("[xtyasrs]更新ERP成品出库数据[matnr={0}]失败", wrkDetl.getMatnr()); |
| | | exceptionHandle("[xtyasrs]更新ERP成品出库数据[matnr={0},FBillNo={1}]失败", wrkDetl.getMatnr(),wrkDetl.getSupplier()); |
| | | } |
| | | } |
| | | } |
| | |
| | | return false; |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String msg = "incrementCPakOut成品增量出库失败[FInterID={0},Fnumber={1},FBillNo={2}]\n"; |
| | | msg = MessageFormat.format(msg,FInterID,Fnumber,FBillNo); |
| | | log.error(msg, e); |
| | | // e.printStackTrace(); |
| | | log.error("incrementCPakOut----" + sql); |
| | | return false; |
| | | } |
| | |
| | | import com.zy.common.service.erp.ErpService; |
| | | import com.zy.common.service.erp.dto.InStockDto; |
| | | import com.zy.common.service.erp.entity.*; |
| | | import lombok.Synchronized; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | /** |
| | | * 原材料入库单 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Scheduled(cron = "0/30 * * * * ? ") |
| | | @Synchronized |
| | | // @PostConstruct |
| | | public void inStockExecute(){ |
| | | List<InStockDto> readyInStock = erpService.getReadyInStock(); |
| | |
| | | /** |
| | | * 成品入库单 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Scheduled(cron = "0/20 * * * * ? ") |
| | | @Synchronized |
| | | // @PostConstruct |
| | | public void inCPICMOExecute(){ |
| | | List<CPICMO> cpicmos = erpService.getReadyCPICMO(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Scheduled(cron = "0/30 * * * * ? ") |
| | | @Synchronized |
| | | public void syncMat(){ |
| | | List<M_item> items = erpService.getItem(); |
| | | for (M_item item : items) { |
| | |
| | | * 成品出库 发货通知单表头,表明细 |
| | | */ |
| | | @Scheduled(cron = "0/15 * * * * ? ") |
| | | @Synchronized |
| | | @Transactional |
| | | public void syncOutStock(){ |
| | | List<OutStockBill> outStockBills = erpService.syncOutStock(); |
| | |
| | | if (null == one) { |
| | | // String Fnumber = (Cools.isEmpty(outStockBillEntry.getFSourceBillNo())) ? outStockBillEntry.getFnumber() : outStockBillEntry.getFnumber()+"|"+outStockBillEntry.getFSourceBillNo(); |
| | | // outStockBillEntry.setFnumber(Fnumber); //产品代码|生产单号 |
| | | outStockBillEntry.setFAmount(new BigDecimal(0)); |
| | | if (!outStockService.insert(outStockBillEntry)) { |
| | | log.info("提取出库通知明细表OutStockBillEntry失败[FBrNo={},FInterID={},FEntryID={}]",outStockBillEntry.getFBrNo(), |
| | | outStockBillEntry.getFInterID(),outStockBillEntry.getFEntryID()); |
| | |
| | | } else { |
| | | // 数量有变化进行更新 |
| | | if (Double.doubleToLongBits(one.getFAuxQty().doubleValue()) != Double.doubleToLongBits(outStockBillEntry.getFAuxQty().doubleValue())) { |
| | | outStockBillEntry.setFAmount(new BigDecimal(0)); |
| | | if (!outStockService.update(outStockBillEntry, wrapper)) { |
| | | log.info("同步更新通知明细表OutStockBillEntry失败[FBrNo={},FInterID={},FEntryID={}]",outStockBillEntry.getFBrNo(), |
| | | outStockBillEntry.getFInterID(),outStockBillEntry.getFEntryID()); |
| | |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | console.log(res); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | |
| | | switch (obj.event) { |
| | | case 'outLocNormal': |
| | | var warehourse = data.warehouse; |
| | | console.log(warehourse); |
| | | |
| | | if(warehourse !== 'cs'){ |
| | | layer.msg("只能出材料平仓"); |
| | | return; |
| | |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="operate"> |
| | | {{# if(d.state === '1'){ }} |
| | | {{# if(d.state === '1' && d.warehouse === 'cs'){ }} |
| | | <button class="layui-btn layui-btn-xs layui-btn-normal btn-out" lay-event="outLocNormal">出库</button> |
| | | {{# } else { }} |
| | | <button class="layui-btn layui-btn-xs layui-btn-disabled btn-out">出库</button> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin: 5px 5px"> |
| | | <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i |
| | | class="layui-icon">+</i>提取 |
| | | </button> |
| | | </div> |
| | | <!-- <div style="margin: 5px 5px">--> |
| | | <!-- <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i--> |
| | | <!-- class="layui-icon">+</i>提取--> |
| | | <!-- </button>--> |
| | | <!-- </div>--> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |