|
|
@@ -95,7 +95,16 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
list.add(errorMessage);
|
|
|
return list;
|
|
|
}
|
|
|
- if ( StringUtils.isBlank(result[i][4].trim())) {
|
|
|
+ if (!StringUtils.isBlank(result[i][4].trim()) && result[i][4].trim().length()>20) {
|
|
|
+ failureNum++;
|
|
|
+ errorIndex=i+1;
|
|
|
+ errorMessage="供应商不得超过20字";
|
|
|
+ list.add(failureNum);
|
|
|
+ list.add(errorIndex);
|
|
|
+ list.add(errorMessage);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ if ( StringUtils.isBlank(result[i][5].trim())) {
|
|
|
failureNum++;
|
|
|
errorIndex=i+1;
|
|
|
errorMessage="工资月份为必填项";
|
|
|
@@ -104,7 +113,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
list.add(errorMessage);
|
|
|
return list;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(result[i][5].trim())) {
|
|
|
+ if (StringUtils.isBlank(result[i][6].trim())) {
|
|
|
failureNum++;
|
|
|
errorIndex=i+1;
|
|
|
errorMessage="应发合计为必填项";
|
|
|
@@ -113,7 +122,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
list.add(errorMessage);
|
|
|
return list;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(result[i][7].trim())) {
|
|
|
+ if (StringUtils.isBlank(result[i][8].trim())) {
|
|
|
failureNum++;
|
|
|
errorIndex=i+1;
|
|
|
errorMessage="实发工资为必填项";
|
|
|
@@ -125,8 +134,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
hpPayroll.setName(result[i][0]);
|
|
|
hpPayroll.setIdCardNumber(result[i][1].trim());
|
|
|
hpPayroll.setCompanyName(result[i][3]);
|
|
|
+ hpPayroll.setSupplier(result[i][4]);
|
|
|
hpPayroll.setWorkNumber(result[i][2]);
|
|
|
- String date1=result[i][4].trim();
|
|
|
+ String date1=result[i][5].trim();
|
|
|
//校验日期
|
|
|
if(date1.length()!=7){
|
|
|
failureNum++;
|
|
|
@@ -216,9 +226,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
// }
|
|
|
|
|
|
Pattern pattern1 = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$");
|
|
|
- if (result[i][5].trim()!="" && result[i][5].trim()!=null) {
|
|
|
- if(pattern1.matcher( result[i][5].trim()).matches()){
|
|
|
- hpPayroll.setGrossPayment(Double.parseDouble(result[i][5].trim()));
|
|
|
+ if (result[i][6].trim()!="" && result[i][6].trim()!=null) {
|
|
|
+ if(pattern1.matcher( result[i][6].trim()).matches()){
|
|
|
+ hpPayroll.setGrossPayment(Double.parseDouble(result[i][6].trim()));
|
|
|
}else{
|
|
|
failureNum++;
|
|
|
errorIndex=i+1;
|
|
|
@@ -229,9 +239,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
return list;
|
|
|
}
|
|
|
}
|
|
|
- if (result[i][6].trim()!="" && result[i][6].trim()!=null) {
|
|
|
- if(pattern1.matcher( result[i][6].trim()).matches()){
|
|
|
- hpPayroll.setTotalChargeback(Double.parseDouble(result[i][6].trim()));
|
|
|
+ if (result[i][7].trim()!="" && result[i][7].trim()!=null) {
|
|
|
+ if(pattern1.matcher( result[i][7].trim()).matches()){
|
|
|
+ hpPayroll.setTotalChargeback(Double.parseDouble(result[i][7].trim()));
|
|
|
}else{
|
|
|
failureNum++;
|
|
|
errorIndex=i+1;
|
|
|
@@ -242,9 +252,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
return list;
|
|
|
}
|
|
|
}
|
|
|
- if (result[i][7].trim()!="" && result[i][7].trim()!=null) {
|
|
|
- if(pattern1.matcher( result[i][7].trim()).matches()){
|
|
|
- hpPayroll.setNetPayment(Double.parseDouble(result[i][7].trim()));
|
|
|
+ if (result[i][8].trim()!="" && result[i][8].trim()!=null) {
|
|
|
+ if(pattern1.matcher( result[i][8].trim()).matches()){
|
|
|
+ hpPayroll.setNetPayment(Double.parseDouble(result[i][8].trim()));
|
|
|
}else{
|
|
|
failureNum++;
|
|
|
errorIndex=i+1;
|
|
|
@@ -258,7 +268,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
try {
|
|
|
JSONArray json = new JSONArray();
|
|
|
for (int k = 0; k < result[i].length; k++) {
|
|
|
- if (k > 7) {
|
|
|
+ if (k > 8) {
|
|
|
if (StringUtils.isBlank(result[0][k])) {
|
|
|
break;
|
|
|
}
|
|
|
@@ -273,7 +283,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
|
|
|
} catch (Exception e) {
|
|
|
failureNum++;
|
|
|
errorIndex=i+1;
|
|
|
- errorMessage="第八列之后错误";
|
|
|
+ errorMessage="第九列之后错误";
|
|
|
list.add(failureNum);
|
|
|
list.add(errorIndex);
|
|
|
list.add(errorMessage);
|