Commit e007fc05 by 杨清松

需用计划增加校验

parent 02baa855
...@@ -12,6 +12,8 @@ import java.util.stream.Collectors; ...@@ -12,6 +12,8 @@ import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.beecode.bcp.type.KObject; import com.beecode.bcp.type.KObject;
import com.xyst.dinas.biz.constant.PlanningCycleConstant;
import com.xyst.dinas.biz.service.PlanningCycleService;
import com.xyst.dinas.contract.service.ContractService; import com.xyst.dinas.contract.service.ContractService;
import com.xyst.dinas.sales.dao.NeedPlanDao; import com.xyst.dinas.sales.dao.NeedPlanDao;
import com.xyst.dinas.sales.dao.SalesPlanDao; import com.xyst.dinas.sales.dao.SalesPlanDao;
...@@ -29,6 +31,9 @@ public class NeedPlanServiceImpl implements NeedPlanService { ...@@ -29,6 +31,9 @@ public class NeedPlanServiceImpl implements NeedPlanService {
@Autowired @Autowired
private ContractService contractService; private ContractService contractService;
@Autowired
private PlanningCycleService planningCycleService;
@Override @Override
public KObject queryNeedPlanAmountByDinasType(UUID planningCycleId,UUID contractId, UUID dinasTypeId) { public KObject queryNeedPlanAmountByDinasType(UUID planningCycleId,UUID contractId, UUID dinasTypeId) {
...@@ -169,4 +174,16 @@ public class NeedPlanServiceImpl implements NeedPlanService { ...@@ -169,4 +174,16 @@ public class NeedPlanServiceImpl implements NeedPlanService {
return planList; return planList;
} }
@Override
public KObject querySalePlanByCycleId(UUID planningCycleId) {
//获取计划周期
KObject planningCycle = planningCycleService.load(planningCycleId); //计划周期
Date startTime = planningCycle.getDate(PlanningCycleConstant.startTime);
Date endTime = planningCycle.getDate(PlanningCycleConstant.endTime);
//根据开始时间和结束时间查询销售计划
KObject salesPlanByTimeKObject = salesPlanDao.querySalesPlanByTime(startTime, endTime);
return salesPlanByTimeKObject;
}
} }
...@@ -28,4 +28,6 @@ public interface NeedPlanService { ...@@ -28,4 +28,6 @@ public interface NeedPlanService {
List<KObject> getProjectByNowPlanningCycle(UUID purchaseSandUnitId, UUID planningCycleId); List<KObject> getProjectByNowPlanningCycle(UUID purchaseSandUnitId, UUID planningCycleId);
Object queryNeedPlanAmountByCycleId(UUID fromString, UUID fromString2); Object queryNeedPlanAmountByCycleId(UUID fromString, UUID fromString2);
KObject querySalePlanByCycleId(UUID fromString);
} }
...@@ -71,5 +71,21 @@ public class NeedPlanController { ...@@ -71,5 +71,21 @@ public class NeedPlanController {
Object object = needPlanService.queryNeedPlanAmountByCycleId(UUID.fromString(planningCycleId), UUID.fromString(projectId)); Object object = needPlanService.queryNeedPlanAmountByCycleId(UUID.fromString(planningCycleId), UUID.fromString(projectId));
return ResponseObj.success("success", object); return ResponseObj.success("success", object);
} }
/**
* 根据计划周期和项目查询本期分配量和实际销售量
* @param planningCycleId
* @param projectId
* @return
*/
@ResponseBody
@RequestMapping(value = "/sand/user/needplan/querySalePlanByCycleId", method = RequestMethod.GET)
public Object querySalePlanByCycleId(@RequestParam("planningCycleId") String planningCycleId) {
KObject kObject = needPlanService.querySalePlanByCycleId(UUID.fromString(planningCycleId));
if (kObject != null) {
return ResponseObj.success("success", kObject.getUuid("id"));
}
return ResponseObj.success("success", null);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment