记得上下班打卡 | git大法好,push需谨慎

Commit b402923d authored by 姜秀龙's avatar 姜秀龙

Merge remote-tracking branch 'origin/master' into jxl-yirenhebing

parents 8a88d7f4 f83b5de2
...@@ -3,8 +3,10 @@ package com.liquidnet.client.admin.web.controller.zhengzai.tools; ...@@ -3,8 +3,10 @@ package com.liquidnet.client.admin.web.controller.zhengzai.tools;
import com.liquidnet.client.admin.common.core.controller.BaseController; import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult; import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.utils.poi.ExcelUtil; import com.liquidnet.client.admin.common.utils.poi.ExcelUtil;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinCommonService;
import com.liquidnet.client.admin.zhengzai.kylin.dto.*; import com.liquidnet.client.admin.zhengzai.kylin.dto.*;
import com.liquidnet.client.admin.zhengzai.kylin.service.IExportService; import com.liquidnet.client.admin.zhengzai.kylin.service.IExportService;
import com.liquidnet.service.goblin.dto.GoblinStoreSearchDto;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -13,7 +15,8 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -13,7 +15,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*; import java.util.Arrays;
import java.util.List;
@Controller @Controller
@RequestMapping("tools/export") @RequestMapping("tools/export")
...@@ -22,6 +25,9 @@ public class ExportDataController extends BaseController { ...@@ -22,6 +25,9 @@ public class ExportDataController extends BaseController {
@Autowired @Autowired
private IExportService exportService; private IExportService exportService;
@Autowired
private IGoblinCommonService goblinCommonService;
private String prefix = "zhengzai/financial"; private String prefix = "zhengzai/financial";
...@@ -30,6 +36,17 @@ public class ExportDataController extends BaseController { ...@@ -30,6 +36,17 @@ public class ExportDataController extends BaseController {
return prefix + "/export"; return prefix + "/export";
} }
/**
* 店铺列表(财务导出用)
*/
@GetMapping("/store/list")
@ResponseBody
public AjaxResult storeList(String storeName) {
List<String> status = Arrays.asList("3", "4", "5");
List<GoblinStoreSearchDto> list = goblinCommonService.storeSearch(storeName, status);
return AjaxResult.success(list);
}
/** /**
* 导出订单明细 * 导出订单明细
* *
...@@ -77,7 +94,12 @@ public class ExportDataController extends BaseController { ...@@ -77,7 +94,12 @@ public class ExportDataController extends BaseController {
} }
private boolean timeIsNotNull(String beginTime, String endTime) { private boolean timeIsNotNull(String beginTime, String endTime) {
return StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime) ? true : false; return StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime);
}
private boolean hasHalfTime(String beginTime, String endTime) {
return (StringUtils.isNotBlank(beginTime) && StringUtils.isBlank(endTime))
|| (StringUtils.isBlank(beginTime) && StringUtils.isNotBlank(endTime));
} }
...@@ -104,18 +126,20 @@ public class ExportDataController extends BaseController { ...@@ -104,18 +126,20 @@ public class ExportDataController extends BaseController {
/** /**
* 导出商品订单 * 导出商品订单
* * 店铺 / 下单时间 填了的条件全部 AND
* @param beginTime
* @param endTime
* @return
*/ */
@PostMapping("/export/commodityOrder") @PostMapping("/export/commodityOrder")
@ResponseBody @ResponseBody
public AjaxResult exportCommodityOrder(String beginTime, String endTime) { public AjaxResult exportCommodityOrder(String beginTime, String endTime, String storeId) {
if (!timeIsNotNull(beginTime, endTime)) { boolean hasStoreId = StringUtils.isNotBlank(storeId);
return error("开始时间和结束时间不能为空!"); boolean hasOrderTime = timeIsNotNull(beginTime, endTime);
if (!hasStoreId && !hasOrderTime) {
return error("请至少填写店铺或下单时间其中一个条件!");
}
if (hasHalfTime(beginTime, endTime)) {
return error("下单时间请填写完整的开始和结束时间!");
} }
List<OrderCommodityExportVo> list = exportService.exportCommodityOrder(beginTime, endTime); List<OrderCommodityExportVo> list = exportService.exportCommodityOrder(beginTime, endTime, storeId);
if (list.size() == 0) { if (list.size() == 0) {
return error("查无信息"); return error("查无信息");
} }
......
...@@ -46,10 +46,15 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService { ...@@ -46,10 +46,15 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService {
@Override @Override
public List<GoblinStoreSearchDto> storeSearch(String name, List<String> status) { public List<GoblinStoreSearchDto> storeSearch(String name, List<String> status) {
List<GoblinStoreInfo> list = goblinStoreInfoMapper.selectList(Wrappers.lambdaQuery(GoblinStoreInfo.class) LambdaQueryWrapper<GoblinStoreInfo> queryWrapper = Wrappers.lambdaQuery(GoblinStoreInfo.class);
.like(GoblinStoreInfo::getStoreName, name) if (StringUtil.isNotBlank(name)) {
queryWrapper.like(GoblinStoreInfo::getStoreName, name);
}
queryWrapper.eq(GoblinStoreInfo::getDelFlg, "0")
.in(GoblinStoreInfo::getStatus, status) .in(GoblinStoreInfo::getStatus, status)
.select(GoblinStoreInfo::getStoreId, GoblinStoreInfo::getStoreName, GoblinStoreInfo::getStatus)); .orderByAsc(GoblinStoreInfo::getStoreName)
.select(GoblinStoreInfo::getStoreId, GoblinStoreInfo::getStoreName, GoblinStoreInfo::getStatus);
List<GoblinStoreInfo> list = goblinStoreInfoMapper.selectList(queryWrapper);
List<GoblinStoreSearchDto> dtoList = new ArrayList<>(); List<GoblinStoreSearchDto> dtoList = new ArrayList<>();
for (GoblinStoreInfo item : list) { for (GoblinStoreInfo item : list) {
GoblinStoreSearchDto dto = GoblinStoreSearchDto.getNew(); GoblinStoreSearchDto dto = GoblinStoreSearchDto.getNew();
......
...@@ -11,6 +11,8 @@ public class OrderCommodityExportVo implements Serializable, Cloneable { ...@@ -11,6 +11,8 @@ public class OrderCommodityExportVo implements Serializable, Cloneable {
@Excel(name = "商户订单号", cellType = Excel.ColumnType.STRING) @Excel(name = "商户订单号", cellType = Excel.ColumnType.STRING)
private String code; private String code;
@Excel(name = "店铺名称", cellType = Excel.ColumnType.STRING)
private String storeName;
@Excel(name = "微信/支付宝订单号", cellType = Excel.ColumnType.STRING) @Excel(name = "微信/支付宝订单号", cellType = Excel.ColumnType.STRING)
private String paymentId; private String paymentId;
@Excel(name = "商品名称", cellType = Excel.ColumnType.STRING) @Excel(name = "商品名称", cellType = Excel.ColumnType.STRING)
...@@ -53,6 +55,7 @@ public class OrderCommodityExportVo implements Serializable, Cloneable { ...@@ -53,6 +55,7 @@ public class OrderCommodityExportVo implements Serializable, Cloneable {
this.setPriceRefund(source.getPriceRefund()); this.setPriceRefund(source.getPriceRefund());
this.setStatus(source.getStatus()); this.setStatus(source.getStatus());
this.setRefundAt(source.getRefundAt()); this.setRefundAt(source.getRefundAt());
this.setStoreName(source.getStoreName());
return this; return this;
} }
......
...@@ -23,5 +23,5 @@ public interface IExportService { ...@@ -23,5 +23,5 @@ public interface IExportService {
List<OrderMemberExportVo> exportMemberOrder(String beginTime, String endTime); List<OrderMemberExportVo> exportMemberOrder(String beginTime, String endTime);
//导出商品订单信息 //导出商品订单信息
List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime); List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime, String storeId);
} }
...@@ -8,13 +8,13 @@ import com.liquidnet.service.kylin.dao.MemberOrderExportDao; ...@@ -8,13 +8,13 @@ import com.liquidnet.service.kylin.dao.MemberOrderExportDao;
import com.liquidnet.service.kylin.dao.OrderExportDao; import com.liquidnet.service.kylin.dao.OrderExportDao;
import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper; import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
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.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -110,12 +110,12 @@ public class ExportServiceImpl implements IExportService { ...@@ -110,12 +110,12 @@ public class ExportServiceImpl implements IExportService {
} }
@Override @Override
public List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime) { public List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime, String storeId) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
Date beginDate = sdf.parse(beginTime); Date beginDate = parseDate(sdf, beginTime);
Date endDate = sdf.parse(endTime); Date endDate = parseDate(sdf, endTime);
List<CommodityOrderExportDao> list = performancesMapper.exportCommodityOrder(beginDate, endDate); List<CommodityOrderExportDao> list = performancesMapper.exportCommodityOrder(beginDate, endDate, storeId);
List<OrderCommodityExportVo> voList = new ArrayList(); List<OrderCommodityExportVo> voList = new ArrayList();
for (CommodityOrderExportDao item : list) { for (CommodityOrderExportDao item : list) {
voList.add(OrderCommodityExportVo.getNew().copyCommodityOrderExportVo(item)); voList.add(OrderCommodityExportVo.getNew().copyCommodityOrderExportVo(item));
...@@ -126,4 +126,11 @@ public class ExportServiceImpl implements IExportService { ...@@ -126,4 +126,11 @@ public class ExportServiceImpl implements IExportService {
throw new BusinessException("导出Excel失败,请联系网站管理员!"); throw new BusinessException("导出Excel失败,请联系网站管理员!");
} }
} }
private Date parseDate(SimpleDateFormat sdf, String time) throws ParseException {
if (StringUtils.isBlank(time)) {
return null;
}
return sdf.parse(time);
}
} }
...@@ -24,5 +24,7 @@ public class CommodityOrderExportDao { ...@@ -24,5 +24,7 @@ public class CommodityOrderExportDao {
private String status; private String status;
//退款时间 //退款时间
private String refundAt; private String refundAt;
//店铺名称
private String storeName;
} }
...@@ -86,7 +86,7 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> { ...@@ -86,7 +86,7 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> {
//会员订单信息 //会员订单信息
List<MemberOrderExportDao> exportMemberOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime); List<MemberOrderExportDao> exportMemberOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
//商品订单信息 //商品订单信息
List<CommodityOrderExportDao> exportCommodityOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime); List<CommodityOrderExportDao> exportCommodityOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("storeId") String storeId);
List<KylinPerformancesDto> getListAll(String title); List<KylinPerformancesDto> getListAll(String title);
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
<result column="price_refund" property="priceRefund"/> <result column="price_refund" property="priceRefund"/>
<result column="status" property="status"/> <result column="status" property="status"/>
<result column="refund_at" property="refundAt"/> <result column="refund_at" property="refundAt"/>
<result column="store_name" property="storeName"/>
</resultMap> </resultMap>
<!-- <resultMap id="OrderExportDaoResult" type="com.liquidnet.service.kylin.dao.OrderExportDao">--> <!-- <resultMap id="OrderExportDaoResult" type="com.liquidnet.service.kylin.dao.OrderExportDao">-->
...@@ -1175,7 +1176,8 @@ GROUP BY user_mobile,tickets_id; ...@@ -1175,7 +1176,8 @@ GROUP BY user_mobile,tickets_id;
WHEN temtable.STATUS = '7' THEN WHEN temtable.STATUS = '7' THEN
'退货通过' '退货通过'
END AS status, END AS status,
temtable.refund_at as refund_at temtable.refund_at as refund_at,
temtable.store_name as store_name
from from
(select do.code, (select do.code,
gso.payment_id, gso.payment_id,
...@@ -1186,15 +1188,22 @@ GROUP BY user_mobile,tickets_id; ...@@ -1186,15 +1188,22 @@ GROUP BY user_mobile,tickets_id;
gso.price_express, gso.price_express,
gso.price_refund, gso.price_refund,
gso.status, gso.status,
gbo.refund_at gbo.refund_at,
max(gsi.store_name) as store_name
from goblin_store_order gso from goblin_store_order gso
inner join goblin_order_sku gos on gos.order_id = gso.order_id inner join goblin_order_sku gos on gos.order_id = gso.order_id
inner join dragon_orders do on do.order_code = gso.master_order_code and do.status = 1 inner join dragon_orders do on do.order_code = gso.master_order_code and do.status = 1
left join goblin_back_order gbo on gbo.order_id = gso.order_id and gbo.status in (2, 8) left join goblin_back_order gbo on gbo.order_id = gso.order_id and gbo.status in (2, 8)
where left join goblin_store_info gsi on gsi.store_id = gso.store_id
do.created_at between #{beginTime} and #{endTime} where gso.status not in (0, 5)
and gso.status not in (0, 5) <if test="beginTime != null and endTime != null">
and do.created_at between #{beginTime} and #{endTime}
</if>
<if test="storeId != null and storeId != ''">
and gso.store_id = #{storeId}
</if>
group by do.code group by do.code
<if test="beginTime != null and endTime != null">
union union
select do.code, select do.code,
gso.payment_id, gso.payment_id,
...@@ -1205,16 +1214,22 @@ GROUP BY user_mobile,tickets_id; ...@@ -1205,16 +1214,22 @@ GROUP BY user_mobile,tickets_id;
gso.price_express, gso.price_express,
gso.price_refund, gso.price_refund,
gso.status, gso.status,
gbo.refund_at gbo.refund_at,
max(gsi.store_name) as store_name
from goblin_store_order gso from goblin_store_order gso
inner join goblin_order_sku gos on gos.order_id = gso.order_id inner join goblin_order_sku gos on gos.order_id = gso.order_id
inner join dragon_orders do on do.order_code = gso.master_order_code and do.status = 1 inner join dragon_orders do on do.order_code = gso.master_order_code and do.status = 1
inner join dragon_order_refunds dor on dor.order_refund_id = do.code inner join dragon_order_refunds dor on dor.order_refund_id = do.code
left join goblin_back_order gbo on gbo.order_id = gso.order_id and gbo.status in (2, 8) left join goblin_back_order gbo on gbo.order_id = gso.order_id and gbo.status in (2, 8)
where left join goblin_store_info gsi on gsi.store_id = gso.store_id
dor.refund_at between #{beginTime} and #{endTime} where dor.refund_at between #{beginTime} and #{endTime}
and gso.status not in (0, 5) and gso.status not in (0, 5)
group by do.code) temtable group by temtable.code <if test="storeId != null and storeId != ''">
and gso.store_id = #{storeId}
</if>
group by do.code
</if>
) temtable group by temtable.code
</select> </select>
<select id="getSubscribeStatisticalByPerformancesId" resultType="com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao"> <select id="getSubscribeStatisticalByPerformancesId" resultType="com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao">
SELECT A.*, SELECT A.*,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment