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

更新member status

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