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

Commit a993b21d authored by limingyang's avatar limingyang

导出订单信息,导入对订单发货

parent 1bcb0804
package com.liquidnet.service.goblin.service;
import com.liquidnet.service.base.ResponseDto;
import javax.servlet.http.HttpServletResponse;
public interface IGoblinExportService {
//导出商城订单信息
ResponseDto<Boolean> exportMallOrder(HttpServletResponse response, String beginTime, String endTime, String state, Integer mailType);
}
......@@ -9,6 +9,7 @@ import java.util.function.Predicate;
public class CollectionUtil {
private static final HashMap<String, String> STRING_STRING_HASH_MAP = new HashMap<>();
private static final HashMap<String, Object> STRING_OBJECT_HASH_MAP = new HashMap<>();
private static final HashMap<String, List<String>> STRING_LIST_HASH_MAP = new HashMap<>();
private static final HashMap<String, Integer> STRING_INTEGER_HASH_MAP = new HashMap<>();
private static final LinkedList<String> STRING_LINKED_LIST = new LinkedList<>();
private static final LinkedList<Object[]> OBJECTS_LINKED_LIST = new LinkedList<>();
......@@ -24,6 +25,9 @@ public class CollectionUtil {
public static HashMap<String, String> mapStringString() {
return (HashMap<String, String>) STRING_STRING_HASH_MAP.clone();
}
public static HashMap<String, List<String>> mapStringList() {
return (HashMap<String, List<String>>) STRING_LIST_HASH_MAP.clone();
}
public static HashMap<String, Object> mapStringObject() {
return (HashMap<String, Object>) STRING_OBJECT_HASH_MAP.clone();
......
......@@ -84,6 +84,12 @@
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-client-admin-common</artifactId>
<version>4.6.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
......
package com.liquidnet.service.goblin.controller;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.utils.poi.ExcelUtil;
import com.liquidnet.service.goblin.dto.OrderMallOrderVo;
import com.liquidnet.service.goblin.service.impl.IGoblinImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Controller
@RequestMapping("/import")
public class GoblinImportController {
private String prefix = "zhengzai/kylin/performances/orderImport";
@Autowired
IGoblinImportService iGoblinImportService;
/**
* 导入对订单发货
*/
@PostMapping("/OrderExpress")
@ResponseBody
public AjaxResult importOrderExpress(MultipartFile file) throws Exception {
ExcelUtil<OrderMallOrderVo> util = new ExcelUtil(OrderMallOrderVo.class);
List<OrderMallOrderVo> MallOrdertVoList = util.importExcel(file.getInputStream());
String message = iGoblinImportService.importExpress(MallOrdertVoList);
return AjaxResult.success(message);
}
}
package com.liquidnet.service.goblin.dto;
import com.liquidnet.client.admin.common.annotation.Excel;
import lombok.Data;
@Data
public class OrderMallOrderVo {
@Excel(name = "订单编号",cellType = Excel.ColumnType.STRING)
private String orderCode;
@Excel(name = "购买人手机号",cellType = Excel.ColumnType.STRING)
private String userMobile;
@Excel(name = "快递费",cellType = Excel.ColumnType.STRING)
private String priceExpress;
@Excel(name = "平台券优惠金额",cellType = Excel.ColumnType.STRING)
private String priceCoupon;
@Excel(name = "店铺券优惠金额",cellType = Excel.ColumnType.STRING)
private String storePriceCoupon;
@Excel(name = "收货人",cellType = Excel.ColumnType.STRING)
private String expressContacts;
@Excel(name = "收货人电话",cellType = Excel.ColumnType.STRING)
private String expressPhone;
@Excel(name = "快递地址",cellType = Excel.ColumnType.STRING)
private String expressDetailAddress;
@Excel(name = "支付方式",cellType = Excel.ColumnType.STRING)
private String payType;
@Excel(name = "支付时间",cellType = Excel.ColumnType.STRING)
private String payTime;
@Excel(name = "下单时间",cellType = Excel.ColumnType.STRING)
private String createdAt;
@Excel(name = "快递公司",cellType = Excel.ColumnType.STRING)
private String logisticsCompany;
@Excel(name = "物流单号",cellType = Excel.ColumnType.STRING)
private String mailNo;
@Excel(name = "商品id1",cellType = Excel.ColumnType.STRING)
private String spuId;
@Excel(name = "商品名1",cellType = Excel.ColumnType.STRING)
private String name;
@Excel(name = "一级分类1",cellType = Excel.ColumnType.STRING)
private String cate1Name;
@Excel(name = "二级分类1",cellType = Excel.ColumnType.STRING)
private String cate2Name;
@Excel(name = "款式1",cellType = Excel.ColumnType.STRING)
private String skuName;
@Excel(name = "数量1",cellType = Excel.ColumnType.STRING)
private String num;
@Excel(name = "单价1",cellType = Excel.ColumnType.STRING)
private String skuPrice;
@Excel(name = "价格1",cellType = Excel.ColumnType.STRING)
private String skuPriceActual;
@Excel(name = "订单skuId1",cellType = Excel.ColumnType.STRING)
private String orderSkuId;
}
package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.client.admin.common.exception.BusinessException;
import com.liquidnet.client.admin.common.utils.StringUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.OrderMallOrderVo;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Slf4j
public class GoblinImportServiceImpl implements IGoblinImportService {
@Autowired
private IGoblinStoreOrderService iGoblinStoreOrderService;
@Override
public String importExpress(List<OrderMallOrderVo> mallOrdertVoList) {
if (StringUtils.isNull(mallOrdertVoList) || mallOrdertVoList.size() == 0) {
throw new BusinessException("导入用户数据不能为空!");
}
int count = 0;
for (OrderMallOrderVo mallOrderVo : mallOrdertVoList) {
ResponseDto<Boolean> express = iGoblinStoreOrderService.express(mallOrderVo.getOrderCode(), null, mallOrderVo.getMailNo());
count++;
}
return String.valueOf(count);
}
}
package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.service.goblin.dto.OrderMallOrderVo;
import java.util.List;
public interface IGoblinImportService {
//导入对订单发货
String importExpress(List<OrderMallOrderVo> orderOutLineVoList);
}
package com.liquidnet.service.platform.controller.goblin;
import com.liquidnet.service.goblin.service.IGoblinExportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
@Api(tags = "商城-订单信息导出")
@Controller
@RequestMapping("/tools/export")
@Validated
public class GoblinExportDataController {
@Autowired
IGoblinExportService iGoblinExportService;
/**
* 导出商城订单信息
*
* @param beginTime
* @param endTime
* @return
*/
@GetMapping("/exportMallOrder")
@ApiOperation(value = "excel订单信息导出")
public void exportMallOrder(HttpServletResponse response, @RequestParam("beginTime") String beginTime, @RequestParam("endTime")String endTime,
@RequestParam("state")String state, @RequestParam("mailType")Integer mailType) {
iGoblinExportService.exportMallOrder(response, beginTime, endTime, state, mailType);
}
}
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