Commit c87dcc03 authored by 朱晨阳's avatar 朱晨阳

Merge remote-tracking branch 'origin/developer_bw' into developer_bw

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
parents 7dacc902 49b8edb7
......@@ -3,14 +3,14 @@ package com.yeejoin.amos.api.householdapi.Utils;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.log.Log;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.householdapi.constant.GoLangConstant;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
......@@ -26,7 +26,8 @@ public class GolangRequestUtil {
@Autowired
HousepvapiRecordsMapper housepvapiRecordsMapper;
@Autowired
IHYGFThirdStationLogService thirdStationLogService;
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @deprecated 根据厂商编码获取厂商的hearer
......@@ -79,6 +80,15 @@ public class GolangRequestUtil {
if (!ObjectUtils.isEmpty(jsonArray)) {
result.addAll(JSONArray.parseArray(jsonArray.toJSONString(), tClass));
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.JLY.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据
JSONObject responeJSON = JSONObject.parseObject(respone);
JSONObject data = responeJSON.getJSONObject("data");
......@@ -130,6 +140,15 @@ public class GolangRequestUtil {
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.JLY.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
return result;
}
......
......@@ -6,6 +6,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.householdapi.constant.GoodWeConstant;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
......@@ -18,7 +21,8 @@ public class GoodWeRequestUtil {
@Autowired
private RedisUtils redisUtils;
@Autowired
IHYGFThirdStationLogService thirdStationLogService;
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @deprecated 根据厂商编码获取厂商的hearer
......@@ -77,6 +81,15 @@ public class GoodWeRequestUtil {
if (!ObjectUtils.isEmpty(jsonArray)) {
result.addAll(JSONArray.parseArray(jsonArray.toJSONString(), tClass));
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.GDW.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据
JSONObject responeJSON = JSONObject.parseObject(respone);
JSONObject data = responeJSON.getJSONObject("data");
......@@ -124,6 +137,15 @@ public class GoodWeRequestUtil {
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.GDW.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
return result;
}
......
......@@ -10,8 +10,9 @@ import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.householdapi.constant.ImasterConstant;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper;
import com.yeejoin.amos.api.householdapi.face.service.impl.GoodWeDataAcquisitionServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import lombok.extern.slf4j.Slf4j;
......@@ -33,6 +34,8 @@ public class ImasterUtils {
HousepvapiRecordsMapper housepvapiRecordsMapper;
@Autowired
RedisUtils redisUtils;
@Autowired
IHYGFThirdStationLogService thirdStationLogService;
final static Logger logger = LoggerFactory.getLogger(ImasterUtils.class);
......@@ -96,6 +99,15 @@ public class ImasterUtils {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} else {
HashMap<String, String> headMap = getHeader();
String url = ImasterConstant.baseurl + apiurl;
......@@ -105,6 +117,15 @@ public class ImasterUtils {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
redisUtils.set(redisKey, headMap.get("XSRF-TOKEN"));
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
}
} catch (Exception exception) {
return result;
......@@ -155,6 +176,15 @@ public class ImasterUtils {
}
}
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} else {
HashMap<String, String> headMap = getHeader();
String url = ImasterConstant.baseurl + apiurl;
......@@ -164,6 +194,15 @@ public class ImasterUtils {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
redisUtils.set(redisKey, headMap.get("XSRF-TOKEN"));
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
}
} catch (Exception exception) {
exception.printStackTrace();
......
......@@ -2,16 +2,15 @@ package com.yeejoin.amos.api.householdapi.Utils;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.householdapi.constant.GoLangConstant;
import com.yeejoin.amos.api.householdapi.constant.KSolarConstant;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.jcajce.provider.symmetric.AES;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
......@@ -25,7 +24,8 @@ public class KsolarRequestUtil {
@Autowired
HousepvapiRecordsMapper housepvapiRecordsMapper;
@Autowired
IHYGFThirdStationLogService thirdStationLogService;
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @deprecated 根据厂商编码获取厂商的hearer
......@@ -74,6 +74,15 @@ public class KsolarRequestUtil {
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
return result;
}
......
......@@ -6,6 +6,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.householdapi.constant.SoFarConstant;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -55,6 +58,8 @@ public class SofarRequestUtil {
@Autowired
private RedisUtils redisUtils;
@Autowired
IHYGFThirdStationLogService thirdStationLogService;
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
......@@ -115,6 +120,15 @@ public class SofarRequestUtil {
result.addAll(JSONArray.parseArray(fastjson.JSON.toJSONString(jsonObject.get(ResultResolveRule)), tClass));
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.SH.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据
JSONObject responeJSON = JSONObject.parseObject(respone);
Integer total = responeJSON.getInteger("total");
......@@ -156,6 +170,15 @@ public class SofarRequestUtil {
result = JSONArray.parseArray(fastjson.JSON.toJSONString(jsonObject.get(ResultResolveRule)), tClass);
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.SH.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
exception.printStackTrace();
return result;
......@@ -176,6 +199,15 @@ public class SofarRequestUtil {
}else{
jsonObject = JSONObject.parseObject(respone);
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.SH.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
exception.printStackTrace();
}
......
......@@ -8,27 +8,15 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.google.gson.Gson;
import com.yeejoin.amos.api.householdapi.face.dto.SunlightDto;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.Sunlight;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.naming.Name;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -158,6 +146,8 @@ public class SunlightUtil {
@Autowired
RedisUtils redisUtils;
@Autowired
IHYGFThirdStationLogService thirdStationLogService;
/*
*
......@@ -249,6 +239,15 @@ public class SunlightUtil {
pageList.addAll(JSONArray.parseArray(JSON.toJSONString(resultData.get("pageList"))));
resultData.putOpt("pageList",pageList);
}
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.YG.getCode());
hygfThirdStationLog.setReqMethod(request.getMethod().toString());
hygfThirdStationLog.setReqHeaders(request.headers().toString());
hygfThirdStationLog.setReqPath(dfurl+url);
hygfThirdStationLog.setReqBody(body);
hygfThirdStationLog.setResBody(res);
thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据
Integer rowCount = resultData.getInt("rowCount");
Integer pageSize= bodyparam.get("size")==null || (Integer)bodyparam.get("size")==0? 1:(Integer)bodyparam.get("size");
......@@ -295,7 +294,15 @@ public class SunlightUtil {
JSONObject jsonObject = JSONUtil.parseObj(res, true);
JSONObject resultData = JSONUtil.parseObj(jsonObject.get("result_data"), true);
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.YG.getCode());
hygfThirdStationLog.setReqMethod(request.getMethod().toString());
hygfThirdStationLog.setReqHeaders(request.headers().toString());
hygfThirdStationLog.setReqPath(dfurl+url);
hygfThirdStationLog.setReqBody(body);
hygfThirdStationLog.setResBody(res);
thirdStationLogService.saveLog(hygfThirdStationLog);
return resultData;
} catch (Exception e) {
log.error("失败,msg["+e.getMessage()+"]", e);
......
......@@ -10,9 +10,14 @@ import com.yeejoin.amos.api.householdapi.exception.BusinessException;
import com.yeejoin.amos.api.householdapi.face.dto.TanYinAccessTokenDTO;
import com.yeejoin.amos.api.householdapi.face.dto.TanYinBaseResultDTO;
import com.yeejoin.amos.api.householdapi.face.dto.TanYinPageResultDTO;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
......@@ -50,6 +55,9 @@ public class TanYinApiUtils {
@Resource (type = RedisUtils.class)
private RedisUtils redisUtils;
@Autowired
private IHYGFThirdStationLogService thirdStationLogService;
/**
* 获取 accessToken 接口
*
......@@ -118,6 +126,15 @@ public class TanYinApiUtils {
headers.put("Authorization", "Bearer " + getAccessToken(clientKey, clientSecret));
// 发送GET请求并获取响应。
response = HttpUtil.createGet(url).execute();
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfThirdStationLog.setReqMethod(HttpMethod.GET.name());
hygfThirdStationLog.setReqHeaders(headers.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(null);
hygfThirdStationLog.setResBody(response.toString());
thirdStationLogService.saveLog(hygfThirdStationLog);
// 解析响应并返回结果。
return parseResponse(desc, response, resultClass);
} catch (BusinessException businessException) {
......@@ -166,6 +183,15 @@ public class TanYinApiUtils {
try {
// 发送POST请求,带上参数和headers,并执行。
response = HttpUtil.createPost(url).body(paramsJsonStr, MediaType.APPLICATION_JSON_UTF8_VALUE).headerMap(headers, true).execute();
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfThirdStationLog.setReqMethod(HttpMethod.POST.name());
hygfThirdStationLog.setReqHeaders(headers.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(paramsJsonStr);
hygfThirdStationLog.setResBody(response.toString());
thirdStationLogService.saveLog(hygfThirdStationLog);
// 解析响应并返回。
return parseResponse(desc, response, resultClass);
} catch (BusinessException businessException) {
......@@ -218,6 +244,15 @@ public class TanYinApiUtils {
response = HttpUtil.createPost(url).body(paramsJsonStr, MediaType.APPLICATION_JSON_UTF8_VALUE).headerMap(headers, true).execute();
// 记录响应日志
log.info("响应 => 碳银{}接口,参数:{},httpCode:{}, response:{}", desc, paramsJsonStr, response.getStatus(), response.body());
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfThirdStationLog.setReqMethod(HttpMethod.POST.name());
hygfThirdStationLog.setReqHeaders(headers.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(paramsJsonStr);
hygfThirdStationLog.setResBody(response.toString());
thirdStationLogService.saveLog(hygfThirdStationLog);
// 解析响应,返回分页信息和请求结果
return parsePageResponse(desc, response, resultClass);
} catch (BusinessException businessException) {
......
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class HYGFThirdStationLog implements Serializable {
private String id;
private String thirdCode;
private Date reqTime;
private String reqMethod;
private String reqPath;
private String reqHeaders;
private String reqBody;
private String resBody;
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
public interface HYGFThirdStationLogMapper extends BaseMapper<HYGFThirdStationLog> {
// 创建新的数据表
@Select("CREATE TABLE IF NOT EXISTS ${tableName} (\n" +
" `id` varchar(256) NOT NULL,\n" +
" `third_code` varchar(30),\n" +
" `req_time` datetime(0),\n" +
" `req_method` varchar(20),\n" +
" `req_path` varchar(1000),\n" +
" `req_headers` varchar(1000),\n" +
" `req_body` longtext,\n" +
" `res_body` longtext,\n" +
" PRIMARY KEY (`id`) USING BTREE\n" +
");")
void createTable(@Param("tableName")String tableName);
// 插入数据到指定表
@Insert("INSERT INTO ${tableName} (`id`,`third_code`,`req_time`,`req_method`,`req_path`,`req_headers`,`req_body`,`res_body`) VALUES (#{thirdStationLog.id},#{thirdStationLog.thirdCode},#{thirdStationLog.reqTime},#{thirdStationLog.reqMethod},#{thirdStationLog.reqPath},#{thirdStationLog.reqHeaders},#{thirdStationLog.reqBody},#{thirdStationLog.resBody})")
void insertData(@Param("tableName") String tableName, @Param("thirdStationLog")HYGFThirdStationLog thirdStationLog);
// 删除超过时间的表
@Select("DROP TABLE IF EXISTS ${tableName}")
void dropTable(@Param("tableName")String tableName);
//获取表数量
@Select("SELECT COUNT(1) FROM information_schema.tables WHERE table_name LIKE #{tableName}")
Integer countTable(@Param("tableName")String tableName);
//获取最老的表名称
@Select("SELECT table_name FROM information_schema.tables WHERE table_name LIKE #{tableName} ORDER BY table_name ASC LIMIT 1")
String getOldestTableName(@Param("tableName")String tableName);
}
package com.yeejoin.amos.api.householdapi.face.service;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
public interface IHYGFThirdStationLogService {
void saveLog(HYGFThirdStationLog hygfThirdStationLog);
}
package com.yeejoin.amos.api.householdapi.face.service.impl;
import cn.hutool.core.lang.UUID;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HYGFThirdStationLog;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HYGFThirdStationLogMapper;
import com.yeejoin.amos.api.householdapi.face.service.IHYGFThirdStationLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
@Service
@Slf4j
public class HYGFThirdStationLogServiceImpl implements IHYGFThirdStationLogService {
private final String TABLE_NAME = "hygf_third_station_log";
@Autowired
private HYGFThirdStationLogMapper hygfThirdStationLogMapper;
@Value("${hygf.third.station.log.reserve.day:7}")
private Integer reserveDay;
@Override
public void saveLog(HYGFThirdStationLog hygfThirdStationLog) {
try {
// 获取今天的表名
String tableName = TABLE_NAME + "_" + getCurrentDate();
// 校验并创建新表
checkAndCreateNewTable(tableName);
//插入数据
insertLogData(tableName,hygfThirdStationLog);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
private void insertLogData(String tableName,HYGFThirdStationLog hygfThirdStationLog) {
if (Objects.nonNull(hygfThirdStationLog)) {
hygfThirdStationLog.setId(UUID.randomUUID().toString());
hygfThirdStationLog.setReqTime(new Date());
hygfThirdStationLogMapper.insertData(tableName, hygfThirdStationLog);
}
}
private void checkAndCreateNewTable(String tableName) {
// 查询当前表的数量
Integer countTable = hygfThirdStationLogMapper.countTable(TABLE_NAME);
// 如果表超过7个,删除最旧的表
if (countTable >= reserveDay) {
String oldestTableName = hygfThirdStationLogMapper.getOldestTableName(TABLE_NAME);
hygfThirdStationLogMapper.dropTable(oldestTableName);
}
// 创建新表
hygfThirdStationLogMapper.createTable(tableName);
}
// 获取当前日期(格式为 yyyyMMdd)
private String getCurrentDate() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
return sdf.format(new Date());
}
}
......@@ -65,18 +65,19 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
# ??????????
dataRequstScheduled.jinlangyun=0 0/50 * * * *
dataRequstScheduled.huawei=0 0/50 * * * *
dataRequstScheduled.keshida=0 0/50 * * * *
dataRequstScheduled.jinlangyun=0 0/40 * * * *
dataRequstScheduled.huawei=0 0/40 * * * *
dataRequstScheduled.keshida=0 0/40 * * * *
dataRequstScheduled.Sunlight=0 0/50 * * * *
dataRequstScheduled.GoodWe=0 0/50 * * * *
dataRequstScheduled.Sunlight=0 0/40 * * * *
dataRequstScheduled.GoodWe=0 0/40 * * * *
dataRequstScheduled.Sofar=0 0/50 * * * *
dataRequstScheduled.Sofar=0 0/40 * * * *
# 碳银
tanYin.api.apiUrl=https://userauth.tanwin.cn
tanYin.api.clientSecret=rKrWVa2sXsSZeNAOW43v
tanYin.api.clientKey=yx10001
dataRequestScheduled.tanYin=0 0/50 * * * *
dataRequestScheduled.tanYin.warn=0 0/50 * * * *
\ No newline at end of file
dataRequestScheduled.tanYin=0 0/40 * * * *
dataRequestScheduled.tanYin.warn=0 0/40 * * * *
hygf.third.station.log.reserve.day=3
\ No newline at end of file
......@@ -11,6 +11,12 @@ import lombok.Getter;
@AllArgsConstructor
public enum PowerStationProcessStateEnum {
进行中("进行中", "0", "progress"),
设计待审核("设计待审核", "5", "design"),
投融待审核("投融待审核", "6", "tourong"),
法务待审核("法务待审核", "7", "fawu"),
典设图纸待上传("典设图纸待上传", "8", "dst"),
施工图纸待上传("施工图纸待上传", "9", "sgt"),
图纸待审校("图纸待审校", "10", "tzdsj"),
通过("通过", "1", "0"),
不通过("不通过", "2", "1"),
完成("完成", "3", "complete"),
......
......@@ -24,6 +24,7 @@ public enum WorkOrderEnum {
审核中("审核中", "审核中"),
待审核("待审核", "待审核"),
经销商工程待审核("经销商工程待审核", "经销商工程待审核"),
片区运营待审核("片区运营待审核", "area"),
设计待审核("设计待审核", "design"),
工程待审核("工程待审核", "engineering"),
......
......@@ -20,7 +20,10 @@
<if test="map.regionalCompaniesName!=null and map.regionalCompaniesName!=''">
and hph.regional_companies_name like concat(concat('%',#{map.regionalCompaniesName}),'%')
</if>
<if test="map.processStatus != null and map.processStatus != ''">
<if test="map.processStatus != null and map.processStatus == '进行中'">
and hps.process_status not in ('不通过','完成')
</if>
<if test="map.processStatus != null and map.processStatus != '进行中'">
and hps.process_status = #{map.processStatus}
</if>
<if test="map.province != null and map.province != ''">
......
......@@ -50,9 +50,9 @@
hjc.collector_sn_code,
hjc.update_time,
hjc.current_power,
CAST(hjc.day_power_generation AS DECIMAL(20, 3)) as dayPowerGeneration,
CAST(hjc.month_power_generation AS DECIMAL(20, 3)) as monthPowerGeneration,
CAST(hjc.year_power_generation AS DECIMAL(20, 3)) as yearPowerGeneration,
CAST( (FLOOR(hjc.day_power_generation * 1000) / 1000) AS DECIMAL(20, 3)) as dayPowerGeneration,
CAST( (FLOOR(hjc.month_power_generation * 1000) / 1000) AS DECIMAL(20, 3)) as monthPowerGeneration,
CAST( (FLOOR(hjc.year_power_generation * 1000) / 1000) AS DECIMAL(20, 3)) as yearPowerGeneration,
hjc.brand,
hjc.model,
hjc.national_standard,
......@@ -64,7 +64,7 @@
hjc.AFCI_version,
hjc.ID,
hjc.capacity,
CAST(hjc.total_power_generation/1000 AS DECIMAL(20, 3)) as totalPowerGeneration,
CAST( (FLOOR(hjc.total_power_generation/1000 * 1000) / 1000) AS DECIMAL(20, 3)) as totalPowerGeneration,
hjc.third_station_id,
hjc.is_delete,
hjc.third_code,
......
......@@ -33,13 +33,13 @@
`day_power_use` dayPowerUse,
`month_power_use` monthPowerUse,
`year_power_use` yearPowerUse,
CAST(`real_time_power` AS DECIMAL(20, 3)) realTimePower,
CAST(`accumulated_power`/1000 AS DECIMAL(20, 3)) accumulatedPower,
CAST( (FLOOR(`real_time_power` * 1000) / 1000) AS DECIMAL(20, 3)) realTimePower,
CAST( (FLOOR(`accumulated_power`/1000 * 1000) / 1000) AS DECIMAL(20, 3)) accumulatedPower,
`state` ,
`type`,
`organizational_code` organizationalCode,
`is_delete` isDelete,
CAST(`day_generate` AS DECIMAL(20, 3)) dayGenerate,
CAST( (FLOOR(`day_generate` * 1000) / 1000) AS DECIMAL(20, 3)) dayGenerate,
`month_generate` monthGenerate,
`year_generate` yearGenerate,
`day_income` dayIncome,
......@@ -93,20 +93,20 @@
select
CAST(sum(real_time_power) AS DECIMAL(20, 3)) realTimePower,
CAST(sum(capacity)/1000 AS DECIMAL(20, 3)) capacity,
CAST(sum(day_generate)/1000 AS DECIMAL(20, 3)) dayGenerate,
CAST(sum(month_generate)/1000 AS DECIMAL(20, 3)) monthGenerate,
CAST(sum(year_generate)/1000 AS DECIMAL(20, 3)) yearGenerate,
CAST(sum(accumulated_power)/1000 AS DECIMAL(20, 3)) accumulatedPower,
CAST( sum(day_income) AS DECIMAL(20, 3)) dayIncome,
CAST(sum(month_income)/10000 AS DECIMAL(20, 3)) monthIncome,
CAST(sum(year_income)/10000 AS DECIMAL(20, 3)) yearIncome,
CAST(sum(cumulative_income)/10000 AS DECIMAL(20, 3)) cumulativeIncome,
CAST(sum(day_power_use)/1000 AS DECIMAL(20, 3)) dayPowerUse,
CAST(sum(month_power_use)/1000 AS DECIMAL(20, 3)) monthPowerUse,
CAST(sum(year_power_use)/1000 AS DECIMAL(20, 3)) yearPowerUse,
CAST(sum(rated_power) AS DECIMAL(20, 3)) ratedPower,
CAST( (FLOOR(sum(real_time_power) * 1000) / 1000) AS DECIMAL(20, 3)) realTimePower,
CAST( (FLOOR(sum(capacity)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) capacity,
CAST( (FLOOR(sum(day_generate)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) dayGenerate,
CAST( (FLOOR(sum(month_generate)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) monthGenerate,
CAST( (FLOOR(sum(year_generate)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) yearGenerate,
CAST( (FLOOR(sum(accumulated_power)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) accumulatedPower,
CAST( (FLOOR( sum(day_income) * 1000) / 1000) AS DECIMAL(20, 3)) dayIncome,
CAST( (FLOOR(sum(month_income)/10000 * 1000) / 1000) AS DECIMAL(20, 3)) monthIncome,
CAST( (FLOOR(sum(year_income)/10000 * 1000) / 1000) AS DECIMAL(20, 3)) yearIncome,
CAST( (FLOOR(sum(cumulative_income)/10000 * 1000) / 1000) AS DECIMAL(20, 3)) cumulativeIncome,
CAST( (FLOOR(sum(day_power_use)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) dayPowerUse,
CAST( (FLOOR(sum(month_power_use)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) monthPowerUse,
CAST( (FLOOR(sum(year_power_use)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) yearPowerUse,
CAST( (FLOOR(sum(rated_power) * 1000) / 1000) AS DECIMAL(20, 3)) ratedPower,
count(*) countBuiltNum
from hygf_jp_station
<where>
......@@ -366,20 +366,20 @@
<select id="getCountJpStationdata" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select
CAST(sum(real_time_power) AS DECIMAL(20, 3)) realTimePower,
CAST(sum(capacity)/1000 AS DECIMAL(20, 3)) capacity,
CAST(sum(day_generate)/1000 AS DECIMAL(20, 3)) dayGenerate,
CAST(sum(month_generate)/1000 AS DECIMAL(20, 3)) monthGenerate,
CAST(sum(year_generate)/1000 AS DECIMAL(20, 3)) yearGenerate,
CAST(sum(accumulated_power)/1000 AS DECIMAL(20, 3)) accumulatedPower,
CAST( sum(day_income) AS DECIMAL(20, 3)) dayIncome,
CAST(sum(month_income)/10000 AS DECIMAL(20, 3)) monthIncome,
CAST(sum(year_income)/10000 AS DECIMAL(20, 3)) yearIncome,
CAST(sum(cumulative_income)/10000 AS DECIMAL(20, 3)) cumulativeIncome,
CAST(sum(day_power_use)/1000 AS DECIMAL(20, 3)) dayPowerUse,
CAST(sum(month_power_use)/1000 AS DECIMAL(20, 3)) monthPowerUse,
CAST(sum(year_power_use)/1000 AS DECIMAL(20, 3)) yearPowerUse,
CAST(sum(rated_power) AS DECIMAL(20, 3)) ratedPower,
CAST( (FLOOR(sum(real_time_power) * 1000) / 1000) AS DECIMAL(20, 3)) realTimePower,
CAST( (FLOOR(sum(capacity)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) capacity,
CAST( (FLOOR(sum(day_generate)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) dayGenerate,
CAST( (FLOOR(sum(month_generate)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) monthGenerate,
CAST( (FLOOR(sum(year_generate)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) yearGenerate,
CAST( (FLOOR(sum(accumulated_power)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) accumulatedPower,
CAST( (FLOOR( sum(day_income) * 1000) / 1000) AS DECIMAL(20, 3)) dayIncome,
CAST( (FLOOR(sum(month_income)/10000 * 1000) / 1000) AS DECIMAL(20, 3)) monthIncome,
CAST( (FLOOR(sum(year_income)/10000 * 1000) / 1000) AS DECIMAL(20, 3)) yearIncome,
CAST( (FLOOR(sum(cumulative_income)/10000 * 1000) / 1000) AS DECIMAL(20, 3)) cumulativeIncome,
CAST( (FLOOR(sum(day_power_use)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) dayPowerUse,
CAST( (FLOOR(sum(month_power_use)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) monthPowerUse,
CAST( (FLOOR(sum(year_power_use)/1000 * 1000) / 1000) AS DECIMAL(20, 3)) yearPowerUse,
CAST( (FLOOR(sum(rated_power) * 1000) / 1000) AS DECIMAL(20, 3)) ratedPower,
count(*) countBuiltNum
from hygf_jp_station
<where>
......@@ -629,8 +629,8 @@
`rec_date` recDate,
`rec_user_id` recUserId,
`rec_user_name` recUserName,
hygf_jp_station.sn_code snCode,
CAST(`capacity` AS DECIMAL(20, 3)) capacity,
`sn_code` snCode,
CAST( (FLOOR(`capacity` * 1000) / 1000) AS DECIMAL(20, 3)) capacity,
`name` ,
`code` ,
`system_code` systemCode,
......@@ -646,21 +646,21 @@
`module_count` moduleCount,
`on_grid_type` onGridType,
`on_grid_time` onGridTime,
hygf_jp_station.third_station_id thirdStationId,
`third_station_id` thirdStationId,
`third_code` thirdCode,
`station_id` stationId,
`day_power_use` dayPowerUse,
`month_power_use` monthPowerUse,
`year_power_use` yearPowerUse,
CAST(`real_time_power` AS DECIMAL(20, 3)) realTimePower,
CAST(`accumulated_power`/1000 AS DECIMAL(20, 3)) accumulatedPower,
CAST( (FLOOR(`real_time_power` * 1000) / 1000) AS DECIMAL(20, 3)) realTimePower,
CAST( (FLOOR(`accumulated_power`/1000 * 1000) / 1000) AS DECIMAL(20, 3)) accumulatedPower,
`state` ,
`type`,
`organizational_code` organizationalCode,
`is_delete` isDelete,
CAST(`day_generate` AS DECIMAL(20, 3)) dayGenerate,
CAST(`month_generate` AS DECIMAL(20, 3)) monthGenerate,
CAST(`year_generate` AS DECIMAL(20, 3)) yearGenerate,
CAST( (FLOOR(`day_generate` * 1000) / 1000) AS DECIMAL(20, 3)) dayGenerate,
CAST( (FLOOR(`month_generate` * 1000) / 1000) AS DECIMAL(20, 3)) monthGenerate,
CAST( (FLOOR(`year_generate` * 1000) / 1000) AS DECIMAL(20, 3)) yearGenerate,
`day_income` dayIncome,
`month_income` monthIncome,
`year_income` yearIncome,
......@@ -668,12 +668,10 @@
`cumulative_income` cumulativeIncome,
`email`,
rated_power ratedPower,
CAST(`day_generate`/capacity AS DECIMAL(20, 3)) fullhour,
CAST( (FLOOR(`day_generate`/capacity * 1000) / 1000) AS DECIMAL(20, 3)) fullhour,
(select privilege_company.COMPANY_NAME from privilege_company where
privilege_company.ORG_CODE=hygf_jp_station.regional_companies_code) regionalCompaniesName,
newTable.sn_code nbqSnCode
privilege_company.ORG_CODE=hygf_jp_station.regional_companies_code) regionalCompaniesName
from hygf_jp_station
left join (select hygf_jp_inverter.sn_code, hygf_jp_inverter.third_station_id from hygf_jp_station left join hygf_jp_inverter on hygf_jp_station.third_station_id = hygf_jp_inverter.third_station_id) newTable on hygf_jp_station.third_station_id = newTable.third_station_id
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
......@@ -708,9 +706,6 @@
<if test="dto.amosCompanyCode!=null">
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
<if test="dto.nbqSnCode!=null">
and newTable.sn_code = #{dto.nbqSnCode}
</if>
</where>
ORDER BY CASE
WHEN state = '报警' THEN 1
......@@ -738,11 +733,11 @@
<!-- code参数为区域公司orgCode或经销商orgCode-->
<!-- <select id="getRegionStatistics" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">-->
<!-- SELECT COUNT(*) AS powerStationNumber,-->
<!-- CAST(SUM(capacity)/1000, 3) AS totalCapacity,-->
<!-- CAST(SUM(day_generate)/1000, 3) AS totalDayGenerate,-->
<!-- CAST(SUM(rated_power), 3) AS totalRatedPower,-->
<!-- CAST(SUM(real_time_power), 3) AS totalRealTimePower,-->
<!-- CAST(SUM(day_income), 3) AS totalDayIncome-->
<!-- CAST( (FLOOR(SUM(capacity)/1000, 3) AS totalCapacity,-->
<!-- CAST( (FLOOR(SUM(day_generate)/1000, 3) AS totalDayGenerate,-->
<!-- CAST( (FLOOR(SUM(rated_power), 3) AS totalRatedPower,-->
<!-- CAST( (FLOOR(SUM(real_time_power), 3) AS totalRealTimePower,-->
<!-- CAST( (FLOOR(SUM(day_income), 3) AS totalDayIncome-->
<!-- FROM hygf_jp_station hjs-->
<!-- <where>-->
<!-- <if test="regionCode != null and regionCode !=''">-->
......
......@@ -77,7 +77,10 @@
<if test="regionalCompaniesName != null and regionalCompaniesName != ''">
AND ph.regional_companies_name LIKE CONCAT('%', #{regionalCompaniesName}, '%')
</if>
<if test="processStatus != null and processStatus != ''">
<if test="processStatus != null and processStatus == '进行中'">
AND ps.process_status not in ('不通过','完成')
</if>
<if test="processStatus != null and processStatus != '进行中'">
AND ps.process_status = #{processStatus}
</if>
<if test="province != null and province != ''">
......
......@@ -5,10 +5,12 @@
<select id="surveyStatusTotal" resultType="map">
SELECT
IFNULL(SUM(CASE WHEN ps.process_status = '不通过' THEN 1 ELSE 0 END),0)AS '未通过',
IFNULL(SUM(CASE WHEN ps.process_status = '进行中' AND ps.business_status = '通过' AND next_node_name = '设计上传典型图库' THEN 1 ELSE 0 END),0) AS '已完成(法务审核)',
IFNULL(SUM(CASE WHEN ps.process_status = '典设图纸待上传' THEN 1 ELSE 0 END),0) AS '已完成(法务审核)',
IFNULL(SUM(CASE WHEN ps.process_status = '投融待审核' THEN 1 ELSE 0 END),0) AS '投融待审核',
IFNULL(SUM(CASE WHEN ps.process_status = '法务待审核' THEN 1 ELSE 0 END),0) AS '法务待审核',
IFNULL(SUM(CASE WHEN ps.process_status = '设计待审核' THEN 1 ELSE 0 END),0) AS '设计待审核',
IFNULL(SUM(CASE WHEN ps.process_status = '完成' THEN 1 ELSE 0 END),0) AS completeTotal,
ROUND(COALESCE(SUM( CASE WHEN ps.process_status = '完成' THEN ei.real_scale ELSE 0 END ), 0), 2) AS completeTotalrl,
IFNULL(SUM(CASE WHEN ps.process_status = '进行中' AND (ps.business_status IS NULL OR ps.design_status IS NULL OR ps.technology_status IS NULL or ps.business_status = '' OR ps.design_status = '' OR ps.technology_status = '') THEN 1 ELSE 0 END),0) AS '进行中(审核)'
ROUND(COALESCE(SUM( CASE WHEN ps.process_status = '完成' THEN ei.real_scale ELSE 0 END ), 0), 2) AS completeTotalrl
FROM hygf_power_station ps
LEFT JOIN hygf_peasant_household ph ON ps.peasant_household_id = ph.sequence_nbr
LEFT JOIN hygf_work_order_power_station wps ON wps.peasant_household_id = ph.sequence_nbr
......@@ -87,8 +89,8 @@
<select id="desionTotal" resultType="map">
SELECT
SUM( CASE WHEN next_node_name = '经销商设计人员上传设计图' and process_status = '进行中'THEN 1 ELSE 0 END ) AS '典设图已上传',
SUM( CASE WHEN next_node_name = '设计图纸审核' and process_status = '进行中'THEN 1 ELSE 0 END ) AS '施工图已上传'
SUM( CASE WHEN next_node_name = '经销商设计人员上传设计图' and process_status = '施工图纸待上传'THEN 1 ELSE 0 END ) AS '典设图已上传',
SUM( CASE WHEN next_node_name = '设计图纸审核' and process_status = '图纸待审校'THEN 1 ELSE 0 END ) AS '施工图已上传'
FROM
`hygf_power_station`
LEFT JOIN
......@@ -149,9 +151,7 @@
WHEN power_station_construction_status = '未通过' THEN '未通过'
WHEN power_station_construction_status = '施工中' or power_station_construction_status = '待施工' THEN '施工资料上传'
WHEN power_station_construction_status = '待登记' THEN '完工登记'
WHEN power_station_construction_status = '待审核' and work_order_power_station_node is null THEN '完工自审'
WHEN power_station_construction_status = '已完工' THEN '已完成'
WHEN power_station_construction_status = '待审核' and work_order_power_station_node in ('engineering','design','area') THEN '审核中'
ELSE power_station_construction_status END )
AS statusText,
ROUND(COALESCE(SUM(ei.real_scale), 0), 2) AS realScale FROM
......@@ -575,8 +575,13 @@
IFNULL( sum( CASE WHEN lc.STATUS = '农户已签署' THEN 1 ELSE 0 END ), 0 ) nhyqs,
IFNULL( sum( CASE WHEN lc.STATUS = '未签署' THEN 1 ELSE 0 END ), 0 ) wqs,
IFNULL( SUM( CASE WHEN ps.process_status = '不通过' THEN 1 ELSE 0 END ), 0 ) AS kcwtg,
IFNULL( SUM( CASE WHEN ps.process_status = '进行中' THEN 1 ELSE 0 END ), 0 ) AS kcjxz,
IFNULL( SUM( CASE WHEN ps.process_status = '完成' THEN 1 ELSE 0 END ), 0 ) AS kcywc,
IFNULL( SUM( CASE WHEN ps.process_status = '设计待审核' THEN 1 ELSE 0 END ), 0 ) AS sjdsh,
IFNULL( SUM( CASE WHEN ps.process_status = '投融待审核' THEN 1 ELSE 0 END ), 0 ) AS trdsh,
IFNULL( SUM( CASE WHEN ps.process_status = '法务待审核' THEN 1 ELSE 0 END ), 0 ) AS fwdsh,
IFNULL( SUM( CASE WHEN ps.process_status = '典设图纸待上传' THEN 1 ELSE 0 END ), 0 ) AS dstzsc,
IFNULL( SUM( CASE WHEN ps.process_status = '施工图纸待上传' THEN 1 ELSE 0 END ), 0 ) AS sgtzsc,
IFNULL( SUM( CASE WHEN ps.process_status = '图纸待审校' THEN 1 ELSE 0 END ), 0 ) AS tzdsj,
IFNULL( SUM( CASE WHEN ps.process_status = '完成' THEN ei.real_scale ELSE 0 END ), 0 ) AS kcywcrl
FROM
hygf_power_station ps
......
......@@ -116,10 +116,10 @@
and newHcr.firstConstructionDate &lt;= #{dto.endTime}
</if>
<if test=' dto.type!=null and dto.type == "1"'>
and hygf_work_order_power_station.power_station_construction_status in ('待登记','未通过','已完工','待审核')
and hygf_work_order_power_station.power_station_construction_status in ('待登记','未通过','已完工','经销商工程待审核')
</if>
<if test=' dto.type !=null and dto.type == "2"'>
and hygf_work_order_power_station.power_station_construction_status IN ( '未通过', '已完工', '待审核', '待整改', '整改中','整改待审核' )
and hygf_work_order_power_station.power_station_construction_status IN ( '未通过', '已完工','经销商工程待审核', '待整改', '整改中','整改待审核' )
</if>
<if test=' dto.type !=null and dto.type == "3" and dto.workOrderPowerStationNodes !=null'>
and ( hygf_work_order_power_station.work_order_power_station_node is not null
......
......@@ -302,13 +302,6 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
if (PowerStationNodeEnum.设计上传图纸.getCode().equals(nodeCode) && Objects.isNull(powerStation.getSjCreateTime())){
powerStation.setSjCreateTime(new Date());
}
if (PowerStationNodeEnum.设计上传图纸.getCode().equals(nodeCode)
|| PowerStationNodeEnum.经销商上传图纸.getCode().equals(nodeCode)) {
powerStation.setProcessStatus(PowerStationProcessStateEnum.进行中.getName());
powerStation.setDrawingReview("");
this.updateSeve(nodeCode, powerStation.getPeasantHouseholdId(), kv);
} else {
if (VERIFY_RESULT_NO.equals(result)) {
powerStation.setProcessStatus(PowerStationProcessStateEnum.不通过.getName());
......@@ -317,14 +310,23 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
switch (nodeByCode) {
case 设计审核:
powerStation.setTechnologyStatus(resultObj.getName());
if (resultObj.getName().equals("通过")){
powerStation.setProcessStatus(PowerStationProcessStateEnum.投融待审核.getName());
}
break;
case 投融审核:
powerStation.setDesignStatus(resultObj.getName());
if (resultObj.getName().equals("通过")){
powerStation.setProcessStatus(PowerStationProcessStateEnum.法务待审核.getName());
}
break;
case 法务审核:
powerStation.setBusinessStatus(resultObj.getName());
if (resultObj.getName().equals("通过")){
powerStation.setProcessStatus(PowerStationProcessStateEnum.典设图纸待上传.getName());
}
if (VERIFY_RESULT_YES.equals(result)) {
LambdaUpdateWrapper<HouseholdContract> lambdaUw = new LambdaUpdateWrapper<>();
lambdaUw.eq(HouseholdContract::getPeasantHouseholdId, powerStation.getPeasantHouseholdId());
......@@ -334,6 +336,16 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
}
break;
case 设计上传图纸:
powerStation.setProcessStatus(PowerStationProcessStateEnum.施工图纸待上传.getName());
powerStation.setDrawingReview("");
this.updateSeve(nodeCode, powerStation.getPeasantHouseholdId(), kv);
break;
case 经销商上传图纸:
powerStation.setProcessStatus(PowerStationProcessStateEnum.图纸待审校.getName());
powerStation.setDrawingReview("");
this.updateSeve(nodeCode, powerStation.getPeasantHouseholdId(), kv);
break;
case 文件审核:
if (VERIFY_RESULT_YES.equals(result)) {
flag = false;
......@@ -345,7 +357,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
default:
break;
}
}
meg = "任务明细:" + nodeByCode + (VERIFY_RESULT_YES.equals(result) ? "通过" : "不通过");
// 2. 更新流程状态
String code = null;
......
......@@ -104,9 +104,9 @@ public class StatisticsHomepageServiceImpl {
List<String> surveKeys = new ArrayList<>(Arrays.asList("未通过","未勘察","已完成(法务审核)","进行中(审核)"));
List<String> surveKeys = new ArrayList<>(Arrays.asList("未通过","未勘察","已完成(法务审核)","设计待审核","投融待审核","法务待审核"));
List<String> contractKeys = new ArrayList<>(Arrays.asList("双方已签署","农户已签署","未签署","已作废"));
List<String> workOrder = new ArrayList<>(Arrays.asList("未通过","施工资料上传","完工登记","完工自审","审核中","已完成","整改待审核" ,"待整改"));
List<String> workOrder = new ArrayList<>(Arrays.asList("未通过","施工资料上传","完工登记","片区运营待审核","工程待审核","设计待审核","已完成","整改待审核" ,"待整改"));
List<String> preparationMoneyKeys = new ArrayList<>(Arrays.asList("待发货","已收货","已发货"));
List<String> desionKeys = new ArrayList<>(Arrays.asList("施工图已上传","典设图已上传"));
List<String> gridKeys = new ArrayList<>(Arrays.asList("待登记","审核中","已完成","未通过","整改待审核" ,"待整改"));
......@@ -210,18 +210,12 @@ public class StatisticsHomepageServiceImpl {
Map<String, Object> map = iterator.next();
workNum += (long) map.get("total");
stationRealScale += (double) map.get("realScale");
if ("审核中".equals(map.get("statusText"))) {
total += (long) map.get("total");
realScale += (double) map.get("realScale");
iterator.remove();
}
if ("施工资料上传".equals(map.get("statusText"))) {
sgtotal += (long) map.get("total");
sgrealScale += (double) map.get("realScale");
iterator.remove();
}
}
maps.add(MapBuilder.<String, Object>create().put("statusText","审核中").put("total",total).put("realScale",new BigDecimal(realScale).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()).build());
maps.add(MapBuilder.<String, Object>create().put("statusText","施工资料上传").put("total",sgtotal).put("realScale",new BigDecimal(sgrealScale).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()).build());
differenceValue(maps,workOrder);
resultMap.put("workOrder",maps);
......
......@@ -433,7 +433,7 @@ public class SurveyInformationServiceImpl
powerStation.setOwnersName(peasantHousehold.getOwnersName());
powerStation.setProjectAddress(peasantHousehold.getProjectAddressName());
powerStation.setPeasantHouseholdId(String.valueOf(peasantHousehold.getSequenceNbr()));
powerStation.setProcessStatus(PowerStationProcessStateEnum.进行中.getName());
powerStation.setProcessStatus(PowerStationProcessStateEnum.设计待审核.getName());
powerStation.setServiceAgent(peasantHousehold.getDeveloperName());
// 获取流程信息
powerStation.setTaskId(basicGridAcceptance.getNextTaskId());
......
......@@ -499,7 +499,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
query.last("limit 1");
HygfWorkOrderStationAuditing hygfWorkOrderStationAuditing = hygfWorkOrderStationAuditingService.getBaseMapper().selectOne(query);
if (!taskKey.contains(hygfWorkOrderStationAuditing.getNextNodeKey())){
throw new BadRequest("无可执行任务");
// throw new BadRequest("无可执行任务");
return;
}
//组装信息
TaskResultDTO task = new TaskResultDTO();
......@@ -1135,7 +1136,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
}
// 修改电站状态
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getCode());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.经销商工程待审核.getCode());
workOrderPowerStationMapper.updateById(workOrderPowerStation);
// 修改派工单状态PowerStationEngineeringInfo
LambdaQueryWrapper<WorkOrderPowerStation> qu1 = new LambdaQueryWrapper();
......@@ -1209,7 +1210,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
if (constructionRecords.getOperationResults().equals("通过")) {
// 修改电站状态
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getName());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.片区运营待审核.getName());
workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.片区运营待审核.getCode());
workOrderPowerStation.setPowerStationAreaStatus(null);
workOrderPowerStation.setPowerStationDesignStatus(null);
......@@ -1311,7 +1312,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
workOrderPowerStation.setPowerStationAreaStatus(approvalStatus.equals("0")?"通过":"驳回");
constructionRecords.setOperationContent("施工验收-片区运营审核-" +workOrderPowerStation.getPowerStationAreaStatus());
workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.工程待审核.getCode());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getName());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.工程待审核.getName());
taskKey = BusinessWorkflowKey.片区运营审核.getCode();
break;
case "design":
......@@ -1325,7 +1326,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
default:
workOrderPowerStation.setPowerStationEngineeringStatus(approvalStatus.equals("0")?"通过":"驳回");
constructionRecords.setOperationContent("施工验收-工程审核-" + workOrderPowerStation.getPowerStationEngineeringStatus());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getName());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.设计待审核.getName());
workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.设计待审核.getCode());
taskKey = BusinessWorkflowKey.工程审核.getCode();
break;
......@@ -1392,6 +1393,9 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
d.add(WorkOrderEnum.待施工.getCode());
d.add(WorkOrderEnum.待登记.getCode());
d.add(WorkOrderEnum.待审核.getCode());
d.add(WorkOrderEnum.片区运营待审核.getCode());
d.add(WorkOrderEnum.工程待审核.getCode());
d.add(WorkOrderEnum.设计待审核.getCode());
d.add(WorkOrderEnum.未通过.getCode());
qu1.in(WorkOrderPowerStation::getPowerStationConstructionStatus, d);
List<WorkOrderPowerStation> list = workOrderPowerStationMapper.selectList(qu1);
......
## DB properties:
spring.datasource.dynamic.primary= mysql-service
spring.datasource.mysql-service.driver-class-name=com.kingbase8.Driver
spring.datasource.mysql-service.jdbc-url=jdbc:kingbase8://10.20.1.176:54321/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.jdbc-url=jdbc:kingbase8://192.168.0.68:54321/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.username=root
spring.datasource.mysql-service.password=Yeejoin@2020
spring.datasource.mysql-service.type=com.alibaba.druid.pool.DruidDataSource
......@@ -23,7 +23,7 @@ spring.datasource.mysql-service.connection-timeout: 30000
spring.datasource.tdengine-service.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
spring.datasource.tdengine-service.jdbc-url=jdbc:TAOS-RS://10.20.0.169:6041/house_pv_data?user=root&password=taosdata&timezone=GMT+8
spring.datasource.tdengine-service.jdbc-url=jdbc:TAOS-RS://192.168.0.61:6041/house_pv_data?user=root&password=taosdata&timezone=GMT+8
spring.datasource.tdengine-service.username=root
spring.datasource.tdengine-service.password=taosdata
spring.datasource.tdengine-service.type=com.zaxxer.hikari.HikariDataSource
......@@ -50,11 +50,11 @@ spring.datasource.tdengine-service.connection-test-query: SELECT 1
## eureka properties:
eureka.instance.hostname=10.20.1.160
eureka.instance.hostname=192.168.0.46
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
spring.redis.database=1
spring.redis.host=10.20.1.210
spring.redis.host=192.168.0.70
spring.redis.port=6379
spring.redis.password=yeejoin@2020
......@@ -90,7 +90,7 @@ lettuce.timeout=10000
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://10.20.1.210:2883
emqx.broker=tcp://192.168.0.70:2883
emqx.user-name=admin
emqx.password=public
emqx.max-inflight=1000
......
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