|
@@ -798,53 +798,53 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
if (!CollectionUtils.isEmpty(tranCarInfoList)){
|
|
if (!CollectionUtils.isEmpty(tranCarInfoList)){
|
|
contractManagementInfo.setTranCarInfoList(tranCarInfoList);
|
|
contractManagementInfo.setTranCarInfoList(tranCarInfoList);
|
|
}
|
|
}
|
|
- //移库编号成本
|
|
|
|
- if ("移库出库".equals(inOutWarehouseTask.getInOutType())) {
|
|
|
|
- //自动创建的临时库移库,成本为对应的合同单价
|
|
|
|
- ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
- .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
- .eq("contract_no", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
- if (contractManagementInfo1 != null) {
|
|
|
|
- contractManagementInfo.setUnitContractPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
|
- }
|
|
|
|
- //其他类型移库,一个运输阶段成本加权,多个成本为空
|
|
|
|
- TranTaskInfo tranTaskInfo=tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
|
|
|
|
- .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
- .eq("contract_no", inOutWarehouseTask.getMoveTaskNo()));
|
|
|
|
- if (tranTaskInfo!=null){
|
|
|
|
- List<TranProcessInfo> tranProcessInfoList=tranProcessInfoService.selectList(new EntityWrapper<TranProcessInfo>()
|
|
|
|
- .eq("info_id",tranTaskInfo.getId()));
|
|
|
|
- //只有一个汽运的运输阶段
|
|
|
|
- if (tranProcessInfoList.size()==1&&tranProcessInfoList.get(0).getTranTypeKey()=="1"){
|
|
|
|
- //成本为所选车辆出库时所在库的加权成本
|
|
|
|
- WarehouseBaseInfo warehouseBaseInfo=warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
|
|
|
|
- .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
- .eq("warehouse_name", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
- if (warehouseBaseInfo!=null){
|
|
|
|
- CostManagementInfo costManagementInfo=costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>()
|
|
|
|
- .eq("warehouse_id", warehouseBaseInfo.getId()));
|
|
|
|
- if (costManagementInfo!=null){
|
|
|
|
- contractManagementInfo.setUnitContractPrice(Double.valueOf(String.valueOf(costManagementInfo.getCost())));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- contractManagementInfo.setUnitContractPrice(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if ("退库".equals(inOutWarehouseTask.getInOutType())) {
|
|
|
|
- //自动创建的临时库退库,成本为对应的合同单价
|
|
|
|
- ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
- .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
- .eq("contract_no", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
- if (contractManagementInfo1 != null) {
|
|
|
|
- contractManagementInfo.setUnitContractPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- contractManagementInfo.setUnitContractPrice(null);
|
|
|
|
- }
|
|
|
|
|
|
+// //移库编号成本
|
|
|
|
+// if ("移库出库".equals(inOutWarehouseTask.getInOutType())) {
|
|
|
|
+// //自动创建的临时库移库,成本为对应的合同单价
|
|
|
|
+// ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
+// .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
+// .eq("contract_no", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
+// if (contractManagementInfo1 != null) {
|
|
|
|
+// contractManagementInfo.setUnitContractPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
|
+// }
|
|
|
|
+// //其他类型移库,一个运输阶段成本加权,多个成本为空
|
|
|
|
+// TranTaskInfo tranTaskInfo=tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
|
|
|
|
+// .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
+// .eq("contract_no", inOutWarehouseTask.getMoveTaskNo()));
|
|
|
|
+// if (tranTaskInfo!=null){
|
|
|
|
+// List<TranProcessInfo> tranProcessInfoList=tranProcessInfoService.selectList(new EntityWrapper<TranProcessInfo>()
|
|
|
|
+// .eq("info_id",tranTaskInfo.getId()));
|
|
|
|
+// //只有一个汽运的运输阶段
|
|
|
|
+// if (tranProcessInfoList.size()==1&&tranProcessInfoList.get(0).getTranTypeKey()=="1"){
|
|
|
|
+// //成本为所选车辆出库时所在库的加权成本
|
|
|
|
+// WarehouseBaseInfo warehouseBaseInfo=warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
|
|
|
|
+// .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
+// .eq("warehouse_name", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
+// if (warehouseBaseInfo!=null){
|
|
|
|
+// CostManagementInfo costManagementInfo=costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>()
|
|
|
|
+// .eq("warehouse_id", warehouseBaseInfo.getId()));
|
|
|
|
+// if (costManagementInfo!=null){
|
|
|
|
+// contractManagementInfo.setUnitContractPrice(Double.valueOf(String.valueOf(costManagementInfo.getCost())));
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// else{
|
|
|
|
+// contractManagementInfo.setUnitContractPrice(null);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// else if ("退库".equals(inOutWarehouseTask.getInOutType())) {
|
|
|
|
+// //自动创建的临时库退库,成本为对应的合同单价
|
|
|
|
+// ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
+// .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
+// .eq("contract_no", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
+// if (contractManagementInfo1 != null) {
|
|
|
|
+// contractManagementInfo.setUnitContractPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// else{
|
|
|
|
+// contractManagementInfo.setUnitContractPrice(null);
|
|
|
|
+// }
|
|
contractManagementInfo.setContractNo(inOutWarehouseTask.getMoveTaskNo());
|
|
contractManagementInfo.setContractNo(inOutWarehouseTask.getMoveTaskNo());
|
|
contractManagementInfo.setContractPrice(inOutWarehouseTask.getUnitPrice());
|
|
contractManagementInfo.setContractPrice(inOutWarehouseTask.getUnitPrice());
|
|
contractManagementInfo.setInOutType("移库入库");
|
|
contractManagementInfo.setInOutType("移库入库");
|
|
@@ -1033,4 +1033,70 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
}
|
|
}
|
|
return warehouseBaseInfoList;
|
|
return warehouseBaseInfoList;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Float selectCost(String contractNo, String carNo) {
|
|
|
|
+ Float cost=0f;
|
|
|
|
+ String compId = "";
|
|
|
|
+ if (compId == null || compId.isEmpty()) {
|
|
|
|
+ compId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
|
|
|
|
+ }
|
|
|
|
+ //采购合同
|
|
|
|
+ ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
+ .eq("comp_id", compId)
|
|
|
|
+ .eq("delete_flag", "0")
|
|
|
|
+ .eq("contract_no", contractNo)
|
|
|
|
+ .eq("contract_type", "2")
|
|
|
|
+ .eq("status_flag", "1")
|
|
|
|
+ .eq("deliver_type", "2"));
|
|
|
|
+ if (contractManagementInfo!=null){
|
|
|
|
+ cost=Float.valueOf(String.valueOf(contractManagementInfo.getUnitContractPrice()));
|
|
|
|
+ }
|
|
|
|
+ //移库任务编号
|
|
|
|
+ InOutWarehouseTask inOutWarehouseTask = iInOutWarehouseTaskService.selectOne(new EntityWrapper<InOutWarehouseTask>()
|
|
|
|
+ .eq("comp_id", compId)
|
|
|
|
+ .eq("move_task_no", contractNo)
|
|
|
|
+ .eq("delete_flag", "0")
|
|
|
|
+ .eq("task_type_key", "3")
|
|
|
|
+ .eq("in_out_flag", "1"));
|
|
|
|
+ if (inOutWarehouseTask!=null){
|
|
|
|
+ if("移库出库".equals(inOutWarehouseTask.getInOutType())) {
|
|
|
|
+ //自动创建的临时库移库,成本为对应的合同单价
|
|
|
|
+ ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
+ .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
+ .eq("contract_no", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
+ if (contractManagementInfo1 != null) {
|
|
|
|
+ cost = Float.valueOf(String.valueOf(contractManagementInfo1.getUnitContractPrice()));
|
|
|
|
+ }
|
|
|
|
+ //其他类型移库,一个运输阶段成本加权,多个成本为空
|
|
|
|
+ TranTaskInfo tranTaskInfo = tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
|
|
|
|
+ .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
+ .eq("contract_no", inOutWarehouseTask.getMoveTaskNo()));
|
|
|
|
+ if (tranTaskInfo != null) {
|
|
|
|
+ List<TranProcessInfo> tranProcessInfoList = tranProcessInfoService.selectList(new EntityWrapper<TranProcessInfo>()
|
|
|
|
+ .eq("info_id", tranTaskInfo.getId()));
|
|
|
|
+ //只有一个汽运的运输阶段
|
|
|
|
+ if (tranProcessInfoList.size() == 1 && tranProcessInfoList.get(0).getTranTypeKey() == "1") {
|
|
|
|
+ //成本为所选车辆出库时所在库的加权成本
|
|
|
|
+ WarehouseInOutInfo warehouseInOutInfo = warehouseInOutInfoService.selectOne(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
|
+ .eq("car_no", carNo).eq("comp_id", compId)
|
|
|
|
+ .eq("contract_no", contractNo));
|
|
|
|
+ if (warehouseInOutInfo != null) {
|
|
|
|
+ cost = warehouseInOutInfo.getWeightedCost();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if ("退库".equals(inOutWarehouseTask.getInOutType())) {
|
|
|
|
+ //自动创建的临时库退库,成本为对应的合同单价
|
|
|
|
+ ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
+ .eq("comp_id", inOutWarehouseTask.getCompId())
|
|
|
|
+ .eq("contract_no", inOutWarehouseTask.getWarehouseName()));
|
|
|
|
+ if (contractManagementInfo1 != null) {
|
|
|
|
+ cost=Float.valueOf(String.valueOf(contractManagementInfo1.getUnitContractPrice()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return cost;
|
|
|
|
+ }
|
|
}
|
|
}
|