|
|
@@ -51,16 +51,41 @@ public class StandardServiceImpl extends BaseMybatisDao<StandardDocumentMapper>
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void deleteFile(String url, String newURL) {
|
|
|
+ if(StringUtils.isBlank(newURL)){
|
|
|
+ deleteFile(url);
|
|
|
+ }else {
|
|
|
+ String[] newU = newURL.split(",");
|
|
|
+ String[] useU = url.split(",");
|
|
|
+ for (String s : useU) {
|
|
|
+ Boolean flag = false;
|
|
|
+ for (String s1 : newU) {
|
|
|
+ if (s.equals(s1)){
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag){
|
|
|
+ deleteFile(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Object update(StandardDocument in) {
|
|
|
Long id = Long.valueOf(in.getId());
|
|
|
StandardDocument use = standardDocumentMapper.selectByPrimaryKey(id);
|
|
|
- if (in.getUrl().equals(use.getUrl())&& StringUtils.isNotEmpty(in.getUrl())){
|
|
|
- deleteFile(use.getUrl());
|
|
|
+ if (StringUtils.isNotEmpty(use.getUrl())&&
|
|
|
+ use.getUrl().equals(in.getUrl())){
|
|
|
+ deleteFile(use.getUrl(),in.getUrl());
|
|
|
}
|
|
|
return standardDocumentMapper.updateByPrimaryKeySelective(in);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public Pagination<OutStandardDocument> list(InputStandardList in) {
|
|
|
Map<String,Object> params = new HashMap();
|