mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-27 18:47:58 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -787,7 +787,7 @@ public class OrderService {
|
|||||||
// 排除掉已经申请过的订单
|
// 排除掉已经申请过的订单
|
||||||
List<String> orderCodeList = orderInvoiceRecords.stream() // 转化为 Stream
|
List<String> orderCodeList = orderInvoiceRecords.stream() // 转化为 Stream
|
||||||
.map(OrderInvoiceRecord::getOrderCodes) // 获取 OrderInvoiceRecord 中的 orderCodes 字符串
|
.map(OrderInvoiceRecord::getOrderCodes) // 获取 OrderInvoiceRecord 中的 orderCodes 字符串
|
||||||
.flatMap(str -> Arrays.stream(str.split(","))) // 分隔逗号并转化为 Stream
|
.flatMap(str -> Arrays.stream(str.split(Constants.DEFAULT_DELIMITER))) // 分隔逗号并转化为 Stream
|
||||||
.collect(Collectors.toList()); // 收集为 List<String>
|
.collect(Collectors.toList()); // 收集为 List<String>
|
||||||
|
|
||||||
orderList = orderList.stream()
|
orderList = orderList.stream()
|
||||||
@@ -809,15 +809,11 @@ public class OrderService {
|
|||||||
int i = 15;
|
int i = 15;
|
||||||
// 查询最近15天完成的订单
|
// 查询最近15天完成的订单
|
||||||
LocalDateTime dateTime = LocalDateTime.now().plusDays(-i);
|
LocalDateTime dateTime = LocalDateTime.now().plusDays(-i);
|
||||||
// 查询最近15天申请开票记录
|
// 查询最近15天 会员的开票记录
|
||||||
QueryInvoiceRecordDTO build = QueryInvoiceRecordDTO.builder()
|
List<OrderInvoiceRecord> orderInvoiceRecords = orderInvoiceRecordService.selectInvoiceRecordList(dto.getMemberId(), dateTime, LocalDateTime.now());
|
||||||
.memberId(dto.getMemberId())
|
|
||||||
.startTime(dateTime)
|
|
||||||
.build();
|
|
||||||
List<OrderInvoiceRecord> orderInvoiceRecords = orderInvoiceRecordService.selectInvoiceRecordList(build);
|
|
||||||
List<String> orderCodeList = orderInvoiceRecords.stream() // 转化为 Stream
|
List<String> orderCodeList = orderInvoiceRecords.stream() // 转化为 Stream
|
||||||
.map(OrderInvoiceRecord::getOrderCodes) // 获取 OrderInvoiceRecord 中的 orderCodes 字符串
|
.map(OrderInvoiceRecord::getOrderCodes) // 获取 OrderInvoiceRecord 中的 orderCodes 字符串
|
||||||
.flatMap(str -> Arrays.stream(str.split(","))) // 分隔逗号并转化为 Stream
|
.flatMap(str -> Arrays.stream(str.split(Constants.DEFAULT_DELIMITER))) // 分隔逗号并转化为 Stream
|
||||||
.collect(Collectors.toList()); // 收集为 List<String>
|
.collect(Collectors.toList()); // 收集为 List<String>
|
||||||
|
|
||||||
// 取交集 校验订单是否已经开票
|
// 取交集 校验订单是否已经开票
|
||||||
@@ -827,19 +823,9 @@ public class OrderService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 整理数据
|
|
||||||
List<OrderVO> orderVOList = orderBasicInfoService.getListByOrderCodes(dto.getOrderCodes());
|
|
||||||
BigDecimal totalAmount = BigDecimal.ZERO;
|
|
||||||
BigDecimal totalElecAmount = BigDecimal.ZERO;
|
|
||||||
BigDecimal totalServiceAmount = BigDecimal.ZERO;
|
|
||||||
for (OrderVO orderVO : orderVOList) {
|
|
||||||
totalAmount = totalAmount.add(orderVO.getOrderAmount());
|
|
||||||
totalElecAmount = totalElecAmount.add(orderVO.getTotalElectricityAmount());
|
|
||||||
totalServiceAmount = totalServiceAmount.add(orderVO.getTotalServiceAmount());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查抬头信息
|
// 查抬头信息
|
||||||
MemberInvoiceTitle invoiceTitle = memberInvoiceTitleService.selectMemberInvoiceTitleById(Long.parseLong(dto.getTitleId()));
|
MemberInvoiceTitle invoiceTitle = memberInvoiceTitleService.selectMemberInvoiceTitleById(Long.parseLong(dto.getTitleId()));
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(dto.getReception())) {
|
if (StringUtils.isNotEmpty(dto.getReception())) {
|
||||||
boolean b = false;
|
boolean b = false;
|
||||||
if (StringUtils.isEmail(dto.getReception()) && !StringUtils.equals(dto.getReception(), invoiceTitle.getEmail())) {
|
if (StringUtils.isEmail(dto.getReception()) && !StringUtils.equals(dto.getReception(), invoiceTitle.getEmail())) {
|
||||||
@@ -855,16 +841,38 @@ public class OrderService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 入库
|
// 整理数据
|
||||||
OrderInvoiceRecord orderInvoiceRecord = new OrderInvoiceRecord();
|
List<OrderVO> orderVOList = orderBasicInfoService.getListByOrderCodes(dto.getOrderCodes());
|
||||||
orderInvoiceRecord.setStatus("0");
|
|
||||||
orderInvoiceRecord.setMemberId(dto.getMemberId());
|
// 根据运营商分组
|
||||||
orderInvoiceRecord.setTitleId(dto.getTitleId());
|
Map<String, List<OrderVO>> map = orderVOList.stream().collect(Collectors.groupingBy(OrderVO::getMerchantId));
|
||||||
orderInvoiceRecord.setOrderCodes(String.join(",", dto.getOrderCodes()));
|
|
||||||
orderInvoiceRecord.setTotalAmount(totalAmount);
|
BigDecimal totalAmount = null;
|
||||||
orderInvoiceRecord.setTotalElecAmount(totalElecAmount);
|
BigDecimal totalElecAmount = null;
|
||||||
orderInvoiceRecord.setTotalServiceAmount(totalServiceAmount);
|
BigDecimal totalServiceAmount = null;
|
||||||
orderInvoiceRecordService.insertOrderInvoiceRecord(orderInvoiceRecord);
|
// 根据运营商创建多笔开票记录
|
||||||
|
for (Map.Entry<String, List<OrderVO>> entry : map.entrySet()) {
|
||||||
|
totalAmount = BigDecimal.ZERO;
|
||||||
|
totalElecAmount = BigDecimal.ZERO;
|
||||||
|
totalServiceAmount = BigDecimal.ZERO;
|
||||||
|
List<OrderVO> orders = entry.getValue();
|
||||||
|
for (OrderVO orderVO : orders) {
|
||||||
|
totalAmount = totalAmount.add(orderVO.getOrderAmount());
|
||||||
|
totalElecAmount = totalElecAmount.add(orderVO.getTotalElectricityAmount());
|
||||||
|
totalServiceAmount = totalServiceAmount.add(orderVO.getTotalServiceAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 入库
|
||||||
|
OrderInvoiceRecord orderInvoiceRecord = new OrderInvoiceRecord();
|
||||||
|
orderInvoiceRecord.setStatus(Constants.ZERO);
|
||||||
|
orderInvoiceRecord.setMemberId(dto.getMemberId());
|
||||||
|
orderInvoiceRecord.setTitleId(dto.getTitleId());
|
||||||
|
orderInvoiceRecord.setOrderCodes(String.join(Constants.DEFAULT_DELIMITER, dto.getOrderCodes()));
|
||||||
|
orderInvoiceRecord.setTotalAmount(totalAmount);
|
||||||
|
orderInvoiceRecord.setTotalElecAmount(totalElecAmount);
|
||||||
|
orderInvoiceRecord.setTotalServiceAmount(totalServiceAmount);
|
||||||
|
orderInvoiceRecordService.insertOrderInvoiceRecord(orderInvoiceRecord);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.web.controller.system;
|
package com.jsowell.web.controller.system;
|
||||||
|
|
||||||
import com.jsowell.common.annotation.Log;
|
import com.jsowell.common.annotation.Log;
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.constant.UserConstants;
|
import com.jsowell.common.constant.UserConstants;
|
||||||
import com.jsowell.common.core.controller.BaseController;
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
import com.jsowell.common.core.domain.AjaxResult;
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
@@ -49,7 +50,7 @@ public class SysDeptController extends BaseController {
|
|||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
SysDept d = (SysDept) it.next();
|
SysDept d = (SysDept) it.next();
|
||||||
if (d.getDeptId().intValue() == deptId
|
if (d.getDeptId().intValue() == deptId
|
||||||
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) {
|
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), Constants.DEFAULT_DELIMITER), deptId + "")) {
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import io.jsonwebtoken.Claims;
|
|||||||
* @author jsowell
|
* @author jsowell
|
||||||
*/
|
*/
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
||||||
|
// 默认分隔符
|
||||||
|
public static final String DEFAULT_DELIMITER = ",";
|
||||||
|
|
||||||
// 非法交易流水号 由充电桩启动的订单会传全是0的交易流水号
|
// 非法交易流水号 由充电桩启动的订单会传全是0的交易流水号
|
||||||
public static final String ILLEGAL_TRANSACTION_CODE = "00000000000000000000000000000000";
|
public static final String ILLEGAL_TRANSACTION_CODE = "00000000000000000000000000000000";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.common.core.text;
|
package com.jsowell.common.core.text;
|
||||||
|
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
@@ -252,7 +253,7 @@ public class Convert {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public static Integer[] toIntArray(String str) {
|
public static Integer[] toIntArray(String str) {
|
||||||
return toIntArray(",", str);
|
return toIntArray(Constants.DEFAULT_DELIMITER, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -262,7 +263,7 @@ public class Convert {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public static Long[] toLongArray(String str) {
|
public static Long[] toLongArray(String str) {
|
||||||
return toLongArray(",", str);
|
return toLongArray(Constants.DEFAULT_DELIMITER, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -312,7 +313,7 @@ public class Convert {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public static String[] toStrArray(String str) {
|
public static String[] toStrArray(String str) {
|
||||||
return toStrArray(",", str);
|
return toStrArray(Constants.DEFAULT_DELIMITER, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.common.filter;
|
package com.jsowell.common.filter;
|
||||||
|
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.enums.HttpMethod;
|
import com.jsowell.common.enums.HttpMethod;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
|
||||||
@@ -25,7 +26,7 @@ public class XssFilter implements Filter {
|
|||||||
public void init(FilterConfig filterConfig) throws ServletException {
|
public void init(FilterConfig filterConfig) throws ServletException {
|
||||||
String tempExcludes = filterConfig.getInitParameter("excludes");
|
String tempExcludes = filterConfig.getInitParameter("excludes");
|
||||||
if (StringUtils.isNotEmpty(tempExcludes)) {
|
if (StringUtils.isNotEmpty(tempExcludes)) {
|
||||||
String[] url = tempExcludes.split(",");
|
String[] url = tempExcludes.split(Constants.DEFAULT_DELIMITER);
|
||||||
for (int i = 0; url != null && i < url.length; i++) {
|
for (int i = 0; url != null && i < url.length; i++) {
|
||||||
excludes.add(url[i]);
|
excludes.add(url[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.jsowell.common.util;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.jsowell.common.constant.CacheConstants;
|
import com.jsowell.common.constant.CacheConstants;
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.core.domain.entity.SysDictData;
|
import com.jsowell.common.core.domain.entity.SysDictData;
|
||||||
import com.jsowell.common.core.redis.RedisCache;
|
import com.jsowell.common.core.redis.RedisCache;
|
||||||
import com.jsowell.common.util.spring.SpringUtils;
|
import com.jsowell.common.util.spring.SpringUtils;
|
||||||
@@ -18,7 +19,7 @@ public class DictUtils {
|
|||||||
/**
|
/**
|
||||||
* 分隔符
|
* 分隔符
|
||||||
*/
|
*/
|
||||||
public static final String SEPARATOR = ",";
|
public static final String SEPARATOR = Constants.DEFAULT_DELIMITER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置字典缓存
|
* 设置字典缓存
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class AddressUtils {
|
|||||||
if (StringUtils.isBlank(areaCode) || StringUtils.isBlank(address)) {
|
if (StringUtils.isBlank(areaCode) || StringUtils.isBlank(address)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String[] split = StringUtils.split(areaCode, ",");
|
String[] split = StringUtils.split(areaCode, Constants.DEFAULT_DELIMITER);
|
||||||
String param = "key=" + AMAP_GET_LOCATION_KEY + "&city=" + split[2] + "&address=" + address;
|
String param = "key=" + AMAP_GET_LOCATION_KEY + "&city=" + split[2] + "&address=" + address;
|
||||||
String resultStr = HttpUtils.sendGet(AMAP_GET_LOCATION_URL, param, Constants.UTF8);
|
String resultStr = HttpUtils.sendGet(AMAP_GET_LOCATION_URL, param, Constants.UTF8);
|
||||||
if (StringUtils.isNotBlank(resultStr)) {
|
if (StringUtils.isNotBlank(resultStr)) {
|
||||||
@@ -81,7 +81,7 @@ public class AddressUtils {
|
|||||||
Map<String, String> map = Maps.newHashMap();
|
Map<String, String> map = Maps.newHashMap();
|
||||||
JSONObject jsonObject = geocodes.getJSONObject(0);
|
JSONObject jsonObject = geocodes.getJSONObject(0);
|
||||||
String location = jsonObject.getString("location");
|
String location = jsonObject.getString("location");
|
||||||
String[] strArr = StringUtils.split(location, ",");
|
String[] strArr = StringUtils.split(location, Constants.DEFAULT_DELIMITER);
|
||||||
map.put("lng", strArr[0]);
|
map.put("lng", strArr[0]);
|
||||||
map.put("lat", strArr[1]);
|
map.put("lat", strArr[1]);
|
||||||
return map;
|
return map;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.common.util.ip;
|
package com.jsowell.common.util.ip;
|
||||||
|
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -200,8 +201,8 @@ public class IpUtils {
|
|||||||
*/
|
*/
|
||||||
public static String getMultistageReverseProxyIp(String ip) {
|
public static String getMultistageReverseProxyIp(String ip) {
|
||||||
// 多级反向代理检测
|
// 多级反向代理检测
|
||||||
if (ip != null && ip.indexOf(",") > 0) {
|
if (ip != null && ip.indexOf(Constants.DEFAULT_DELIMITER) > 0) {
|
||||||
final String[] ips = ip.trim().split(",");
|
final String[] ips = ip.trim().split(Constants.DEFAULT_DELIMITER);
|
||||||
for (String subIp : ips) {
|
for (String subIp : ips) {
|
||||||
if (false == isUnknown(subIp)) {
|
if (false == isUnknown(subIp)) {
|
||||||
ip = subIp;
|
ip = subIp;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.jsowell.common.annotation.Excel.ColumnType;
|
|||||||
import com.jsowell.common.annotation.Excel.Type;
|
import com.jsowell.common.annotation.Excel.Type;
|
||||||
import com.jsowell.common.annotation.Excels;
|
import com.jsowell.common.annotation.Excels;
|
||||||
import com.jsowell.common.config.JsowellConfig;
|
import com.jsowell.common.config.JsowellConfig;
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.core.domain.AjaxResult;
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
import com.jsowell.common.core.text.Convert;
|
import com.jsowell.common.core.text.Convert;
|
||||||
import com.jsowell.common.exception.UtilException;
|
import com.jsowell.common.exception.UtilException;
|
||||||
@@ -889,7 +890,7 @@ public class ExcelUtil<T> {
|
|||||||
*/
|
*/
|
||||||
public static String convertByExp(String propertyValue, String converterExp, String separator) {
|
public static String convertByExp(String propertyValue, String converterExp, String separator) {
|
||||||
StringBuilder propertyString = new StringBuilder();
|
StringBuilder propertyString = new StringBuilder();
|
||||||
String[] convertSource = converterExp.split(",");
|
String[] convertSource = converterExp.split(Constants.DEFAULT_DELIMITER);
|
||||||
for (String item : convertSource) {
|
for (String item : convertSource) {
|
||||||
String[] itemArray = item.split("=");
|
String[] itemArray = item.split("=");
|
||||||
if (StringUtils.containsAny(propertyValue, separator)) {
|
if (StringUtils.containsAny(propertyValue, separator)) {
|
||||||
@@ -918,7 +919,7 @@ public class ExcelUtil<T> {
|
|||||||
*/
|
*/
|
||||||
public static String reverseByExp(String propertyValue, String converterExp, String separator) {
|
public static String reverseByExp(String propertyValue, String converterExp, String separator) {
|
||||||
StringBuilder propertyString = new StringBuilder();
|
StringBuilder propertyString = new StringBuilder();
|
||||||
String[] convertSource = converterExp.split(",");
|
String[] convertSource = converterExp.split(Constants.DEFAULT_DELIMITER);
|
||||||
for (String item : convertSource) {
|
for (String item : convertSource) {
|
||||||
String[] itemArray = item.split("=");
|
String[] itemArray = item.split("=");
|
||||||
if (StringUtils.containsAny(propertyValue, separator)) {
|
if (StringUtils.containsAny(propertyValue, separator)) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.framework.config;
|
package com.jsowell.framework.config;
|
||||||
|
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.filter.RepeatableFilter;
|
import com.jsowell.common.filter.RepeatableFilter;
|
||||||
import com.jsowell.common.filter.XssFilter;
|
import com.jsowell.common.filter.XssFilter;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
@@ -33,7 +34,7 @@ public class FilterConfig {
|
|||||||
FilterRegistrationBean registration = new FilterRegistrationBean();
|
FilterRegistrationBean registration = new FilterRegistrationBean();
|
||||||
registration.setDispatcherTypes(DispatcherType.REQUEST);
|
registration.setDispatcherTypes(DispatcherType.REQUEST);
|
||||||
registration.setFilter(new XssFilter());
|
registration.setFilter(new XssFilter());
|
||||||
registration.addUrlPatterns(StringUtils.split(urlPatterns, ","));
|
registration.addUrlPatterns(StringUtils.split(urlPatterns, Constants.DEFAULT_DELIMITER));
|
||||||
registration.setName("xssFilter");
|
registration.setName("xssFilter");
|
||||||
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
|
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
|
||||||
Map<String, String> initParameters = new HashMap<String, String>();
|
Map<String, String> initParameters = new HashMap<String, String>();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.framework.config;
|
package com.jsowell.framework.config;
|
||||||
|
|
||||||
import com.google.code.kaptcha.text.impl.DefaultTextCreator;
|
import com.google.code.kaptcha.text.impl.DefaultTextCreator;
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ import java.util.Random;
|
|||||||
* @author jsowell
|
* @author jsowell
|
||||||
*/
|
*/
|
||||||
public class KaptchaTextCreator extends DefaultTextCreator {
|
public class KaptchaTextCreator extends DefaultTextCreator {
|
||||||
private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(",");
|
private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(Constants.DEFAULT_DELIMITER);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText() {
|
public String getText() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.framework.config;
|
package com.jsowell.framework.config;
|
||||||
|
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import org.apache.ibatis.io.VFS;
|
import org.apache.ibatis.io.VFS;
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
@@ -42,7 +43,7 @@ public class MyBatisConfig {
|
|||||||
MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
|
MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
|
||||||
List<String> allResult = new ArrayList<String>();
|
List<String> allResult = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
for (String aliasesPackage : typeAliasesPackage.split(",")) {
|
for (String aliasesPackage : typeAliasesPackage.split(Constants.DEFAULT_DELIMITER)) {
|
||||||
List<String> result = new ArrayList<String>();
|
List<String> result = new ArrayList<String>();
|
||||||
aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
|
aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
|
||||||
+ ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN;
|
+ ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN;
|
||||||
@@ -66,7 +67,7 @@ public class MyBatisConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (allResult.size() > 0) {
|
if (allResult.size() > 0) {
|
||||||
typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0]));
|
typeAliasesPackage = String.join(Constants.DEFAULT_DELIMITER, (String[]) allResult.toArray(new String[0]));
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包");
|
throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包");
|
||||||
}
|
}
|
||||||
@@ -103,7 +104,7 @@ public class MyBatisConfig {
|
|||||||
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
|
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
|
||||||
sessionFactory.setDataSource(dataSource);
|
sessionFactory.setDataSource(dataSource);
|
||||||
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
|
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
|
||||||
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
|
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, Constants.DEFAULT_DELIMITER)));
|
||||||
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
|
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
|
||||||
return sessionFactory.getObject();
|
return sessionFactory.getObject();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.generator.util;
|
package com.jsowell.generator.util;
|
||||||
|
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.constant.GenConstants;
|
import com.jsowell.common.constant.GenConstants;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.generator.config.GenConfig;
|
import com.jsowell.generator.config.GenConfig;
|
||||||
@@ -156,7 +157,7 @@ public class GenUtils {
|
|||||||
boolean autoRemovePre = GenConfig.getAutoRemovePre();
|
boolean autoRemovePre = GenConfig.getAutoRemovePre();
|
||||||
String tablePrefix = GenConfig.getTablePrefix();
|
String tablePrefix = GenConfig.getTablePrefix();
|
||||||
if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) {
|
if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) {
|
||||||
String[] searchList = StringUtils.split(tablePrefix, ",");
|
String[] searchList = StringUtils.split(tablePrefix, Constants.DEFAULT_DELIMITER);
|
||||||
tableName = replaceFirst(tableName, searchList);
|
tableName = replaceFirst(tableName, searchList);
|
||||||
}
|
}
|
||||||
return StringUtils.convertToCamelCase(tableName);
|
return StringUtils.convertToCamelCase(tableName);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.jsowell.pile.domain.OrderInvoiceRecord;
|
|||||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||||
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,7 +20,7 @@ public interface IOrderInvoiceRecordService {
|
|||||||
* @param id 申请开票主键
|
* @param id 申请开票主键
|
||||||
* @return 申请开票
|
* @return 申请开票
|
||||||
*/
|
*/
|
||||||
public OrderInvoiceRecord selectOrderInvoiceRecordById(Integer id);
|
OrderInvoiceRecord selectOrderInvoiceRecordById(Integer id);
|
||||||
|
|
||||||
InvoiceRecordVO selectInvoiceTitleVO(Integer id);
|
InvoiceRecordVO selectInvoiceTitleVO(Integer id);
|
||||||
|
|
||||||
@@ -29,10 +30,12 @@ public interface IOrderInvoiceRecordService {
|
|||||||
* @param orderInvoiceRecord 申请开票
|
* @param orderInvoiceRecord 申请开票
|
||||||
* @return 申请开票集合
|
* @return 申请开票集合
|
||||||
*/
|
*/
|
||||||
public List<OrderInvoiceRecord> selectOrderInvoiceRecordList(OrderInvoiceRecord orderInvoiceRecord);
|
List<OrderInvoiceRecord> selectOrderInvoiceRecordList(OrderInvoiceRecord orderInvoiceRecord);
|
||||||
|
|
||||||
List<OrderInvoiceRecord> selectInvoiceRecordList(QueryInvoiceRecordDTO memberId);
|
List<OrderInvoiceRecord> selectInvoiceRecordList(QueryInvoiceRecordDTO memberId);
|
||||||
|
|
||||||
|
List<OrderInvoiceRecord> selectInvoiceRecordList(String memberId, LocalDateTime startTime, LocalDateTime endTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增申请开票
|
* 新增申请开票
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -638,8 +638,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
orderAmount = payAmount;
|
orderAmount = payAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 虚拟金额 指订单消费中使用赠送金额支付的部分
|
// 虚拟金额 指订单消费中不参与结算的部分
|
||||||
BigDecimal virtualAmount = BigDecimal.ZERO;
|
BigDecimal virtualAmount = BigDecimal.ZERO;
|
||||||
|
if (OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue().equals(orderBasicInfo.getPayMode())) {
|
||||||
|
// 白名单支付所消费的金额,都属于虚拟金额,不参与结算对账
|
||||||
|
virtualAmount = new BigDecimal(orderAmount.toString());
|
||||||
|
}
|
||||||
|
|
||||||
// 剩余需要退回的金额 residue
|
// 剩余需要退回的金额 residue
|
||||||
BigDecimal residue = payAmount.subtract(orderAmount);
|
BigDecimal residue = payAmount.subtract(orderAmount);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,6 +86,15 @@ public class OrderInvoiceRecordServiceImpl implements IOrderInvoiceRecordService
|
|||||||
return orderInvoiceRecordMapper.selectInvoiceRecordList(dto);
|
return orderInvoiceRecordMapper.selectInvoiceRecordList(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderInvoiceRecord> selectInvoiceRecordList(String memberId, LocalDateTime startTime, LocalDateTime endTime) {
|
||||||
|
QueryInvoiceRecordDTO dto = new QueryInvoiceRecordDTO();
|
||||||
|
dto.setMemberId(memberId);
|
||||||
|
dto.setStartTime(startTime);
|
||||||
|
dto.setEndTime(endTime);
|
||||||
|
return selectInvoiceRecordList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增申请开票
|
* 新增申请开票
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ public class OrderVO {
|
|||||||
*/
|
*/
|
||||||
private String pileConnectorCode;
|
private String pileConnectorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商id
|
||||||
|
*/
|
||||||
|
private String merchantId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点id
|
* 站点id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -971,8 +971,9 @@
|
|||||||
<select id="getListByOrderCodes" resultType="com.jsowell.pile.vo.uniapp.OrderVO">
|
<select id="getListByOrderCodes" resultType="com.jsowell.pile.vo.uniapp.OrderVO">
|
||||||
SELECT t1.order_code as orderCode,
|
SELECT t1.order_code as orderCode,
|
||||||
t1.order_status as orderStatus,
|
t1.order_status as orderStatus,
|
||||||
t1.reason,
|
t1.reason as reason,
|
||||||
t1.station_id,
|
t1.merchant_id as merchantId,
|
||||||
|
t1.station_id as stationId,
|
||||||
t3.station_name as stationName,
|
t3.station_name as stationName,
|
||||||
t1.pile_sn as pileSn,
|
t1.pile_sn as pileSn,
|
||||||
t1.connector_code as connectorCode,
|
t1.connector_code as connectorCode,
|
||||||
@@ -985,8 +986,8 @@
|
|||||||
t2.total_electricity_amount as totalElectricityAmount,
|
t2.total_electricity_amount as totalElectricityAmount,
|
||||||
t2.total_service_amount as totalServiceAmount
|
t2.total_service_amount as totalServiceAmount
|
||||||
from order_basic_info t1
|
from order_basic_info t1
|
||||||
join order_detail t2 on t1.order_code = t2.order_code
|
join order_detail t2 on t1.order_code = t2.order_code
|
||||||
join pile_station_info t3 on t1.station_id = t3.id
|
join pile_station_info t3 on t1.station_id = t3.id
|
||||||
where t1.del_flag = '0'
|
where t1.del_flag = '0'
|
||||||
and t1.order_code in
|
and t1.order_code in
|
||||||
<foreach collection="orderCodes" item="orderCode" open="(" separator="," close=")">
|
<foreach collection="orderCodes" item="orderCode" open="(" separator="," close=")">
|
||||||
|
|||||||
Reference in New Issue
Block a user