|
@@ -13,7 +13,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
public class DataAttachUtil {
|
|
public class DataAttachUtil {
|
|
|
|
|
|
- public static void dataAttachUpload(String busId, String newAttachPaths, String busIndx){
|
|
|
|
|
|
+ public static void dataAttachUpload(String busId, String newAttachPaths, String busIndx, String busSource){
|
|
ICenterdataTAttachService bean = SpringUtils.getBean(ICenterdataTAttachService.class);
|
|
ICenterdataTAttachService bean = SpringUtils.getBean(ICenterdataTAttachService.class);
|
|
if (newAttachPaths != null){
|
|
if (newAttachPaths != null){
|
|
String[] pathArray = newAttachPaths.split(",");
|
|
String[] pathArray = newAttachPaths.split(",");
|
|
@@ -47,12 +47,12 @@ public class DataAttachUtil {
|
|
|
|
|
|
// 批量添加附件地址
|
|
// 批量添加附件地址
|
|
if (StringUtils.isNotEmpty(addList)){
|
|
if (StringUtils.isNotEmpty(addList)){
|
|
- List<CenterdataTAttach> attachList = toAttachList(busId, addList, busIndx);
|
|
|
|
|
|
+ List<CenterdataTAttach> attachList = toAttachList(busId, addList, busIndx, busSource);
|
|
bean.insertListCenterdataTAttach(attachList);
|
|
bean.insertListCenterdataTAttach(attachList);
|
|
}
|
|
}
|
|
// 批量删除附件地址
|
|
// 批量删除附件地址
|
|
if (StringUtils.isNotEmpty(delList)){
|
|
if (StringUtils.isNotEmpty(delList)){
|
|
- List<CenterdataTAttach> attachList = toAttachList(busId, delList, busIndx);
|
|
|
|
|
|
+ List<CenterdataTAttach> attachList = toAttachList(busId, delList, busIndx, busSource);
|
|
bean.deleteListCenterdataTAttach(busId,attachList);
|
|
bean.deleteListCenterdataTAttach(busId,attachList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -60,14 +60,18 @@ public class DataAttachUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private static List<CenterdataTAttach> toAttachList(String busId, List<String> addList, String busIndx) {
|
|
|
|
|
|
+ private static List<CenterdataTAttach> toAttachList(String busId, List<String> addList, String busIndx, String busSource) {
|
|
List<CenterdataTAttach> list = new ArrayList<>();
|
|
List<CenterdataTAttach> list = new ArrayList<>();
|
|
for (String addPath : addList){
|
|
for (String addPath : addList){
|
|
CenterdataTAttach centerdataTAttach = new CenterdataTAttach();
|
|
CenterdataTAttach centerdataTAttach = new CenterdataTAttach();
|
|
centerdataTAttach.setBusId(busId);
|
|
centerdataTAttach.setBusId(busId);
|
|
centerdataTAttach.setAttachPath(addPath);
|
|
centerdataTAttach.setAttachPath(addPath);
|
|
centerdataTAttach.setBusIndx(busIndx);
|
|
centerdataTAttach.setBusIndx(busIndx);
|
|
- centerdataTAttach.setBusSource("PC");
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(busSource)){
|
|
|
|
+ centerdataTAttach.setBusSource(busSource);
|
|
|
|
+ }else {
|
|
|
|
+ centerdataTAttach.setBusSource("PC");
|
|
|
|
+ }
|
|
centerdataTAttach.setFileName(null);
|
|
centerdataTAttach.setFileName(null);
|
|
centerdataTAttach.setFileType("image");
|
|
centerdataTAttach.setFileType("image");
|
|
list.add(centerdataTAttach);
|
|
list.add(centerdataTAttach);
|