Commit 2a677b7d authored by 刘文胜's avatar 刘文胜

更新member status

parent 0fc65ba4
......@@ -138,6 +138,22 @@ public class KolonMemberServiceImpl implements KolonMemberService {
kolonMember.lastName = kolonMemberDTO.lastName;
flag = true;
}
if (!Util.isNotNull(kolonMemberDTO.status)) {
kolonMember.status = kolonMemberDTO.status;
flag = true;
}
if (!Util.isNotNull(kolonMemberDTO.bonus)) {
kolonMember.bonus = kolonMemberDTO.bonus;
flag = true;
}
if (!Util.isNotNull(kolonMemberDTO.lifecycle)) {
kolonMember.lifecycle = kolonMemberDTO.lifecycle;
flag = true;
}
if (!Util.isNotNull(kolonMemberDTO.customerType)) {
kolonMember.customerType = kolonMemberDTO.customerType;
flag = true;
}
if (flag) {
kolonMember.updateTime = new Date();
this.save(kolonMember);
......
......@@ -110,6 +110,12 @@ public class FtpMemberUtil {
throw new RuntimeException("FTP server refused connection.");
}
} catch (Throwable e) {
if(ftpClient!=null){
try {
ftpClient.disconnect();
} catch (IOException e2) {
}
}
throw new RuntimeException(e);
}
return ftpClient;
......@@ -161,7 +167,7 @@ public class FtpMemberUtil {
String name = fileName
.substring(0, fileName.lastIndexOf("."));
String newFileName = name + "_" + getTime() + suffix;
ftpClient.mkd(getFileHistoryDir);
ftpClient.rename(getFileDir + fileName, getFileHistoryDir
+ newFileName);
} catch (Throwable e) {
......@@ -205,9 +211,10 @@ public class FtpMemberUtil {
* 上传文件到FTP服务器
*/
public void uploadFile() {
FTPClient ftpClient = null;
try {
SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd");
FTPClient ftpClient = this.getFTPClient();
ftpClient = this.getFTPClient();
ftpClient.mkd(putFileDir);
ftpClient.changeWorkingDirectory(putFileDir);
InputStream addInputStream = new FileInputStream(new File(
......@@ -219,6 +226,14 @@ public class FtpMemberUtil {
ftpClient.storeFile(putUpdateFileName.replace("YYYY-MM-dd",sdf.format(new Date())), updateInputStream);
} catch (Throwable e) {
throw new RuntimeException(e);
}finally{
if(ftpClient!=null){
try {
ftpClient.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
......
......@@ -70,6 +70,12 @@ public class FtpProductUtil {
throw new RuntimeException("FTP server refused connection.");
}
} catch (Throwable e) {
if(ftpClient!=null){
try {
ftpClient.disconnect();
} catch (IOException e2) {
}
}
throw new RuntimeException(e);
}
return ftpClient;
......@@ -122,7 +128,7 @@ public class FtpProductUtil {
String name = fileName
.substring(0, fileName.lastIndexOf("."));
String newFileName = name + "_" + getTime() + suffix;
ftpClient.mkd(getFileHistoryDir);
ftpClient.rename(getFileDir + fileName, getFileHistoryDir
+ newFileName);
} catch (Throwable e) {
......
......@@ -70,6 +70,12 @@ public class FtpSaleUtil {
throw new RuntimeException("FTP server refused connection.");
}
} catch (Throwable e) {
if(ftpClient!=null){
try {
ftpClient.disconnect();
} catch (IOException e2) {
}
}
throw new RuntimeException(e);
}
return ftpClient;
......@@ -122,7 +128,7 @@ public class FtpSaleUtil {
String name = fileName
.substring(0, fileName.lastIndexOf("."));
String newFileName = name + "_" + getTime() + suffix;
ftpClient.mkd(getFileHistoryDir);
ftpClient.rename(getFileDir + fileName, getFileHistoryDir
+ newFileName);
} catch (Throwable e) {
......
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