|  |  |  | 
|---|
|  |  |  | 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.HDepotStoreService; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  | 
|---|
|  |  |  | * @param data | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @DataResolver | 
|---|
|  |  |  | public void saveDepotStore(DepotStore data) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //TODO 根据页面说明增加保存前验证 2023年5月27日 18:53:56 | 
|---|
|  |  |  | 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.pullDepotStatus(data.getCompanyId(), data.getDepotId(), data.getDepotStatus()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|