|
|
|
@ -5,7 +5,6 @@ import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.config.WebSocketServer;
|
|
|
|
|
import com.glxp.api.constant.BasicProcessStatus;
|
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
|
import com.glxp.api.entity.sync.SyncDataSetEntity;
|
|
|
|
@ -20,6 +19,7 @@ import com.glxp.api.service.sync.SyncDataSetService;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
|
import com.glxp.api.util.ExcelUtil;
|
|
|
|
|
import com.glxp.api.util.RedisUtil;
|
|
|
|
|
import org.java_websocket.server.WebSocketServer;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -45,7 +45,7 @@ public class ThrCorpsDlService {
|
|
|
|
|
ThrCorpExportLogService thrCorpExportLogService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ThrCorpImportDetailService thrCorpImportDetailService;
|
|
|
|
|
// @Value("${SPSYNC_IP}")
|
|
|
|
|
// @Value("${SPSYNC_IP}")
|
|
|
|
|
// private String spsSyncUrl;
|
|
|
|
|
@Resource
|
|
|
|
|
ErpBasicClient erpBasicClient;
|
|
|
|
@ -66,7 +66,7 @@ public class ThrCorpsDlService {
|
|
|
|
|
public void importSelectCorps(String genKey, List<ThrCorpsResponse> thrCorpsResponseList, String thirdSys) {
|
|
|
|
|
ThrSystemDetailEntity piDetailEntity = thrSystemDetailService.selectByKey("corpUrl", thirdSys);
|
|
|
|
|
if (piDetailEntity == null || piDetailEntity.getValue() == null) {
|
|
|
|
|
WebSocketServer.sendInfo("往来单位接口未设置!", "sid");
|
|
|
|
|
// WebSocketServer.sendInfo("往来单位接口未设置!", "sid");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ThrCorpImportLogEntity thrProductsImportLogEntity = thrCorpImportLogService.selectByGenKey(genKey);
|
|
|
|
@ -107,7 +107,7 @@ public class ThrCorpsDlService {
|
|
|
|
|
|
|
|
|
|
thrCorpService.insertThrCorpss(thrCorpEntities);
|
|
|
|
|
redisUtil.set(Constant.dlThrProducts, "false");
|
|
|
|
|
WebSocketServer.sendInfo("往来单位信息下载已完成,请刷新查看!", "sid");
|
|
|
|
|
// WebSocketServer.sendInfo("往来单位信息下载已完成,请刷新查看!", "sid");
|
|
|
|
|
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
|
|
|
|
|
thrProductsImportLogEntity.setUpdateTime(new Date());
|
|
|
|
|
thrCorpImportLogService.updateImportLog(thrProductsImportLogEntity);
|
|
|
|
@ -119,7 +119,7 @@ public class ThrCorpsDlService {
|
|
|
|
|
public void importCorps(String genKey, ThrUnitMaintainFilterRequest thrUnitMaintainFilterRequest, String thirdSys) {
|
|
|
|
|
ThrSystemDetailEntity piDetailEntity = thrSystemDetailService.selectByKey("corpUrl", thirdSys);
|
|
|
|
|
if (piDetailEntity == null || piDetailEntity.getValue() == null) {
|
|
|
|
|
WebSocketServer.sendInfo("往来单位接口未设置!", "sid");
|
|
|
|
|
// WebSocketServer.sendInfo("往来单位接口未设置!", "sid");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ThrCorpImportLogEntity thrProductsImportLogEntity = thrCorpImportLogService.selectByGenKey(genKey);
|
|
|
|
@ -147,7 +147,7 @@ public class ThrCorpsDlService {
|
|
|
|
|
thrCorpService.insertThrCorpss(data);
|
|
|
|
|
}
|
|
|
|
|
redisUtil.set(Constant.dlThrProducts, "false");
|
|
|
|
|
WebSocketServer.sendInfo("往来单位信息下载已完成,请刷新查看!", "sid");
|
|
|
|
|
// WebSocketServer.sendInfo("往来单位信息下载已完成,请刷新查看!", "sid");
|
|
|
|
|
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
|
|
|
|
|
thrProductsImportLogEntity.setUpdateTime(new Date());
|
|
|
|
|
thrCorpImportLogService.updateImportLog(thrProductsImportLogEntity);
|
|
|
|
@ -353,9 +353,9 @@ public class ThrCorpsDlService {
|
|
|
|
|
public List<List<String>> genExcelData(FilterThrCorpRequest filterThrOrderRequest) {
|
|
|
|
|
|
|
|
|
|
List<List<String>> excelData = new ArrayList<>();
|
|
|
|
|
List<ThrCorpEntity> thrCorpEntityList=new ArrayList<>();
|
|
|
|
|
List<ThrCorpEntity> thrCorpEntityList = new ArrayList<>();
|
|
|
|
|
List<ThrCorpsResponse> thrCorpsResponseList = thrCorpService.filterThrCorps(filterThrOrderRequest);
|
|
|
|
|
if(thrCorpsResponseList.size()>0){
|
|
|
|
|
if (thrCorpsResponseList.size() > 0) {
|
|
|
|
|
thrCorpEntityList = thrCorpsResponseList.stream().map(
|
|
|
|
|
item -> {
|
|
|
|
|
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();
|
|
|
|
@ -419,12 +419,12 @@ public class ThrCorpsDlService {
|
|
|
|
|
exportData.addAll(thrCorpEntities);
|
|
|
|
|
} else {
|
|
|
|
|
//根据查询条件一键导出数据库往来单位
|
|
|
|
|
List<ThrCorpEntity> thrCorpEntityList=new ArrayList<>();
|
|
|
|
|
List<ThrCorpEntity> thrCorpEntityList = new ArrayList<>();
|
|
|
|
|
FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest();
|
|
|
|
|
BeanUtils.copyProperties(thrCorpExportRequest, filterThrCorpRequest);
|
|
|
|
|
filterThrCorpRequest.setPage(null);
|
|
|
|
|
List<ThrCorpsResponse> thrCorpsResponseList = thrCorpService.filterThrCorps(filterThrCorpRequest);
|
|
|
|
|
if(thrCorpsResponseList.size()>0){
|
|
|
|
|
if (thrCorpsResponseList.size() > 0) {
|
|
|
|
|
thrCorpEntityList = thrCorpsResponseList.stream().map(
|
|
|
|
|
item -> {
|
|
|
|
|
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();
|
|
|
|
@ -476,12 +476,12 @@ public class ThrCorpsDlService {
|
|
|
|
|
exportData.addAll(thrCorpEntities);
|
|
|
|
|
} else {
|
|
|
|
|
//根据查询条件一键导出数据库往来单位
|
|
|
|
|
List<ThrCorpEntity> thrCorpEntityList=new ArrayList<>();
|
|
|
|
|
List<ThrCorpEntity> thrCorpEntityList = new ArrayList<>();
|
|
|
|
|
FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest();
|
|
|
|
|
BeanUtils.copyProperties(thrCorpExportRequest, filterThrCorpRequest);
|
|
|
|
|
filterThrCorpRequest.setPage(null);
|
|
|
|
|
List<ThrCorpsResponse> thrCorpsResponseList = thrCorpService.filterThrCorps(filterThrCorpRequest);
|
|
|
|
|
if(thrCorpsResponseList.size()>0){
|
|
|
|
|
if (thrCorpsResponseList.size() > 0) {
|
|
|
|
|
thrCorpEntityList = thrCorpsResponseList.stream().map(
|
|
|
|
|
item -> {
|
|
|
|
|
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();
|
|
|
|
|