|
|
@@ -9,12 +9,17 @@ import com.zksy.data.service.XcrInvoiceIssuanceService;
|
|
|
import com.zksy.data.mapper.XcrInvoiceIssuanceMapper;
|
|
|
import com.zksy.data.utils.RedisService;
|
|
|
import com.zksy.data.utils.XhRequestUtil;
|
|
|
+import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Locale;
|
|
|
import java.util.Vector;
|
|
|
|
|
|
/**
|
|
|
@@ -33,6 +38,7 @@ public class XcrInvoiceIssuanceServiceImpl extends ServiceImpl<XcrInvoiceIssuanc
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
+
|
|
|
public void saveDataByUniCode(String address) {
|
|
|
//模拟从数据库中取数据大约为3000-4000条
|
|
|
List<String> creditCodes = (List<String>) redisService.getList("creditNames").get(0);
|
|
|
@@ -47,6 +53,17 @@ public class XcrInvoiceIssuanceServiceImpl extends ServiceImpl<XcrInvoiceIssuanc
|
|
|
toDatabaseList.addAll(list);
|
|
|
}
|
|
|
});
|
|
|
+ SimpleDateFormat inputFormat = new SimpleDateFormat("dd-MMM-yy", Locale.US);
|
|
|
+ toDatabaseList.stream().map(q->{
|
|
|
+ Date date;
|
|
|
+ try {
|
|
|
+ date = inputFormat.parse(q.getAPPLYDATE());
|
|
|
+ } catch (ParseException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ q.setA(date);
|
|
|
+ return q;
|
|
|
+ });
|
|
|
this.remove(null);
|
|
|
this.saveBatch(toDatabaseList);
|
|
|
log.info("发票开票信息同步完成");
|