|
@@ -45,6 +45,7 @@ import java.io.IOException;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.text.Bidi;
|
|
import java.text.Bidi;
|
|
|
|
+import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -1332,7 +1333,7 @@ public class OrderController {
|
|
* System Format 导出请求
|
|
* System Format 导出请求
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "exportSystemFormat")
|
|
@RequestMapping(value = "exportSystemFormat")
|
|
- public R exportSystemFormat(@RequestParam Map<String, Object> params, HttpServletResponse response, HttpServletRequest request) {
|
|
|
|
|
|
+ public R exportSystemFormat(@RequestParam Map<String, Object> params, HttpServletResponse response, HttpServletRequest request) throws ParseException {
|
|
|
|
|
|
ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
|
|
ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
|
|
params = ParamUtils.setTimeMap(params);
|
|
params = ParamUtils.setTimeMap(params);
|
|
@@ -1351,6 +1352,32 @@ public class OrderController {
|
|
list.add(headerMap);
|
|
list.add(headerMap);
|
|
if (systemFormatList != null && systemFormatList.size() > 0) {
|
|
if (systemFormatList != null && systemFormatList.size() > 0) {
|
|
for (SystemFormatDto systemFormat : systemFormatList) {
|
|
for (SystemFormatDto systemFormat : systemFormatList) {
|
|
|
|
+
|
|
|
|
+ // 如果有退款,获取销售时间的年月和退款时间的年月
|
|
|
|
+ if (StringUtils.isNotEmpty(systemFormat.getOutRefundNo())){
|
|
|
|
+ Date saleDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(systemFormat.getTimeStampDetails());
|
|
|
|
+ Date refundDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(systemFormat.getRefundTime());
|
|
|
|
+ Calendar saleC = Calendar.getInstance();
|
|
|
|
+ saleC.setTime(saleDate);
|
|
|
|
+ Calendar refundC = Calendar.getInstance();
|
|
|
|
+ refundC.setTime(refundDate);
|
|
|
|
+ int saleYear = saleC.get(Calendar.YEAR);// 销售的年
|
|
|
|
+ int refundYear = refundC.get(Calendar.YEAR);// 退款的年
|
|
|
|
+ int saleMonth = saleC.get(Calendar.MONTH);
|
|
|
|
+ int refundMonth = refundC.get(Calendar.MONTH);
|
|
|
|
+
|
|
|
|
+ // 如果是同一年并且销售时间是比退款时间少的话
|
|
|
|
+ if (saleMonth<refundMonth && saleYear==refundYear){
|
|
|
|
+ systemFormat.setOrderStatus(Dict.orderStatus.item_301.getItem());
|
|
|
|
+ }
|
|
|
|
+ if (saleYear!= refundYear){
|
|
|
|
+ systemFormat.setOrderStatus(Dict.orderStatus.item_301.getItem());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
LinkedHashMap<String, Object> map = new LinkedHashMap<>(32);
|
|
LinkedHashMap<String, Object> map = new LinkedHashMap<>(32);
|
|
if (Objects.nonNull(systemFormat.getTaxRate()) && Objects.nonNull(systemFormat.getTotalSalesInclTax())){
|
|
if (Objects.nonNull(systemFormat.getTaxRate()) && Objects.nonNull(systemFormat.getTotalSalesInclTax())){
|
|
|
|
|