|
|
|
@ -27,7 +27,7 @@ import java.util.UUID;
|
|
|
|
|
public class UpgradeServiceImpl implements UpgradeService {
|
|
|
|
|
|
|
|
|
|
@Value("${maintain.apk}")
|
|
|
|
|
private String path;
|
|
|
|
|
private String apkpath;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
MntnUpgradesMapper mapper;
|
|
|
|
@ -52,7 +52,7 @@ public class UpgradeServiceImpl implements UpgradeService {
|
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
|
String ext = StringUtils.getFilenameExtension(fileName);
|
|
|
|
|
String path = DateUtil.format(new Date(), "yyyyMMdd") + "_upd_"
|
|
|
|
|
+ UUID.randomUUID().toString().substring(0, 13);
|
|
|
|
|
+ UUID.randomUUID().toString().replace("-", "").substring(0, 13);
|
|
|
|
|
if (StringUtils.hasLength(ext)) {
|
|
|
|
|
path = path + "." + ext;
|
|
|
|
|
}
|
|
|
|
@ -62,7 +62,7 @@ public class UpgradeServiceImpl implements UpgradeService {
|
|
|
|
|
item.setCreateTime(new Date());
|
|
|
|
|
item.setUpdateTime(new Date());
|
|
|
|
|
|
|
|
|
|
File dest = new File(path + "/" + path);
|
|
|
|
|
File dest = new File(apkpath + "/" + path);
|
|
|
|
|
file.transferTo(dest);
|
|
|
|
|
mapper.insert(item);
|
|
|
|
|
return true;
|
|
|
|
@ -76,7 +76,7 @@ public class UpgradeServiceImpl implements UpgradeService {
|
|
|
|
|
}
|
|
|
|
|
record.setTitle(item.getTitle());
|
|
|
|
|
record.setUpdateTime(new Date());
|
|
|
|
|
mapper.updateByPrimaryKey(record);
|
|
|
|
|
mapper.updateByPrimaryKeySelective(record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|