|
@@ -1,11 +1,153 @@
|
|
|
package com.gyee.backconfig.service;
|
|
|
|
|
|
|
|
|
+import com.gyee.backconfig.model.auto.Companys;
|
|
|
+import com.gyee.backconfig.model.auto.Region;
|
|
|
+import com.gyee.backconfig.model.auto.Standardpoint;
|
|
|
+import com.gyee.backconfig.model.auto.Windturbine;
|
|
|
+import com.gyee.backconfig.service.auto.*;
|
|
|
+import com.gyee.common.model.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 生成测点服务类
|
|
|
*/
|
|
|
@Service
|
|
|
public class PointGenerateService {
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IRegionService regionService;//区域
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ICompanysService companysService;//公司
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProjectService projectService;//期次
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ILineService lineService;//线路
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IWindpowerstationService windpowerstationService;//场站
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IWindturbineService windturbineService;//风机
|
|
|
+
|
|
|
+
|
|
|
+ public int addGeneratePoint(String regionCode, String companysId, String stationId, String projectId, String lineId, List<Standardpoint> pointList) {
|
|
|
+
|
|
|
+
|
|
|
+ int tag = 0;
|
|
|
+ //区域
|
|
|
+ List<Region> regionList = regionService.getReginBycode(regionCode);
|
|
|
+
|
|
|
+ //判断公司是否为空
|
|
|
+ if (null != companysId && companysId.length() > 0) {
|
|
|
+ //不为空
|
|
|
+ for (Region r : regionList) {
|
|
|
+ List<Companys> companysList = companysService.getCompanysByidAndRid(companysId, r.getId());
|
|
|
+
|
|
|
+ //判断是否有匹配的的公司
|
|
|
+ if (null != companysList && companysList.size() > 0) {
|
|
|
+ for (Companys c : companysList) {
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotNull(regionCode) && StringUtils.isNotNull(companysId)
|
|
|
+ && StringUtils.isNotNull(stationId) && StringUtils.isNotNull(projectId) && StringUtils.isNotNull(lineId)) {
|
|
|
+ tag = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotNull(regionCode) && StringUtils.isNotNull(companysId)
|
|
|
+ && StringUtils.isNotNull(stationId) && StringUtils.isNotNull(projectId)) {
|
|
|
+ tag = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotNull(regionCode) && StringUtils.isNotNull(companysId) && StringUtils.isNotNull(stationId)) {
|
|
|
+ tag = 3;
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotNull(regionCode) && StringUtils.isNotNull(companysId)) {
|
|
|
+ tag = 4;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotNull(regionCode)) {
|
|
|
+ tag = 5;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (tag) {
|
|
|
+ case 1:
|
|
|
+ addPoint(regionCode, companysId, stationId, projectId, lineId, pointList);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ addPoint(regionCode, companysId, stationId, projectId, pointList);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ addPoint(regionCode, companysId, stationId, pointList);
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ addPoint(regionCode, companysId, pointList);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 5:
|
|
|
+ addPoint(regionCode, pointList);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ addPoint(pointList);
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ int addPoint(String regionCode, String companysId, String stationId, String projectId, String lineId, List<Standardpoint> pointList) {
|
|
|
+
|
|
|
+
|
|
|
+ List<Windturbine> windturbineList = windturbineService.getWindturbineGyLine(lineId);
|
|
|
+ for (Standardpoint point : pointList){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ int addPoint(String regionCode, String companysId, String stationId, String projectId, List<Standardpoint> uniformcodes) {
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ int addPoint(String regionCode, String companysId, String stationId, List<Standardpoint> uniformcodes) {
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ int addPoint(String regionCode, String companysId, List<Standardpoint> uniformcodes) {
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ int addPoint(String regionCode, List<Standardpoint> uniformcodes) {
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ int addPoint(List<Standardpoint> uniformcodes) {
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
}
|