提交 628c4952 authored 作者: hzh's avatar hzh

订单增加作废接口

上级 be706870
......@@ -22,6 +22,10 @@ public enum InsureApiEnum implements ApiEnum {
* 签单接口
*/
ISSUE("/api/v1/insure/issue/{OrderNum}", "签单接口"),
/**
* 作废接口
*/
ABANDON("/api/v1/order/abandon/{orderId}", "作废接口"),
/**
* 订单详情
*/
......
......@@ -50,6 +50,13 @@ public interface WeishiService {
*/
IssueResponse insureIssue(String token, String orderNum);
/**
* 作废接口
* @param token token
* @param orderId 订单id
*/
void insureAbandon(String token, Integer orderId);
/**
* 订单详情
*
......
......@@ -104,6 +104,22 @@ public class WeishiServiceImpl implements WeishiService {
return res;
}
@Override
public void insureAbandon(String token, Integer orderId) {
Map<String, Object> map = MapUtil.<String, Object>builder()
.put("orderId", orderId)
.build();
IssueResponse res = Api.v1(RequestMethodEnum.POST,
DomainEnum.TEST.getDomain(),
StrUtil.format(InsureApiEnum.ABANDON.getUrl(), map),
token,
null,
IssueResponse.class);
if (!Objects.equals(res.getResultTp(), Code.SUCCESS.getCode())) {
throw new WeishiException(res.getResultMsg());
}
}
@Override
public DetailResponse insureDetail(String token, Integer orderId) {
Map<String, Object> map = MapUtil.<String, Object>builder()
......
......@@ -140,6 +140,18 @@ public class WeishiController {
return R.ok();
}
/**
* 作废接口
*
* @param orderId 订单id
*/
@PostMapping("/insureAbandon/{orderId}")
public R<IssueResponse> insureAbandon(@PathVariable Integer orderId) {
weishiService.insureAbandon(getToken(), orderId);
insureService.insureAbandon(orderId);
return R.ok();
}
/**
* 保单撤单接口
*
......
......@@ -63,4 +63,11 @@ public interface IInsureService extends IBaseService<InsureVo, InsureBo, Insure>
* @return 数据
*/
InsureVo getDetail(Long id);
/**
* 作废接口
*
* @param orderId 订单id
*/
void insureAbandon(Integer orderId);
}
......@@ -6,15 +6,13 @@ import lombok.RequiredArgsConstructor;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.common.mybatis.service.AbstractBaseService;
import org.dromara.mall.domain.weishi.Account;
import org.dromara.mall.controller.weishi.admin.bo.AccountBo;
import org.dromara.mall.controller.weishi.admin.vo.AccountVo;
import org.dromara.mall.domain.weishi.Account;
import org.dromara.mall.mapper.weishi.AccountMapper;
import org.dromara.mall.service.weishi.IAccountService;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 保险账号Service业务层处理
*
......@@ -34,7 +32,6 @@ public class AccountServiceImpl extends AbstractBaseService<AccountVo, AccountBo
@Override
public LambdaQueryWrapper<Account> buildQueryWrapper(AccountBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<Account> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getDeptId() != null, Account::getDeptId, bo.getDeptId());
lqw.eq(StringUtils.isNotBlank(bo.getUsername()), Account::getUsername, bo.getUsername());
......
......@@ -84,6 +84,7 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
lqw.eq(StringUtils.isNotBlank(bo.getDataTp()), Insure::getDataTp, bo.getDataTp());
lqw.like(StringUtils.isNotBlank(bo.getInsuredAbbr()), Insure::getInsuredAbbr, bo.getInsuredAbbr());
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), Insure::getStatus, bo.getStatus());
lqw.eq(bo.getCreateDept() != null, Insure::getCreateDept, bo.getCreateDept());
lqw.eq(bo.getOrderTime() != null, Insure::getOrderTime, bo.getOrderTime());
return lqw;
}
......@@ -181,6 +182,12 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
updateStatus(orderNum, OrderStatus.E.getKey());
}
@Override
public void insureAbandon(Integer orderId) {
Insure insure = baseMapper.selectOne(Insure::getOrderId, orderId);
updateStatus(insure.getOrderNum(), OrderStatus.A.getKey());
}
private void updateStatus(String orderNum, String orderStatus) {
Insure insure = baseMapper.selectOne(Insure::getOrderNum, orderNum);
insure.setStatus(orderStatus);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论