Commit f9243d9b authored by lanbaoming's avatar lanbaoming

Merge remote-tracking branch 'origin/dev' into dev

parents 2d320dc2 ee0bfece
......@@ -150,14 +150,16 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
"GROUP BY r1.title_zh",
"</when>",
"<when test = 'type == 2'>",
"AND w.guojia=#{regionId}",
"AND w.guojia in (${regionId})",
"GROUP BY w.shi",
"</when>",
"<when test = 'type == 3'>",
"AND w.shi=#{regionId}",
"<if test= 'regionId != null and regionId != \"\" '>",
"AND w.shi in (${regionId})",
"</if>",
"GROUP BY w.title_zh",
"</when>",
"</script>"
})
List<WarehouseTreeRegionVO> getRegionList(@Param("type") Integer type, @Param("regionId") Integer regionId);
List<WarehouseTreeRegionVO> getRegionList(@Param("type") Integer type, @Param("regionId") String regionId);
}
......@@ -171,5 +171,5 @@ public interface WarehouseService {
List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType);
List<WarehouseTreeRegionVO> getRegionList(Integer type, Integer regionId);
List<WarehouseTreeRegionVO> getRegionList(Integer type, String regionId);
}
......@@ -514,7 +514,10 @@ public class WarehouseServiceImpl implements WarehouseService {
}
@Override
public List<WarehouseTreeRegionVO> getRegionList(Integer type, Integer regionId) {
public List<WarehouseTreeRegionVO> getRegionList(Integer type, String regionId) {
if(regionId.equals("")){
return new ArrayList();
}
List<WarehouseTreeRegionVO> list = warehouseMapper.getRegionList(type,regionId);
return list;
}
......
......@@ -101,7 +101,7 @@ public class WarehouseController {
}
@GetMapping("/getRegionList")
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(@RequestParam(value = "type", required = false) Integer type,Integer regionId){
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(@RequestParam(value = "type", required = false) Integer type,String regionId){
List<WarehouseTreeRegionVO> list = warehouseService.getRegionList(type,regionId);
return success(list);
}
......
......@@ -153,11 +153,16 @@ public interface OrderQueryService {
List<OrderDO> getOrderList(OrderQueryVO query);
PageResult<OrderBackPageVO> orderPage(OrderQueryVO query, PageVO page);
PageResult<OrderBackPageVO> myOrderPage(OrderQueryDTO query, PageVO page);
long orderCount(OrderQueryVO query);
PageResult<OrderBackPageVO> deptOrderPage(OrderQueryVO query, PageVO page);
PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page);
PageResult<OrderBackPageVO> myIssuedOrderPage(OrderQueryVO query, PageVO page);
/**
......@@ -307,6 +312,7 @@ public interface OrderQueryService {
List<OrderDO> getOrderChildren(List<Long> orderIds);
StatisticsOrderVO statisticsOrder(OrderQueryVO query);
StatisticsOrderVO statisticsMyOrder(OrderQueryDTO query) ;
void exportOrderExcel(HttpServletResponse response, OrderQueryVO query) throws IOException;
......
......@@ -875,6 +875,20 @@ public class OrderQueryServiceImpl implements OrderQueryService {
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
@Override
public PageResult<OrderBackPageVO> myOrderPage(OrderQueryDTO query, PageVO page) {
if (Objects.isNull(query.getLang())) {
query.setLang(I18nMessage.getLang());
}
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.orderCount1(query);
log.warn(I18nMessage.getLang().toString());
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<OrderBackPageVO> list = orderMapper.orderList1(start, size, query);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
@Override
public long orderCount(OrderQueryVO query) {
return orderMapper.orderCount(query);
......@@ -892,6 +906,18 @@ public class OrderQueryServiceImpl implements OrderQueryService {
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
@Override
public PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page) {
query.setLang(I18nMessage.getLang());
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.deptOrderCount1(query);
log.warn(I18nMessage.getLang().toString());
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<OrderBackPageVO> list = orderMapper.deptOrderList1(start, size, query);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
@Override
public PageResult<OrderBackPageVO> myIssuedOrderPage(OrderQueryVO query, PageVO page) {
query.setLang(I18nMessage.getLang());
......@@ -1480,6 +1506,61 @@ public class OrderQueryServiceImpl implements OrderQueryService {
return vo;
}
@Override
public StatisticsOrderVO statisticsMyOrder(OrderQueryDTO query) {
StatisticsOrderVO vo = orderMapper.statisticsMyOrder(query);
if (Objects.nonNull(vo)) {
vo.setTotalVolume(new BigDecimal(vo.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalWeight(new BigDecimal(vo.getTotalWeight()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalWVolume(new BigDecimal(vo.getTotalWVolume()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalVWeight(new BigDecimal(vo.getTotalVWeight()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalChargeVolume(new BigDecimal(vo.getTotalChargeVolume()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalChargeWeight(new BigDecimal(vo.getTotalChargeWeight()).setScale(2, RoundingMode.HALF_UP).toString());
} else {
vo = new StatisticsOrderVO();
}
if (Objects.nonNull(query.getBeginWarehouseInTime()) && Objects.nonNull(query.getEndWarehouseInTime())) {
// 入仓记录统计时,实测入仓数据替换为入仓记录中的和值
StatisticsOrderVO warehouseInVO = orderMapper.statisticsMyWarehouseIn(query);
if (Objects.nonNull(warehouseInVO)) {
vo.setTotalNum(warehouseInVO.getTotalNum());
vo.setTotalVolume(new BigDecimal(warehouseInVO.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalWeight(new BigDecimal(warehouseInVO.getTotalWeight()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setOrderQuantity(warehouseInVO.getOrderQuantity());
} else {
vo.setTotalNum(0);
vo.setTotalVolume(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalWeight(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP).toString());
vo.setOrderQuantity(0);
}
}
if (Objects.nonNull(query.getBeginRucangTime()) && Objects.nonNull(query.getEndRucangTime())) {
// 入仓记录统计时,实测入仓数据替换为入仓记录中的和值
StatisticsOrderVO warehouseInVO = orderMapper.statisticsMyWarehouseIn(query);
if (Objects.nonNull(warehouseInVO)) {
vo.setTotalNum(warehouseInVO.getTotalNum());
vo.setTotalVolume(new BigDecimal(warehouseInVO.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalWeight(new BigDecimal(warehouseInVO.getTotalWeight()).setScale(2, RoundingMode.HALF_UP).toString());
vo.setOrderQuantity(warehouseInVO.getOrderQuantity());
} else {
vo.setTotalNum(0);
vo.setTotalVolume(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP).toString());
vo.setTotalWeight(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP).toString());
vo.setOrderQuantity(0);
}
}
if (Objects.nonNull(query.getBeginPickUpTime()) && Objects.nonNull(query.getEndPickUpTime())) {
// 入仓记录统计时,实测入仓数据替换为入仓记录中的和值
StatisticsOrderVO pickUpVO = orderMapper.statisticsMyPickUp(query);
if (Objects.nonNull(pickUpVO)) {
vo.setTotalNum(pickUpVO.getTotalNum());
} else {
vo.setTotalNum(0);
}
}
return vo;
}
@Override
public void exportOrderExcel(HttpServletResponse response, OrderQueryVO query) throws IOException {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATA_FORMAT);
......
......@@ -27,10 +27,7 @@ import cn.iocoder.yudao.module.infra.service.file.FileService;
import cn.iocoder.yudao.module.order.convert.order.OrderConvert;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dto.OrderBackInfoDto;
import cn.iocoder.yudao.module.order.dto.OrderExportBackDTO;
import cn.iocoder.yudao.module.order.dto.PackingListDto;
import cn.iocoder.yudao.module.order.dto.SearchBackDto;
import cn.iocoder.yudao.module.order.dto.*;
import cn.iocoder.yudao.module.order.enums.OrderTempLateEnum;
import cn.iocoder.yudao.module.order.enums.TransportTypeShortEnum;
import cn.iocoder.yudao.module.order.service.order.OrderBusinessService;
......@@ -308,9 +305,9 @@ public class OrderController {
@GetMapping("/page")
@ApiOperation("获得订单分页")
// @PreAuthorize("@ss.hasPermission('ecw:order:query')")
public CommonResult<PageResult<OrderBackPageVO>> getOrderPage(OrderQueryVO query, PageVO page) {
public CommonResult<PageResult<OrderBackPageVO>> getOrderPage(OrderQueryDTO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult = orderQueryService.orderPage(query, page);
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
return success(pageResult);
}
......@@ -326,12 +323,12 @@ public class OrderController {
@GetMapping("/my/page")
@ApiOperation("获得我的订单分页")
public CommonResult<PageResult<OrderBackPageVO>> myOrderPage(OrderQueryVO query, PageVO page) {
public CommonResult<PageResult<OrderBackPageVO>> myOrderPage(OrderQueryDTO query, PageVO page) {
Long salesmanId = SecurityFrameworkUtils.getLoginUserId(); // 获取当前登录用户ID
query.setUserType(UserTypeEnum.ADMIN.getValue());
// query.setSalesmanId(salesmanId);
query.setCreator(String.valueOf(salesmanId));
PageResult<OrderBackPageVO> pageResult = orderQueryService.orderPage(query, page);
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
return success(pageResult);
}
......@@ -339,11 +336,11 @@ public class OrderController {
@GetMapping("/dept-order-page")
@ApiOperation("部门订单分页")
// @PreAuthorize("@ss.hasPermission('ecw:order:query')")
public CommonResult<PageResult<OrderBackPageVO>> getDeptOrderPage(OrderQueryVO query, PageVO page) {
public CommonResult<PageResult<OrderBackPageVO>> getDeptOrderPage(OrderQueryDTO query, PageVO page) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
query.setUserType(UserTypeEnum.ADMIN.getValue());
query.setDeptId(Objects.isNull(loginUser) ? 0L : loginUser.getDeptId());
PageResult<OrderBackPageVO> pageResult = orderQueryService.deptOrderPage(query, page);
PageResult<OrderBackPageVO> pageResult = orderQueryService.deptOrderPage1(query, page);
return success(pageResult);
}
......@@ -716,12 +713,12 @@ public class OrderController {
@GetMapping("/dept/statistics")
@ApiOperation("参数查询获得部门订单统计")
public CommonResult<StatisticsOrderVO> statisticsDeptOrder(OrderQueryVO query) {
public CommonResult<StatisticsOrderVO> statisticsDeptOrder(OrderQueryDTO query) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); // 获取当前登录用户ID
query.setUserType(UserTypeEnum.ADMIN.getValue());
// query.setSalesmanId(salesmanId);
query.setDeptId(Objects.isNull(loginUser) || Objects.isNull(loginUser.getDeptId()) ? 0L : loginUser.getDeptId());
return success(orderQueryService.statisticsOrder(query));
return success(orderQueryService.statisticsMyOrder(query));
}
@GetMapping("/data/scope/statistics")
......@@ -746,19 +743,19 @@ public class OrderController {
@GetMapping("/my/statistics")
@ApiOperation("参数查询获得我的订单统计")
public CommonResult<StatisticsOrderVO> statisticsMyOrder(OrderQueryVO query) {
public CommonResult<StatisticsOrderVO> statisticsMyOrder(OrderQueryDTO query) {
Long salesmanId = SecurityFrameworkUtils.getLoginUserId(); // 获取当前登录用户ID
query.setUserType(UserTypeEnum.ADMIN.getValue());
// query.setSalesmanId(salesmanId);
query.setCreator(String.valueOf(salesmanId));
return success(orderQueryService.statisticsOrder(query));
return success(orderQueryService.statisticsMyOrder(query));
}
@GetMapping("/statistics")
@ApiOperation("参数查询订单管理统计")
public CommonResult<StatisticsOrderVO> statisticsOrder(OrderQueryVO query) {
return success(orderQueryService.statisticsOrder(query));
public CommonResult<StatisticsOrderVO> statisticsOrder(OrderQueryDTO query) {
return success(orderQueryService.statisticsMyOrder(query));
}
......
package cn.iocoder.yudao.module.product.dto;
import cn.iocoder.yudao.module.product.vo.productPrice.LineChannelVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Size;
import java.util.List;
@ApiModel("复制价格入参DTO")
@Data
public class CopyProductPriceDto {
......@@ -14,4 +18,8 @@ public class CopyProductPriceDto {
@ApiModelProperty("商品id")
private String productId ;
@ApiModelProperty(value = "线路渠道列表", required = true)
@Size(min = 1)
private List<LineChannelVo> lineChannelList;
}
......@@ -3306,23 +3306,33 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//列出要复制的商品价格
List<ProductPriceDO> productPriceDOList = this.productPriceMapper.selectList(new LambdaQueryWrapper<ProductPriceDO>().in(ProductPriceDO::getId, ids));
ProductPriceAirCreateReqVO createReqVO = new ProductPriceAirCreateReqVO() ;
createReqVO.setProductId(Long.parseLong(dto.getProductId()) );
List<LineChannelVo> lineChannelList = createReqVO.getLineChannelList();
ProductDO productDO = checkUpdateStatus(lineChannelList, createReqVO.getProductId());
WarehouseLineSearchVO searchVO = new WarehouseLineSearchVO();
List<WarehouseLineDO> warehouseLineList = warehouseService.openedRouterList(searchVO);
List<ProductDO> productList = Collections.singletonList(productDO);
//商品线路保存在redis。更新成功后移除
batchSaveKeyInCache(productList, lineChannelList);
if(productPriceDOList.size()>0){
productPriceDOList.forEach(p->{
ProductPriceAirCreateReqVO createReqVO = new ProductPriceAirCreateReqVO() ;
BeanUtils.copyProperties(p,createReqVO);
createReqVO.setProductId(Long.parseLong(dto.getProductId()) );
LineChannelVo vo = new LineChannelVo();
vo.setShippingChannelId(p.getShippingChannelId());
vo.setLineId(p.getWarehouseLineId());
List<LineChannelVo> lineChannelList = new ArrayList<>();
lineChannelList.add(vo);
createReqVO.setLineChannelList(lineChannelList);
//ProductDO productDO = checkUpdateStatus(lineChannelList, createReqVO.getProductId());
ProductDO productDO = productService.getProduct(createReqVO.getProductId());
WarehouseLineSearchVO searchVO = new WarehouseLineSearchVO();
List<WarehouseLineDO> warehouseLineList = warehouseService.openedRouterList(searchVO);
List<ProductDO> productList = Collections.singletonList(productDO);
//商品线路保存在redis。更新成功后移除
batchSaveKeyInCache(productList, lineChannelList);
createReqVO.setSync(true);
createReqVO.setBatch(false);
batchUpdateAir(createReqVO, warehouseLineList, productList);
});
}
createReqVO.setSync(true);
createReqVO.setBatch(false);
batchUpdateAir(createReqVO, warehouseLineList, productList);
}
......
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