提交 7526895c 作者: zhenjie

订单列表

上级 447bd930
package com.mmc.oms.client;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mmc.oms.model.dto.mall.CooperationTagDTO;
import com.mmc.oms.model.dto.mall.MallProductSpecPriceDTO;
import com.mmc.oms.model.dto.mall.CooperationTagVO;
import com.mmc.oms.model.dto.mall.OrderGoodsProdDTO;
import com.mmc.oms.model.dto.user.UserAccountSimpleDTO;
import com.mmc.oms.model.qo.mall.BUserAccountQO;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -156,13 +157,14 @@ public class UserClient {
* 用户合作标签
* @return
*/
public List<CooperationTagDTO> feignListCooperationTag(){
ResponseEntity<List> responseEntity = restTemplate.getForEntity(userAppUri + "cooperation/feignListCooperationTag", List.class);
if (CollectionUtils.isEmpty(responseEntity.getBody())) {
return null;
}
List<CooperationTagDTO> cooperationTagDTO = (List<CooperationTagDTO>) responseEntity.getBody().stream().map(it->new ObjectMapper().convertValue(it,CooperationTagDTO.class)).collect(Collectors.toList());
return cooperationTagDTO;
public List<CooperationTagVO> feignListCooperationTag(){
//ResponseEntity<List> responseEntity = restTemplate.getForEntity(userAppUri + "cooperation/feignListCooperationTag", List.class);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> entity = new HttpEntity<>(null, headers);
ResponseEntity<String> responseEntity = restTemplate.exchange(userAppUri + "cooperation/feignListCooperationTag", HttpMethod.GET, entity, String.class);
List<CooperationTagVO> cooperationTagVOS = JSONArray.parseArray(responseEntity.getBody(), CooperationTagVO.class);
return cooperationTagVOS;
}
}
......@@ -33,14 +33,14 @@ public class AppMallOrderController extends BaseController {
return appMallOrderService.addMallOrder(param, this.getCurrentAccount(request));
}
@ApiOperation(value = "订单列表-查询", hidden = true)
@ApiOperation(value = "v1.0.0订单列表-查询")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallOrderPageDTO.class)})
@GetMapping("listPage")
public ResultBody listPage(@RequestParam Integer pageNo, @RequestParam Integer pageSize,
@RequestParam(required = false) String keyword, @RequestParam(required = false) Integer showType,
@ApiParam(value = "all全部-doing进行中") @RequestParam(required = false) String orderType,
HttpServletRequest request) {
return ResultBody.success(appMallOrderService.listAPPPage(pageNo, pageSize, keyword, showType, orderType, this.getCurrentAccount(request)));
return ResultBody.success(appMallOrderService.listAPPPage(pageNo, pageSize, keyword, showType, orderType, this.getCurrentAccount(request), request.getHeader("token")));
}
@ApiOperation(value = "订单列表-数量查询", hidden = true)
......
......@@ -41,18 +41,18 @@ public class PMOrderControllerVerOne extends BaseController {
@Autowired
private MallOrderServiceSub mallOrderServiceSub;
@ApiOperation(value = "订单管理-分页查询(改版后)")
@ApiOperation(value = "v1.0.0订单管理-分页查询(改版后)")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = MallOrderPageDTO.class) })
@PostMapping("listPageManagerVerOne")
public ResultBody listPageManagerVerOne(@RequestBody MallOrderQO param, HttpServletRequest request) {
return ResultBody.success(mallOrderService.listPageManagerVerOne(param, this.getCurrentAccount(request)));
return ResultBody.success(mallOrderService.listPageManagerVerOne(param, this.getCurrentAccount(request), request.getHeader("token")));
}
@ApiOperation(value = "订单管理-导出(改版后)", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) })
@PostMapping("listPageManagerExportVerOne")
public void listPageManagerExportVerOne(@RequestBody MallOrderQO param, HttpServletResponse response, HttpServletRequest request) {
mallOrderService.listPageManagerExportVerOne(param,response,this.getCurrentAccount(request));
mallOrderService.listPageManagerExportVerOne(param,response,this.getCurrentAccount(request), request.getHeader("token"));
}
@ApiOperation(value = "v1.0.0订单管理-详情(改版后)")
......@@ -103,7 +103,7 @@ public class PMOrderControllerVerOne extends BaseController {
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) })
@PostMapping("listOperationalDataExport")
public void listOperationalDataExport(@RequestBody MallOrderQO param, HttpServletResponse response, HttpServletRequest request) throws IOException {
mallOrderService.listOperationalDataExport(param,response,this.getCurrentAccount(request));
mallOrderService.listOperationalDataExport(param,response,this.getCurrentAccount(request), request.getHeader("token"));
}
@ApiOperation(value = "订单管理-运营数据导出(改版后)", hidden = true)
......
package com.mmc.oms.feign;
import com.mmc.oms.model.dto.mall.CooperationTagDTO;
import com.mmc.oms.model.dto.mall.CooperationTagVO;
import com.mmc.oms.model.dto.user.UserAccountSimpleDTO;
import com.mmc.oms.model.qo.mall.BUserAccountQO;
//import io.swagger.annotations.ApiParam;
......@@ -82,6 +82,6 @@ public interface UserAppApi {
* @return
*/
@GetMapping("cooperation/feignListCooperationTag")
List<CooperationTagDTO> feignListCooperationTag();
List<CooperationTagVO> feignListCooperationTag();
}
package com.mmc.oms.feign.hystrix;
import com.mmc.oms.feign.UserAppApi;
import com.mmc.oms.model.dto.mall.CooperationTagDTO;
import com.mmc.oms.model.dto.mall.CooperationTagVO;
import com.mmc.oms.model.dto.user.UserAccountSimpleDTO;
import com.mmc.oms.model.qo.mall.BUserAccountQO;
import lombok.extern.slf4j.Slf4j;
......@@ -57,7 +57,7 @@ public class UserAppApiHystrix implements UserAppApi {
}
@Override
public List<CooperationTagDTO> feignListCooperationTag() {
public List<CooperationTagVO> feignListCooperationTag() {
log.error("熔断:feignListCooperationTag:{}");
return null;
}
......
......@@ -17,7 +17,7 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CooperationTagDTO implements Serializable {
public class CooperationTagVO implements Serializable {
private static final long serialVersionUID = 8884567706797525506L;
@ApiModelProperty(value = "id")
private Integer id;
......
......@@ -25,7 +25,7 @@ public interface AppMallOrderService {
ResultBody<ConfirmGoodsInfoDTO> confirmShop(List<MallProdShopCarDO> mallProdShopCarDOS, List<MallIndstShopCarDO> mallIndstShopCarDOS, UserAccountSimpleDTO userAccountSimpleDTO);
PageResult listAPPPage(Integer pageNo, Integer pageSize, String keyword, Integer showType, String orderType, BaseAccountDTO currentAccount);
PageResult listAPPPage(Integer pageNo, Integer pageSize, String keyword, Integer showType, String orderType, BaseAccountDTO currentAccount, String token);
/**
......
......@@ -120,11 +120,11 @@ public interface MallOrderService {
void mallOrderCreditPeriodTask();
PageResult listPageManagerVerOne(MallOrderQO param, BaseAccountDTO currentAccount);
PageResult listPageManagerVerOne(MallOrderQO param, BaseAccountDTO currentAccount, String token);
List<MallOrderPageDTO> buildMallOrderPageDTO(List<MallOrderDO> list);
List<MallOrderPageDTO> buildMallOrderPageDTO(List<MallOrderDO> list, String token);
void listPageManagerExportVerOne(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount);
void listPageManagerExportVerOne(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount, String token);
MallOrderDTO getMallOrderDetailById(Long orderId, BaseAccountDTO currentAccount, String token);
......@@ -136,7 +136,7 @@ public interface MallOrderService {
void exportMultiSheet(HttpServletResponse response, List<Long> orderIds) throws IOException;
void listOperationalDataExport(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount) throws IOException;
void listOperationalDataExport(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount, String token) throws IOException;
ResultBody feignOrderUseCoupon(List<Long> orderIds);
......
......@@ -17,8 +17,6 @@ import com.mmc.oms.model.dto.coupon.CouponUserDTO;
import com.mmc.oms.model.dto.coupon.CouponUserOrderDTO;
import com.mmc.oms.model.dto.mall.*;
import com.mmc.oms.model.dto.user.BaseAccountDTO;
import com.mmc.oms.model.dto.user.MallUserDTO;
import com.mmc.oms.model.dto.user.UserAccountDTO;
import com.mmc.oms.model.dto.user.UserAccountSimpleDTO;
import com.mmc.oms.model.qo.mall.MallOrderGoodsInfoQO;
import com.mmc.oms.model.qo.mall.MallShopCarQO;
......@@ -460,14 +458,14 @@ public class AppMallOrderServiceImpl implements AppMallOrderService {
}
@Override
public PageResult listAPPPage(Integer pageNo, Integer pageSize, String keyword, Integer showType, String orderType, BaseAccountDTO currentAccount) {
public PageResult listAPPPage(Integer pageNo, Integer pageSize, String keyword, Integer showType, String orderType, BaseAccountDTO currentAccount, String token) {
List<Integer> statusCodes = this.getOrderStatusByShowType(showType);
int count = mallOrderDao.countAppPageOrder(keyword, orderType, statusCodes, currentAccount.getUserAccountId());
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, count);
}
List<MallOrderDO> orders = mallOrderDao.listAppPageAmOrder((pageNo - 1) * pageSize, pageSize, keyword, orderType, statusCodes, currentAccount.getUserAccountId());
List<MallOrderPageDTO> mallOrderPageDTOList = mallOrderService.buildMallOrderPageDTO(orders);
List<MallOrderPageDTO> mallOrderPageDTOList = mallOrderService.buildMallOrderPageDTO(orders, token);
//需要处理所选规格
List<Long> orderIds = orders.stream().map(MallOrderDO::getId).collect(Collectors.toList());
List<MallOrderSimpleDO> mallOrderSimpleDOList = appMallOrderDao.listMallOrderSkuSpec(orderIds);
......
......@@ -2,6 +2,7 @@ package com.mmc.oms.service.mall.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
......@@ -32,7 +33,6 @@ import com.mmc.oms.model.dto.user.UserAccountSimpleDTO;
import com.mmc.oms.model.excel.*;
import com.mmc.oms.model.qo.mall.MallOrderQO;
import com.mmc.oms.model.vo.mall.*;
import com.mmc.oms.model.vo.order.TagInfoAllotVO;
import com.mmc.oms.service.mall.*;
import com.mmc.oms.util.BeanCopyUtils;
import lombok.SneakyThrows;
......@@ -1420,7 +1420,7 @@ public class MallOrderServiceImpl implements MallOrderService {
}
@Override
public PageResult listPageManagerVerOne(MallOrderQO param, BaseAccountDTO currentAccount) {
public PageResult listPageManagerVerOne(MallOrderQO param, BaseAccountDTO currentAccount, String token) {
List<Integer> statusCodes = this.getOrderStatusByShowType(param.getShowType());
param.setStatusCode(statusCodes);
//不是管理员。都只能看自己相关的订单
......@@ -1439,7 +1439,7 @@ public class MallOrderServiceImpl implements MallOrderService {
param.buildCurrentPage();
List<MallOrderDO> list = mallOrderDao.listPagePmOrderVerOne(param);
//转换查出来的订单信息
List<MallOrderPageDTO> mallOrderPageDTOList = this.buildMallOrderPageDTO(list);
List<MallOrderPageDTO> mallOrderPageDTOList = this.buildMallOrderPageDTO(list, token);
return PageResult.buildPage(pageNo, param.getPageSize(), count, mallOrderPageDTOList);
}
......@@ -1472,25 +1472,25 @@ public class MallOrderServiceImpl implements MallOrderService {
}
@Override
public List<MallOrderPageDTO> buildMallOrderPageDTO(List<MallOrderDO> list) {
public List<MallOrderPageDTO> buildMallOrderPageDTO(List<MallOrderDO> list, String token) {
//1查出相关商品信息、2查出运营人员、3查出合同信息、4查出推荐人信息、5查出、6设置订单产品清单
List<Long> mallOrderIds = list.stream().map(MallOrderDO::getId).collect(Collectors.toList());
//List<Integer> mallUserIds = list.stream().map(MallOrderDO::getMallUserId).collect(Collectors.toList());
List<Integer> rcdMallUserIds = list.stream().map(MallOrderDO::getRecMallUserId).collect(Collectors.toList());
//批量查出所有商品信息,有产品和行业两种商品订单信息,分别查出
List<MallOrderSimpleDO> pMallOrderSimpleDOList = orderGoodsProdService.listOrderGoodsProdBaseInfo(mallOrderIds);
List<MallOrderSimpleDO> iMallOrderSimpleDOList = orderGoodsIndstService.listOrderGoodsIndstBaseInfo(mallOrderIds);
//List<MallOrderSimpleDO> iMallOrderSimpleDOList = orderGoodsIndstService.listOrderGoodsIndstBaseInfo(mallOrderIds);
// 获取下单用户的认证企业信
List<Integer> userIds = list.stream().map(MallOrderDO::getUserAccountId).collect(Collectors.toList());
//List<MallUserDTO> mallUserDTO = mallUserClient.feignListMallUserDTO(userIds);
List<UserAccountSimpleDTO> userAccountSimpleDTOS = userClient.feignListUserAccountByIds(userIds, null);
List<UserAccountSimpleDTO> userAccountSimpleDTOS = userClient.feignListUserAccountByIds(userIds, token);
// 获取推荐人信息
//Map<Integer, MallUserDTO> integerMallUserDTOMap = mallUserPayClient.feignGetReferralInfos(userIds);
List<UserAccountSimpleDTO> listRcdUserInfo = userClient.feignListRcdUserInfo(userIds, null);
List<CooperationTagDTO> cooperationTagDTOList = userClient.feignListCooperationTag();
List<UserAccountSimpleDTO> listRcdUserInfo = userClient.feignListRcdUserInfo(userIds, token);
List<CooperationTagVO> cooperationTagVOList = userClient.feignListCooperationTag();
// 获取用户的等级标签信息
// List<MallUserDTO> newMallUserDTO = mallUserDTO.stream().peek(d->{
// TagInfoDTO tagInfoDTO = systemServletClient.feignTagInfoById(d.getChannelClass());
......@@ -1503,7 +1503,7 @@ public class MallOrderServiceImpl implements MallOrderService {
List<MallOrderSimpleDO> commonMallOrderList = new ArrayList<>();
commonMallOrderList.addAll(pMallOrderSimpleDOList);
commonMallOrderList.addAll(iMallOrderSimpleDOList);
//commonMallOrderList.addAll(iMallOrderSimpleDOList);
List<Integer> opIds = list.stream().distinct().map(MallOrderDO::getOperationId).collect(Collectors.toList());
opIds.removeIf(Objects::isNull);
......@@ -1514,7 +1514,7 @@ public class MallOrderServiceImpl implements MallOrderService {
//Map<Integer, UserAccountDTO> mapOperate = new HashMap<>();
Map<Integer, UserAccountSimpleDTO> mapOperate = new HashMap<>();
if( !CollectionUtils.isEmpty(opIds) ){
operateUser = userClient.feignListUserAccountByIds(opIds, null );
operateUser = userClient.feignListUserAccountByIds(opIds, token );
//生成key为运营人员id,value为运营人员信息的map
mapOperate = CollectionUtils.isEmpty(operateUser) ? null
: operateUser.stream().collect(Collectors.toMap(UserAccountSimpleDTO::getId, user -> user, (k1, k2) -> k2));
......@@ -1526,7 +1526,7 @@ public class MallOrderServiceImpl implements MallOrderService {
//批量查出推荐人信息
//List<MallUserDTO> rcdMallUserDTOList = mallUserClient.feignListMallUserDTO(rcdMallUserIds);
List<UserAccountSimpleDTO> rcdMallUserDTOList = userClient.feignListUserAccountByIds(rcdMallUserIds, null);
List<UserAccountSimpleDTO> rcdMallUserDTOList = userClient.feignListUserAccountByIds(rcdMallUserIds, token);
Map<Integer, UserAccountSimpleDTO> finalMapOperate = mapOperate;
List<MallOrderPageDTO> mallOrderPageDTOList = list.stream().map(d -> {
......@@ -1563,11 +1563,14 @@ public class MallOrderServiceImpl implements MallOrderService {
// }
// }
// }
//设置推荐人信息
for (UserAccountSimpleDTO rcdMallUserDTO : rcdMallUserDTOList){
if(rcdMallUserDTO.getId().toString().equals(d.getRecMallUserId().toString())){
mallOrderPageDTO.setRecMallUserName(rcdMallUserDTO.getUserName());
break;
if(CollectionUtil.isNotEmpty(rcdMallUserDTOList)){
//设置推荐人信息
for (UserAccountSimpleDTO rcdMallUserDTO : rcdMallUserDTOList){
if(rcdMallUserDTO.getId().toString().equals(d.getRecMallUserId().toString())){
mallOrderPageDTO.setRecMallUserName(rcdMallUserDTO.getUserName());
break;
}
}
}
......@@ -1599,7 +1602,7 @@ public class MallOrderServiceImpl implements MallOrderService {
@SneakyThrows
@Override
public void listPageManagerExportVerOne(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount) {
public void listPageManagerExportVerOne(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount, String token) {
//不是管理员。都只能看自己相关的订单
// if (currentAccount.getAdmin() != 1) {
// param.setOperationId(currentAccount.getId());
......@@ -1614,7 +1617,7 @@ public class MallOrderServiceImpl implements MallOrderService {
}
List<MallOrderDO> list = mallOrderDao.listExportOrderVerOne(param);
List<MallOrderPageDTO> mallOrderPageDTOList = this.buildMallOrderPageDTO(list);
List<MallOrderPageDTO> mallOrderPageDTOList = this.buildMallOrderPageDTO(list, token);
OrderStatus[] values = OrderStatus.values();
List<MallOrderExcel> collect = mallOrderPageDTOList.stream().map(d -> {
MallOrderExcel mallOrderExcel = new MallOrderExcel(d);
......@@ -2015,7 +2018,7 @@ public class MallOrderServiceImpl implements MallOrderService {
}
@Override
public void listOperationalDataExport(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount) throws IOException {
public void listOperationalDataExport(MallOrderQO param, HttpServletResponse response, BaseAccountDTO currentAccount, String token) throws IOException {
//不是管理员。都只能看自己相关的订单
// if (currentAccount.getAdmin() != 1) {
// param.setOperationId(currentAccount.getId());
......@@ -2029,7 +2032,7 @@ public class MallOrderServiceImpl implements MallOrderService {
throw new BizException("没有需要导出的数据");
}
List<MallOrderDO> list = mallOrderDao.listExportOrderVerOne(param);
List<MallOrderPageDTO> mallOrderPageDTOList = this.buildMallOrderPageDTO(list);
List<MallOrderPageDTO> mallOrderPageDTOList = this.buildMallOrderPageDTO(list, token);
List<OperationalDataExcel> collect = mallOrderPageDTOList.stream().map(d -> {
OperationalDataExcel operationalDataExcel = new OperationalDataExcel(d);
List<MallGoodsInfoDTO> mallGoodsInfoDTOS = this.buildMallGoodsInfoDTO(d.getId());
......
......@@ -143,7 +143,6 @@
open="mo.id in (" close=")" separator=",">
#{id}
</foreach>
and mo.create_time >= '2022-12-07 10:20:00'
</select>
<select id="listOrderCoupon" resultType="com.mmc.oms.entity.mall.OrderCouponDO">
......
......@@ -665,7 +665,6 @@
<if test="operationId != null">
and o.operation_id = #{operationId}
</if>
and o.create_time >= '2022-12-07 10:20:00'
</where>
</select>
......@@ -739,7 +738,7 @@
</select>
<select id="listAppPageAmOrder" resultMap="mallOrderResultMap">
select o.id,o.user_account_id,o.order_no,o.status_code,o.pay_method,o.create_time,o.contract_signed_way,o.remark,o.contract_signed_way,o.credit_period,o.share_id,o.share_status
select o.id,o.user_account_id,o.order_no,o.order_amount,o.status_code,o.pay_method,o.create_time,o.contract_signed_way,o.remark,o.contract_signed_way,o.credit_period,o.share_id,o.share_status
from
mall_order o
<where>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论