| | |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.bstek.dorado.data.provider.Page; |
| | | import com.ld.igds.constant.DepotStatus; |
| | | import com.ld.igds.models.DepotStore; |
| | | import com.ld.igds.view.service.HDepotService; |
| | | import com.ld.igds.view.service.HDepotStoreService; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * depotStorePR#pageListDepotStore |
| | | * depotStorePR#pageList |
| | | * |
| | | * @Desc: 分页查询库存信息 |
| | | * @author: Andy |
| | | * @update-time: 2022/11/17 |
| | | */ |
| | | @DataProvider |
| | | public void pageListDepotStore(Page<DepotStore> page, Map<String, Object> param) throws Exception { |
| | | |
| | | public void pageList(Page<DepotStore> page, Map<String, Object> param) throws Exception { |
| | | if (null == param) { |
| | | param = new HashMap<>(); |
| | | } |
| | | |
| | | depotStoreService.listDepotStore(page, param); |
| | | } |
| | | |
| | |
| | | * @param data |
| | | */ |
| | | @DataResolver |
| | | public void saveDepotStore(DepotStore data) { |
| | | public String saveDepotStore(DepotStore data) throws Exception { |
| | | |
| | | //如果仓库状态=封仓/入库中/出库中 |
| | | if (DepotStatus.STATUS_2.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_3.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_4.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_31.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_32.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_33.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_34.getCode().equals(data.getDepotStatus())) { |
| | | |
| | | if (null == data.getFoodYear()) return "货位状态=封仓/入库中/出库中,收货年度不能为空"; |
| | | |
| | | if (null == data.getCountry()) return "货位状态=封仓/入库中/出库中,国别不能为空"; |
| | | |
| | | if (null == data.getFoodLocation()) return "货位状态=封仓/入库中/出库中,粮食产地不能为空"; |
| | | |
| | | if (null == data.getFoodLocation()) return "货位状态=封仓/入库中/出库中,粮食产地不能为空"; |
| | | |
| | | if (null == data.getStoreDate()) return "货位状态=封仓/入库中/出库中,入库时间不可为空"; |
| | | } |
| | | |
| | | //货位状态=封仓/出库中,必填 |
| | | if (DepotStatus.STATUS_3.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_4.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_31.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_32.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_33.getCode().equals(data.getDepotStatus()) || |
| | | DepotStatus.STATUS_34.getCode().equals(data.getDepotStatus())) { |
| | | |
| | | if (null == data.getFullDate()) return "货位状态=封仓/出库中,封仓时间不可为空"; |
| | | } |
| | | |
| | | //货位状态=空仓,必填。最后一车粮食出仓时间 |
| | | if (DepotStatus.STATUS_1.getCode().equals(data.getDepotStatus())) { |
| | | if (null == data.getOutDate()) return "货位状态=空仓,出仓完成时间不可为空"; |
| | | } |
| | | |
| | | depotStoreService.saveDepotStore(data); |
| | | |
| | | //更新库存和状态 |
| | | //根据库存信息更新到仓库信息,仓库储粮信息以当前为准 |
| | | depotPR.updateByStore(data); |
| | | |
| | | //远程同步状态 |
| | | depotPR.pullDepotStatus(data.getCompanyId(), data.getDepotId(), data.getDepotStatus()); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |