|
|
|
@ -52,6 +52,7 @@ import jnpf.util.file.UploadUtil;
|
|
|
|
|
import jnpf.warehouse.service.WareHouseService;
|
|
|
|
|
import lombok.Cleanup;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
|
@ -679,25 +680,26 @@ public class PurchaseorderController {
|
|
|
|
|
PurchaseorderInfoVO vo = JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
|
|
|
|
|
|
|
|
|
|
//子表数据转换
|
|
|
|
|
List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id);
|
|
|
|
|
List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.queryPurchaseOrderItemInfo(id);
|
|
|
|
|
// List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id);
|
|
|
|
|
List<Purchaseorder_item0Model> jg_purchaseorder_item0ModelList = JsonUtil.getJsonToList(jg_purchaseorder_item0List, Purchaseorder_item0Model.class);
|
|
|
|
|
for (Purchaseorder_item0Model jg_purchaseorder_item0Model : jg_purchaseorder_item0ModelList) {
|
|
|
|
|
Map<String, Object> vehicleIdMap = new HashMap<>();
|
|
|
|
|
jg_purchaseorder_item0Model.setVehicleName(generaterSwapUtil.getPopupSelectValue("389754644018016581", "vehicle_id", "ticketno", jg_purchaseorder_item0Model.getVehicleId(), vehicleIdMap));
|
|
|
|
|
Map<String, Object> materialIdMap = new HashMap<>();
|
|
|
|
|
jg_purchaseorder_item0Model.setMaterialName(generaterSwapUtil.getPopupSelectValue("397736371898382533", "id", "item_name", jg_purchaseorder_item0Model.getMaterialId(), materialIdMap));
|
|
|
|
|
PoundlistEntity poundlistEntity = poundlistService.getById(jg_purchaseorder_item0Model.getPoundlistId());
|
|
|
|
|
jg_purchaseorder_item0Model.setPoundDate(poundlistEntity.getPoundDate());
|
|
|
|
|
|
|
|
|
|
SupplierEntity supplierEntity = supplierService.getById(jg_purchaseorder_item0Model.getSupplierId());
|
|
|
|
|
if (supplierEntity != null) {
|
|
|
|
|
jg_purchaseorder_item0Model.setSupplierName(supplierEntity.getSupplierName());
|
|
|
|
|
}
|
|
|
|
|
UserEntity userEntity = userService.getById(poundlistEntity.getBusinessId());
|
|
|
|
|
if (userEntity != null) {
|
|
|
|
|
jg_purchaseorder_item0Model.setBusinessName(userEntity.getRealName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// for (Purchaseorder_item0Model jg_purchaseorder_item0Model : jg_purchaseorder_item0ModelList) {
|
|
|
|
|
// Map<String, Object> vehicleIdMap = new HashMap<>();
|
|
|
|
|
// jg_purchaseorder_item0Model.setVehicleName(generaterSwapUtil.getPopupSelectValue("389754644018016581", "vehicle_id", "ticketno", jg_purchaseorder_item0Model.getVehicleId(), vehicleIdMap));
|
|
|
|
|
// Map<String, Object> materialIdMap = new HashMap<>();
|
|
|
|
|
// jg_purchaseorder_item0Model.setMaterialName(generaterSwapUtil.getPopupSelectValue("397736371898382533", "id", "item_name", jg_purchaseorder_item0Model.getMaterialId(), materialIdMap));
|
|
|
|
|
// PoundlistEntity poundlistEntity = poundlistService.getById(jg_purchaseorder_item0Model.getPoundlistId());
|
|
|
|
|
// jg_purchaseorder_item0Model.setPoundDate(poundlistEntity.getPoundDate());
|
|
|
|
|
//
|
|
|
|
|
// SupplierEntity supplierEntity = supplierService.getById(jg_purchaseorder_item0Model.getSupplierId());
|
|
|
|
|
// if (supplierEntity != null) {
|
|
|
|
|
// jg_purchaseorder_item0Model.setSupplierName(supplierEntity.getSupplierName());
|
|
|
|
|
// }
|
|
|
|
|
// UserEntity userEntity = userService.getById(poundlistEntity.getBusinessId());
|
|
|
|
|
// if (userEntity != null) {
|
|
|
|
|
// jg_purchaseorder_item0Model.setBusinessName(userEntity.getRealName());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
vo.setPurchaseorder_item0List(jg_purchaseorder_item0ModelList);
|
|
|
|
|
List<Invoices_item0itemEntity> jg_invoices_item0List = purchaseorderitemService.GetInvoices_item0itemList(id);
|
|
|
|
|
List<Invoices_item0itemModel> jg_invoices_item0ModelList = JsonUtil.getJsonToList(jg_invoices_item0List, Invoices_item0itemModel.class);
|
|
|
|
@ -775,10 +777,18 @@ public class PurchaseorderController {
|
|
|
|
|
//附表数据转换
|
|
|
|
|
|
|
|
|
|
//添加到详情表单对象中
|
|
|
|
|
Map<String, Object> contractCodeMap = new HashMap<>();
|
|
|
|
|
vo.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229", "id", "contract_name", vo.getContractCode(), contractCodeMap));
|
|
|
|
|
Map<String, Object> supplierIdMap = new HashMap<>();
|
|
|
|
|
vo.setSupplierName(generaterSwapUtil.getPopupSelectValue("397751667988199621", "id", "supplier_name", vo.getSupplierId(), supplierIdMap));
|
|
|
|
|
ContractFileEntity contractFileEntity = contractFileService.getInfo(vo.getContractCode());
|
|
|
|
|
if (ObjectUtils.isNotEmpty(contractFileEntity) && StringUtils.isNotEmpty(contractFileEntity.getContractName())){
|
|
|
|
|
vo.setContractName(contractFileEntity.getContractName());
|
|
|
|
|
}
|
|
|
|
|
SupplierEntity supplierEntity = supplierService.getInfo(vo.getSupplierId());
|
|
|
|
|
if (ObjectUtils.isNotEmpty(supplierEntity) && StringUtils.isNotEmpty(supplierEntity.getSupplierName())){
|
|
|
|
|
vo.setSupplierName(supplierEntity.getSupplierName());
|
|
|
|
|
}
|
|
|
|
|
// Map<String, Object> contractCodeMap = new HashMap<>();
|
|
|
|
|
// vo.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229", "id", "contract_name", vo.getContractCode(), contractCodeMap));
|
|
|
|
|
// Map<String, Object> supplierIdMap = new HashMap<>();
|
|
|
|
|
// vo.setSupplierName(generaterSwapUtil.getPopupSelectValue("397751667988199621", "id", "supplier_name", vo.getSupplierId(), supplierIdMap));
|
|
|
|
|
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
|
|
|
|
|
|
|
|
|
|
return ActionResult.success(vo);
|
|
|
|
|