UID下载修改

master
hongtianzai 4 years ago
parent f8b557ee7e
commit b46bc21588

@ -3,6 +3,7 @@ package com.glxp.udidl.admin.controller.device;
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
import com.glxp.udidl.admin.service.DataSync.DeviceSyncService;
import com.glxp.udidl.common.res.BaseResponse;
import com.glxp.udidl.common.util.ResultVOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,15 +24,16 @@ public class UdidlDeviceController {
@GetMapping("udidl/device/dlByDays")
public BaseResponse dlByDays(@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
logger.info("---按日期段下载");
return deviceSyncService.downloadUdi(startDate, endDate);
deviceSyncService.downloadUdi(startDate, endDate);
return ResultVOUtils.success("后台已开始下载!");
}
@AuthRuleAnnotation("udidl_udidlDevice_all")
@GetMapping("udidl/device/dlByDay")
public String dlByDay(String day) {
public BaseResponse dlByDay(String day) {
logger.info(day + "---按天开启下载");
deviceSyncService.downloadUdi(day,"manual");
//asyncDownloadTask.downloadByDay(day);
return "ok";
return ResultVOUtils.success("后台已开始下载!");
}
@AuthRuleAnnotation("udidl_udidlDevice_all")
@PostMapping("udidl/device/dlByDi")

@ -17,4 +17,5 @@ public interface UdplatGoodsMatchMapper {
int updateByPrimaryKey(UdplatGoodsMatch record);
UdplatGoodsMatch selectByDeviceRecordKey(String id);
//List<UdplatGoodsMatchListModel> getList()
}

@ -12,6 +12,7 @@ import com.glxp.udidl.common.res.BaseResponse;
import com.glxp.udidl.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -127,6 +128,7 @@ public class DeviceSyncService {
jobLogService.insert(jobLog);
}
}*/
@Async
public void downloadUdi(String day,String downloadType){
try
{
@ -151,17 +153,23 @@ public class DeviceSyncService {
* @param endDate
* @return
*/
@Async
public BaseResponse downloadUdi(Date startDate, Date endDate){
if(startDate.getTime() > endDate.getTime())
return ResultVOUtils.error(-1,"起始日期不能大于结束日期!");
Date fdate=startDate;
for (int i=0;fdate.getTime()<=endDate.getTime();i++){
while (fdate.getTime()<=endDate.getTime()){
String day=DateUtil.formatDate(fdate);
downloadUdi(day,"manual");
fdate = DateUtil.addDays(fdate,1);
}
/*for (int i=0;fdate.getTime()<=endDate.getTime();i++){
String day=DateUtil.formatDate(fdate);
downloadUdi(day,"manual");
//System.out.println(fdate);
i++;
fdate = DateUtil.addDays(fdate,1);
}
}*/
return ResultVOUtils.success("执行完成,详情请查看日志!");
}
public BaseResponse downloadByDi(String deviceId){

@ -13,10 +13,10 @@ import java.util.TreeMap;
@Service
public class UdplatDownloadService {
private String host="http://120.32.125.20";//"http://pre.udplat.org/deal";
private String appId="10000090";
private String secretKey="XTMNpBExNF66bS4";
private String userName="诏安县医院";
private String host="http://pre.udplat.org";//"http://pre-mcs.udplat.org";//"http://120.32.125.20";//"http://pre.udplat.org/deal";
private String appId="20004072";
private String secretKey="hoGxLSEsSyysnS9";
private String userName="漳州片仔癀诊断";
private long getTime(){
return System.currentTimeMillis();
}

@ -15,7 +15,6 @@ cors.allowed-methods=GET,POST,OPTIONS
UDIC_MIPSDOWNLOAD_URL = http://127.0.0.1:8080/UDIC_MIPSDL_Server
#UDIC_MIPSDOWNLOAD_URL=http://127.0.0.1:9997
config.downloadPath=E:/temp
config.openAuth=true
config.
config.openAuth=false
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=1000MB

@ -15,7 +15,6 @@ cors.allowed-methods=GET,POST,OPTIONS
UDIC_MIPSDOWNLOAD_URL = http://127.0.0.1:8080/UDIC_MIPSDL_Server
#UDIC_MIPSDOWNLOAD_URL=http://127.0.0.1:9997
config.downloadPath=E:/temp
config.openAuth=true
config.
config.openAuth=false
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=1000MB
Loading…
Cancel
Save