diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java b/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java index fa9de9fa..4a3ec778 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java @@ -63,6 +63,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -77,7 +78,7 @@ import java.util.stream.Collectors; * @Date: 2021-08-31 * @Version: V1.0 */ -@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class) +@Transactional(rollbackFor = Exception.class) @Service public class PayPaymentRecordServiceImpl extends ServiceImpl implements IPayPaymentRecordService { @Resource diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDepartController.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDepartController.java index 0e3b3937..e6f0fc39 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDepartController.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDepartController.java @@ -15,6 +15,7 @@ import com.jero.common.util.ValidUtil; import com.jero.modules.system.model.SysDepartExcel; import com.jero.modules.system.util.FindsDepartsChildrenUtil; import io.swagger.models.auth.In; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import com.jero.common.api.vo.Result; @@ -403,14 +404,20 @@ public class SysDepartController { params.setNeedSave(true); //导入Excel格式校验,看匹配的字段文本概率 Boolean t = ExcelImportCheckUtil.check(file.getInputStream(), SysDepartExcel.class, params,1.0); + if (t == null){ + return Result.error("文件导入失败: 导入数据为空"); + } if(!t){ - return Result.error("表头有误!"); + return Result.error("文件导入失败: 表头有误!"); } try { // orgCode编码长度 int codeLength = YouBianCodeUtil.zhanweiLength; listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepartExcel.class, params); listSysDeparts = listSysDeparts.stream().filter(i -> !oConvertUtils.checkObjAllFieldsIsNull(i)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(listSysDeparts)){ + return Result.error("文件导入失败: 导入数据为空"); + } //按长度排序 Collections.sort(listSysDeparts, new Comparator() { @Override