接口联调
This commit is contained in:
@@ -57,6 +57,8 @@ public class Version extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private byte[] file;
|
private byte[] file;
|
||||||
|
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端程序版本状态(0-停用 1-启用)
|
* 终端程序版本状态(0-停用 1-启用)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ public class VersionVO implements Serializable {
|
|||||||
@ApiModelProperty("终端程序版本状态(0-停用 1-启用)")
|
@ApiModelProperty("终端程序版本状态(0-停用 1-启用)")
|
||||||
private Integer versionFlag;
|
private Integer versionFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,9 +57,10 @@ public class ProgramVersionController extends BaseController {
|
|||||||
@RequestParam("devType") String devType,
|
@RequestParam("devType") String devType,
|
||||||
@RequestParam("remark") String remark,
|
@RequestParam("remark") String remark,
|
||||||
@RequestParam(value = "versionType",required = false) String versionType,
|
@RequestParam(value = "versionType",required = false) String versionType,
|
||||||
|
@RequestParam("filename") String fileName,
|
||||||
@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file) {
|
@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file) {
|
||||||
String methodDescribe = getMethodDescribe("addProgramVersion");
|
String methodDescribe = getMethodDescribe("addProgramVersion");
|
||||||
boolean res = programService.addProgramVersion(name,protocol,date,devType,remark,versionType,file);
|
boolean res = programService.addProgramVersion(name,protocol,date,devType,remark,versionType,fileName,file);
|
||||||
if (res) {
|
if (res) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
@@ -91,9 +92,10 @@ public class ProgramVersionController extends BaseController {
|
|||||||
@RequestParam("devType") String devType,
|
@RequestParam("devType") String devType,
|
||||||
@RequestParam("remark") String remark,
|
@RequestParam("remark") String remark,
|
||||||
@RequestParam(value = "versionType",required = false) String versionType,
|
@RequestParam(value = "versionType",required = false) String versionType,
|
||||||
|
@RequestParam("filename") String fileName,
|
||||||
@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file) {
|
@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file) {
|
||||||
String methodDescribe = getMethodDescribe("updateProgramVersion");
|
String methodDescribe = getMethodDescribe("updateProgramVersion");
|
||||||
boolean res = programService.updateProgramVersion(id,name,protocol,date,devType,remark,versionType,file);
|
boolean res = programService.updateProgramVersion(id,name,protocol,date,devType,remark,versionType,fileName,file);
|
||||||
if (res) {
|
if (res) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
A.`Update_Time` updateTime,
|
A.`Update_Time` updateTime,
|
||||||
A.`Remark` remark,
|
A.`Remark` remark,
|
||||||
A.`Version_Type` versionType,
|
A.`Version_Type` versionType,
|
||||||
A.`Version_Flag` versionFlag
|
A.`Version_Flag` versionFlag,
|
||||||
|
A.`File_Name` fileName
|
||||||
FROM
|
FROM
|
||||||
cld_version A,
|
cld_version A,
|
||||||
sys_dict_data B,
|
sys_dict_data B,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public interface ProgramVersionService {
|
|||||||
* 新增程序版本管理信息
|
* 新增程序版本管理信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean addProgramVersion(String name, String protocol, LocalDate date, String devType, String remark, String versionType, MultipartFile file);
|
boolean addProgramVersion(String name, String protocol, LocalDate date, String devType, String remark, String versionType,String fileName, MultipartFile file);
|
||||||
/**
|
/**
|
||||||
* 版本文件是否存在
|
* 版本文件是否存在
|
||||||
* @return
|
* @return
|
||||||
@@ -32,7 +32,7 @@ public interface ProgramVersionService {
|
|||||||
* 修改程序版本管理信息
|
* 修改程序版本管理信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean updateProgramVersion(String id, String name, String protocol, LocalDate date, String devType, String remark, String versionType, MultipartFile file);
|
boolean updateProgramVersion(String id, String name, String protocol, LocalDate date, String devType, String remark, String versionType,String fileName, MultipartFile file);
|
||||||
/**
|
/**
|
||||||
* 修改程序版本状态
|
* 修改程序版本状态
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addProgramVersion(String name, String protocol, LocalDate date, String devType, String remark, String versionType, MultipartFile file) {
|
public boolean addProgramVersion(String name, String protocol, LocalDate date, String devType, String remark, String versionType, String fileName,MultipartFile file) {
|
||||||
check(null,name,false);
|
check(null,name,false);
|
||||||
Version version = new Version();
|
Version version = new Version();
|
||||||
version.setName(name);
|
version.setName(name);
|
||||||
@@ -90,7 +90,7 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
version.setFile(b);
|
version.setFile(b);
|
||||||
|
version.setFileName(fileName);
|
||||||
version.setVersionFlag(DataStateEnum.ENABLE.getCode());
|
version.setVersionFlag(DataStateEnum.ENABLE.getCode());
|
||||||
version.setState(DataStateEnum.ENABLE.getCode());
|
version.setState(DataStateEnum.ENABLE.getCode());
|
||||||
version.setCreateBy(RequestUtil.getUserIndex());
|
version.setCreateBy(RequestUtil.getUserIndex());
|
||||||
@@ -108,7 +108,7 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateProgramVersion(String id, String name, String protocol, LocalDate date, String devType, String remark, String versionType, MultipartFile file) {
|
public boolean updateProgramVersion(String id, String name, String protocol, LocalDate date, String devType, String remark, String versionType, String fileName,MultipartFile file) {
|
||||||
check(id,name,true);
|
check(id,name,true);
|
||||||
Version version = new Version();
|
Version version = new Version();
|
||||||
version.setId(id);
|
version.setId(id);
|
||||||
@@ -129,9 +129,9 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
version.setFile(b);
|
version.setFile(b);
|
||||||
|
version.setFileName(fileName);
|
||||||
version.setUpdateBy(RequestUtil.getUserIndex());
|
version.setUpdateBy(RequestUtil.getUserIndex());
|
||||||
version.setUpdateTime(LocalDateTime.now());
|
version.setUpdateTime(LocalDateTime.now());
|
||||||
|
|
||||||
versionMapper.updateById(version);
|
versionMapper.updateById(version);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.time.LocalDate;
|
||||||
import java.util.Calendar;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -19,12 +18,10 @@ public class DeviceAbnormalStatisticsJob {
|
|||||||
@XxlJob("deviceAbnormalStatisticsJob")
|
@XxlJob("deviceAbnormalStatisticsJob")
|
||||||
public void deviceAbnormalStatisticsJob (){
|
public void deviceAbnormalStatisticsJob (){
|
||||||
// System.out.println("朱鑫宇定时任务");
|
// System.out.println("朱鑫宇定时任务");
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
String time = LocalDate.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
String format = formatter.format(Calendar.getInstance().getTime());
|
log.info("执行日期deviceAbnormalStatisticsJob===============>"+time);
|
||||||
System.out.println(format);
|
|
||||||
log.info("执行日期deviceAbnormalStatisticsJob===============>"+format);
|
|
||||||
DeviceAbnormaStatisticsParam param =new DeviceAbnormaStatisticsParam();
|
DeviceAbnormaStatisticsParam param =new DeviceAbnormaStatisticsParam();
|
||||||
param.setTime(formatter.format(Calendar.getInstance().getTime()));
|
param.setTime(time);
|
||||||
deviceAbnormalFeignClient.dailyDeviceAbnormaStatistics(param);
|
deviceAbnormalFeignClient.dailyDeviceAbnormaStatistics(param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user