|
|
@ -23,6 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import jnpf.util.*;
|
|
|
|
import jnpf.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
@ -41,12 +43,67 @@ public class Arinvoices_item0ServiceImpl extends ServiceImpl<Arinvoices_item0Map
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> importPreview(List<Arinvoices_item0Entity> personList) {
|
|
|
|
public Map<String, Object> importPreview(List<Arinvoices_item0Entity> personList) {
|
|
|
|
|
|
|
|
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
SimpleDateFormat format2=new SimpleDateFormat("yyyy-M-d");
|
|
|
|
|
|
|
|
SimpleDateFormat format3=new SimpleDateFormat("yyyy/MM/dd");
|
|
|
|
|
|
|
|
SimpleDateFormat format4=new SimpleDateFormat("yyyy/M/d");
|
|
|
|
|
|
|
|
SimpleDateFormat sim1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
|
|
|
|
List<Map<String, Object>> dataRow = new ArrayList<>();
|
|
|
|
List<Map<String, Object>> dataRow = new ArrayList<>();
|
|
|
|
List<Map<String, Object>> columns = new ArrayList<>();
|
|
|
|
List<Map<String, Object>> columns = new ArrayList<>();
|
|
|
|
if(personList != null) {
|
|
|
|
if(personList != null) {
|
|
|
|
for (int i = 0; i < personList.size(); i++) {
|
|
|
|
for (int i = 0; i < personList.size(); i++) {
|
|
|
|
Map<String, Object> dataRowMap = new HashMap<>();
|
|
|
|
Map<String, Object> dataRowMap = new HashMap<>();
|
|
|
|
Arinvoices_item0Entity model = personList.get(i);
|
|
|
|
Arinvoices_item0Entity model = personList.get(i);
|
|
|
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
if (model.getInvoiceDateStr()!=null) {
|
|
|
|
|
|
|
|
String dateStr = model.getInvoiceDateStr();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Date date = format.parse(dateStr);
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", date);
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!flag) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Date date = format2.parse(dateStr);
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", date);
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!flag) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Date date = format3.parse(dateStr);
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", date);
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!flag) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Date date = format4.parse(dateStr);
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", date);
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!flag){
|
|
|
|
|
|
|
|
if (model.getInvoiceDateStr()!=null) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Date newDate = sim1.parse(model.getInvoiceDateStr());
|
|
|
|
|
|
|
|
dataRowMap.put("invoiceDate", newDate);
|
|
|
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// String newDateStr = model.getInvoiceDateStr().replace("\"","");
|
|
|
|
|
|
|
|
// dataRowMap.put("invoiceDate", new);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
dataRowMap.put("materialName", model.getMaterialName());
|
|
|
|
dataRowMap.put("materialName", model.getMaterialName());
|
|
|
|
dataRowMap.put("invoiceCode", model.getInvoiceCode());
|
|
|
|
dataRowMap.put("invoiceCode", model.getInvoiceCode());
|
|
|
|
dataRowMap.put("invoiceNo", model.getInvoiceNo());
|
|
|
|
dataRowMap.put("invoiceNo", model.getInvoiceNo());
|
|
|
@ -56,8 +113,8 @@ public class Arinvoices_item0ServiceImpl extends ServiceImpl<Arinvoices_item0Map
|
|
|
|
dataRowMap.put("taxAmount", model.getTaxAmount());
|
|
|
|
dataRowMap.put("taxAmount", model.getTaxAmount());
|
|
|
|
dataRowMap.put("amountNotTax", model.getAmountNotTax());
|
|
|
|
dataRowMap.put("amountNotTax", model.getAmountNotTax());
|
|
|
|
dataRowMap.put("invoiceStatus", model.getInvoiceStatus());
|
|
|
|
dataRowMap.put("invoiceStatus", model.getInvoiceStatus());
|
|
|
|
dataRowMap.put("creatorUserName", model.getCreatorUserName());
|
|
|
|
dataRowMap.put("arinvoicesUser", model.getArinvoicesUser());
|
|
|
|
dataRowMap.put("invoiceDate", model.getInvoiceDate());
|
|
|
|
dataRowMap.put("invoicesDate", model.getInvoiceDate());
|
|
|
|
dataRow.add(dataRowMap);
|
|
|
|
dataRow.add(dataRowMap);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (int i = 1; i < 12; i++) {
|
|
|
|
for (int i = 1; i < 12; i++) {
|
|
|
|