LiFei 5 lat temu
rodzic
commit
ce95647a2d

+ 2 - 1
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgpayment/service/IHlgPaymentService.java

@@ -9,6 +9,7 @@ import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
 import java.util.List;
 
 /**
@@ -29,7 +30,7 @@ public interface IHlgPaymentService extends IService<HlgPayment> {
 
     Result<HlgPayment> nextPayment(HlgPayment hlgPayment);
 
-    List importExcel(MultipartFile file, HlgPayment hlgPayment);
+    List importExcel(MultipartFile file, HlgPayment hlgPayment) throws UnsupportedEncodingException;
 
     Result<HlgPaymentDetail> handSupplementPayment(HlgPaymentDetail hlgPaymentDetail);
 

+ 17 - 1
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgpayment/service/impl/HlgPaymentServiceImpl.java

@@ -72,6 +72,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
@@ -782,7 +783,7 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public List importExcel(MultipartFile file, HlgPayment hlgPayment) {
+    public List importExcel(MultipartFile file, HlgPayment hlgPayment) throws UnsupportedEncodingException {
         List resultlist = new ArrayList();
         List<HlgPaymentDetailExport> hlgPaymentDetailList = new ArrayList<HlgPaymentDetailExport>();
         List<HlgUser> userList = new ArrayList<HlgUser>();
@@ -1020,6 +1021,21 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
                         map.put("reason", "开户行或开户地未填写");
                         resultlist.add(map);
                         continue;
+                    }else{
+                        if(eacbnk.getBytes("UTF-8").length>62){
+                            map.put("id", j + 3);
+                            map.put("phone", phone);
+                            map.put("reason", "开户行字符串长度过长");
+                            resultlist.add(map);
+                            continue;
+                        }
+                        if(rcveaa.getBytes("UTF-8").length>120){
+                            map.put("id", j + 3);
+                            map.put("phone", phone);
+                            map.put("reason", "开户地字符串长度过长");
+                            resultlist.add(map);
+                            continue;
+                        }
                     }
                 } else {
                     map.put("id", j + 3);