Compare commits
No commits in common. "200bc1ee3a669fda88538732357a984e1520e209" and "25190d46bd9d30c6b610cbc84d137269032b90eb" have entirely different histories.
200bc1ee3a
...
25190d46bd
|
|
@ -30,9 +30,6 @@ public class DiscountManageEntity {
|
|||
*/
|
||||
private Long companyId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 费用类型:goods 产品 service 服务费
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,16 +2,12 @@ package com.njzscloud.supervisory.discount.service.impl;
|
|||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.BizCompanyEntity;
|
||||
import com.njzscloud.supervisory.biz.service.BizCompanyService;
|
||||
import com.njzscloud.supervisory.discount.mapper.DiscountManageMapper;
|
||||
import com.njzscloud.supervisory.discount.pojo.DiscountManageEntity;
|
||||
import com.njzscloud.supervisory.discount.service.DiscountManageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -22,11 +18,8 @@ import java.util.List;
|
|||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DiscountManageServiceImpl extends ServiceImpl<DiscountManageMapper, DiscountManageEntity> implements DiscountManageService {
|
||||
|
||||
private final BizCompanyService bizCompanyService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
|
@ -56,12 +49,7 @@ public class DiscountManageServiceImpl extends ServiceImpl<DiscountManageMapper,
|
|||
*/
|
||||
@Override
|
||||
public DiscountManageEntity detail(Long id) {
|
||||
DiscountManageEntity entity = this.getById(id);
|
||||
BizCompanyEntity companyEntity = bizCompanyService.getById(entity.getCompanyId());
|
||||
if (null != companyEntity) {
|
||||
entity.setCompanyName(companyEntity.getCompanyName());
|
||||
}
|
||||
return entity;
|
||||
return this.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -69,20 +57,13 @@ public class DiscountManageServiceImpl extends ServiceImpl<DiscountManageMapper,
|
|||
*/
|
||||
@Override
|
||||
public PageResult<DiscountManageEntity> paging(PageParam pageParam, DiscountManageEntity discountManageEntity) {
|
||||
Page<DiscountManageEntity> page = this.page(pageParam.toPage(), Wrappers.<DiscountManageEntity>lambdaQuery()
|
||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<DiscountManageEntity>lambdaQuery()
|
||||
.eq(discountManageEntity.getCompanyId() != null, DiscountManageEntity::getCompanyId, discountManageEntity.getCompanyId())
|
||||
.eq(StrUtil.isNotBlank(discountManageEntity.getFeeType()), DiscountManageEntity::getFeeType, discountManageEntity.getFeeType())
|
||||
.eq(discountManageEntity.getExpenseId() != null, DiscountManageEntity::getExpenseId, discountManageEntity.getExpenseId())
|
||||
.eq(StrUtil.isNotBlank(discountManageEntity.getType()), DiscountManageEntity::getType, discountManageEntity.getType())
|
||||
.eq(discountManageEntity.getDeleted() != null, DiscountManageEntity::getDeleted, Boolean.FALSE)
|
||||
.orderByDesc(DiscountManageEntity::getCreateTime));
|
||||
for (DiscountManageEntity entity: page.getRecords()) {
|
||||
BizCompanyEntity companyEntity = bizCompanyService.getById(entity.getCompanyId());
|
||||
if (null != companyEntity) {
|
||||
entity.setCompanyName(companyEntity.getCompanyName());
|
||||
}
|
||||
}
|
||||
return PageResult.of(page);
|
||||
.orderByDesc(DiscountManageEntity::getCreateTime)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.njzscloud.supervisory.order.pojo.param.*;
|
|||
import com.njzscloud.supervisory.order.pojo.result.OrderCertificateResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.TrainBillResult;
|
||||
import com.njzscloud.supervisory.order.service.AccountRegulationService;
|
||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||
import com.njzscloud.supervisory.sys.log.annotation.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -32,8 +31,6 @@ import java.util.List;
|
|||
public class OrderInfoController {
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
private final AccountRegulationService accountRegulationService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
|
@ -271,14 +268,4 @@ public class OrderInfoController {
|
|||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Log("业务调账")
|
||||
@PostMapping("/account_regulation")
|
||||
public R<?> accountRegulation(@RequestBody RegulationParam param) {
|
||||
accountRegulationService.accountRegulation(param);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 调账入参
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class RegulationParam {
|
||||
|
||||
/**
|
||||
* 清运公司Id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 订单sn
|
||||
*/
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
private String delta;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.njzscloud.supervisory.order.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.ChangePriceParam;
|
||||
import com.njzscloud.supervisory.order.pojo.param.RegulationParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AccountRegulationService {
|
||||
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
/**
|
||||
* 业务调账
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void accountRegulation(RegulationParam param) {
|
||||
OrderInfoEntity order = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getSn, param.getSn()));
|
||||
Assert.notNull(order, () -> Exceptions.clierr("订单不存在"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue