From 63b7c2cf029bf1c54194df85aea4816f7c76c939 Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期四, 19 十月 2023 16:33:43 +0800
Subject: [PATCH] #路径拼接
---
server/platform/src/main/java/com/doumee/api/business/PricingParamController.java | 8 ++++
server/services/src/main/java/com/doumee/service/business/impl/RefundServiceImpl.java | 4 +
server/services/src/main/java/com/doumee/dao/business/model/Goodsorder.java | 4 ++
server/services/src/main/java/com/doumee/dao/business/model/MemberRides.java | 1
server/services/src/main/java/com/doumee/service/business/impl/ActionLogServiceImpl.java | 10 ++--
server/services/src/main/java/com/doumee/dao/business/model/ActionLog.java | 6 +++
server/services/src/main/java/com/doumee/service/business/impl/PricingDetailServiceImpl.java | 4 +-
server/services/src/main/java/com/doumee/service/business/PricingParamService.java | 2 +
server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java | 1
server/services/src/main/java/com/doumee/dao/business/model/Member.java | 2
server/services/src/main/java/com/doumee/service/business/impl/PricingParamServiceImpl.java | 47 ++++++++++++++++++++++-
server/services/src/main/java/com/doumee/service/business/impl/AdServiceImpl.java | 2 +
12 files changed, 78 insertions(+), 13 deletions(-)
diff --git a/server/platform/src/main/java/com/doumee/api/business/PricingParamController.java b/server/platform/src/main/java/com/doumee/api/business/PricingParamController.java
index f45e51b..d3994aa 100644
--- a/server/platform/src/main/java/com/doumee/api/business/PricingParamController.java
+++ b/server/platform/src/main/java/com/doumee/api/business/PricingParamController.java
@@ -67,6 +67,14 @@
return ApiResponse.success(null);
}
+ @ApiOperation("鏍规嵁ID淇敼鐘舵��")
+ @PostMapping("/updateStatusById")
+ @RequiresPermissions("business:pricingparam:update")
+ public ApiResponse updateStatus(@RequestBody PricingParam pricingParam){
+ pricingParamService.updateStatus(pricingParam);
+ return ApiResponse.success(null);
+ }
+
@ApiOperation("鍒嗛〉鏌ヨ")
@PostMapping("/page")
@RequiresPermissions("business:pricingparam:query")
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/ActionLog.java b/server/services/src/main/java/com/doumee/dao/business/model/ActionLog.java
index 8e2d761..4b18017 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/ActionLog.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/ActionLog.java
@@ -35,6 +35,11 @@
@ExcelColumn(name="鍒涘缓浜�",index = 7,width = 10,align = HorizontalAlignment.CENTER)
private String creator;
+
+ @ApiModelProperty(value = "鍒涘缓浜哄悕绉�")
+ @ExcelColumn(name="鍒涘缓浜哄悕绉�",index = 7,width = 10,align = HorizontalAlignment.CENTER)
+ private String creatorName;
+
@ApiModelProperty(value = "缂栬緫鏃堕棿")
//@JsonFormat(pattern = "yyyy-MM-dd")
private Date editDate;
@@ -58,6 +63,7 @@
@ExcelColumn(name="绫诲瀷 " ,valueMapping = "0=寮哄埗杩樿溅;1=楠戣鏃堕暱淇敼;",index = 5,width = 10,align = HorizontalAlignment.CENTER)
private Integer type;
@ApiModelProperty(value = "绫诲瀷闆嗗悎", example = "1")
+ @TableField(exist = false)
private List<Integer> typeList;
@ApiModelProperty(value = "鍏宠仈瀵硅薄缂栫爜")
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/Goodsorder.java b/server/services/src/main/java/com/doumee/dao/business/model/Goodsorder.java
index 1571c57..4ea6dde 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/Goodsorder.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/Goodsorder.java
@@ -128,4 +128,8 @@
@TableField(exist = false)
@ExcelColumn(name="閫�娆剧粨绠楁椂闂�",width = 10,align = HorizontalAlignment.CENTER)
private Date refundDate;
+
+ @ApiModelProperty(value = "鏈�杩戦獞琛岀姸鎬�")
+ @TableField(exist = false)
+ private Integer memberRidesStatus;
}
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/Member.java b/server/services/src/main/java/com/doumee/dao/business/model/Member.java
index b21c16e..1164937 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/Member.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/Member.java
@@ -46,7 +46,7 @@
@ApiModelProperty(value = "鏄惁宸插垹闄� 0鏈垹闄� 1宸插垹闄�", example = "1")
@ExcelColumn(name="鏄惁宸插垹闄� 0鏈垹闄� 1宸插垹闄�")
- @TableLogic
+
private Integer isdeleted;
@ApiModelProperty(value = "澶囨敞")
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/MemberRides.java b/server/services/src/main/java/com/doumee/dao/business/model/MemberRides.java
index 8d508cd..a39fb50 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/MemberRides.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/MemberRides.java
@@ -37,7 +37,6 @@
private String editor;
@ApiModelProperty(value = "鏄惁宸插垹闄� 0鏈垹闄� 1宸插垹闄�")
- @TableLogic
private Integer isdeleted;
@ApiModelProperty(value = "澶囨敞")
diff --git a/server/services/src/main/java/com/doumee/service/business/PricingParamService.java b/server/services/src/main/java/com/doumee/service/business/PricingParamService.java
index a1658a6..685480a 100644
--- a/server/services/src/main/java/com/doumee/service/business/PricingParamService.java
+++ b/server/services/src/main/java/com/doumee/service/business/PricingParamService.java
@@ -48,6 +48,8 @@
*/
void update(PricingParam pricingParam);
+ void updateStatus(PricingParam pricingParam);
+
void updateById(PricingParam pricingParam);
/**
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/ActionLogServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/ActionLogServiceImpl.java
index b55f6d9..b07dca8 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/ActionLogServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/ActionLogServiceImpl.java
@@ -96,7 +96,7 @@
QueryWrapper<ActionLog> wrapper = new QueryWrapper<>(actionLog);
return actionLogMapper.selectList(wrapper);
}
-
+
@Override
public PageData<ActionLog> findPage(PageWrap<ActionLog> pageWrap) {
@@ -136,10 +136,10 @@
queryWrapper.le(pageWrap.getModel().getEndDate()!=null, ActionLog::getCreateDate,pageWrap.getModel().getEndDate());
queryWrapper.eq(pageWrap.getModel().getCreator()!=null, ActionLog::getCreator,pageWrap.getModel().getCreator());
queryWrapper.in(pageWrap.getModel().getTypeList()!=null && pageWrap.getModel().getTypeList().size()>0, ActionLog::getType,pageWrap.getModel().getTypeList());
- queryWrapper.selectAs(ActionLog::getCreateDate,ActionLog::getCreateDate)
- .selectAs(ActionLog::getActInfo,ActionLog::getActInfo)
- .selectAs(ActionLog::getActReason,ActionLog::getActReason)
- .selectAs(SystemUser::getNickname,ActionLog::getCreator)
+ queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getBikeCode()),ActionLog::getBeforeContent,"%"+pageWrap.getModel().getBikeCode()+"%");
+ queryWrapper
+ .selectAll(ActionLog.class)
+ .selectAs(SystemUser::getRealname,ActionLog::getCreatorName)
.selectAs(Member::getOpenid,ActionLog::getOpenid)
.selectAs(MemberRides::getBikeCode,ActionLog::getBikeCode)
.selectAs(MemberRides::getRentSiteId,ActionLog::getRentSiteId)
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/AdServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/AdServiceImpl.java
index f122600..708b526 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/AdServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/AdServiceImpl.java
@@ -34,6 +34,8 @@
@Override
public String create(Ad ad) {
+ ad.setIsdeleted(Constants.ZERO);
+ ad.setStatus(Constants.ZERO);
adMapper.insert(ad);
return ad.getId();
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
index 69cb907..7726ace 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
@@ -227,6 +227,7 @@
public PageData<Goodsorder> findPage(PageWrap<Goodsorder> pageWrap) {
IPage<Goodsorder> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
MPJLambdaWrapper<Goodsorder> queryWrapper = initQueryParamByModel(pageWrap.getModel());
+ queryWrapper.select("(select er.status from member_rides er where er.ordre_id=t.id order by er.create_date limit 1) as memberRidesStatus");
IPage<Goodsorder> goodsorderIPage = goodsorderJoinMapper.selectJoinPage(page, Goodsorder.class, queryWrapper);
if (!CollectionUtils.isEmpty(goodsorderIPage.getRecords())){
goodsorderIPage.getRecords().forEach(s->{
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/PricingDetailServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/PricingDetailServiceImpl.java
index 4d0f278..4cbd243 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/PricingDetailServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/PricingDetailServiceImpl.java
@@ -93,7 +93,7 @@
public static String getRoleNameByParam(BigDecimal basePrice, Integer baseTime, BigDecimal unitPrice, Integer unitTime) {
String title = "璁¤垂瑙勫垯锛�";
if(baseTime < 0){
- title = Constants.translateMoney(basePrice).doubleValue()+"鍏冪晠楠戜竴鏁村ぉ";
+ title = basePrice.doubleValue()+"鍏冪晠楠戜竴鏁村ぉ";
}else {
title = "璧锋";
int time = baseTime / 60;
@@ -105,7 +105,7 @@
title += min+"鍒嗛挓";
}
title += Constants.translateMoney(unitPrice).doubleValue()
- +"鍏冿紝瓒呰繃鍚�"+Constants.translateMoney(basePrice).doubleValue()+"鍏�/"
+ +"鍏冿紝瓒呰繃鍚�"+basePrice.doubleValue()+"鍏�/"
+unitTime+"鍒嗛挓";
}
return title;
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/PricingParamServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/PricingParamServiceImpl.java
index 9e09b2c..e196d52 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/PricingParamServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/PricingParamServiceImpl.java
@@ -1,11 +1,15 @@
package com.doumee.service.business.impl;
import com.doumee.core.constants.Constants;
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.PricingDetailMapper;
import com.doumee.dao.business.PricingParamMapper;
+import com.doumee.dao.business.model.PricingDetail;
import com.doumee.dao.business.model.PricingParam;
import com.doumee.service.business.PricingParamService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -19,6 +23,7 @@
import java.util.Date;
import java.util.List;
+import java.util.Objects;
/**
* 瀹氫环鏂规閰嶇疆Service瀹炵幇
@@ -30,6 +35,9 @@
@Autowired
private PricingParamMapper pricingParamMapper;
+
+ @Autowired
+ private PricingDetailMapper pricingDetailMapper;
@Override
public String create(PricingParam pricingParam) {
@@ -45,7 +53,7 @@
insert.setStartDate(pricingParam.getStartDate());
insert.setEndDate(pricingParam.getEndDate());
insert.setSortnum(pricingParam.getSortnum());
- insert.setStatus(Constants.ZERO);
+ insert.setStatus(Constants.ONE);
insert.setInfo(pricingParam.getInfo());
pricingParamMapper.insert(insert);
return insert.getId();
@@ -79,13 +87,46 @@
.eq(PricingParam::getId,pricingParam.getId())
.set(PricingParam::getEditor,principal.getId())
.set(PricingParam::getName,pricingParam.getName())
- .set(PricingParam::getStatus,pricingParam.getStatus())
+// .set(PricingParam::getStatus,pricingParam.getStatus())
.set(PricingParam::getStartDate,pricingParam.getStartDate())
.set(PricingParam::getEndDate,pricingParam.getEndDate())
.set(PricingParam::getSortnum,pricingParam.getSortnum());
pricingParamMapper.update(null,wrapper);
}
+ @Override
+ public void updateStatus(PricingParam pricingParam) {
+
+ if (Objects.nonNull(pricingParam.getStatus()) && pricingParam.getStatus().equals(Constants.ZERO)){
+ QueryWrapper<PricingDetail> wrapper = new QueryWrapper<>();
+ wrapper.lambda()
+ .eq(PricingDetail::getIsdeleted,Constants.ZERO)
+ .eq(PricingDetail::getPricePramId,pricingParam.getId());
+ Integer integer = pricingDetailMapper.selectCount(wrapper);
+ if (integer < 0 ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇ュ畾浠锋柟妗堜笅娌℃湁閰嶇疆浠锋牸");
+ }
+ PricingParam pricingParam1 = new PricingParam();
+ pricingParam1.setId(pricingParam.getId());
+ pricingParam1.setStatus(pricingParam.getStatus());
+ pricingParamMapper.updateById(pricingParam1);
+ }else if (Objects.nonNull(pricingParam.getStatus()) && pricingParam.getStatus().equals(Constants.ONE)){
+
+ QueryWrapper<PricingParam> wrapper = new QueryWrapper<>();
+ wrapper.lambda()
+ .eq(PricingParam::getIsdeleted,Constants.ZERO)
+ .eq(PricingParam::getStatus,Constants.ZERO);
+ Integer integer = pricingParamMapper.selectCount(wrapper);
+ if (integer <= 1 ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇ュ畾浠锋柟妗堝繀椤婚厤缃�");
+ }
+ PricingParam pricingParam1 = new PricingParam();
+ pricingParam1.setId(pricingParam.getId());
+ pricingParam1.setStatus(pricingParam.getStatus());
+ pricingParamMapper.updateById(pricingParam1);
+ }
+
+ }
@Override
public void updateById(PricingParam pricingParam) {
@@ -164,8 +205,8 @@
if (pageWrap.getModel().getInfo() != null) {
queryWrapper.lambda().eq(PricingParam::getInfo, pageWrap.getModel().getInfo());
}
- queryWrapper.lambda().orderByAsc(PricingParam::getSortnum);
queryWrapper.lambda().orderByAsc(PricingParam::getStatus);
+ queryWrapper.lambda().orderByAsc(PricingParam::getSortnum);
return PageData.from(pricingParamMapper.selectPage(page, queryWrapper));
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/RefundServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/RefundServiceImpl.java
index c9eff3b..c7f0b15 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/RefundServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/RefundServiceImpl.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -96,7 +97,7 @@
QueryWrapper<Refund> wrapper = new QueryWrapper<>(refund);
return refundMapper.selectList(wrapper);
}
-
+
@Override
public PageData<Refund> findPlatPage(PageWrap<Refund> pageWrap) {
pageWrap.getModel().setTypeList(new ArrayList<>());
@@ -106,6 +107,7 @@
pageWrap.getModel().setStatus(Constants.TWO);
IPage<Goodsorder> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
MPJLambdaWrapper<Refund> queryWrapper = initQueryParamByModel(pageWrap.getModel());
+ queryWrapper.eq(StringUtils.isNotBlank(pageWrap.getModel().getCreatorName()),SystemUser::getRealname,pageWrap.getModel().getCreatorName());
return PageData.from(refundJoinMapper.selectJoinPage(page, Refund.class,queryWrapper));
}
@Override
--
Gitblit v1.9.3