| | |
| | | //20230203添加 lfd料箱库根据输送线筛选入库 |
| | | if (!Cools.isEmpty(locMast) && locMast.getCrnNo()<5){ |
| | | int wrkMastsC0 = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", locMast.getCrnNo()).eq("io_type",1)); |
| | | if (wrkMastsC0>3){ |
| | | if (wrkMastsC0>3 && times < rowCount){ |
| | | BasCrnp basCrnp1 = basCrnpService.selectById(1); |
| | | if (basCrnp1.getInEnable().equals("Y") && basCrnp1.getCrnSts().equals(3)){ |
| | | int wrkMastsC1 = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", 1).eq("io_type",1)); |
| | |
| | | |
| | | @ApiModelProperty(value = "增减符号:1(加,入库)、2(减,出库)") |
| | | @TableField("ADD_ID") |
| | | private int addId2; |
| | | private Integer addId2; |
| | | |
| | | /** |
| | | * 数量 |
| | |
| | | public ErpDetTb() { |
| | | } |
| | | |
| | | public ErpDetTb(String billNo, String prdNo, String iokindid, int itm, int addId2, String addId, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { |
| | | public ErpDetTb(String billNo, String prdNo, String iokindid, int itm, Integer addId2, String addId, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { |
| | | this.billNo = billNo; |
| | | this.prdNo = prdNo; |
| | | this.iokindid = iokindid; |
| | |
| | | this.temp3 = temp3; |
| | | } |
| | | |
| | | public ErpDetTb(String billNo, String prdNo, int itm, int addId2, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { |
| | | public ErpDetTb(String billNo, String prdNo, int itm, Integer addId2, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { |
| | | this.billNo = billNo; |
| | | this.prdNo = prdNo; |
| | | this.itm = itm; |
| | |
| | | |
| | | @ApiModelProperty(value = "增减符号:1(加,入库)、2(减,出库)") |
| | | @TableField("ADD_ID") |
| | | private int addId2; |
| | | private Integer addId2; |
| | | |
| | | /** |
| | | * 数量 |
| | |
| | | if (status == 0) { |
| | | Mat mat = matService.selectByMatnr(erpDetTb.getPrdNo()); |
| | | if (Cools.isEmpty(mat)) { |
| | | erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='品号信息在立库不存在,请先添加商品!!!'" + "where 1=1 and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'"); |
| | | callApiLogSave(erpDetTb, "ERP_DETTB", "品号信息在立库不存在,请先添加商品!!!", false); |
| | | if(Cools.isEmpty(erpDetTb.getTemp1())){ |
| | | erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='品号信息在立库不存在,请先添加商品!!!'" + "where 1=1 " |
| | | +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" |
| | | +" and ITM=" + "'" + erpDetTb.getItm() + "'" |
| | | +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); |
| | | callApiLogSave(erpDetTb, "ERP_DETTB", "品号信息在立库不存在,请先添加商品!!!", false); |
| | | } |
| | | } else { |
| | | Order order = orderService.selectByNo(erpDetTb.getBillNo()); |
| | | if (Cools.isEmpty(order)) { |
| | |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | String InAndOut = erpDetTb.getAddId2()==2 ? "(出库)" : "(入库)"; |
| | | DocType docType = docTypeService.selectOrAdd("ERP订单"+InAndOut, erpDetTb.getAddId2()==1); |
| | | String InAndOut = erpDetTb.getAddId2().equals(2) ? "(出库)" : "(入库)"; |
| | | DocType docType = docTypeService.selectOrAdd("ERP订单"+InAndOut, erpDetTb.getAddId2().equals(1)); |
| | | if (!Cools.isEmpty(docType)) { |
| | | order.setDocType(docType.getDocId()); |
| | | if (!orderService.insert(order)) { |
| | |
| | | erpSqlServer.update(sqlUpDateErpDetTbOne + "'" + erpDetTb.getPrdNo() + "'"); |
| | | callApiLogSave(erpDetTb, "ERP_DETTB", "接收ERP下发订单接收成功!!", true); |
| | | } else { |
| | | erpSqlServer.update(sqlUpDateErpDetTbTwo + ",temp1='添加订单明细档失败!!!'" + "where 1=1 and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'"); |
| | | callApiLogSave(erpDetTb, "ERP_DETTB", "ERP下发订单接收失败!!", false); |
| | | if (Cools.isEmpty(erpDetTb.getTemp2())){ |
| | | erpSqlServer.update(sqlUpDateErpDetTbTwo + ",temp2='添加订单明细档失败!!!'" + "where 1=1 " |
| | | +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" |
| | | +" and ITM=" + "'" + erpDetTb.getItm() + "'" |
| | | +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); |
| | | callApiLogSave(erpDetTb, "ERP_DETTB", "ERP下发订单接收失败!!", false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // callApiLogSave(erpDetTb, "ERP_DETTB", "ERP下发订单备份后删除成功!!", true); |
| | | |
| | | } else { |
| | | callApiLogSave(erpDetTb, "ERP_DETTB", "接收ERP下发订单失败!!!状态异常!!!", false); |
| | | if (Cools.isEmpty(erpDetTb.getTemp1()) && Cools.isEmpty(erpDetTb.getTemp2()) && Cools.isEmpty(erpDetTb.getTemp3())){ |
| | | erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='接收ERP下发订单失败!!!状态异常!!!请ERP、立库双方协助解决。'" + "where 1=1 " |
| | | +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" |
| | | +" and ITM=" + "'" + erpDetTb.getItm() + "'" |
| | | +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); |
| | | callApiLogSave(erpDetTb, "ERP_DETTB", "接收ERP下发订单失败!!!状态异常!!!", false); |
| | | } |
| | | } |
| | | } |
| | | } |