| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.OutDetTB; |
| | | import com.zy.third.erp.entity.OutHedTB; |
| | |
| | | List<OutHedTB> inHeds = erpSqlServer.select(sqlInHed, OutHedTB.class); |
| | | if (!inHeds.isEmpty()) { |
| | | for (OutHedTB inHed : inHeds) { |
| | | if (!Cools.isEmpty(inHed.getTemp3()) && inHed.getTemp3().equals("fault")) { |
| | | continue; |
| | | } |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + inHed.getBillNo() + "'"); |
| | | List<OutDetTB> inDetTBS = erpSqlServer.selectList(OutDetTB.class, condition); |
| | | HashMap<String, Object> hedAndDet = new HashMap<>(); |
| | | hedAndDet.put("hed", inHed); |
| | | hedAndDet.put("det", inDetTBS); |
| | | boolean result = inMS.createOutOrder(inHed, inDetTBS); |
| | | if (result) { |
| | | log.info("出库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | } else { |
| | | String sql = "UPDATE erp_OutHedTB SET Temp3 = ‘fault’ WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | try { |
| | | inMS.createOutOrder(inHed, inDetTBS); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String sql = "UPDATE erp_OutHedTB SET Temp3 = 'fault' WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | log.info("出库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | |
| | | } |
| | | } |
| | | } |