Commit b73bc0b7 authored by 吴江's avatar 吴江

Merge branch 'developer_bw' into 'developer'

Developer bw See merge request !24
parents 3d3659be d19961cc
......@@ -5,10 +5,7 @@ import org.apache.commons.lang3.StringUtils;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.*;
......@@ -853,6 +850,18 @@ public class DateUtils {
}
/**
* 获取现在日期字符串时间戳格式
*
* @return返回字符串格式 yyyy-MM-dd
*/
public static String getDateNowShortNumberN() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN);
String dateString = formatter.format(currentTime);
return dateString;
}
/**
* 获取一年的第几周
*
* @param date
......@@ -1166,4 +1175,23 @@ public class DateUtils {
private static boolean shouldContinue(int i, int num, Boolean bool) {
return bool ? i < Math.abs(num) : i <=Math.abs(num) ;
}
/**
* 获取指定年度和季度包含的月份
* */
public static List<String> getMonthsInQuarterAsString(int year, int quarter) {
if (quarter < 1 || quarter > 4) {
throw new IllegalArgumentException("Quarter must be between 1 and 4.");
}
List<String> monthsInQuarter = new ArrayList<>();
for (int i = (quarter - 1) * 3 + 1; i <= quarter * 3; i++) {
Month month = Month.of(i);
// 格式化为 "yyyy-MM"
String formattedMonth = String.format("%d-%02d", year, month.getValue());
monthsInQuarter.add(formattedMonth);
}
return monthsInQuarter;
}
}
......@@ -17,6 +17,10 @@ import javax.xml.transform.stream.StreamResult;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import static org.springframework.util.FileCopyUtils.BUFFER_SIZE;
/**
......@@ -33,6 +37,12 @@ public class WordConverterUtils {
return multipartFile;
}
public static MultipartFile fileToMultipartFileZip(File file) throws IOException {
FileItem fileItem = createFileItemZip(file);
MultipartFile multipartFile = new CommonsMultipartFile(fileItem);
return multipartFile;
}
private static FileItem createFileItem(File file) {
FileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem item = factory.createItem("textField", "text/plain", true, file.getName());
......@@ -48,9 +58,69 @@ public class WordConverterUtils {
}
return item;
}
private static boolean isZipFile(File file) {
try (InputStream is = new BufferedInputStream(new FileInputStream(file))) {
byte[] signature = new byte[4];
int length = is.read(signature);
return length == 4 && (signature[0] == 0x50 && signature[1] == 0x4B && signature[2] == 0x03 && signature[3] == 0x04);
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
public static FileItem createFileItemZip(File file) throws IOException {
FileItemFactory factory = new DiskFileItemFactory(16, null);
String mimeType = getMimeType(file);
// 创建 FileItem
FileItem item = factory.createItem("textField", mimeType, true, file.getName());
try (FileInputStream fis = new FileInputStream(file);
OutputStream os = item.getOutputStream()) {
if (isZipFile(file)) {
handleZipFile(fis, os);
} else {
copyStream(fis, os);
}
}
return item;
}
private static void handleZipFile(InputStream fis, OutputStream os) throws IOException {
try (ZipInputStream zis = new ZipInputStream(fis)) {
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
if (!entry.isDirectory()) {
copyStream(zis, os);
}
zis.closeEntry();
}
}
}
private static void copyStream(InputStream input, OutputStream output) throws IOException {
byte[] buffer = new byte[BUFFER_SIZE];
int bytesRead;
while ((bytesRead = input.read(buffer, 0, BUFFER_SIZE)) != -1) {
output.write(buffer, 0, bytesRead);
}
}
private static String getMimeType(File file) {
String fileName = file.getName().toLowerCase();
if (fileName.endsWith(".zip")) {
return "application/zip";
} else {
// 这里可以根据文件扩展名返回其他 MIME 类型,或者使用更复杂的 MIME 类型检测机制
return "application/octet-stream";
}
}
/**
......
......@@ -64,15 +64,18 @@ public class GolangRequestUtil {
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
Integer pageNo = 1;
String url ="";
HashMap<String, String> headMap = new HashMap<>();
String requestParmInfo ="";
try {
do {
requestInfo.put("pageNo", pageNo);
String requestParmInfo = JSON.toJSONString(requestInfo);
requestParmInfo = JSON.toJSONString(requestInfo);
HashMap<String, Object> producerInfo = getHeaderOfGolang();
String baseurl = (String) producerInfo.get("apiurl");
HashMap<String, String> headMap = (HashMap<String, String>) producerInfo.get("header");
headMap= (HashMap<String, String>) producerInfo.get("header");
String orginalAuthorization = headMap.get("Authorization") + ":";
String url = baseurl + apiurl;
url = baseurl + apiurl;
String appsecret = (String) producerInfo.get("appsecret");
JLYHeaderMapHandler(params, headMap, orginalAuthorization, appsecret, apiurl);
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
......@@ -99,7 +102,10 @@ public class GolangRequestUtil {
JSONObject page = data.getJSONObject("page");
responePages = page.getInteger("pages");
}
if (responePages == pageNo){
if(Objects.isNull(responePages)){
responePages=0;
}
if (responePages <= pageNo){
break;
} else {
pageNo++;
......@@ -107,6 +113,15 @@ public class GolangRequestUtil {
}while (true);
} catch (Exception exception) {
log.error(exception.getMessage(),exception);
//存储日志
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);
return result;
}
return result;
......@@ -127,12 +142,14 @@ public class GolangRequestUtil {
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
String url ="";
HashMap<String, String> headMap = new HashMap<>();
try {
HashMap<String, Object> producerInfo = getHeaderOfGolang();
String baseurl = (String) producerInfo.get("apiurl");
HashMap<String, String> headMap = (HashMap<String, String>) producerInfo.get("header");
headMap = (HashMap<String, String>) producerInfo.get("header");
String orginalAuthorization = headMap.get("Authorization") + ":";
String url = baseurl + apiurl;
url = baseurl + apiurl;
String appsecret = (String) producerInfo.get("appsecret");
JLYHeaderMapHandler(params, headMap, orginalAuthorization, appsecret, apiurl);
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
......@@ -150,6 +167,15 @@ public class GolangRequestUtil {
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
//存储日志
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);
return result;
}
return result;
......
......@@ -65,12 +65,15 @@ public class GoodWeRequestUtil {
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
Integer pageNo = 1;
String url ="";
HashMap<String, String> headMap = new HashMap<>();
String requestParmInfo ="";
try {
do {
requestInfo.put("page_index", pageNo);
String requestParmInfo = fastjson.JSON.toJSONString(requestInfo);
HashMap<String, String> headMap = getHeaderOfGoodWE();
String url = GoodWeConstant.baseurl + apiurl;
requestParmInfo = fastjson.JSON.toJSONString(requestInfo);
headMap = getHeaderOfGoodWE();
url = GoodWeConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
//token如果失效重新获取{"code":100002,"msg":"授权已失效,请重新登录","data":null}
if(JSONObject.parseObject(respone).getInteger("code") == 100002){
......@@ -93,10 +96,10 @@ public class GoodWeRequestUtil {
//处理其他页数的数据
JSONObject responeJSON = JSONObject.parseObject(respone);
JSONObject data = responeJSON.getJSONObject("data");
Integer record = data.getInteger("record");
Integer record = data.getInteger("record") == null ? 0:data.getInteger("record");
Integer pageSize= requestInfo.get("page_size")==null || (Integer)requestInfo.get("page_size")==0? 1:(Integer)requestInfo.get("page_size");
Integer responePages=(record/pageSize)+1;
if (responePages == pageNo){
if (responePages <= pageNo){
break;
} else {
pageNo++;
......@@ -104,6 +107,15 @@ public class GoodWeRequestUtil {
} while (true);
} catch (Exception exception) {
//存储日志
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);
return result;
}
return result;
......@@ -124,9 +136,11 @@ public class GoodWeRequestUtil {
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
String url ="";
HashMap<String, String> headMap = new HashMap<>();
try {
HashMap<String, String> headMap = getHeaderOfGoodWE();
String url = GoodWeConstant.baseurl + apiurl;
headMap = getHeaderOfGoodWE();
url = GoodWeConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
//token如果失效重新获取{"code":100002,"msg":"授权已失效,请重新登录","data":null}
if(JSONObject.parseObject(respone).getInteger("code") == 100002){
......@@ -147,6 +161,15 @@ public class GoodWeRequestUtil {
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
//存储日志
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);
return result;
}
return result;
......
......@@ -77,10 +77,11 @@ public class ImasterUtils {
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
HashMap<String, String> headMap =new HashMap<>();
try {
Object o = redisUtils.get(redisKey);
if (o != null) {
HashMap<String, String> headMap = new HashMap<>();
headMap = new HashMap<>();
headMap.put("XSRF-TOKEN", o.toString());
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
......@@ -109,7 +110,7 @@ public class ImasterUtils {
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} else {
HashMap<String, String> headMap = getHeader();
headMap = getHeader();
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
......@@ -128,6 +129,15 @@ public class ImasterUtils {
thirdStationLogService.saveLog(hygfThirdStationLog);
}
} catch (Exception exception) {
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(ImasterConstant.baseurl + apiurl);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
return result;
}
return result;
......@@ -149,10 +159,11 @@ public class ImasterUtils {
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
HashMap<String, String> headMap = new HashMap<>();
try {
Object o = redisUtils.get(redisKey);
if (o != null) {
HashMap<String, String> headMap = new HashMap<>();
headMap = new HashMap<>();
headMap.put("XSRF-TOKEN", o.toString());
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
......@@ -186,7 +197,7 @@ public class ImasterUtils {
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} else {
HashMap<String, String> headMap = getHeader();
headMap = getHeader();
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolveruleOther(ResultResolveRule, respone);
......@@ -206,6 +217,15 @@ public class ImasterUtils {
}
} catch (Exception exception) {
exception.printStackTrace();
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfThirdStationLog.setReqMethod(requestMethod);
hygfThirdStationLog.setReqHeaders(headMap.toString());
hygfThirdStationLog.setReqPath(ImasterConstant.baseurl + apiurl);
hygfThirdStationLog.setReqBody(requestParmInfo);
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
return result;
}
return result;
......
......@@ -65,9 +65,11 @@ public class KsolarRequestUtil {
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
String url ="";
HashMap<String, String> headMap = new HashMap<>();
try {
HashMap<String, String> headMap = getHeader();
String url = KSolarConstant.baseurl + apiurl;
headMap = getHeader();
url = KSolarConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
//log.info("原始数据:{}", jsonArray);
......@@ -84,6 +86,15 @@ public class KsolarRequestUtil {
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
//存储日志
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);
return result;
}
return result;
......
......@@ -131,10 +131,10 @@ public class SofarRequestUtil {
thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据
JSONObject responeJSON = JSONObject.parseObject(respone);
Integer total = responeJSON.getInteger("total");
Integer total = responeJSON.getInteger("total")==null ? 0:responeJSON.getInteger("total");
Integer pageSize= requestInfo.get("size")==null || (Integer)requestInfo.get("size")==0? 1:(Integer)requestInfo.get("size");
Integer responePages=(total/pageSize)+1;
if (responePages == pageNo){
if (responePages <= pageNo){
break;
} else {
pageNo++;
......@@ -160,10 +160,11 @@ public class SofarRequestUtil {
public <T> List<T> getResPonse(String apiurl, String requestMethod, String requestParmInfo, String ResultResolveRule, Class<T> tClass) {
String respone = "";
List<T> result = new ArrayList<>();
String url ="";
HashMap<String, String> headMap = new HashMap<>();
try {
HashMap<String, String> headMap = getHeaderOfSofar();
String url = SoFarConstant.baseurl + apiurl;
headMap = getHeaderOfSofar();
url = SoFarConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
JSONObject jsonObject = JSONObject.parseObject(respone);
if(jsonObject!=null&&jsonObject.get(ResultResolveRule)!=null){
......@@ -181,6 +182,15 @@ public class SofarRequestUtil {
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
exception.printStackTrace();
//存储日志
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);
return result;
}
return result;
......@@ -190,9 +200,11 @@ public class SofarRequestUtil {
public JSONObject getResPonseobj(String apiurl, String requestMethod, String requestParmInfo, String ResultResolveRule) {
String respone = "";
JSONObject jsonObject = null;
String url ="";
HashMap<String, String> headMap = new HashMap<>();
try {
HashMap<String, String> headMap = getHeaderOfSofar();
String url = SoFarConstant.baseurl + apiurl;
headMap = getHeaderOfSofar();
url = SoFarConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
if(respone!=null&&JSONObject.parseObject(respone).get(ResultResolveRule)!=null&&ResultResolveRule!=null){
jsonObject = JSONObject.parseObject(JSONObject.parseObject(respone).get(ResultResolveRule).toString());
......@@ -209,6 +221,15 @@ public class SofarRequestUtil {
hygfThirdStationLog.setResBody(respone);
thirdStationLogService.saveLog(hygfThirdStationLog);
} catch (Exception exception) {
//存储日志
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);
exception.printStackTrace();
}
return jsonObject;
......
......@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* @description:
......@@ -212,11 +213,14 @@ public class SunlightUtil {
JSONObject resultData = new JSONObject();
JSONArray pageList = new JSONArray();
Integer pageNo = 1;
HttpRequest request = null;
String body="";
String res="";
try {
do {
bodyparam.put("curPage", pageNo);
//请求头
HttpRequest request = HttpUtil.createPost(dfurl+url);
request = HttpUtil.createPost(dfurl+url);
request.header("Content-Type", "application/json;charset=UTF-8");
request.header("sys_code", "901");
request.header("x-access-key", access_key);
......@@ -225,13 +229,13 @@ public class SunlightUtil {
bodyparam.put("token", this.getSunlightToken());
Gson gson = new Gson();
String body = gson.toJson(bodyparam);
body = gson.toJson(bodyparam);
request.body(body);
HttpResponse execute = request.execute();
if (!execute.isOk()) {
throw new RuntimeException(execute.body());
}
String res = UnicodeUtil.toString(execute.body());
res = UnicodeUtil.toString(execute.body());
JSONObject jsonObject = JSONUtil.parseObj(res, true);
resultData = JSONUtil.parseObj(jsonObject.get("result_data"), true);
......@@ -249,10 +253,10 @@ public class SunlightUtil {
hygfThirdStationLog.setResBody(res);
thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据
Integer rowCount = resultData.getInt("rowCount");
Integer rowCount = resultData.getInt("rowCount") ==null ? 0: resultData.getInt("rowCount");
Integer pageSize= bodyparam.get("size")==null || (Integer)bodyparam.get("size")==0? 1:(Integer)bodyparam.get("size");
Integer responePages=(rowCount/pageSize)+1;
if (responePages == pageNo){
if (responePages <= pageNo){
break;
} else {
pageNo++;
......@@ -260,6 +264,17 @@ public class SunlightUtil {
} while (true);
} catch (Exception e) {
log.error("失败,msg["+e.getMessage()+"]", e);
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.YG.getCode());
if(Objects.nonNull(request)){
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;
}
return resultData;
......@@ -271,10 +286,12 @@ public class SunlightUtil {
public JSONObject getdata(String url,Map<String, Object> bodyparam ){
String data=null;
HttpRequest request = null;
String body="";
String res="";
try {
//请求头
HttpRequest request = HttpUtil.createPost(dfurl+url);
request = HttpUtil.createPost(dfurl+url);
request.header("Content-Type", "application/json;charset=UTF-8");
request.header("sys_code", "901");
request.header("x-access-key", access_key);
......@@ -283,13 +300,13 @@ public class SunlightUtil {
bodyparam.put("token", this.getSunlightToken());
Gson gson = new Gson();
String body = gson.toJson(bodyparam);
body = gson.toJson(bodyparam);
request.body(body);
HttpResponse execute = request.execute();
if (!execute.isOk()) {
throw new RuntimeException(execute.body());
}
String res = UnicodeUtil.toString(execute.body());
res = UnicodeUtil.toString(execute.body());
JSONObject jsonObject = JSONUtil.parseObj(res, true);
JSONObject resultData = JSONUtil.parseObj(jsonObject.get("result_data"), true);
......@@ -306,6 +323,17 @@ public class SunlightUtil {
return resultData;
} catch (Exception e) {
log.error("失败,msg["+e.getMessage()+"]", e);
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.YG.getCode());
if(Objects.nonNull(request)){
hygfThirdStationLog.setReqMethod(request.getMethod().toString());
hygfThirdStationLog.setReqHeaders(request.headers().toString());
}
hygfThirdStationLog.setReqPath(dfurl+url);
hygfThirdStationLog.setReqBody(body);
hygfThirdStationLog.setResBody(res);
thirdStationLogService.saveLog(hygfThirdStationLog);
return new JSONObject();
}
......
......@@ -120,7 +120,7 @@ public class TanYinApiUtils {
// 记录请求开始的日志信息。
log.debug("请求 => 碳银{}接口,url:{}", desc, url);
Map<String, String> headers = new HashMap<>();
HttpResponse response;
HttpResponse response =null;
try {
// 添加Authorization头,使用Bearer令牌模式。
headers.put("Authorization", "Bearer " + getAccessToken(clientKey, clientSecret));
......@@ -144,6 +144,17 @@ public class TanYinApiUtils {
response = HttpUtil.createGet(url).execute();
return parseResponse(desc, response, resultClass);
} catch (Exception e) {
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfThirdStationLog.setReqMethod(HttpMethod.GET.name());
hygfThirdStationLog.setReqHeaders(headers.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(null);
if(Objects.nonNull(response)){
hygfThirdStationLog.setResBody(response.toString());
}
thirdStationLogService.saveLog(hygfThirdStationLog);
// 记录未预期异常的日志信息。
log.warn(String.format("异常 => 碳银%s接口", desc), e);
return null;
......@@ -206,6 +217,17 @@ public class TanYinApiUtils {
log.warn(String.format("异常 => 碳银%s接口,参数: %s,响应: %s", desc, paramsJsonStr, response != null ? response.body() : businessException.getMessage()));
return null;
} catch (Exception e) {
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfThirdStationLog.setReqMethod(HttpMethod.GET.name());
hygfThirdStationLog.setReqHeaders(headers.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(null);
if(Objects.nonNull(response)){
hygfThirdStationLog.setResBody(response.toString());
}
thirdStationLogService.saveLog(hygfThirdStationLog);
// 记录未预期的异常日志。
log.warn(String.format("异常 => 碳银%s接口,参数: %s", desc, paramsJsonStr), e);
return null;
......@@ -267,6 +289,17 @@ public class TanYinApiUtils {
log.warn(String.format("异常 => 碳银%s接口,参数: %s,响应: %s", desc, paramsJsonStr, response != null ? response.body() : businessException.getMessage()));
return null;
} catch (Exception e) {
//存储日志
HYGFThirdStationLog hygfThirdStationLog = new HYGFThirdStationLog();
hygfThirdStationLog.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfThirdStationLog.setReqMethod(HttpMethod.GET.name());
hygfThirdStationLog.setReqHeaders(headers.toString());
hygfThirdStationLog.setReqPath(url);
hygfThirdStationLog.setReqBody(null);
if(Objects.nonNull(response)){
hygfThirdStationLog.setResBody(response.toString());
}
thirdStationLogService.saveLog(hygfThirdStationLog);
// 记录异常日志
log.warn(String.format("异常 => 碳银%s接口,参数: %s", desc, paramsJsonStr), e);
return null;
......
......@@ -208,6 +208,7 @@ public class GoodWeConstant {
public static String inverterDayURL ="/v1/api/inverterDay";
public static String inverterMonthURL ="/v1/api/inverterMonth";
public static String inverterYearURL ="/v1/api/inverterYear";
public static String snStatusURL ="/api/OpenApi/GetPowerStationMonitorDetailBySn";
public static String resovleRule_data_page_records = "data,page,records";
public static String resovleRule_data_list = "data,list";
public static String resovleRule_data_records = "data,records";
......
......@@ -15,12 +15,11 @@ public class SoFarConstant {
}
};
public static String baseurl = "https://openapi.sofarsolarmonitor.com";
public static String baseurl = "https://openapi.sofarcloud.com/openapi-switch";
public static String appId = "447430219192733696";
public static String appSecret = "5881ee8c062817016a2b34425c45937d";
public static String corporationId = "447430928264990720";
public static String account = "18120415291";
public static String password = "ZXNK123456..";
public static String tokenurl = "/account/auth/createToken";
......
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.*;
import com.yeejoin.amos.api.householdapi.face.service.*;
import com.yeejoin.amos.api.householdapi.face.service.business.*;
import com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.JpStationServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.SofarDataAcquisitionServiceImpl;
import fastjson.JSON;
import io.swagger.annotations.Api;
......@@ -77,6 +78,20 @@ public class HouseholdTestController {
@Autowired
private TanYinDataAcquisitionService tanYinDataAcquisitionService;
@Autowired
private JpStationServiceImpl jpStationService;
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/testInitStation")
@ApiOperation(httpMethod = "GET", value = "测试初始化场站", notes = "测试初始化场站")
public void testInitStation() throws IOException {
jpStationService.initStationValue();
}
/**
* 新增户用光伏-厂商API haders
......
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "td_hygf_station_generate_day" ,autoResultMap = true)
public class TdHYGFStationDayGenerate implements Serializable {
/**
* 创建时间
*/
private Long createdTime;
/**
* 第三方场站id
*/
private String thirdStationId;
/**
*日 yyyy-MM-dd
*/
private String dayTime;
/**
*月 yyyy-MM
*/
private String yearMonth;
/**
*时分 HH:mm
*/
private String hour;
/**
* 发电量
*/
private Double generate;
/**
* 满发小时数
*/
private Double fullhour;
/**
* 收益
*/
private Double income;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
private String stationState;//电站状态
}
......@@ -8,7 +8,7 @@ import java.util.List;
public interface TanYinCustomerInfoMapper extends BaseMapper<TanYinCustomerInfo> {
@Select("select project_no from tanyin_customer_info group by project_no")
@Select("select project_no from house_pv_data.tanyin_customer_info group by project_no")
List<String> listProjectNo();
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.TdHYGFStationDayGenerate;
public interface TdHYGFStationDayGenerateMapper extends BaseMapper<TdHYGFStationDayGenerate> {
}
......@@ -104,7 +104,8 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
private TdHYGFStationYearGenerateMapper TdHYGFStationYearGenerateMapper;
@Autowired
private TdHYGFStationAllGenerateMapper TdHYGFStationAllGenerateMapper;
@Autowired
private HouseholdPvApiServiceImpl householdPvApiService;
@Autowired
private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper;
@Autowired
......@@ -145,6 +146,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
List<String> stationIds = getStationIds();
String today = DateUtil.today();
String hour = new Date().getHours() + ":00";
String currentTime = DateUtil.format(new Date(), "HH:mm");
for (int i = 0; i < stationIds.size(); i++) {
try {
TimeUnit.SECONDS.sleep(1);
......@@ -198,8 +200,16 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
} else {
jpStation.setMonthGenerate(golangStationDetail.getMonthenergy());
}
jpStation.setYearGenerate(golangStationDetail.getYearenergy() * GoLangConstant.mwhTokwh);
jpStation.setAccumulatedPower(golangStationDetail.getAllenergy() * GoLangConstant.mwhTokwh);
if (!golangStationDetail.getYearenergystr().toLowerCase().equals("kwh")) {
jpStation.setYearGenerate(golangStationDetail.getYearenergy() * GoLangConstant.mwhTokwh);
} else {
jpStation.setYearGenerate(golangStationDetail.getYearenergy());
}
if (!golangStationDetail.getAllenergystr().toLowerCase().equals("kwh")) {
jpStation.setAccumulatedPower(golangStationDetail.getAllenergy() * GoLangConstant.mwhTokwh);
} else {
jpStation.setAccumulatedPower(golangStationDetail.getAllenergy() );
}
jpStation.setDayIncome(golangStationDetail.getDayincome());
jpStation.setMonthIncome(golangStationDetail.getMonthincome());
jpStation.setYearIncome(golangStationDetail.getYearincome());
......@@ -293,6 +303,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate)) {
TdHYGFStationMonthGenerate = new TdHYGFStationMonthGenerate();
}
TdHYGFStationMonthGenerate.setThirdStationId(stationIds.get(i));
TdHYGFStationMonthGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd"));
TdHYGFStationMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM"));
......@@ -305,7 +316,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
TdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
TdHYGFStationMonthGenerate.setStationName(jpStation.getName());
TdHYGFStationMonthGenerate.setStationState(jpStation.getState());
householdPvApiService.addTdHYGFStationDayGenerate(TdHYGFStationMonthGenerate,hour);
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate.getCreatedTime())) {
TdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate);
......
......@@ -48,11 +48,11 @@ public class HYGFThirdStationLogServiceImpl implements IHYGFThirdStationLogServi
private void checkAndCreateNewTable(String tableName) {
// 查询当前表的数量
Integer countTable = hygfThirdStationLogMapper.countTable(TABLE_NAME);
Integer countTable = hygfThirdStationLogMapper.countTable(TABLE_NAME + "%");
// 如果表超过7个,删除最旧的表
if (countTable >= reserveDay) {
String oldestTableName = hygfThirdStationLogMapper.getOldestTableName(TABLE_NAME);
if (countTable > reserveDay) {
String oldestTableName = hygfThirdStationLogMapper.getOldestTableName(TABLE_NAME + "%");
hygfThirdStationLogMapper.dropTable(oldestTableName);
}
......
package com.yeejoin.amos.api.householdapi.face.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.api.householdapi.face.model.HouseholdPvApiDto;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.TdHYGFStationDayGenerate;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.TdHYGFStationMonthGenerate;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HouseholdPvApiMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HouseholdPvApi;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.TdHYGFStationDayGenerateMapper;
import com.yeejoin.amos.api.householdapi.face.service.IHouseholdPvApiService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Date;
import java.util.List;
/**
......@@ -17,6 +27,10 @@ import java.util.List;
*/
@Service
public class HouseholdPvApiServiceImpl extends BaseService<HouseholdPvApiDto, HouseholdPvApi, HouseholdPvApiMapper> implements IHouseholdPvApiService {
@Autowired
public TdHYGFStationDayGenerateMapper TdHYGFStationDayGenerateMapper;
/**
* 分页查询
*/
......@@ -30,4 +44,33 @@ public class HouseholdPvApiServiceImpl extends BaseService<HouseholdPvApiDto, Ho
public List<HouseholdPvApiDto> queryForHouseholdPvApiList() {
return this.queryForList("" , false);
}
public void addTdHYGFStationDayGenerate(TdHYGFStationMonthGenerate tdHYGFStationMonthGenerate,String currentTime){
TdHYGFStationDayGenerate tdHYGFStationDayGenerate = TdHYGFStationDayGenerateMapper.selectOne(
new QueryWrapper<TdHYGFStationDayGenerate>().eq("third_station_id", tdHYGFStationMonthGenerate.getThirdStationId())
.eq("day_time", DateUtil.format(new Date(), "yyyy-MM-dd"))
.eq("hour", currentTime)
.eq("year_month", DateUtil.format(new Date(), "yyyy-MM")));
Long createdTime = System.currentTimeMillis();
boolean flag= false;
if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate)) {
tdHYGFStationDayGenerate = new TdHYGFStationDayGenerate();
flag= true;
}else {
createdTime = tdHYGFStationDayGenerate.getCreatedTime();
}
BeanUtils.copyProperties(tdHYGFStationMonthGenerate,tdHYGFStationDayGenerate);
tdHYGFStationDayGenerate.setHour(currentTime);
if (tdHYGFStationDayGenerate.getStationState().equals("离线")){
tdHYGFStationDayGenerate.setGenerate(null);
}
if (flag){
tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis());
}else {
tdHYGFStationDayGenerate.setCreatedTime(createdTime);
}
TdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate);
}
}
\ No newline at end of file
package com.yeejoin.amos.api.householdapi.face.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.api.householdapi.Utils.CalendarAdjust;
......@@ -33,6 +35,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -120,7 +125,8 @@ public class ImasterDataServiceImpl implements ImasterDataService {
private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper;
@Autowired
TdJpStationMapper tdJpStationMapper;
@Autowired
private HouseholdPvApiServiceImpl householdPvApiService;
final static Logger logger = LoggerFactory.getLogger(GoLangDataAcquisitionServiceImpl.class);
final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -398,6 +404,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate)) {
TdHYGFStationMonthGenerate = new TdHYGFStationMonthGenerate();
}
TdHYGFStationMonthGenerate.setThirdStationId(jpStation.getThirdStationId());
TdHYGFStationMonthGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd"));
TdHYGFStationMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM"));
......@@ -409,7 +416,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
TdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
TdHYGFStationMonthGenerate.setStationName(jpStation.getName());
TdHYGFStationMonthGenerate.setStationState(jpStation.getState());
householdPvApiService.addTdHYGFStationDayGenerate(TdHYGFStationMonthGenerate,hour);
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate.getCreatedTime())) {
TdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate);
......@@ -1033,7 +1040,6 @@ public class ImasterDataServiceImpl implements ImasterDataService {
// jpStationMapper.updateById(jpStation1);
}
@Scheduled(cron = "${dataRequstScheduled.huawei}")
@Override
@Async
......@@ -1041,6 +1047,10 @@ public class ImasterDataServiceImpl implements ImasterDataService {
long ts = System.currentTimeMillis();
logger.info("-------华为同步告警开始" + ts + "------- " + sdf.format(new Date()));
List<String> inverterSns = imasterInverterListMapper.getCollectIds();
if (CollectionUtil.isEmpty(inverterSns)){
logger.warn("-------没有逆变器,跳过告警-------");
return;
}
// for (int i = 0; i < inverterSns.size(); i++) {
// try {
// TimeUnit.MINUTES.sleep(3);
......@@ -1048,12 +1058,20 @@ public class ImasterDataServiceImpl implements ImasterDataService {
// throw new RuntimeException(e);
// }
HashMap<String, Object> requestInfo = new HashMap<>();
// 获取今天的日期
LocalDate today = LocalDate.now();
// 将 LocalDate 转换为 LocalDateTime,设置时间为零点
LocalDateTime midnight = today.atStartOfDay();
// 将 LocalDateTime 转换为 Date
Date date = Date.from(midnight.atZone(ZoneId.systemDefault()).toInstant());
// 获取今天零点的时间戳(毫秒)
long todayTimestamp = date.getTime();
requestInfo.put("sns", inverterSns.stream().collect(Collectors.joining(",")));
requestInfo.put("language", "zh_CN ");
requestInfo.put("devTypes", 1);
requestInfo.put("beginTime", DateUtil.today());
requestInfo.put("endTime", DateUtil.today());
requestInfo.put("language", "zh_CN");
requestInfo.put("devTypes", "1");
requestInfo.put("beginTime", todayTimestamp);
requestInfo.put("endTime", System.currentTimeMillis());
String requestParaminfo = JSON.toJSONString(requestInfo);
List<ImasterAlarmDto> result = imasterUtils.getResPonse(ImasterConstant.alarmListUrl,
GoLangConstant.requestPost,
......
package com.yeejoin.amos.api.householdapi.face.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@Service
public class JpStationServiceImpl {
@Autowired
JpStationMapper jpStationMapper;
@Scheduled(cron = "${dataRequstScheduled.initStation:0 0 0 * * ?}")
@Async
public void initStationValue(){
LambdaUpdateWrapper<JpStation> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(JpStation::getCapacity,0.0)
.set(JpStation::getRealTimePower,0.0)
.set(JpStation::getAccumulatedPower,0.0)
.set(JpStation::getDayGenerate,0.0)
.set(JpStation::getMonthGenerate,0.0)
.set(JpStation::getYearGenerate,0.0)
.set(JpStation::getDayIncome,0.0)
.set(JpStation::getMonthIncome,0.0)
.set(JpStation::getYearIncome,0.0)
.set(JpStation::getCumulativeIncome,0.0)
.set(JpStation::getDayPowerUse,0.0)
.set(JpStation::getMonthPowerUse,0.0)
.set(JpStation::getYearPowerUse,0.0)
.set(JpStation::getRatedPower,0.0);
jpStationMapper.update(null,wrapper);
}
}
......@@ -114,7 +114,8 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper;
@Autowired
TdJpStationMapper tdJpStationMapper;
@Autowired
private HouseholdPvApiServiceImpl householdPvApiService;
final static Logger logger = LoggerFactory.getLogger(SofarDataAcquisitionServiceImpl.class);
final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -145,7 +146,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
List<String> stationIds = kSolarStationMapper.getStationIds();
String today = DateUtil.today();
String hour = new Date().getHours() + ":00";
String currentTime = DateUtil.format(new Date(), "HH:mm");
for (String stationId : stationIds) {
LambdaQueryWrapper<KsolarStationList> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(KsolarStationList::getStationId, stationId);
......@@ -332,7 +333,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
TdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
TdHYGFStationMonthGenerate.setStationName(jpStation.getName());
TdHYGFStationMonthGenerate.setStationState(jpStation.getState());
householdPvApiService.addTdHYGFStationDayGenerate(TdHYGFStationMonthGenerate,hour);
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate.getCreatedTime())) {
TdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate);
......
......@@ -12,6 +12,8 @@ import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.PostConstruct;
import cn.hutool.core.collection.CollectionUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -110,7 +112,8 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
private HYGFJPStationPowerHistoryMapper hygfjpStationPowerHistoryMapper;
@Autowired
private HYGFJPDayPowerMapper hygfjpDayPowerMapper;
@Autowired
private HouseholdPvApiServiceImpl householdPvApiService;
@Override
@Scheduled(cron = "${dataRequstScheduled.Sofar}")
public void stationList() {
......@@ -120,9 +123,11 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
List<SofarStationList> jsonObject = requestUtil.getResPonseList(SoFarConstant.stationListUrl,
SoFarConstant.requestPost, requestInfo, SoFarConstant.resovleRule_data, SofarStationList.class);
// 新增td电站
int i = 0;
for (SofarStationList sunlight : jsonObject) {
sunlight.setCreatedTime(System.currentTimeMillis());
sofarStationListMapper.insert(sunlight);
System.out.println(++i);
}
//删除多余的信息
deleteSHMessage(jsonObject);
......@@ -178,8 +183,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
@Override
public void stationDetail(List<SofarStationList> list) {
// 业务表场站
String hour = new Date().getHours() + ":00"; // 业务表场站
List<JpStation> jpStations = jpStationMapper
.selectList(new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.SH.getCode()));
......@@ -191,11 +195,18 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
}
}
List<String> names = jpStations.stream().map(i->i.getName()).collect(Collectors.toList());
// 封装电站数据
for (int i = 0; i < list.size(); i++) {
SofarStationList sunlightDto = list.get(i);
if(names.contains(sunlightDto.getName()))
{
continue;
}
// System.out.println(i+"====================================================");
JpStation jpStation = null;
if (bodyparam.containsKey(sunlightDto.getId().toString())) {
......@@ -383,7 +394,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
if (jsonObject1 != null && !jsonObject1.isEmpty()) {
Map<String, String> maps = jsonObject1.stream()
.collect(Collectors.toMap(SofarInverterDto::getKey, SofarInverterDto::getValue));
.collect(Collectors.toMap(SofarInverterDto::getKey, SofarInverterDto::getValue,(k1,k2)->k1));
// // 功率
// jpStation.setRealTimePower(
// maps != null && maps.containsKey("TPG")
......@@ -484,11 +495,11 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
if (!ObjectUtils.isEmpty(jpStation.getSequenceNbr())) {
jpStationMapper.updateById(jpStation);
} else {
jpStationMapper.insert(jpStation);
jpStationMapper.insert(jpStation);
}
String today = DateUtil.today();
String hour = new Date().getHours() + ":00";
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
new QueryWrapper<HYGFJPDayPower>().eq("third_station_id", sunlightDto.getId().toString())
.eq("year_month_day", today).eq("hour", hour));
......@@ -604,6 +615,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
);
TdHYGFStationMonthGenerate.setIncome(jpStation.getDayIncome());
householdPvApiService.addTdHYGFStationDayGenerate(TdHYGFStationMonthGenerate,hour);
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate.getCreatedTime())) {
TdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate);
......
......@@ -94,7 +94,8 @@ public class SunlightServiceImpl implements SunlightService {
final static Logger logger = LoggerFactory.getLogger(SofarDataAcquisitionServiceImpl.class);
final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Autowired
private HouseholdPvApiServiceImpl householdPvApiService;
// td电站信息存储
@Override
@Scheduled(cron = "${dataRequstScheduled.Sunlight}")
......@@ -169,6 +170,7 @@ public class SunlightServiceImpl implements SunlightService {
// 电站数据如库,电站统计数据入库
public void stationDetail(JSONObject data) {
String hour = new Date().getHours() + ":00";
// 所有场站信息
List<SunlightDto> list = JSONArray.parseArray(JSON.toJSONString(data.get("pageList")), SunlightDto.class);
......@@ -242,46 +244,79 @@ public class SunlightServiceImpl implements SunlightService {
jpStation.setSnCode(sunlightDto.getPs_id().toString());// sncode
try {
Map<String, String> map = sunlightDto.getTotal_capcity();
if (map != null && map.get("unit") != null && !map.get("unit").isEmpty()
&& !"--".equals(map.get("value"))) {
jpStation.setCapacity(SunlightUtil.zj.get(String.valueOf(map.get("unit")))
* Double.valueOf(String.valueOf(map.get("value"))));// 装机容量
try {
Map<String, String> map = sunlightDto.getTotal_capcity();
if (map != null && map.get("unit") != null && !map.get("unit").isEmpty()
&& !"--".equals(map.get("value"))) {
jpStation.setCapacity(SunlightUtil.zj.get(String.valueOf(map.get("unit")))
* Double.valueOf(String.valueOf(map.get("value"))));// 装机容量
}
}catch (Exception e){
jpStation.setCapacity(0.0);
}
Map<String, String> map1 = sunlightDto.getCurr_power();
if (map1 != null && map1.get("unit") != null && !map1.get("unit").isEmpty()
&& !"--".equals(map1.get("value"))) {
jpStation.setRealTimePower(SunlightUtil.GL.get(String.valueOf(map1.get("unit")))
* Double.valueOf(String.valueOf(map1.get("value"))));// 实时功率
try {
Map<String, String> map1 = sunlightDto.getCurr_power();
if (map1 != null && map1.get("unit") != null && !map1.get("unit").isEmpty()
&& !"--".equals(map1.get("value"))) {
jpStation.setRealTimePower(SunlightUtil.GL.get(String.valueOf(map1.get("unit")))
* Double.valueOf(String.valueOf(map1.get("value"))));// 实时功率
}
}catch (Exception e){
jpStation.setRealTimePower(0.0);
}
Map<String, String> map2 = sunlightDto.getToday_energy();
if (map2 != null && map2.get("unit") != null && !map2.get("unit").isEmpty()
&& !"--".equals(map2.get("value"))) {
jpStation.setDayGenerate(SunlightUtil.fd.get(String.valueOf(map2.get("unit")))
* Double.valueOf(String.valueOf(map2.get("value"))));// 日发电量
try {
Map<String, String> map2 = sunlightDto.getToday_energy();
if (map2 != null && map2.get("unit") != null && !map2.get("unit").isEmpty()
&& !"--".equals(map2.get("value"))) {
jpStation.setDayGenerate(SunlightUtil.fd.get(String.valueOf(map2.get("unit")))
* Double.valueOf(String.valueOf(map2.get("value"))));// 日发电量
}
}catch (Exception e){
jpStation.setDayGenerate(0.0);
}
Map<String, String> map3 = sunlightDto.getTotal_energy();
if (map3 != null && map3.get("unit") != null && !map3.get("unit").isEmpty()
&& !"--".equals(map3.get("value"))) {
jpStation.setAccumulatedPower(SunlightUtil.fd.get(String.valueOf(map3.get("unit")))
* Double.valueOf(String.valueOf(map3.get("value"))));// 累计发电量
try {
Map<String, String> map3 = sunlightDto.getTotal_energy();
if (map3 != null && map3.get("unit") != null && !map3.get("unit").isEmpty()
&& !"--".equals(map3.get("value"))) {
jpStation.setAccumulatedPower(SunlightUtil.fd.get(String.valueOf(map3.get("unit")))
* Double.valueOf(String.valueOf(map3.get("value"))));// 累计发电量
}
}catch (Exception e){
jpStation.setAccumulatedPower(0.0);
}
Map<String, String> map4 = sunlightDto.getToday_income();
if (map4 != null && map4.get("unit") != null && !map4.get("unit").isEmpty()
&& !"--".equals(map4.get("value"))) {
jpStation.setDayIncome(SunlightUtil.sy.get(String.valueOf(map4.get("unit")))
* Double.valueOf(String.valueOf(map4.get("value"))));// 日收益
try {
Map<String, String> map4 = sunlightDto.getToday_income();
if (map4 != null && map4.get("unit") != null && !map4.get("unit").isEmpty()
&& !"--".equals(map4.get("value"))) {
jpStation.setDayIncome(SunlightUtil.sy.get(String.valueOf(map4.get("unit")))
* Double.valueOf(String.valueOf(map4.get("value"))));// 日收益
}
}catch (Exception e){
jpStation.setDayIncome(0.0);
}
Map<String, String> map5 = sunlightDto.getTotal_income();
if (map5 != null && map5.get("unit") != null && !map5.get("unit").isEmpty()
&& !"--".equals(map5.get("value"))) {
jpStation.setCumulativeIncome(SunlightUtil.sy.get(String.valueOf(map5.get("unit")))
* Double.valueOf(String.valueOf(map5.get("value"))));// 累计收益
if (!map5.get("unit").equals("")){
try {
jpStation.setCumulativeIncome(SunlightUtil.sy.get(String.valueOf(map5.get("unit")))
* Double.valueOf(String.valueOf(map5.get("value"))));// 累计收益
}catch (Exception e){
//此处出现异常 直接赋值0.0 异常原因基本为厂商赋值问题
jpStation.setCumulativeIncome(0.0);
}
}else {
jpStation.setCumulativeIncome(0.0);
}
}
} catch (Exception e) {
......@@ -325,7 +360,7 @@ public class SunlightServiceImpl implements SunlightService {
bodyparamjp.put("size", 3000);
bodyparamjp.put("curPage", 1);
bodyparamjp.put("device_type_list", lif);
JSONObject jsonObject1data = SunlightUtil.getDataList(SunlightUtil.getDeviceList, bodyparamjp);
JSONObject jsonObject1data = SunlightUtil.getdata(SunlightUtil.getDeviceList, bodyparamjp);
List<Device> listd = JSONArray.parseArray(JSON.toJSONString(jsonObject1data.get("pageList")), Device.class);
// 获取电站,月发电量
......@@ -389,7 +424,7 @@ public class SunlightServiceImpl implements SunlightService {
jpStation.setYearIncome(js != null ? Double.valueOf(js.get(0).get("4") + "") / 1000 : null);
String today = DateUtil.today();
String hour = new Date().getHours() + ":00";
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
new QueryWrapper<HYGFJPDayPower>().eq("third_station_id", sunlightDto.getPs_id().toString())
.eq("year_month_day", today).eq("hour", hour));
......@@ -460,11 +495,11 @@ public class SunlightServiceImpl implements SunlightService {
jpStationMapper.insert(jpStation);
}
if (listd != null) {
if (CollectionUtil.isNotEmpty(listd)) {
this.setJpInverte(listd, jpStation, listdtx);
}
if (listd != null) {
if (CollectionUtil.isNotEmpty(listdtx)) {
this.collectorDetail(listdtx, jpStation);
}
......@@ -497,7 +532,7 @@ public class SunlightServiceImpl implements SunlightService {
TdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
TdHYGFStationMonthGenerate.setStationName(jpStation.getName());
TdHYGFStationMonthGenerate.setStationState(jpStation.getState());
householdPvApiService.addTdHYGFStationDayGenerate(TdHYGFStationMonthGenerate,hour);
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate.getCreatedTime())) {
TdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate);
......
package com.yeejoin.amos.api.householdapi.face.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.api.householdapi.Utils.RedisUtils;
import com.yeejoin.amos.api.householdapi.Utils.TanYinApiUtils;
import com.yeejoin.amos.api.householdapi.constant.TanYinConstant;
import com.yeejoin.amos.api.householdapi.face.dto.SunlightDto;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpCollector;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpInverter;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpInverterElectricity;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation;
......@@ -162,7 +166,8 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
private final static String pageNo = "1";
private final static String pageSize = "999";
@Autowired
private HouseholdPvApiServiceImpl householdPvApiService;
/**
* 每隔 10分钟通过并网时间段同步碳银对应范围内的项目信息
*
......@@ -174,7 +179,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
*/
@Scheduled (cron = "${dataRequestScheduled.tanYin}")
@Override
public void customerInfoList() {
try {
String startDate = LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
......@@ -220,7 +224,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
@Scheduled (cron = "${dataRequestScheduled.tanYin}")
@Async
@Override
@PostConstruct
public void stationList() {
long ts = System.currentTimeMillis();
log.info("-------碳银同步电站开始: {} ------- ", ts);
......@@ -235,16 +238,17 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
for (List<String> projectNoList : projectNoLists) {
Map<String, Object> params = MapBuilder.<String, Object>create().put("projectNoList", projectNoList).put("powerDate", powerDate).build();
List<TanYinStationInfo> tanYinStationInfoList = tanYinApiUtils.post("电站基本信息", apiUrl + TanYinConstant.stationListUrl, params, null, TanYinStationInfo.class);
if (CollectionUtils.isEmpty(tanYinStationInfoList)) {
continue;
if (!CollectionUtils.isEmpty(tanYinStationInfoList)) {
tanYinStationInfos.addAll(tanYinStationInfoList);
}
tanYinStationInfos.addAll(tanYinStationInfoList);
}
if (CollectionUtils.isEmpty(tanYinStationInfos)) {
log.warn("-------碳银同步电站结束: 未同步到电站基本信息 -------");
return;
}
List<String> stationIds = tanYinStationInfos.stream().map(TanYinStationInfo::getProjectNo).collect(Collectors.toList());
//删除多余的场站
deleteTyMessage(stationIds);
List<JpStation> jpStations = jpStationMapper.selectList(new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.TANYIN.getCode()).in("third_station_id", stationIds));
Map<String, JpStation> jpStationMap = jpStations.stream().collect(Collectors.toMap(JpStation::getThirdStationId, Function.identity()));
......@@ -299,6 +303,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
jpStation.setYearIncome(tanYinStationInfo.getYearPower() != null ? Double.parseDouble(tanYinStationInfo.getYearPower()) * 0.45 : 0.0);
jpStation.setCumulativeIncome(tanYinStationInfo.getTotalPower() != null ? Double.parseDouble(tanYinStationInfo.getTotalPower()) * 0.45 : 0.0);
jpStation.setArea(tanYinStationInfo.getArea());
jpStation.setState("在线");
// jpStation.setEmail();
// jpStation.setCreateTime();
// jpStation.setRatedPower();
......@@ -368,7 +373,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
TdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
TdHYGFStationMonthGenerate.setStationName(jpStation.getName());
TdHYGFStationMonthGenerate.setStationState(jpStation.getState());
householdPvApiService.addTdHYGFStationDayGenerate(TdHYGFStationMonthGenerate,hour);
if (ObjectUtils.isEmpty(TdHYGFStationMonthGenerate.getCreatedTime())) {
TdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate);
......@@ -432,6 +437,45 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
}
private void deleteTyMessage(List<String> stationIds) {
// 所有场站信息
if(CollectionUtil.isNotEmpty(stationIds)){
//场站
QueryWrapper<JpStation> wrapper = new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.TANYIN.getCode());
List<JpStation> jpStations = jpStationMapper.selectList(wrapper);
if(CollectionUtil.isNotEmpty(jpStations)){
for (JpStation jpStation : jpStations) {
if(!stationIds.contains(jpStation.getThirdStationId())){
//删除多余数据
jpStationMapper.deleteById(jpStation.getSequenceNbr());
}
}
}
//采集器
QueryWrapper<JpCollector> wrapper1 = new QueryWrapper<JpCollector>().eq("third_code", PVProducerInfoEnum.TANYIN.getCode());
List<JpCollector> jpCollectors = jpCollectorMapper.selectList(wrapper1);
if(CollectionUtil.isNotEmpty(jpCollectors)){
for (JpCollector jpCollector : jpCollectors) {
if(!stationIds.contains(jpCollector.getThirdStationId())){
//删除多余数据
jpCollectorMapper.deleteById(jpCollector.getSequenceNbr());
}
}
}
//逆变器
QueryWrapper<JpInverter> wrapper2 = new QueryWrapper<JpInverter>().eq("third_code", PVProducerInfoEnum.TANYIN.getCode());
List<JpInverter> jpInverters = jpInverterMapper.selectList(wrapper2);
if(CollectionUtil.isNotEmpty(jpInverters)){
for (JpInverter jpInverter : jpInverters) {
if(!stationIds.contains(jpInverter.getThirdStationId())){
//删除多余数据
jpInverterMapper.deleteById(jpInverter.getSequenceNbr());
}
}
}
}
}
@Override
public void inverterList() {
......
## DB properties hygf
## db1-production database
spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url=jdbc:mysql://47.92.234.253:13306/amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.url=jdbc:kingbase8://39.98.224.23:54321/amos_openapi_47?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.username=root
spring.db1.datasource.password=Yeejoin_1234
spring.db1.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.db1.datasource.password=Yeejoin@2020
spring.db1.datasource.driver-class-name=com.kingbase8.Driver
## db2-sync_data
spring.db2.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url=jdbc:mysql://47.92.234.253:13306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.url=jdbc:kingbase8://39.98.224.23:54321/amos_project_47?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username=root
spring.db2.datasource.password=Yeejoin_1234
spring.db2.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name=com.kingbase8.Driver
## db3-taosiData
spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db3.datasource.url=jdbc:TAOS-RS://47.92.234.253:6041/house_pv_data?user=root&password=taosdata&characterEncoding=utf8
......@@ -72,7 +73,7 @@ dataRequstScheduled.keshida=0 0/40 * * * *
dataRequstScheduled.Sunlight=0 0/40 * * * *
dataRequstScheduled.GoodWe=0 0/40 * * * *
dataRequstScheduled.Sofar=0 0/40 * * * *
dataRequstScheduled.Sofar=0 0/20 * * * *
# 碳银
tanYin.api.apiUrl=https://userauth.tanwin.cn
......
......@@ -13,7 +13,7 @@ spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name=com.kingbase8.Driver
## db3-taosiData
spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db3.datasource.url=jdbc:TAOS-RS://47.92.234.253:6041/house_pv_data?user=root&password=taosdata&characterEncoding=utf8
spring.db3.datasource.url=jdbc:TAOS-RS://192.168.0.61:6041/house_pv_data?user=root&password=taosdata&characterEncoding=utf8
spring.db3.datasource.username=root
spring.db3.datasource.password=taosdata
spring.db3.datasource.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
......
spring.application.name=AMOS-API-ACCESSAPI
server.servlet.context-path=/housepvapi
server.port=11006
spring.profiles.active=dev
spring.profiles.active=kingbase8
server.compression.enabled=true
spring.jackson.dateFormat=yyyy-MM-dd HH:mm:ss
......
......@@ -46,7 +46,10 @@
<!-- 日志输出级别 -->
<root level="DEBUG">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
<root level="ERROR">
<appender-ref ref="FILE" />
</root>
</configuration>
\ No newline at end of file
......@@ -24,5 +24,36 @@
<artifactId>taos-jdbcdriver</artifactId>
<version>3.2.4</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version> <!-- 请根据需要选择最新版本 -->
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
......@@ -18,8 +18,7 @@ public enum BusinessTypeEnum {
HYGF_ZGDSHLC("RectificationAudit", "整改单审核流程"),
HYGF_YSLC("AcceptanceCheck", "验收流程"),
HYGF_BWLC("GridConnected", "并网流程"),
HYGF_SGLCSH("ProcessEngineering", "施工流程审核"),
HYGF_REPAY("hygf_repayment", "还款"),
HYGF_SGLCSH("ProcessEngineering", "施工流程审核")
;
private final String code;
......
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.Getter;
/**
* 户用光伏业务类型枚举
*
* @author Administrator
*/
@Getter
public enum HygfRouthTypeEnum {
/**
* 业务类型枚举
*/
HYGF_REPAY("hygf_repayment", "还款",10000L),
HYGF_DZKC("hygf_dzkc", "电站勘察",10001L),
HYGF_DSG("hygf_dsg", "待施工",10002L),
HYGF_HTFQ("hygf_htfq", "合同发起",10003L),
HYGF_HTQS("hygf_htqs", "合同签署",10004L),
HYGF_HTGZ("hygf_htgz", "合同盖章",10005L),
HYGF_XZFHD("fh_xzfhd", "新增发货单",10006L),
HYGF_XZPGD("hygf_xzpgd", "新增派工单",10007L),
HYGF_XZBWDJ("bw_xzbwdj", "新增并网登记",10008L),
HYGF_XZYSTJ("ys_xzystj", "新增验收提交",10009L),
HYGF_XZTSRZ("hygf_xztsrz", "新增推送融资",10010L),
HYGF_BWSJSH("bw_bwsjsh", "并网设计审核",10011L),
HYGF_BWGCSH("bw_bwgcsh", "并网工程审核",10012L),
HYGF_YSTRSH("bw_ystrsh", "验收投融审核",10013L),
HYGF_YSFWSH("bw_ysfwsh", "验收法务审核",10014L),
HYGF_HTCXFQ("hygf_htcxfq", "合同重新发起",10015L),
HYGF_DFK("hygf_dfk", "待放款",10016L),
;
private final String code;
private final String name;
private final Long business;
HygfRouthTypeEnum(String code, String name,Long business) {
this.code = code;
this.name = name;
this.business = business;
}
public static String getNameByType(String code) {
String name = null;
for (HygfRouthTypeEnum enumOne : HygfRouthTypeEnum.values()) {
if (enumOne.getCode().equals(code)) {
name = enumOne.getName();
break;
}
}
return name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.yeejoin.amos.boot.module.hygf.api.Enum;
public enum PVProducerInfoEnum {
GDW("固德威","GOODWE"),
SH("首航","SH"),
JLY("锦浪云","JLY"),
KSOLAR("科士达","KSD"),
YG("阳光","YG"),
HUAWEI("华为","HW"),
TANYIN("碳银","TY");
private String name;
private String code;
public String getName() {
return name;
}
PVProducerInfoEnum(String name, String code) {
this.name = name;
this.code = code;
}
public static String getNameByCode(String code) {
String name = null;
for(PVProducerInfoEnum type: PVProducerInfoEnum.values()) {
if (type.getCode().equals(code)) {
name = type.getName();
break;
}
}
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
......@@ -13,13 +13,13 @@ import lombok.Getter;
public enum PowerStationNodeEnum {
经销商审核("经销商确认", "hygf_02"),
经销商确认("经销商确认", "hygf_02"),
设计审核("设计审核", "hygf_03"),
投融审核("投融审核", "hygf_05"),
法务审核("法务审核", "hygf_07"),
设计上传图纸("设计上传图纸", "hygf_09"),
经销商上传图纸("经销商上传图纸", "hygf_10"),
文件审核("文件审核", "hygf_11");
文件审核("图纸审核", "hygf_11");
/**
......
......@@ -27,29 +27,31 @@ public enum StatisicsHomePageEnum {
备货进行中容量("bhjxzrl",15),
备货已完成("bhywc",16),
备货已完成容量("bhywcrl",17),
施工未通过("sgwtg",18),
施工未通过容量("sgwtgrl",19),
施工进行中("sgjxz",20),
施工进行中容量("sgjxzrl",21),
施工已完成("sgywc",22),
施工已完成容量("sgywcrl",23),
并网未通过("bwwtg",24),
并网未通过容量("bwwtgrl",25),
并网进行中("bwjxz",26),
并网进行中容量("bwjxzrl",27),
并网已完成("bwywc",28),
并网已完成容量("bwywcrl",29),
验收未通过("yswtg",30),
验收未通过容量("yswtgrl",31),
验收进行中("ysjxz",32),
验收进行中容量("ysjxzrl",33),
验收已完成("ysywc",34),
验收已完成容量("ysywcrl",35),
融资公司("rzgs",36),
融资户数("rzhs",37),
融资容量("rzrl",38),
融资单价("rzdj",39),
放款金额("fkje",40);
备货完成("bhwc",18),
备货完成容量("bhwcrl",19),
施工未通过("sgwtg",20),
施工未通过容量("sgwtgrl",21),
施工进行中("sgjxz",22),
施工进行中容量("sgjxzrl",23),
施工已完成("sgywc",24),
施工已完成容量("sgywcrl",25),
并网未通过("bwwtg",26),
并网未通过容量("bwwtgrl",27),
并网进行中("bwjxz",28),
并网进行中容量("bwjxzrl",29),
并网已完成("bwywc",30),
并网已完成容量("bwywcrl",31),
验收未通过("yswtg",32),
验收未通过容量("yswtgrl",33),
验收进行中("ysjxz",34),
验收进行中容量("ysjxzrl",35),
验收已完成("ysywc",36),
验收已完成容量("ysywcrl",37),
融资公司("rzgs",38),
融资户数("rzhs",39),
融资容量("rzrl",40),
融资单价("rzdj",40),
放款金额("fkje",42);
/**
* 名称,描述
*/
......
......@@ -5,11 +5,15 @@ import lombok.Getter;
@AllArgsConstructor
public enum TaskTypeStationEnum {
经销商审核("经销商审核", "经销商审核"),
电站勘察("电站勘察", "电站勘察"),
电站审核("电站审核", "电站审核"),
合同填报("合同填报", "合同填报"),
勘察("勘察", "勘察"),
合同("合同", "合同"),
重置密码("重置密码", "重置密码"),
设置管理员("设置管理员", "设置管理员"),
发货("发货", "发货"),
施工("施工", "施工"),
并网("并网", "并网"),
验收("验收", "验收"),
投融资("投融资", "投融资"),
还款("还款", "还款");
/**
* 名称,描述
......
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum UploadStatusEnum {
未上传("未上传","未上传"),
已上传("上传中","上传中"),
未生成("未上传","未上传"),
成功("成功","成功"),
失败("失败","失败"),
代扣成功("成功","0"),
代扣失败("失败","1"),
代扣中("","99"),
代扣处理中("代扣处理中","代扣处理中");
private String name;
private String code;
public static UploadStatusEnum getNodeByCode(String code) {
UploadStatusEnum anEnum = null;
for (UploadStatusEnum type : UploadStatusEnum.values()) {
if (type.getCode().equals(code) ) {
anEnum = type;
break;
}
}
return anEnum;
}
}
......@@ -11,9 +11,9 @@ import lombok.Data;
*/
@Data
public class DayGenerateEX {
@ExcelProperty(value = "电站编号", index = 0)
@ApiModelProperty(value = "电站编码")
private String code;
@ExcelProperty(value = "号", index = 0)
@ApiModelProperty(value = "序号")
private Integer index;
@ExcelProperty(value = "电站名称", index = 1)
@ApiModelProperty(value = "电站名称")
private String name;
......
......@@ -22,4 +22,10 @@ public class DropDown {
@ApiModelProperty(value = "单位名称+单位id")
private String id;
@ApiModelProperty(value = "单位地址")
private String address;
@ApiModelProperty(value = "区域编码")
private String regionSeq;
}
......@@ -61,4 +61,5 @@ public class HouseholdContractPageDto{
private String province;
private String startTime;
private String endTime;
private String routhPathId;
}
......@@ -124,6 +124,17 @@ public class HygfIcbcRecordDTO {
@ApiModelProperty(value = "电站信息")
private List<IcbcPeasantHousehold> peasantHouseholds;
/*
* 区域公司code
* */
@ApiModelProperty(value = "区域公司code")
private String regionalCompaniesCode;
/*
* 区域公司名称
* */
@ApiModelProperty(value = "区域公司名称")
private String regionalCompaniesName;
@Data
@AllArgsConstructor
@NoArgsConstructor
......@@ -168,5 +179,10 @@ public class HygfIcbcRecordDTO {
@ApiModelProperty(value = "实际安装规模(kW)")
private String realScale;
}
@ApiModelProperty (value = "代扣金额")
private Double paymentAmount;
@ApiModelProperty (value = "代扣时间")
private String paymentTime;
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;
/**
* (hygf_icbc_record)实体类
*
* @author yangyang
* @description
* @since 2024-07-18 11:40:46
*/
@Data
@NoArgsConstructor
@ApiModel (value = "HygfIcbcRecordExportDTO", description = "聚富通钱包开户DTO")
public class HygfIcbcRecordExportDTO {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelIgnore
protected Long sequenceNbr;
@ExcelProperty(value = "户主姓名", index = 0)
@ApiModelProperty (value = "户主姓名")
private String custName;
/**
* 身份证号
*/
@ExcelProperty(value = "区域公司", index = 1)
@ApiModelProperty(value = "区域公司")
private String regionalCompaniesName;
/**
* 手机号码
*/
@ExcelProperty(value = "手机号", index = 2)
@ApiModelProperty (value = "手机号码")
private String phone;
@ExcelProperty(value = "身份证号", index = 3)
@ApiModelProperty (value = "身份证号")
private String idCard;
/**
* 聚富通电子账户账号
*/
@ExcelProperty(value = "聚富通账户", index = 4)
@ApiModelProperty (value = "聚富通电子账户账号")
private String mediumId;
/**
* 开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败
*/
@ExcelProperty(value = "开户状态", index = 5)
@ApiModelProperty (value = "开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败")
private String openAccountStatus;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@ExcelProperty(value = "协议状态", index = 6)
@ApiModelProperty (value = "协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认")
private String protocolStatus;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@ExcelProperty(value = "扣款总金额(元)", index = 7)
@ApiModelProperty (value = "扣款总金额")
private Double paymentAmount;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@ExcelProperty(value = "最后扣款成功时间", index = 8)
@ApiModelProperty (value = "最后扣款成功时间")
private String paymentTime;
}
\ No newline at end of file
......@@ -5,6 +5,8 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* <p>
* ProjectName: amos-boot-zx-biz
......@@ -44,4 +46,6 @@ public class HygfIcbcRecordQueryDTO {
private Integer limit;
private Integer offset;
private List<String> ids;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* (hygf_icbc_record)实体类
*
* @author yangyang
* @description
* @since 2024-07-18 11:40:46
*/
@Data
@NoArgsConstructor
@ApiModel (value = "HygfIcbcRecordExportDTO", description = "聚富通钱包开户DTO")
public class HygfIcbcWithholdRecordExportDTO {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelIgnore
protected Long sequenceNbr;
@ExcelProperty(value = "开户名", index = 0)
@ApiModelProperty (value = "开户名")
private String custName;
/**
* 身份证号
*/
@ExcelProperty(value = "项目公司", index = 1)
@ApiModelProperty(value = "项目公司")
private String regionalCompaniesName;
/**
* 手机号码
*/
@ExcelProperty(value = "扣款批次号", index = 2)
@ApiModelProperty (value = "扣款批次号")
private String batchNo;
/**
* 聚富通电子账户账号
*/
@ExcelProperty(value = "聚富通账户", index = 3)
@ApiModelProperty (value = "聚富通电子账户账号")
private String mediumId;
/**
*
*/
@ExcelProperty(value = "扣款金额", index = 4)
@ApiModelProperty (value = "扣款金额")
private double paymentAmount;
@ExcelProperty(value = "扣款状态", index = 5)
@ApiModelProperty (value = "扣款状态")
private String withholdStatus;
@ExcelProperty(value = "扣款时间", index = 6)
@ApiModelProperty (value = "扣款时间")
private Date paymentTime;
@ExcelProperty(value = "操作人", index = 7)
@ApiModelProperty (value = "操作人")
private String uploader;
@ExcelProperty(value = "说明", index =8)
@ApiModelProperty (value = "说明")
private String desc;
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@Data
@ApiModel(value="IcbcExcelDto", description=" 聚富通导出ExcelDto类")
public class IcbcExcelDto {
@ApiModelProperty("选中的主键")
private List<String> sequenceNbrList;
@ApiModelProperty("上传人员")
private String uploader;
@ApiModelProperty("上传时间(开始时间)")
private String uploadStartTime;
@ApiModelProperty("上传时间(结束时间)")
private String uploadEndTime;
@ApiModelProperty("上传状态")
private String uploadStatus;
@ApiModelProperty("确认人员")
private String confirmator;
@ApiModelProperty("确认时间(开始时间)")
private String confirmationStartTime;
@ApiModelProperty("确认时间(结束时间)")
private String confirmationEndTime;
@ApiModelProperty("代扣状态")
private String withholdStatus;
@ApiModelProperty("说明")
private String desc;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 聚富通代扣信息表
*
* @author system_generator
* @date 2024-12-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="IcbcWithholdDto", description=" 聚富通代扣信息表")
public class IcbcWithholdDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "付款目标")
private String paymentTarget;
@ApiModelProperty(value = "项目编号")
private String projectNumber;
@ApiModelProperty(value = "付款总金额")
private String paymentAmount;
@ApiModelProperty(value = "说明")
private String desc;
@ApiModelProperty(value = "确认人员")
private String confirmator;
@ApiModelProperty(value = "确认时间")
private Date confirmationTime;
@ApiModelProperty(value = "上传人员")
private String uploader;
@ApiModelProperty(value = "上传时间")
private Date uploadTime;
@ApiModelProperty(value = "上传文件")
private String uploadFile;
@ApiModelProperty(value = "上传状态")
private String uploadStatus;
@ApiModelProperty(value = "代扣状态")
private String withholdStatus;
@ApiModelProperty(value = "失败原因")
private String errorDesc;
@ApiModelProperty(value = "户主icbcid")
private String icbcId;
@ApiModelProperty(value = "批次号")
private String batchNo;
@ApiModelProperty("所选商户冗余")
private String icbcRecordInfos;
private String uploadFileName;
/**
* 失败原因
*/
private String uploadErrorDesc;
private String receiptFile;
@ApiModelProperty(value = "缴费开始时间")
private String paymentStartTime;
@ApiModelProperty(value = "缴费结束时间")
private String paymentEndTime;
@ApiModelProperty(value = "导出用 姓名")
private String custName;
/**
* 失败原因
*/
private String paymentErrorDesc;
@ApiModelProperty(value = "付款信息")
private List<HygfIcbcRecordDTO> recordDTOS;
private List<Long> ids;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @author system_generator
* @date 2024-12-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "IcbcWithholdRecordDto", description = "")
public class IcbcWithholdRecordDto extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelIgnore
protected Long sequenceNbr;
@ExcelProperty(value = "户主姓名", index = 0)
@ApiModelProperty(value = "户主姓名")
private String custName;
/**
* 身份证号
*/
@ExcelProperty(value = "区域公司", index = 1)
@ApiModelProperty(value = "区域公司")
private String regionalCompaniesName;
/**
* 手机号码
*/
@ExcelProperty(value = "手机号", index = 2)
@ApiModelProperty(value = "手机号码")
private String phone;
@ExcelProperty(value = "身份证号", index = 3)
@ApiModelProperty(value = "身份证号")
private String idCard;
/**
* 聚富通电子账户账号
*/
@ExcelProperty(value = "银行卡号", index = 4)
@ApiModelProperty(value = "聚富通电子账户账号")
private String mediumId;
/**
* 开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败
*/
@ExcelIgnore @ApiModelProperty(value = "开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败")
private String openAccountStatus;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@ExcelIgnore @ApiModelProperty(value = "协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认")
private String protocolStatus;
@ExcelProperty(value = "批次号", index = 5)
@ApiModelProperty(value = "批次号")
private String batchNo;
@ExcelProperty(value = "项目编号", index = 6)
@ApiModelProperty(value = "项目编号")
private String projectId;
@ExcelProperty(value = "付款金额(元)", index = 7)
@ApiModelProperty(value = "付款金额")
private double paymentAmount;
@ExcelProperty(value = "代扣状态", index = 8)
@ApiModelProperty(value = "代扣状态")
private String withholdStatus;
@ExcelIgnore
@ApiModelProperty(value = "上传时间")
private Date withholdTime;
@ExcelProperty(value = "缴费时间", index = 9)
@ApiModelProperty(value = "缴费时间")
private Date paymentTime;
@ExcelIgnore
@ApiModelProperty(value = "缴费开始时间")
private String paymentStartTime;
@ExcelIgnore
@ApiModelProperty(value = "缴费结束时间")
private String paymentEndTime;
@ExcelIgnore
private String outUserId;
@ExcelIgnore
private String amosUserId;
@ExcelIgnore
private String contentText;
@ExcelIgnore
private String show;
@ExcelIgnore
private String regionalCompaniesCode;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 第三方场站
*
* @author system_generator
* @date 2023-09-19
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "JpStationBatchDto", description = "第三方场站批量")
public class JpStationBatchDto extends BaseDto {
private List<String> sequenceNbrList;
@ApiModelProperty("项目公司Code")
private String regionalCompaniesCode;
@ApiModelProperty("项目公司名称")
private String regionalCompaniesName;
@ApiModelProperty("经销商名称")
private String amosCompanyName;
@ApiModelProperty("经销商Code")
private String amosCompanyCode;
}
......@@ -36,9 +36,10 @@ public class JpStationDto extends BaseDto {
@ExcelProperty(value = "电站名称", index = 1)
@ApiModelProperty(value = "电站名称")
private String name;
@ExcelProperty(value = "电站编号", index = 0)
@ApiModelProperty(value = "电站编码")
private String code;
@ExcelProperty(value = "序号", index = 0)
@ApiModelProperty(value = "序号")
private Integer index;
@ExcelIgnore
@ApiModelProperty(value = "组织编码")
private String systemCode;
......@@ -172,7 +173,8 @@ public class JpStationDto extends BaseDto {
private String regionalCompaniesCode;
@ExcelProperty(value = "项目公司名称", index = 8)
private String regionalCompaniesName;
@ExcelIgnore
private String amosCompanyName;
@ExcelIgnore
private String amosCompanyCode;
......@@ -210,4 +212,12 @@ public class JpStationDto extends BaseDto {
String dbsn;
@ExcelIgnore
String qxysn;
@ExcelIgnore
String bindType;
@ExcelIgnore
Integer current;
@ExcelIgnore
Integer size;
@ExcelIgnore
String thirdCodeName;
}
......@@ -14,9 +14,9 @@ public class MonthGenerateEX {
@ExcelProperty(value = "电站编号", index = 0)
@ApiModelProperty(value = "电站编码")
private String code;
@ExcelProperty(value = "号", index = 0)
@ApiModelProperty(value = "序号")
private Integer index;
@ExcelProperty(value = "电站名称", index = 1)
@ApiModelProperty(value = "电站名称")
private String name;
......
......@@ -23,4 +23,5 @@ public class PreparationDto {
String deliveryTimeEnd;
String flag ;
String orderStatus;
String routhPathId;
}
......@@ -30,5 +30,5 @@ public class PreparationPageDto extends Page<PreparationMoney> {
String deliveryTimeEnd;
String flag ;
String orderStatus;
String routhPathId;
}
......@@ -7,4 +7,10 @@ import java.util.List;
@Data
public class RepaymentBatchDto {
private List<String> sequenceNbrList;
private String companyName;
private String loanPeriod;
private String messageState;
private String period;
private String repayDate;
private String repayState;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
@Data
public class ResultLinkField {
/**
* 地区编号 5
*
*/
private String zoneNo;
/**
* 批次号 18
*/
private String batchNo;
/**
* 序号 30
*/
private String billNo;
/**
* 状态 1 0成功 1失败
*/
private String status;
/**
* 错误信息 500
*/
private String errMsg;
/**
* 导入时间 20
*/
private String timestamp;
/**
* 实扣金额(单位:分) 17
*/
private String amt;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
@Data
public class WithholdFirstLinkField {
/**
* 总金额(单位:分)
* 非负整数,无小数位
*/
private int totalAmt;
/**
* 总笔数
*/
private int totalNum;
/**
* 批次号 同文件名后18位
*/
private String batchNo;
/**
* 企业CIS号
*/
private String corpCis;
/**
* 缴费大类
*/
private String payClass;
/**
* 缴费小类
*/
private String paySubClass;
/**
* 缴费项目ID
*/
private String projectId;
/**
* 账单别名 最长10个中文
*/
private String billName;
/**
* 摘要
*/
private String summary;
/**
* 自定义字段 50位长度1000010格式,第一位表示
* 是否启用item50作为回单自定义字
* 段。0-否,1-是
*/
private String customField;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
@Data
public class WithholdLoopField {
/**
* 序号,不能重复
*/
private int billNo;
/**
* 业务编号
*/
private String busiCode;
/**
* 付款人账号
* 付方账号,会与对应委托代扣协议做校验
*/
private String busiAcct;
/**
*付款人户
* 名
*/
private String busiName;
/**
* 付款人地
* 址
*/
private String busiAddr;
/**
* 付款人手
* 机
*/
private String busiTel;
/**
* 付款人邮
* 箱
*/
private String busiEmail;
/**
* 收款企业
* 入账账号
*/
private String actualAcctNo;
/**
* 出账日期
*/
private String billDate;
/**
* 明细失效
* 日期
*/
private String billCaeseDate;
/**
* 应缴金额
* (单位:
* 分)
*/
private int captAmount;
/**
* 查询业务
* 要素1
*/
private String query_item1;
/**
* 查询业务
* 要素2
*/
private String query_item2;
/**
* 查询业务
* 要素3
*/
private String query_item3;
/**
* 查询业务
* 要素4
*/
private String query_item4;
/**
* 查询业务
* 要素5
*/
private String query_item5;
/**
* 查询业务
* 要素6
*/
private String query_item6;
/**
* 查询业务
* 要素7
*/
private String query_item7;
/**
* 查询业务
* 要素8
*/
private String query_item8;
/**
* 查询业务
* 要素9
*/
private String query_item9;
/**
* 查询业务
* 要素10
*/
private String query_item10;
/**
* 查询业务
* 要素11
*/
private String query_item11;
/**
* 查询业务
* 要素12
*/
private String query_item12;
/**
* 查询业务
* 要素13
*/
private String query_item13;
/**
* 查询业务
* 要素14
*/
private String query_item14;
/**
* 查询业务
* 要素15
*/
private String query_item15;
/**
* 缴费业务
* 要素1
*/
private String item1;
/**
* 缴费业务
* 要素2
*/
private String item2;
/**
* 缴费业务
* 要素3
*/
private String item3;
/**
* 缴费业务
* 要素4
*/
private String item4;
/**
* 缴费业务
* 要素5
*/
private String item5;
/**
* 缴费业务
* 要素6
*/
private String item6;
/**
* 缴费业务
* 要素7
*/
private String item7;
/**
* 缴费业务
* 要素8
*/
private String item8;
/**
* 缴费业务
* 要素9
*/
private String item9;
/**
* 缴费业务
* 要素10
*/
private String item10;
/**
* 缴费业务
* 要素11
*/
private String item11;
/**
* 缴费业务
* 要素12
*/
private String item12;
/**
* 缴费业务
* 要素13
*/
private String item13;
/**
* 缴费业务
* 要素14
*/
private String item14;
/**
* 缴费业务
* 要素15
*/
private String item15;
/**
* 缴费业务
* 要素16
*/
private String item16;
/**
* 缴费业务
* 要素17
*/
private String item17;
/**
* 缴费业务
* 要素18
*/
private String item18;
/**
* 缴费业务
* 要素19
*/
private String item19;
/**
* 缴费业务
* 要素20
*/
private String item20;
/**
* 缴费业务
* 要素21
*/
private String item21;
/**
* 缴费业务
* 要素22
*/
private String item22;
/**
* 缴费业务
* 要素23
*/
private String item23;
/**
* 缴费业务
* 要素24
*/
private String item24;
/**
* 缴费业务
* 要素25
*/
private String item25;
/**
* 缴费业务
* 要素26
*/
private String item26;
/**
* 缴费业务
* 要素27
*/
private String item27;
/**
* 缴费业务
* 要素28
*/
private String item28;
/**
* 缴费业务
* 要素29
*/
private String item29;
/**
* 缴费业务
* 要素30
*/
private String item30;
/**
* 缴费业务
* 要素31
*/
private String item31;
/**
* 缴费业务
* 要素32
*/
private String item32;
/**
* 缴费业务
* 要素33
*/
private String item33;
/**
* 缴费业务
* 要素34
*/
private String item34;
/**
* 缴费业务
* 要素35
*/
private String item35;
/**
* 缴费业务
* 要素36
*/
private String item36;
/**
* 缴费业务
* 要素37
*/
private String item37;
/**
* 缴费业务
* 要素38
*/
private String item38;
/**
* 缴费业务
* 要素39
*/
private String item39;
/**
* 缴费业务
* 要素40
*/
private String item40;
/**
* 缴费业务
* 要素41
*/
private String item41;
/**
* 缴费业务
* 要素42
*/
private String item42;
/**
* 缴费业务
* 要素43
*/
private String item43;
/**
* 缴费业务
* 要素44
*/
private String item44;
/**
* 缴费业务
* 要素45
*/
private String item45;
/**
* 缴费业务
* 要素46
*/
private String item46;
/**
* 缴费业务
* 要素47
*/
private String item47;
/**
* 缴费业务
* 要素48
*/
private String item48;
/**
* 缴费业务
* 要素49
*/
private String item49;
/**
* 缴费业务
* 要素1
*/
private String item50;
/**
* 地区
*/
private String depzone;
/**
* 网点
*/
private String depbrno;
/**
* 代理业务
* 编号
*/
private String agentno;
/**
* 缴费客户
* 注册号
*/
private String CUSTOMER_NO;
/**
* 客户类型
*/
private String CUSTOMER_TYPE;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -108,4 +109,7 @@ public class WorkOrderPage {
private String startTime;
@ApiModelProperty(value = "结束时间",example = "2024-10-15 10:12:31")
private String endTime;
@ApiModelProperty(value = "路由地址Id",example = "17068690861069734112")
@TableField(exist = false)
private String routhPathId;
}
......@@ -11,9 +11,9 @@ import lombok.Data;
*/
@Data
public class YearGenerateEX {
@ExcelProperty(value = "电站编号", index = 0)
@ApiModelProperty(value = "电站编码")
private String code;
@ExcelProperty(value = "号", index = 0)
@ApiModelProperty(value = "序号")
private Integer index;
@ExcelProperty(value = "电站名称", index = 1)
@ApiModelProperty(value = "电站名称")
private String name;
......
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
/**
* @description:
* @author: tw
* @createDate: 2023/11/8
*/
@Data
@Accessors(chain = true)
@TableName("td_hygf_station_generate_day")
public class HourGenerate {
@Id
private Long createdTime;
/**
* 第三方电站id
*/
@TableField("third_station_id")
private String thirdStationId;
/**
* 天
*/
@TableField("day_time")
private String dayTime;
/**
* 时分
*/
@TableField("hour")
private String hour;
/**
* 月份
*/
@TableField("year_month")
private String yearMonth;
/**
* 发电量
*/
@TableField("generate")
private Double generate;
/**
* 满发小时数
*
* */
@TableField("fullhour")
private Double fullhour;
@TableField("income")
// 日收益
private Double income;
@TableField("regional_companies_code")
private String regionalCompaniesCode;
@TableField("amos_company_code")
private String amosCompanyCode;
@TableField("station_name")
private String stationName;
@TableField("station_state")
private String stationState;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 聚富通代扣信息表
*
* @author system_generator
* @date 2024-12-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_icbc_withhold")
public class IcbcWithhold extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 付款目标
*/
@TableField("payment_target")
private String paymentTarget;
/**
* 项目编号
*/
@TableField("project_number")
private String projectNumber;
/**
* 付款金额
*/
@TableField("payment_amount")
private String paymentAmount;
/**
* 说明
*/
@TableField("content")
private String desc;
/**
* 确认人员
*/
@TableField("confirmator")
private String confirmator;
/**
* 确认时间
*/
@TableField("confirmation_time")
private Date confirmationTime;
/**
* 上传人员
*/
@TableField("uploader")
private String uploader;
/**
* 上传时间
*/
@TableField("upload_time")
private Date uploadTime;
/**
* 上传文件
*/
@TableField("upload_file")
private String uploadFile;
/**
* 上传文件生成名称
*/
@TableField("upload_fileName")
private String uploadFileName;
/**
* 上传文件
*/
@TableField("receipt_file")
private String receiptFile;
/**
* 上传状态
*/
@TableField("upload_status")
private String uploadStatus;
/**
* 代扣状态
*/
@TableField("withhold_status")
private String withholdStatus;
/**
* 失败原因
*/
@TableField("upload_error_desc")
private String uploadErrorDesc;
/**
* 失败原因
*/
@TableField("payment_error_desc")
private String paymentErrorDesc;
/**
* 户主icbcid 弃用冗余 传递导出参数使用
*/
@TableField("icbc_id")
private String icbcId;
/**
* 批次号
*/
@TableField("batch_no")
private String batchNo;
/**
* 所选商户冗余
*/
@TableField("icbc_record_infos")
private String icbcRecordInfos;
/**
* 付款信息
*/
@TableField(exist = false)
private List<IcbcWithholdRecord> recordDTOS;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2024-12-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_icbc_withhold_record")
public class IcbcWithholdRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 农户姓名
*/
@TableField("cust_name")
private String custName;
/**
* 身份证号
*/
@TableField("id_card")
private String idCard;
/**
* 批次号
*/
@TableField("batch_no")
private String batchNo;
/**
* 聚富通电子账户账号
*/
@TableField("medium_id")
private String mediumId;
/**
* 项目编号
*/
@TableField("project_id")
private String projectId;
/**
* 付款金额
*/
@TableField("payment_amount")
private double paymentAmount;
/**
* 代扣状态
*/
@TableField("withhold_status")
private String withholdStatus;
/**
* 上传时间
*/
@TableField("withhold_time")
private Date withholdTime;
/**
* 缴费时间
*/
@TableField("payment_time")
private Date paymentTime;
/**
* 用户编号
*/
@TableField("out_user_id")
private String outUserId;
/**
* 平台用户id
*/
@TableField("amos_user_id")
private String amosUserId;
/*
* 区域公司code
* */
@TableField("regional_companies_code")
private String regionalCompaniesCode;
/*
* 区域公司名称
* */
@TableField("regional_companies_name")
private String regionalCompaniesName;
/*
* 备注
* */
@TableField("content_text")
private String contentText;
/*
*
* */
@TableField("phone")
private String phone;
@TableField(exist = false)
private String openAccountStatusName;
@TableField(exist = false)
private String protocolStatusName;
}
......@@ -74,8 +74,8 @@ public class RegionalCompanies extends BaseEntity {
private String companyCode;
@TableField(exist = false)
private List<Object> children;
private int limits;
......
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.Date;
......@@ -26,43 +34,43 @@ public class ToDoTasks extends BaseEntity {
/**
* 任务类型
*/
@TableField("type")
@TableField("type")
private String type;
/**
* 业务id
*/
@TableField("business_id")
@TableField("business_id")
private Long businessId;
/**
* 任务状态
*/
@TableField("state")
@TableField("state")
private String state;
/**
* 用户id
*/
@TableField("amos_user_id")
@TableField("amos_user_id")
private String amosUserId;
/**
* 任务创建时间
*/
@TableField("creation_time")
@TableField("creation_time")
private Date creationTime;
/**
* 完成时间
*/
@TableField("complete_time")
@TableField("complete_time")
private Date completeTime;
/**
* 任务名称
*/
@TableField("task_name")
@TableField("task_name")
private String taskName;
/**
......@@ -77,8 +85,15 @@ public class ToDoTasks extends BaseEntity {
@TableField("route_path")
private String routePath;
/**
*路由地址
*/
@TableField("wx_route_path")
private String wxRoutePath;
public ToDoTasks(String type, Long businessId, String taskName,String orgCode) {
public ToDoTasks(String type, Long businessId, String taskName, String orgCode) {
addOperator();
this.type = type;
this.businessId = businessId;
this.state = "待办";
......@@ -87,7 +102,8 @@ public class ToDoTasks extends BaseEntity {
this.taskName = taskName;
}
public ToDoTasks(String type, Long businessId, String taskName,String orgCode,String routePath) {
public ToDoTasks(String type, Long businessId, String taskName, String orgCode, String routePath,String wxRoutePath) {
addOperator();
this.type = type;
this.businessId = businessId;
this.state = "待办";
......@@ -95,8 +111,28 @@ public class ToDoTasks extends BaseEntity {
this.creationTime = new Date();
this.taskName = taskName;
this.routePath = routePath;
this.wxRoutePath= wxRoutePath;
}
public ToDoTasks(String type, Long businessId) {
addOperator();
this.type = type;
this.businessId = businessId;
this.state = "待办";
this.creationTime = new Date();
}
public ToDoTasks() {
}
private void addOperator() {
try {
this.recDate = new Date();
this.recUserId = RequestContext.getExeUserId();
this.recUserName = RequestContext.getLoginId();
} catch (Exception e) {
e.printStackTrace();
}
}
}
......@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.Date;
......@@ -70,6 +71,7 @@ public class UserMessage extends BaseEntity {
public UserMessage(String type, Long businessId, String amosUserId, Date creationTime, String taskName, String amosOrgCode) {
addOperator();
this.type = type;
this.businessId = businessId;
this.amosUserId = amosUserId;
......@@ -78,6 +80,16 @@ public class UserMessage extends BaseEntity {
this.amosOrgCode = amosOrgCode;
}
private void addOperator() {
try {
this.recDate = new Date();
this.recUserId = RequestContext.getExeUserId();
this.recUserName = RequestContext.getLoginId();
} catch (Exception e) {
e.printStackTrace();
}
}
public UserMessage() {
}
}
......@@ -185,4 +185,8 @@ public class WorkOrder extends BaseEntity {
@ApiModelProperty(value = "电站名称",example = "admin")
@TableField(exist = false)
private String ownersName;
@ApiModelProperty(value = "路由地址Id",example = "17068690861069734112")
@TableField(exist = false)
private String routhPathId;
}
......@@ -2,8 +2,6 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.WorkOrderPage;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfBusinessField;
import org.apache.ibatis.annotations.Param;
......@@ -61,62 +59,62 @@ public interface BusinessFieldMapper extends BaseMapper<HygfBusinessField> {
* @param stationIdList
* @return
*/
List<Map<String, Object>> getBasicInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getBasicInformation(@Param("list") List<Long> stationIdList);
/**
* 获取勘察信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getSurveyInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getSurveyInformation(@Param("list") List<Long> stationIdList);
/**
* 获取设计信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getDesignInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getDesignInformation(@Param("list") List<Long> stationIdList);
/**
* 获取商务信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getBusinessInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getBusinessInformation(@Param("list") List<Long> stationIdList);
/**
* 获取扩展信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getExtendedInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getExtendedInformation(@Param("list") List<Long> stationIdList);
/**
* 获取资料归档信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getArchivingInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getArchivingInformation(@Param("list") List<Long> stationIdList);
/**
* 获取工程信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getEngineeringInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getEngineeringInformation(@Param("list") List<Long> stationIdList);
/**
* 获取并网信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getGridInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getGridInformation(@Param("list") List<Long> stationIdList);
/**
* 获取派工单信息
* @param stationIdList
* @return
*/
List<Map<String, Object>> getDispatchOrderInformation(@Param("list") List<String> stationIdList);
List<Map<String, Object>> getDispatchOrderInformation(@Param("list") List<Long> stationIdList);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordExportDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfIcbcRecord;
import org.apache.ibatis.annotations.Mapper;
......@@ -28,4 +29,12 @@ public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordDTO> pageList(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordDTO> pageListSum(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordExportDTO> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordExportDTO> paymentAmountExport(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
}
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.IcbcExcelDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.IcbcWithhold;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.annotations.ApiParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 聚富通代扣信息表 Mapper 接口
*
* @author system_generator
* @date 2024-12-02
*/
public interface IcbcWithholdMapper extends BaseMapper<IcbcWithhold> {
public List<IcbcWithholdDto> queryForIcbcWithholdPage( String uploader, String uploadStartTime, String uploadEndTime, String uploadStatus, String confirmator, String confirmationStartTime, String confirmationEndTime,String desc, String withholdStatus,String batchNo);
public IcbcWithholdDto queryForIcbcWithholdAoumont( String uploader, String uploadStartTime, String uploadEndTime, String uploadStatus, String confirmator, String confirmationStartTime, String confirmationEndTime,String desc, String withholdStatus);
List<IcbcWithholdDto> queryForIcbcWithhold(@Param("dto") IcbcExcelDto icbcExcelDto);
List<IcbcWithholdDto> queryForIcbcWithholdBySequenceNbrs(@Param("list") List<String> sequenceNbrList);
}
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordExportDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdRecordDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.IcbcWithholdRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
*
* @author system_generator
* @date 2024-12-06
*/
public interface IcbcWithholdRecordMapper extends BaseMapper<IcbcWithholdRecord> {
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and",specific=false)
List<IcbcWithholdRecordDto> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district, String year, String month, List<String> quarters, @Param("dto")IcbcWithholdRecordDto dto);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and",specific=false)
List<IcbcWithholdRecordDto> exportData( @Param("dto")IcbcWithholdRecordDto dto);
}
......@@ -37,8 +37,9 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<JpStation> getJpStationList(@Param("dto") JpStationDto reviewDto);
@UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
List<DropDown> getRegion(String regionName);
List<DropDown> getRegion(String regionName, String address);
List<String> getRegionAddress(@Param("regionSeqList") List<String> regionSeqList);
@UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
List<DropDown> getRegionByProvince(@Param(value = "ids") List<String> ids);
......@@ -93,4 +94,12 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
@UserEmpower(field ={"hygf_jp_station.regional_companies_code"},dealerField ={"hygf_jp_station.amos_company_code","hygf_jp_station.regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<JpStationDto> queryAllPowerStation(String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type);
List<Map<String, String>> queryCompany(@Param("companyType") String companyType);
List<JpStationDto> queryStation(@Param("dto") JpStationDto reviewDto);
List<Map<String, String>> queryUnitInfo();
}
......@@ -31,7 +31,7 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
);
@UserEmpower(field={"regional_companies_code"},dealerField={"developer_code","regional_companies_code","developer_user_id"} ,fieldConditions ={"eq","in","eq"} ,relationship="and")
List<PeasantHousehold> queryForPage( String developerCode,String ownersName,Long developerId,Integer isCertified,String preparationMoneyState, String peasantHouseholdNo,String province,String isHistory,String regionalCompaniesSeq);
List<PeasantHousehold> queryForPage( String developerCode,String ownersName,Long developerId,Integer isCertified,String preparationMoneyState, String peasantHouseholdNo,String province,String isHistory,String regionalCompaniesSeq,String routhPathId);
List<Map<String,Object>> selectUserIsHouse(String telephone);
......
......@@ -25,7 +25,8 @@ public interface PowerStationMapper extends BaseMapper<PowerStation> {
@Param("projectAddress") String projectAddress,
@Param("status") String status,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
@Param("endTime") String endTime,
@Param("routhPathId")String routhPathId);
String getInstanceIdByhouseId(String peasantHouseholdId);
List<Map<String, Object>> getKcCreateTime();
......
......@@ -39,6 +39,7 @@ public interface PreparationMoneyMapper extends BaseMapper<PreparationMoney> {
@Param(value = "province") String province,
@Param(value = "projectAddress") String projectAddress,
@Param(value = "startTime") String startTime,
@Param(value = "endTime") String endTime);
@Param(value = "endTime") String endTime,
@Param(value = "routhPathId")String routhPathId);
PreparationMoney selectPreparationMoneyInfo(@Param(value = "peasantHouseholdId") String peasantHouseholdId);
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.RepaymentBatchDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.RepaymentDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PrivilegeCompany;
import com.yeejoin.amos.boot.module.hygf.api.entity.Repayment;
......@@ -27,14 +28,9 @@ public interface RepaymentMapper extends BaseMapper<Repayment> {
*/
PrivilegeCompany getPrivilegeCompanyByOrgCode(@Param("orgCode")String orgCode);
/**
* 根据角色和区域公司获取用户Id
* @param companyOrgCode
* @param roleId
* @return
*/
List<String> getTodoUserIds(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId);
List<String> getTodoTelephones(@Param("userIds") List<String> userIds);
String getSequenceNbrByName(@Param("groupName") String groupName);
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"regional_companies_code"}, fieldConditions = {"in"}, relationship = "and")
List<Repayment> getAllData(@Param("dto") RepaymentBatchDto repaymentBatchDto);
}
......@@ -16,7 +16,57 @@ import java.util.List;
public interface ToDoTasksMapper extends BaseMapper<ToDoTasks> {
List<TasksRole> getTasksRole(@Param("roleId")String roleId,@Param("orgCode")String orgCode);
List<TasksRole> getTasksRole(@Param("roleId") String roleId, @Param("orgCode") String orgCode);
String getRoleIdByName(@Param("groupName") String groupName);
/**
* 根据角色和区域公司获取用户Id
* @param companyOrgCode
* @param roleId
* @return
*/
List<String> getTodoUserIds(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId);
/**
* 根据区域公司、角色、经销商获取待办的人员
* @param companyOrgCode
* @param roleId
* @param amosOrgCode
* @return
*/
List<String> getTodoUserIdsByAmosDealer(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId, @Param("amosOrgCode") String amosOrgCode);
/**
* 过滤用户根据管理端
* @param companyOrgCode
* @param userId
* @return
*/
List<String> filterUsersByAdmin(@Param("companyOrgCode") String companyOrgCode, @Param("list") List<String> userId);
/**
* 过滤用户根据经销商端
* @param companyOrgCode
* @param amosDealerCode
* @param userId
* @return
*/
List<String> filterUsersByAmosDealer(@Param("companyOrgCode") String companyOrgCode, @Param("amosDealerCode") String amosDealerCode, @Param("list") List<String> userId);
/**
* 过滤经销商管理员
* @param amosCompanyCode
* @param userId
* @return
*/
List<String> filterUsersByAmosDealerAdmin(@Param("amosCompanyCode") String amosCompanyCode, @Param("list") List<String> userId);
/**
* 获取融资机构的待办人员
* @param companyOrgCode
* @param roleId
* @return
*/
List<String> getTodoUserIdsByRzjg(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId);
}
......@@ -21,4 +21,6 @@ public interface WorkOrderPowerStationMapper extends BaseMapper<WorkOrderPowerSt
List<Map<String, Object>> getSgCreateTime();
List<Map<String, Object>> getSgEndTime();
String getStationName(@Param("workOrderPowerStationId") Long workOrderPowerStationId);
}
......@@ -13,5 +13,5 @@ public interface IDealerReviewService {
public com.baomidou.mybatisplus.extension.plugins.pagination.Page<ReviewDto> queryForDealerReviewPage(int pageNum, int pageSize, ReviewDto reviewDto);
boolean saveDealerReview(DealerReview dealerReview, boolean flag, boolean token,String name,String meg);
boolean saveDealerReview(DealerReview dealerReview, boolean flag, boolean token,String name,String regionalCompaniesCode,String meg);
}
......@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
......@@ -13,4 +14,5 @@ import javax.servlet.http.HttpServletResponse;
* @date 2024-01-12
*/
public interface IHygfIcbcService {
Map<String,Long> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district);
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 接口类
*
* @author system_generator
* @date 2024-12-06
*/
public interface IIcbcWithholdRecordService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
import com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.IcbcWithhold;
import java.io.IOException;
/**
* 聚富通代扣信息表接口类
*
* @author system_generator
* @date 2024-12-02
*/
public interface IIcbcWithholdService {
void fileGeneration(IcbcWithhold model) throws IllegalAccessException, IOException, Exception;
void removeDataById(Long sequenceNbr, String uploader);
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.DayGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description:
* @author: tw
* @createDate: 2023/11/8
*/
public interface HourGenerateMapper extends BaseMapper<DayGenerate> {
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PowerCurveDto> getHourGeneratqx(@Param("date") String date,@Param("regionalCompaniesCode") String regionalCompaniesCode, @Param("amosCompanyCode") String amosCompanyCode, @Param("stationType") String stationType, @Param("thirdStationId") String thirdStationId,@Param("dto")List<String> statioId);
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.AllPower;
import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower;
......@@ -30,7 +31,7 @@ public interface MonthPowerMapper extends BaseMapper<MonthPower> {
List<PowerCurveDto> getYearPower(@Param("date") String month,@Param("dto")List<String> statioId);
List<PowerCurveDto> getAllPower(@Param("date") String month,@Param("dto")List<String> statioId);
List<PowerCurveDto> getDayPowercount(@Param("date") String month,@Param("dto")List<String> statioId,@Param("thirdStationId") String thirdStationId);
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"amos_company_code", "regional_companies_code"}, fieldConditions = {"eq", "in"}, relationship = "and")
List<PowerCurveDto> getDayPowercount(@Param("date") String month,@Param("regionalCompaniesCode") String regionalCompaniesCode, @Param("amosCompanyCode") String amosCompanyCode,@Param("dto")List<String> statioId,@Param("thirdStationId") String thirdStationId);
}
......@@ -33,14 +33,14 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"amos_company_code", "regional_companies_code"}, fieldConditions = {"eq", "in"}, relationship = "and")
List<TdHygfJpInverterWarnDto> selectWarnList(List<String> state, String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size, String handlerStatus, String stationName);
List<TdHygfJpInverterWarnDto> selectWarnList(List<String> state, String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size, String handlerStatus, String stationName,String isDeal);
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"amos_company_code", "regional_companies_code"}, fieldConditions = {"eq", "in"}, relationship = "and")
int selectWarnListTotal(List<String> state,String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, String handlerStatus, String stationName);
Integer selectWarnListTotal(List<String> state,String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, String handlerStatus, String stationName,String isDeal);
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"amos_company_code", "regional_companies_code"}, fieldConditions = {"eq", "in"}, relationship = "and")
int selectWarnTotal(List<String> state, String regionalCompaniesCode,
Integer selectWarnTotal(List<String> state, String regionalCompaniesCode,
String amosCompanyCode,
String thirdStationId,
String type);
......
......@@ -17,7 +17,6 @@ public class FileUtil {
InputStream fileInputStream = null;
try {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
......
package com.yeejoin.amos.boot.module.hygf.api.util;
import com.yeejoin.amos.component.robot.BadRequest;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileChannel.MapMode;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
public class FileUtils {
public byte[] getContent(String filePath) throws IOException {
......@@ -32,6 +50,74 @@ public class FileUtils {
return buffer;
}
/**
* 创建ZIP文件
*
* @param filesToZip 要打包的文件列表
* @param zipPath ZIP文件保存路径
* @throws IOException 如果I/O操作失败
*/
public static void createZipFile(List<Path> filesToZip, String zipPath) throws IOException {
try (FileOutputStream fos = new FileOutputStream(zipPath);
ZipOutputStream zos = new ZipOutputStream(fos)) {
for (Path file : filesToZip) {
FileInputStream fis = new FileInputStream(file.toFile());
ZipEntry zipEntry = new ZipEntry(file.getFileName().toString());
zos.putNextEntry(zipEntry);
byte[] bytes = new byte[1024];
int length;
while ((length = fis.read(bytes)) >= 0) {
zos.write(bytes, 0, length);
}
zos.closeEntry();
fis.close();
}
}
}
/**
*
* 创建压缩包文件
**/
public static void addFileToZip(String filePath, String zipFileName, ZipOutputStream zos) throws IOException {
File file = new File(filePath);
FileInputStream fis = new FileInputStream(file);
ZipEntry zipEntry = new ZipEntry(zipFileName);
zos.putNextEntry(zipEntry);
byte[] bytes = new byte[1024];
int length;
while ((length = fis.read(bytes)) >= 0) {
zos.write(bytes, 0, length);
}
zos.closeEntry();
fis.close();
}
public static void cleanup(Path tempDir) {
try (Stream<Path> paths = Files.walk(tempDir)) {
List<Path> filesToDelete = paths.sorted(Comparator.reverseOrder())
.collect(Collectors.toList());
// 分批删除文件
int batchSize = 100; // 根据实际情况调整批次大小
for (int i = 0; i < filesToDelete.size(); i += batchSize) {
List<Path> batch = filesToDelete.subList(i, Math.min(i + batchSize, filesToDelete.size()));
batch.forEach(file -> {
try {
Files.delete(file);
} catch (IOException e) {
e.printStackTrace();
}
});
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* the traditional io way
*
......@@ -174,4 +260,122 @@ public class FileUtils {
}
}
public static void createZipFile(Path folderPath, String zipFilePath, HttpServletResponse response) {
try (ServletOutputStream out = response.getOutputStream();
ZipOutputStream zos = new ZipOutputStream(out)) {
addFolderToZip(folderPath.toFile(), "", zos);
} catch (IOException e) {
e.printStackTrace();
}
}
private static void addFolderToZip(File folder, String parentFolder, ZipOutputStream zos) throws IOException {
File[] files = folder.listFiles();
if (files != null) {
for (File file : files) {
if (file.isDirectory()) {
addFolderToZip(file, parentFolder + file.getName() + "/", zos);
} else {
addFileToZip(file, parentFolder, zos);
}
}
}
}
private static void addFileToZip(File sourceFile, String parentFolder, ZipOutputStream zipOut) throws IOException {
FileInputStream fin = new FileInputStream(sourceFile);
String zipEntryName = parentFolder + sourceFile.getName();
zipOut.putNextEntry(new ZipEntry(zipEntryName));
byte[] buffer = new byte[1024];
int length;
while ((length = fin.read(buffer)) >= 0) {
zipOut.write(buffer, 0, length);
}
zipOut.closeEntry();
fin.close();
}
public static MultipartFile convertZipToMultipartFile(File zipFile) throws IOException {
try (FileInputStream input = new FileInputStream(zipFile)) {
return new MockMultipartFile(
zipFile.getName(), // name
zipFile.getName(), // originalFilename
"application/zip", // contentType
FileCopyUtils.copyToByteArray(input) // bytes
);
}
}
public static boolean unzipAndUpload( String localZipFilePath,HttpServletResponse response) throws Exception {
boolean success = false;
File tempDir = null;
try {
// 创建临时目录用于解压
tempDir = Files.createTempDirectory("unzip_temp_").toFile();
tempDir.deleteOnExit(); // 确保 JVM 退出时删除临时目录
// 解压本地 ZIP 文件到临时目录
unzipLocalFile(localZipFilePath, tempDir.getAbsolutePath());
// 获取解压后的文件列表
File[] files = tempDir.listFiles();
if (files == null || files.length == 0) {
throw new IOException("No files found after unzipping.");
}
createZipFile(tempDir.toPath(),tempDir.getPath(),response);
success = true;
} catch (Exception e) {
throw e;
} finally {
// 清理临时文件和断开连接
if (tempDir != null) {
com.yeejoin.amos.boot.module.hygf.api.util.FileUtils.cleanup(tempDir.toPath());
}
}
return success;
}
private static void unzipLocalFile(String zipFilePath, String destDir) throws IOException {
byte[] buffer = new byte[1024];
Path zipFilePathObj = Paths.get(zipFilePath);
Path destDirObj = Paths.get(destDir);
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFilePathObj.toFile()))) {
ZipEntry zipEntry = zis.getNextEntry();
while (zipEntry != null) {
Path newFilePath = destDirObj.resolve(zipEntry.getName());
if (!zipEntry.isDirectory()) {
// 如果是文件,则创建新文件并写入内容
Files.createDirectories(newFilePath.getParent());
try (FileOutputStream fos = new FileOutputStream(newFilePath.toFile())) {
int len;
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
}
} else {
// 如果是目录,则创建目录
Files.createDirectories(newFilePath);
}
zipEntry = zis.getNextEntry();
}
zis.closeEntry();
}
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.util;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
......@@ -16,7 +17,15 @@ package com.yeejoin.amos.boot.module.hygf.api.util;
import java.security.spec.X509EncodedKeySpec;
import org.apache.commons.codec.binary.Base64;
import org.bouncycastle.asn1.DERNull;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo;
import org.bouncycastle.asn1.pkcs.RSAPrivateKey;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.util.io.pem.PemObject;
import org.bouncycastle.util.io.pem.PemReader;
import org.springframework.core.io.ClassPathResource;
/**
* SHA256WithRSA签名、验签工具
*
......@@ -64,6 +73,25 @@ public class RSASignUtils {
return signature.sign();
}
private static byte[] convertPKCS1ToPKCS8(byte[] pkcs1Bytes) throws Exception {
// 使用 BouncyCastle 库解析 PKCS#1 格式的私钥
RSAPrivateKey pkcs1PrivKey = RSAPrivateKey.getInstance(pkcs1Bytes);
// 构建 AlgorithmIdentifier,指定了 rsaEncryption OID 和空参数
AlgorithmIdentifier algId = new AlgorithmIdentifier(
PKCSObjectIdentifiers.rsaEncryption,
DERNull.INSTANCE
);
// 构建 PKCS#8 格式的私钥信息
PrivateKeyInfo pkcs8PrivKeyInfo = new PrivateKeyInfo(algId, pkcs1PrivKey.toASN1Primitive());
// 返回 PKCS#8 格式的编码字节数组
return pkcs8PrivKeyInfo.getEncoded();
}
/**
* 验签
*
......@@ -121,7 +149,9 @@ public class RSASignUtils {
* @throws Exception
*/
public static PrivateKey loadPrivateKey(String path) throws Exception {
PemReader pemReader = new PemReader(new InputStreamReader(new FileInputStream(path)));
ClassPathResource classPathResource = new ClassPathResource(path);
PemReader pemReader = new PemReader(new InputStreamReader(classPathResource.getInputStream()));
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(pemReader.readPemObject().getContent());
pemReader.close();
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
......@@ -143,6 +173,44 @@ public class RSASignUtils {
}
/**
* 从指定路径加载并转换 PKCS#1 格式的 RSA 私钥为 PKCS#8 格式。
*
* @param path 私钥文件的路径。该文件应为 PEM 格式,并包含 PKCS#1 格式的 RSA 私钥信息。
* @return 解析并转换后的 PrivateKey 对象,用于后续的加密或签名操作。
* @throws Exception 如果读取文件、解析或转换私钥时发生错误。
*/
public static PrivateKey loadPrivateKeyNew(String path) throws Exception {
try (FileInputStream fis = new FileInputStream(path);
InputStreamReader isr = new InputStreamReader(fis);
PemReader pemReader = new PemReader(isr)) {
// 读取 PEM 文件中的对象
PemObject pemObject = pemReader.readPemObject();
if (pemObject == null) {
throw new IOException("PEM file is empty or not in the correct format: " + path);
}
// 获取编码后的私钥数据
byte[] encoded = pemObject.getContent();
// 将 PKCS#1 转换为 PKCS#8
byte[] pkcs8Key = convertPKCS1ToPKCS8(encoded);
// 创建 PKCS#8 编码规范
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(pkcs8Key);
// 获取 RSA 算法的 KeyFactory 实例,用于生成私钥对象
KeyFactory keyFactory = KeyFactory.getInstance("RSA", "BC");
// 使用 KeyFactory 和 PKCS#8 编码规范来生成并返回 PrivateKey 对象
return keyFactory.generatePrivate(pkcs8EncodedKeySpec);
} catch (IOException e) {
throw new IOException("Error reading private key from file: " + path, e);
} catch (Exception e) {
throw new Exception("Unexpected error while loading private key from file: " + path, e);
}
}
/**
* 从文件加载 PKCS8 格式的 RSA 公钥
*/
public static RSAPublicKey readPublicKeyFromFile(String path) throws Exception {
......
......@@ -47,7 +47,9 @@
newHcar on newHcar.work_order_power_station_id = hbga.work_order_power_station_id
<where>
hbga.is_delete = 0
<if test="map.routhPathId != null and map.routhPathId != ''">
and hph.sequence_nbr = #{map.routhPathId}
</if>
<if test="map.amosDealerId!=null and map.amosDealerId!=''">
and hygf_work_order.amos_dealer_id = #{map.amosDealerId}
</if>
......
......@@ -55,7 +55,9 @@
newHcgr on newHcgr.work_order_power_station_id = hbga.work_order_power_station_id
<where>
hbga.is_delete = 0
<if test="map.routhPathId != null and map.routhPathId != ''">
and hph.sequence_nbr = #{map.routhPathId}
</if>
<if test="map.amosDealerId!=null and map.amosDealerId!=''">
and hygf_work_order.amos_dealer_id = #{map.amosDealerId}
</if>
......
......@@ -30,7 +30,7 @@
and hph.project_address like concat(concat('%',#{map.province}),'%')
</if>
GROUP BY hps.peasant_household_id
ORDER BY hps.rec_date desc
ORDER BY hps.peasant_household_id desc
</select>
<select id="getBasicInformation" resultType="java.util.Map">
......
......@@ -46,6 +46,7 @@
<if test="unitInfoId != null and unitInfoId != ''">
AND u.`sequence_nbr` = #{unitInfoId}
</if>
</where>
ORDER BY u.audit_status ,u.rec_date DESC,u.sequence_nbr DESC
......
......@@ -29,6 +29,9 @@
left join hygf_financing_info hfi on hfi.peasant_household_id = hph.sequence_nbr
<where>
hph.construction_state = '验收完成'
<if test="params.routhPathId != null and params.routhPathId != ''">
and hph.sequence_nbr = #{params.routhPathId}
</if>
<if test="params.ownersName != null and params.ownersName !=''">
and hph.owners_name like concat('%',#{params.ownersName},'%')
</if>
......
......@@ -15,6 +15,9 @@
from hygf_household_contract
LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id
<where>
<if test="dto.routhPathId != null and dto.routhPathId != ''">
and hygf_household_contract.sequence_nbr = #{dto.routhPathId}
</if>
<if test="dto.status != null and dto.status !=''">
and hygf_household_contract.status = #{dto.status}
</if>
......
......@@ -100,9 +100,14 @@
ifnull( icbc.id_card, ph.id_card ) AS idCard,
ph.amos_user_id,
icbc.open_account_status,
icbc.out_user_id as outUserId,
icbc.protocol_status,
icbc.medium_id,
ph.rec_date
ph.rec_date,
ph.regional_companies_name as regionalCompaniesName,
ph.regional_companies_code as regionalCompaniesCode,
wr.paymentAmount,
wr.payment_time as paymentTime
FROM
(
SELECT
......@@ -119,6 +124,7 @@
FROM hygf_peasant_household GROUP BY amos_user_id
) ph
LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
LEFT JOIN ( SELECT amos_user_id, MAX ( payment_time ) payment_time, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record WHERE withhold_status = '成功' GROUP BY amos_user_id ) wr ON wr.amos_user_id = icbc.amos_user_id
<where>
ph.is_delete = 0
<if test="param.custName != null and param.custName != ''">
......@@ -154,4 +160,197 @@
ORDER BY
ph.rec_date DESC
</select>
<select id="pageListSum" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT
icbc.sequence_nbr,
ifnull( icbc.cust_name, ph.owners_name ) AS custName,
ifnull( icbc.phone, ph.telephone ) AS phone,
ifnull( icbc.id_card, ph.id_card ) AS idCard,
ph.amos_user_id,
icbc.open_account_status,
icbc.out_user_id as outUserId,
icbc.protocol_status,
icbc.medium_id,
ph.rec_date,
ph.regional_companies_name as regionalCompaniesName,
ph.regional_companies_code as regionalCompaniesCode,
wr.paymentAmount,
wr.payment_time as paymentTime
FROM
(
SELECT
amos_user_id,
MAX(developer_code) AS developer_code,
MAX(regional_companies_code ) AS regional_companies_code ,
MAX(is_delete) AS is_delete,
MAX(owners_name) AS owners_name,
MAX(telephone) AS telephone,
MAX(id_card) AS id_card,
MAX(regional_companies_name) AS regional_companies_name,
MAX(project_address) AS project_address,
MAX(rec_date) AS rec_date
FROM hygf_peasant_household GROUP BY amos_user_id
) ph
LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
LEFT JOIN ( SELECT amos_user_id, MAX ( payment_time ) payment_time, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record WHERE withhold_status = '成功' GROUP BY amos_user_id ) wr ON wr.amos_user_id = icbc.amos_user_id
<where>
ph.is_delete = 0
<if test="param.custName != null and param.custName != ''">
AND (ph.owners_name LIKE CONCAT('%', #{param.custName}, '%') OR icbc.cust_name LIKE CONCAT('%', #{param.custName}, '%'))
</if>
<if test="param.idCard != null and param.idCard != ''">
AND (ph.id_card LIKE CONCAT('%', #{param.idCard}, '%') OR icbc.id_card LIKE CONCAT('%', #{param.idCard}, '%'))
</if>
<if test="param.phone != null and param.phone != ''">
AND (ph.telephone LIKE CONCAT('%', #{param.phone}, '%') OR icbc.phone LIKE CONCAT('%', #{param.phone}, '%'))
</if>
<if test="param.regionalCompaniesName != null and param.regionalCompaniesName != ''">
AND ph.regional_companies_name LIKE CONCAT('%', #{param.regionalCompaniesName}, '%')
</if>
<if test="param.addressName != null and param.addressName != ''">
AND ph.project_address LIKE CONCAT('%', #{param.addressName}, '%')
</if>
<if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''">
<if test="param.openAccountStatus != '00'">
AND icbc.open_account_status = #{param.openAccountStatus}
</if>
<if test="param.openAccountStatus == '00'">
AND (icbc.open_account_status = #{param.openAccountStatus} OR icbc.open_account_status is null)
</if>
</if>
</if>
</where>
</select>
<select id="exportTotal" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordExportDTO">
SELECT
MAX(ph.owners_name) AS custName,
MAX(ph.telephone) AS phone,
MAX(ph.id_card) AS idCard,
MAX(ph.regional_companies_name) AS regionalCompaniesName,
MAX(re.medium_id) AS mediumId,
MAX(
CASE
re.protocol_status
WHEN 0 THEN
'未生效'
WHEN 1 THEN
'已生效'
WHEN 2 THEN
'过期'
WHEN 3 THEN
'作废'
WHEN 4 THEN
'待短信确认' ELSE''
END
) AS protocolStatus,
MAX( CASE re.open_account_status WHEN 02 THEN '开户成功' WHEN 03 THEN '开户失败' ELSE'未开户' END ) AS openAccountStatus,
SUM(iw.payment_amount) as paymentAmount
FROM
`hygf_peasant_household` ph
LEFT JOIN hygf_icbc_record re ON re.amos_user_id = ph.amos_user_id
LEFT JOIN hygf_icbc_withhold_record iw ON re.amos_user_id = iw.amos_user_id
<where>
<if test="developerCode != null and developerCode != ''">
AND ph.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND ph.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND ph.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND ph.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND ph.project_address LIKE CONCAT ('%',#{district},'%')
</if>
</where>
GROUP BY
ph.amos_user_id
</select>
<select id="paymentAmountExport" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordExportDTO">
SELECT
MAX(ph.owners_name) AS custName,
MAX(ph.telephone) AS phone,
MAX(ph.id_card) AS idCard,
MAX(ph.regional_companies_name) AS regionalCompaniesName,
MAX(re.medium_id) AS mediumId,
MAX(
CASE re.protocol_status
WHEN 0 THEN '未生效'
WHEN 1 THEN '已生效'
WHEN 2 THEN '过期'
WHEN 3 THEN '作废'
WHEN 4 THEN '待短信确认'
ELSE ''
END
) AS protocolStatus,
MAX(
CASE re.open_account_status
WHEN '02' THEN '开户成功'
WHEN '03' THEN '开户失败'
ELSE '未开户'
END
) AS openAccountStatus,
pa.paymentAmount AS paymentAmount,
MAX(pa.payTime) paymentTime
FROM
`hygf_peasant_household` ph
LEFT JOIN
hygf_icbc_record re ON re.amos_user_id = ph.amos_user_id
LEFT JOIN( SELECT
iw.amos_user_id,
SUM(iw.payment_amount) AS paymentAmount,
MAX(payment_time) as payTime
FROM
hygf_icbc_withhold_record iw
WHERE
iw.withhold_status = '成功'
GROUP BY
iw.amos_user_id) pa ON pa.amos_user_id = ph.amos_user_id
<where>
<if test="param.custName != null and param.custName != ''">
AND (ph.owners_name LIKE CONCAT('%', #{param.custName}, '%') OR re.cust_name LIKE CONCAT('%', #{param.custName}, '%'))
</if>
<if test="param.idCard != null and param.idCard != ''">
AND (ph.id_card LIKE CONCAT('%', #{param.idCard}, '%') OR icbc.id_card LIKE CONCAT('%', #{param.idCard}, '%'))
</if>
<if test="param.phone != null and param.phone != ''">
AND (ph.telephone LIKE CONCAT('%', #{param.phone}, '%') OR icbc.phone LIKE CONCAT('%', #{param.phone}, '%'))
</if>
<if test="param.regionalCompaniesName != null and param.regionalCompaniesName != ''">
AND ph.regional_companies_name LIKE CONCAT('%', #{param.regionalCompaniesName}, '%')
</if>
<if test="param.addressName != null and param.addressName != ''">
AND ph.project_address LIKE CONCAT('%', #{param.addressName}, '%')
</if>
<if test="param.ids != null and param.ids.size() > 0">
AND ph.amos_user_id in
<foreach collection="param.ids" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''">
<if test="param.openAccountStatus != '00'">
AND re.open_account_status = #{param.openAccountStatus}
</if>
<if test="param.openAccountStatus == '00'">
AND (re.open_account_status = #{param.openAccountStatus} OR re.open_account_status is null)
</if>
</if>
</if>
</where>
GROUP BY
ph.amos_user_id, pa.paymentAmount
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.IcbcWithholdMapper">
<select id="queryForIcbcWithholdPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdDto">
select *,
content as desc
from hygf_icbc_withhold
<where>
is_delete = 0
<if test="uploader != null and uploader != ''">
and uploader like concat('%',#{uploader},'%')
</if>
<if test="uploadStartTime != null and uploadStartTime != ''">
and upload_time > #{uploadStartTime}
</if>
<if test="uploadEndTime != null and uploadEndTime != ''">
and upload_time <![CDATA[<]]> #{uploadEndTime}
</if>
<if test="uploadStatus != null and uploadStatus != ''">
and upload_status = #{uploadStatus}
</if>
<if test="withholdStatus != null and withholdStatus != ''">
and withhold_status = #{withholdStatus}
</if>
<if test="confirmator != null and confirmator != ''">
and confirmator like concat('%',#{confirmator},'%')
</if>
<if test="desc != null and desc != ''">
and content like concat('%',#{desc},'%')
</if>
<if test="confirmationStartTime != null and confirmationStartTime != ''">
and confirmation_time > #{confirmationStartTime}
</if>
<if test="confirmationEndTime != null and confirmationEndTime != ''">
and confirmation_time <![CDATA[<]]> #{confirmationEndTime}
</if>
<if test="batchNo != null and batchNo != ''">
and batch_no like concat ('%',#{batchNo},'%')
</if>
</where>
order by hygf_icbc_withhold.sequence_nbr desc
</select>
<select id="queryForIcbcWithholdAoumont" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdDto">
select sum(payment_amount) paymentAmount
from hygf_icbc_withhold
<where>
is_delete = 0
<if test="uploader != null and uploader != ''">
and uploader like concat('%',#{uploader},'%')
</if>
<if test="uploadStartTime != null and uploadStartTime != ''">
and upload_time > #{uploadStartTime}
</if>
<if test="uploadEndTime != null and uploadEndTime != ''">
and upload_time <![CDATA[<]]> #{uploadEndTime}
</if>
<if test="uploadStatus != null and uploadStatus != ''">
and upload_status = #{uploadStatus}
</if>
<if test="withholdStatus != null and withholdStatus != ''">
and withhold_status = #{withholdStatus}
</if>
<if test="confirmator != null and confirmator != ''">
and confirmator like concat('%',#{confirmator},'%')
</if>
<if test="desc != null and desc != ''">
and content like concat('%',#{desc},'%')
</if>
<if test="confirmationStartTime != null and confirmationStartTime != ''">
and confirmation_time > #{confirmationStartTime}
</if>
<if test="confirmationEndTime != null and confirmationEndTime != ''">
and confirmation_time <![CDATA[<]]> #{confirmationEndTime}
</if>
</where>
</select>
<select id="queryForIcbcWithhold" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdDto">
select *,
content as desc
from hygf_icbc_withhold
<where>
is_delete = 0
<if test="dto.uploader != null and dto.uploader != ''">
and uploader like concat('%',#{dto.uploader},'%')
</if>
<if test="dto.uploadStartTime != null and dto.uploadStartTime != ''">
and upload_time > #{dto.uploadStartTime}
</if>
<if test="dto.uploadEndTime != null and dto.uploadEndTime != ''">
and upload_time <![CDATA[<]]> #{dto.uploadEndTime}
</if>
<if test="dto.uploadStatus != null and dto.uploadStatus != ''">
and upload_status = #{dto.uploadStatus}
</if>
<if test="dto.withholdStatus != null and dto.withholdStatus != ''">
and withhold_status = #{dto.withholdStatus}
</if>
<if test="dto.confirmator != null and dto.confirmator != ''">
and confirmator like concat('%',#{dto.confirmator},'%')
</if>
<if test="dto.desc != null and dto.desc != ''">
and content like concat('%',#{dto.desc},'%')
</if>
<if test="dto.confirmationStartTime != null and dto.confirmationStartTime != ''">
and confirmation_time > #{dto.confirmationStartTime}
</if>
<if test="dto.confirmationEndTime != null and dto.confirmationEndTime != ''">
and confirmation_time <![CDATA[<]]> #{dto.confirmationEndTime}
</if>
</where>
order by hygf_icbc_withhold.sequence_nbr desc
</select>
<select id="queryForIcbcWithholdBySequenceNbrs"
resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdDto">
select *,
content as desc
from hygf_icbc_withhold
<where>
sequence_nbr in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</where>
order by hygf_icbc_withhold.sequence_nbr desc
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.IcbcWithholdRecordMapper">
<!-- <select id="exportTotal" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdRecordDto">-->
<!-- SELECT-->
<!-- re.*-->
<!-- FROM hygf_icbc_withhold_record re-->
<!-- LEFT JOIN `hygf_peasant_household` ph ON re.amos_user_id = ph.amos_user_id-->
<!-- <where>-->
<!-- <if test="developerCode != null and developerCode != ''">-->
<!-- AND ph.developer_code = #{developerCode}-->
<!-- </if>-->
<!-- <if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">-->
<!-- AND ph.regional_companies_code = #{regionalCompaniesCode}-->
<!-- </if>-->
<!-- <if test="province != null and province != ''">-->
<!-- AND ph.project_address LIKE CONCAT ('%',#{province},'%')-->
<!-- </if>-->
<!-- <if test="city != null and city != ''">-->
<!-- AND ph.project_address LIKE CONCAT ('%',#{city},'%')-->
<!-- </if>-->
<!-- <if test="district != null and district != ''">-->
<!-- AND ph.project_address LIKE CONCAT ('%',#{district},'%')-->
<!-- </if>-->
<!-- <if test="year != null and year != ''">-->
<!-- AND EXTRACT(YEAR FROM re.withhold_time) = #{year}-->
<!-- </if>-->
<!-- <if test="month != null and month != ''">-->
<!-- AND EXTRACT(MONTH FROM re.withhold_time) = #{month}-->
<!-- </if>-->
<!-- <if test="quarter != null and quarter.size() > 1">-->
<!-- AND ph.withhold_time BETWEEN <foreach collection="quarter" item="item" separator="and">-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="dto.amosUserId != null and dto.amosUserId != ''">-->
<!-- AND re.amos_user_id = #{dto.amosUserId}-->
<!-- </if>-->
<!-- <if test="dto.batchNo != null and dto.batchNo != ''">-->
<!-- AND re.batch_no = #{dto.batchNo}-->
<!-- </if>-->
<!-- <if test="dto.paymentStartTime != null and dto.paymentStartTime != ''">-->
<!-- AND re.payment_time > #{dto.paymentStartTime}-->
<!-- </if>-->
<!-- <if test="dto.paymentEndTime != null and dto.paymentEndTime != ''">-->
<!-- AND re.payment_time &amp;lt #{dto.paymentEndTime}-->
<!-- </if>-->
<!-- </where>-->
<!-- GROUP BY-->
<!-- re.sequence_nbr-->
<!-- </select>-->
<select id="exportTotal" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdRecordDto">
SELECT
re.*
FROM
(
SELECT
amos_user_id,
MAX(developer_code) AS developer_code,
MAX(regional_companies_code ) AS regional_companies_code ,
MAX(is_delete) AS is_delete,
MAX(owners_name) AS owners_name,
MAX(telephone) AS telephone,
MAX(id_card) AS id_card,
MAX(regional_companies_name) AS regional_companies_name,
MAX(project_address) AS project_address,
MAX(rec_date) AS rec_date
FROM hygf_peasant_household GROUP BY amos_user_id
) ph
LEFT JOIN hygf_icbc_withhold_record re ON ph.amos_user_id = re.amos_user_id
<where>
ph.is_delete = 0 AND re.withhold_status in ('成功','失败')
<if test="developerCode != null and developerCode != ''">
AND ph.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND ph.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND ph.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND ph.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND ph.project_address LIKE CONCAT ('%',#{district},'%')
</if>
<if test="year != null and year != ''">
AND EXTRACT(YEAR FROM re.withhold_time) = #{year}
</if>
<if test="month != null and month != ''">
AND TO_CHAR(re.withhold_time, 'YYYY-MM') = #{month}
</if>
<if test="quarters != null and quarters.size() > 1">
AND TO_CHAR(re.withhold_time, 'YYYY-MM') in <foreach collection="quarters" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="dto.amosUserId != null and dto.amosUserId != ''">
AND re.amos_user_id = #{dto.amosUserId}
</if>
<if test="dto.batchNo != null and dto.batchNo != ''">
AND re.batch_no like concat('%',#{dto.batchNo},'%')
</if>
<if test="dto.withholdStatus != null and dto.withholdStatus != ''">
AND re.withhold_status = #{dto.withholdStatus}
</if>
<if test="dto.paymentStartTime != null and dto.paymentStartTime != ''">
AND re.payment_time > #{dto.paymentStartTime}
</if>
<if test="dto.paymentEndTime != null and dto.paymentEndTime != ''">
AND re.payment_time <![CDATA[<]]> #{dto.paymentEndTime}
</if>
</where>
ORDER BY
re.rec_date DESC
</select>
<select id="exportData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdRecordDto">
SELECT
re.*
FROM
(
SELECT
amos_user_id,
MAX(developer_code) AS developer_code,
MAX(regional_companies_code ) AS regional_companies_code ,
MAX(is_delete) AS is_delete,
MAX(owners_name) AS owners_name,
MAX(telephone) AS telephone,
MAX(id_card) AS id_card,
MAX(regional_companies_name) AS regional_companies_name,
MAX(project_address) AS project_address,
MAX(rec_date) AS rec_date
FROM hygf_peasant_household GROUP BY amos_user_id
) ph
LEFT JOIN hygf_icbc_withhold_record re ON ph.amos_user_id = re.amos_user_id
<where>
ph.is_delete = 0
<if test="dto.amosUserId != null and dto.amosUserId != ''">
AND re.amos_user_id = #{dto.amosUserId}
</if>
<if test="dto.show != null and dto.show != ''">
AND re.withhold_status in ('成功','失败')
</if>
<if test="dto.batchNo != null and dto.batchNo != ''">
AND re.batch_no like concat('%',#{dto.batchNo},'%')
</if>
<if test="dto.withholdStatus != null and dto.withholdStatus != ''">
AND re.withhold_status = #{dto.withholdStatus}
</if>
<if test="dto.paymentStartTime != null and dto.paymentStartTime != ''">
AND re.payment_time > #{dto.paymentStartTime}
</if>
<if test="dto.paymentEndTime != null and dto.paymentEndTime != ''">
AND re.payment_time <![CDATA[<]]> #{dto.paymentEndTime}
</if>
</where>
ORDER BY
re.rec_date DESC
</select>
</mapper>
This diff is collapsed.
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