| | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.service.erp.ErpService; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | |
| | | /** |
| | | * Created by vincent on 2020/7/6 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RestController |
| | | public class WorkLogHandler extends AbstractHandler<String> { |
| | |
| | | private ErpService erpService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @GetMapping("/test1") |
| | | public String test1(String barcode){ |
| | |
| | | // 获取工作档内物料清单 |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(wrapper.eq("wrk_no", wrkMast.getWrkNo()).and().isNotNull("supplier")); |
| | | for (WrkDetl wrkDetl: wrkDetls) { |
| | | if (!Cools.isEmpty(wrkDetl.getMemo())) { |
| | | if (!Cools.isEmpty(wrkDetl)) { |
| | | Integer FInterI = outStockService.queryOutStockFInterID(wrkDetl.getSupplier()); // 获取出库单主表主键 |
| | | log.info("incrementCPakOut---" + wrkMast.getWrkNo() + "----FInterI" + FInterI); |
| | | if (!Cools.isEmpty(FInterI)) { |
| | | if (!erpService.incrementCPakOut(FInterI, wrkDetl.getMatnr(), wrkDetl.getAnfme(), wrkDetl.getSupplier())) { |
| | | log.error("erpService.incrementCPakOut"); |
| | | exceptionHandle("[xtyasrs_dual]更新ERP成品出库数据[matnr={0}]失败", wrkDetl.getMatnr()); |
| | | } |
| | | // if (!outStockService.incrementCPakOut(FInterI, wrkDetl.getMatnr(), wrkDetl.getAnfme(), wrkDetl.getSupplier())) { |
| | | // exceptionHandle("[xtyasrs]更新ERP成品出库数据[matnr={0}]失败", wrkDetl.getMatnr()); |
| | | // } |
| | | } |
| | | if (wrkDetl.getMemo().equals("原材料")) { |
| | | // 待实现 |
| | | |
| | | |
| | | } else if (wrkDetl.getMemo().equals("成品")) { |
| | | Integer FInterI = outStockService.queryOutStockFInterID(wrkDetl.getSupplier()); // 获取出库单主表主键 |
| | | if (!erpService.incrementCPakOut(FInterI, wrkDetl.getMatnr(), wrkDetl.getAnfme(), wrkDetl.getSupplier())) { |
| | | exceptionHandle("更新ERP成品出库数据[matnr={0}]失败", wrkDetl.getMatnr()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |