Merge remote-tracking branch 'origin/wzj-main' into wzj-main
This commit is contained in:
commit
9e2fa2ed16
BIN
null/download/0952cc1651f0458fab7c1b52eed45d1b_订单售后数据.xlsx
Normal file
BIN
null/download/0952cc1651f0458fab7c1b52eed45d1b_订单售后数据.xlsx
Normal file
Binary file not shown.
BIN
null/download/62f9b95dc78e4096b1284da19117d9e5_订单售后数据.xlsx
Normal file
BIN
null/download/62f9b95dc78e4096b1284da19117d9e5_订单售后数据.xlsx
Normal file
Binary file not shown.
BIN
null/download/7899d2d8a00f4f899a882eaaa8f4b8a2_订单售后数据.xlsx
Normal file
BIN
null/download/7899d2d8a00f4f899a882eaaa8f4b8a2_订单售后数据.xlsx
Normal file
Binary file not shown.
BIN
null/download/ee3cbbae3c454908810316c4dc7da48e_订单售后数据.xlsx
Normal file
BIN
null/download/ee3cbbae3c454908810316c4dc7da48e_订单售后数据.xlsx
Normal file
Binary file not shown.
BIN
qrcode/12342424.png
Normal file
BIN
qrcode/12342424.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 444 B |
@ -1,12 +1,17 @@
|
||||
package org.dromara.web.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.wzj.soopin.order.service.OrderService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*
|
||||
@ -17,6 +22,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
public class IndexController {
|
||||
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
/**
|
||||
* 访问首页,提示语
|
||||
*/
|
||||
@ -29,8 +37,11 @@ public class IndexController {
|
||||
/**
|
||||
* 获取数量统计
|
||||
*/
|
||||
// public List< String>
|
||||
|
||||
@GetMapping("/count")
|
||||
public R getCount() {
|
||||
return R.ok(orderService.getCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今日待办任务
|
||||
|
@ -98,6 +98,14 @@
|
||||
<groupId>org.lionsoul</groupId>
|
||||
<artifactId>ip2region</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
package com.wzj.soopin.order.utils;
|
||||
package org.dromara.common.core.utils;
|
||||
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
@ -20,6 +20,14 @@
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-satoken</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -10,6 +10,7 @@ import com.wzj.soopin.content.domain.vo.CommentVO;
|
||||
import com.wzj.soopin.content.domain.vo.IndexVlogVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -94,4 +95,7 @@ public interface VlogMapper extends BaseMapper<Vlog> {
|
||||
* @return 分页结果,包含视频信息及统计数据
|
||||
*/
|
||||
IPage<Map<String, Object>> selectVlogListWithAggregatedData(Page<Map<String, Object>> page, @Param("vlogBO") VlogBO vlogBO);
|
||||
|
||||
@Select("SELECT COUNT(*) FROM t_vlog where status = 0")
|
||||
Object countVlog();
|
||||
}
|
||||
|
@ -7,8 +7,10 @@ import com.wzj.soopin.goods.domain.bo.ProductBo;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商品信息Mapper接口
|
||||
@ -25,4 +27,15 @@ public interface ProductMapper extends BaseMapper<Product> {
|
||||
List<Product> selectByEntity(Product product);
|
||||
|
||||
IPage<ProductVO> getlist(@Param("page") Page<Product> page, @Param("query") ProductBo query);
|
||||
|
||||
|
||||
|
||||
@Select("SELECT " +
|
||||
"SUM(CASE WHEN auth_flag = 1 THEN 1 ELSE 0 END) AS count1, " +
|
||||
"SUM(CASE WHEN auth_flag = 2 THEN 1 ELSE 0 END) AS count2 " +
|
||||
"FROM pms_product")
|
||||
Map<String, Object> countProduct();
|
||||
|
||||
// @Select("SELECT COUNT(*) FROM pms_product WHERE auth_flag = 1")
|
||||
// Object AuditProduct();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -49,4 +49,7 @@ public interface MemberMapper extends BaseMapper<Member> {
|
||||
"WHERE id = #{memberId} \n" +
|
||||
" AND expert = 1;")
|
||||
Member isExpert(String memberId);
|
||||
|
||||
@Select("SELECT COUNT(*) FROM ums_member")
|
||||
Object countMember();
|
||||
}
|
||||
|
@ -1,14 +1,9 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.po.Withdraw;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 意见反馈Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface WithdrawMapper extends BaseMapper<Withdraw> {
|
||||
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> i
|
||||
memberAccountChangeRecordService.save(memberAccountChangeRecord);
|
||||
|
||||
} else {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -157,7 +157,14 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.22</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-content</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-content</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
@ -1,35 +1,20 @@
|
||||
package com.wzj.soopin.order.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.member.domain.bo.FeedbackBO;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountBO;
|
||||
import com.wzj.soopin.member.domain.bo.MemberBO;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.vo.FeedbackVO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberVO;
|
||||
import com.wzj.soopin.order.convert.AftersaleConvert;
|
||||
import com.wzj.soopin.order.domain.bo.AftersaleBo;
|
||||
import com.wzj.soopin.order.domain.entity.OrderOperateHistory;
|
||||
import com.wzj.soopin.order.service.AftersaleService;
|
||||
import com.wzj.soopin.order.domain.entity.Aftersale;
|
||||
import com.wzj.soopin.order.domain.form.DealWithAftersaleForm;
|
||||
import com.wzj.soopin.order.domain.form.ManagerAftersaleOrderForm;
|
||||
import com.wzj.soopin.order.domain.query.AftersaleQuery;
|
||||
import com.wzj.soopin.order.domain.vo.*;
|
||||
import com.wzj.soopin.order.service.impl.AftersaleServiceImpl;
|
||||
import com.wzj.soopin.order.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.utils.SecurityUtils;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
@ -64,9 +49,8 @@ public class AftersaleController extends BaseController {
|
||||
|
||||
@Tag(name ="查询订单售后列表")
|
||||
@PostMapping("/list")
|
||||
public R<Page<AftersaleVO>> list(@RequestBody AftersaleBo query, Page<Aftersale> page) {
|
||||
Page<Aftersale> list = aftersaleService.page(page,query.toWrapper() );
|
||||
return R.ok(convert.toVO(list));
|
||||
public R<IPage<AftersaleVO>> list(@RequestBody AftersaleBo query, Page<Aftersale> page) {
|
||||
return R.ok(service.getlist(page,query));
|
||||
}
|
||||
|
||||
|
||||
@ -88,8 +72,8 @@ public class AftersaleController extends BaseController {
|
||||
@Tag(name ="新增订单售后")
|
||||
@Log(title = "订单售后", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public R add(@RequestBody AftersaleBo query) {
|
||||
return R.ok(service.save(convert.toPo(query)));
|
||||
public R add(@RequestBody Aftersale aftersale) {
|
||||
return R.ok(service.save(aftersale));
|
||||
}
|
||||
|
||||
@Tag(name ="修改订单售后")
|
||||
@ -99,13 +83,14 @@ public class AftersaleController extends BaseController {
|
||||
return R.ok(service.updateById(aftersale));
|
||||
}
|
||||
|
||||
@Tag(name ="删除订单售后")
|
||||
@Tag(name = "删除订单售后")
|
||||
@Log(title = "订单售后", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
@DeleteMapping("/{id}")
|
||||
public R remove(@PathVariable Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
||||
@Tag(name ="售后订单操作")
|
||||
@PostMapping("/dealWith")
|
||||
public ResponseEntity<Boolean> updateStatus(@RequestBody DealWithAftersaleForm request){
|
||||
|
@ -9,12 +9,10 @@ import com.wzj.soopin.order.domain.form.DeliverProductForm;
|
||||
import com.wzj.soopin.order.domain.vo.*;
|
||||
import com.wzj.soopin.order.service.OrderService;
|
||||
import com.wzj.soopin.order.service.impl.OrderServiceImpl;
|
||||
import com.wzj.soopin.order.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.SecurityUtils;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
@ -22,9 +20,7 @@ import org.dromara.common.redis.redis.RedisService;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.wzj.soopin.order.controller;
|
||||
|
||||
import com.wzj.soopin.order.domain.dto.CodeVerificationDto;
|
||||
import com.wzj.soopin.order.service.VerificationCodeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -31,15 +32,12 @@ public class VerificationCodeController {
|
||||
|
||||
/**
|
||||
* 扫码核销接口
|
||||
* @param codeValue 核销码
|
||||
* @param usedMerchantId 使用商家ID
|
||||
* @return 核销结果z
|
||||
*/
|
||||
@PostMapping("/verify")
|
||||
@Tag(name = "扫码核销接口")
|
||||
public R verifyCode(@RequestParam String codeValue,
|
||||
@RequestParam Long usedMerchantId) {
|
||||
return verificationCodeService.verifyCode(codeValue, usedMerchantId);
|
||||
public R verifyCode(@RequestBody CodeVerificationDto codeVerificationDto) {
|
||||
return verificationCodeService.verifyCode(codeVerificationDto);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.wzj.soopin.order.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "核销订单请求VO")
|
||||
public class CodeVerificationDto {
|
||||
|
||||
@Schema(description = "核销码")
|
||||
private String codeValue;
|
||||
|
||||
@Schema(description = "商家id")
|
||||
private Long usedMerchantId;
|
||||
|
||||
}
|
@ -31,6 +31,10 @@ public class AftersaleVO extends BaseAudit {
|
||||
@Excel(name = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private Long orderSn;
|
||||
|
||||
|
||||
/** 退款金额 */
|
||||
@Schema(description = "退款金额")
|
||||
@Excel(name = "退款金额")
|
||||
|
@ -3,10 +3,14 @@ package com.wzj.soopin.order.mapper;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.order.domain.bo.AftersaleBo;
|
||||
import com.wzj.soopin.order.domain.entity.Aftersale;
|
||||
import com.wzj.soopin.order.domain.form.ManagerAftersaleOrderForm;
|
||||
import com.wzj.soopin.order.domain.vo.AftersaleVO;
|
||||
import com.wzj.soopin.order.domain.vo.ManagerRefundOrderVO;
|
||||
import com.wzj.soopin.order.domain.vo.OrderAndAftersaleStatisticsVO;
|
||||
import com.wzj.soopin.order.domain.vo.OrderVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -31,4 +35,5 @@ public interface AftersaleMapper extends BaseMapper<Aftersale> {
|
||||
|
||||
OrderAndAftersaleStatisticsVO statPendingAndProcessing();
|
||||
|
||||
IPage<AftersaleVO> getlist(@Param("page") Page<Aftersale> page, @Param("query")AftersaleBo query);
|
||||
}
|
||||
|
@ -11,9 +11,11 @@ import com.wzj.soopin.order.domain.entity.SystemStatistics;
|
||||
import com.wzj.soopin.order.domain.form.ManagerOrderQueryForm;
|
||||
import com.wzj.soopin.order.domain.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 订单表Mapper接口
|
||||
@ -54,6 +56,13 @@ public interface OrderMapper extends BaseMapper<Order> {
|
||||
|
||||
IPage<OrderVO> getlist(@Param("page") Page<Order> page,@Param("query") OrderBo query);
|
||||
|
||||
@Select("SELECT " +
|
||||
"COUNT(*) AS count1, " +
|
||||
"SUM(CASE WHEN aftersale_status = 2 THEN 1 ELSE 0 END) AS count2 " +
|
||||
"FROM oms_order")
|
||||
Map<String, Object> countOrder();
|
||||
|
||||
|
||||
|
||||
// IPage<OrderVO> getlist(@Param("page") Page<Object> objectPage, @Param("query") OrderBo query);
|
||||
}
|
||||
|
@ -9,10 +9,11 @@ import com.wzj.soopin.order.domain.entity.Order;
|
||||
import com.wzj.soopin.order.domain.vo.OrderVO;
|
||||
import com.wzj.soopin.order.domain.vo.PageVO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface OrderService extends IService<Order> {
|
||||
|
||||
Map<String, Object> getCount();
|
||||
|
||||
IPage<OrderVO> getlist(Page<Order> page, OrderBo query);
|
||||
|
||||
// IPage<OrderVO> getlist(PageVO pageVO, OrderBo query);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.wzj.soopin.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.order.domain.dto.CodeVerificationDto;
|
||||
import com.wzj.soopin.order.domain.entity.VerificationCodes;
|
||||
import org.dromara.common.core.domain.R;
|
||||
|
||||
@ -9,5 +10,5 @@ public interface VerificationCodeService extends IService<VerificationCodes> {
|
||||
|
||||
R generateVerificationCode(Long orderId);
|
||||
|
||||
R verifyCode(String codeValue, Long usedMerchantId);
|
||||
R verifyCode(CodeVerificationDto codeVerificationDto);
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.wechat.pay.java.service.refund.model.Refund;
|
||||
import com.wechat.pay.java.service.refund.model.RefundNotification;
|
||||
@ -16,6 +18,7 @@ import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.MemberWechat;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberWechatMapper;
|
||||
import com.wzj.soopin.order.domain.bo.AftersaleBo;
|
||||
import com.wzj.soopin.order.service.AftersaleService;
|
||||
import com.wzj.soopin.order.convert.OrderOperateHistoryConvert;
|
||||
import com.wzj.soopin.order.domain.entity.*;
|
||||
@ -469,4 +472,14 @@ public class AftersaleServiceImpl extends ServiceImpl<AftersaleMapper, Aftersale
|
||||
itemQw.in("status",Arrays.asList(AftersaleStatus.APPLY.getType(),AftersaleStatus.WAIT.getType()));
|
||||
return aftersaleMapper.selectOne(itemQw);
|
||||
}
|
||||
|
||||
public IPage<AftersaleVO> getlist(Page<Aftersale> page, AftersaleBo query) {
|
||||
IPage<AftersaleVO> resultPage = aftersaleMapper.getlist(page,query);
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
// public Page<AftersaleVO> getlist(Page<Aftersale> page, AftersaleBo query) {
|
||||
// IPage<OrderVO> resultPage = aftersaleMapper.getlist(page,query);
|
||||
// return resultPage;
|
||||
// }
|
||||
}
|
||||
|
@ -8,11 +8,20 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.content.domain.po.Vlog;
|
||||
import com.wzj.soopin.content.mapper.VlogMapper;
|
||||
import com.wzj.soopin.content.service.impl.VlogServiceImpl;
|
||||
import com.wzj.soopin.goods.convert.SkuConvert;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.mapper.ProductMapper;
|
||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.Withdraw;
|
||||
import com.wzj.soopin.member.mapper.*;
|
||||
import com.wzj.soopin.member.service.impl.FeedbackServiceImpl;
|
||||
import com.wzj.soopin.member.service.impl.MemberServiceImpl;
|
||||
import com.wzj.soopin.member.service.impl.WithdrawServiceImpl;
|
||||
import com.wzj.soopin.order.convert.OrderConvert;
|
||||
import com.wzj.soopin.order.convert.OrderOperateHistoryConvert;
|
||||
import com.wzj.soopin.order.domain.bo.OrderBo;
|
||||
@ -30,10 +39,10 @@ import com.wzj.soopin.order.mapper.OrderMapper;
|
||||
import com.wzj.soopin.order.mapper.OrderOperateHistoryMapper;
|
||||
import com.wzj.soopin.order.service.OrderService;
|
||||
import com.wzj.soopin.order.service.VerificationCodeService;
|
||||
import com.wzj.soopin.order.utils.SecurityUtils;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.event.Constants;
|
||||
import org.dromara.common.core.utils.PhoneUtils;
|
||||
import org.dromara.common.core.utils.SecurityUtils;
|
||||
import org.dromara.system.domain.SysTenant;
|
||||
import org.dromara.system.mapper.SysOperLogMapper;
|
||||
import org.dromara.system.mapper.SysTenantMapper;
|
||||
@ -43,9 +52,6 @@ import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.wzj.soopin.member.mapper.MemberAddressMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberCartMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
@ -95,6 +101,27 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Autowired
|
||||
private SysTenantMapper sysTenantMapper;
|
||||
|
||||
@Autowired
|
||||
private VlogMapper vlogMapper;
|
||||
|
||||
@Autowired
|
||||
private FeedbackMapper feedbackMapper;
|
||||
|
||||
@Autowired
|
||||
private WithdrawMapper withdrawMapper;
|
||||
|
||||
@Autowired
|
||||
private MemberServiceImpl memberService;
|
||||
|
||||
@Autowired
|
||||
private FeedbackServiceImpl feedbackService;
|
||||
|
||||
@Autowired
|
||||
private WithdrawServiceImpl withdrawService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询订单表
|
||||
*
|
||||
@ -540,7 +567,65 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Map<String, Object> getCount() {
|
||||
// Map<String, Object> result = new HashMap<>();
|
||||
// result.put("MemberCount", memberMapper.countMember());
|
||||
// result.put("storeCount", sysTenantMapper.countStore());
|
||||
// result.put("productCount", productMapper.countProduct());
|
||||
// result.put("orderCount", orderMapper.countOrder());
|
||||
//
|
||||
//
|
||||
//
|
||||
//// result.put("productAudit", productMapper.AuditProduct());
|
||||
////
|
||||
//// List<Map<String, Object>> incomeExpenseList = incomeExpenseMapper.getIncomeExpenseByMonth();
|
||||
//// result.put("incomeExpense", incomeExpenseList);
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCount() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("memberCount", memberService.count()); //用户数量
|
||||
result.put("vlogCount", vlogMapper.countVlog()); //待审核视频
|
||||
|
||||
// 待审核举报统计
|
||||
QueryWrapper<Feedback> FeedbackWrapper = new QueryWrapper<>();
|
||||
FeedbackWrapper.eq("status", 0);
|
||||
result.put("feedbackCount", feedbackService.count(FeedbackWrapper));
|
||||
|
||||
// 待审核提现统计
|
||||
QueryWrapper<Withdraw> withdrawQueryWrapper = new QueryWrapper<>();
|
||||
withdrawQueryWrapper.eq("audit_status", 0);
|
||||
result.put("WithdrawCount", withdrawService.count(withdrawQueryWrapper));
|
||||
|
||||
// 商品统计、待审核商品统计
|
||||
Map<String, Object> productCounts = productMapper.countProduct();
|
||||
result.put("productCount", productCounts.get("count1"));
|
||||
result.put("productAudit", productCounts.get("count2"));
|
||||
|
||||
// 店铺统计、待审核店铺统计
|
||||
Map<String, Object> StoreCounts = sysTenantMapper.countProduct();
|
||||
result.put("storeCount", StoreCounts.get("count1"));
|
||||
result.put("StoreAudit", StoreCounts.get("count2"));
|
||||
|
||||
// 订单统计、待审核退款统计
|
||||
Map<String, Object> OrderCounts = orderMapper.countOrder();
|
||||
result.put("orderCount", OrderCounts.get("count1"));
|
||||
result.put("orderAudit", OrderCounts.get("count2"));
|
||||
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public IPage<OrderVO> getlist(PageVO pageVO, OrderBo query) {
|
||||
|
@ -2,6 +2,7 @@ package com.wzj.soopin.order.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.order.domain.dto.CodeVerificationDto;
|
||||
import com.wzj.soopin.order.domain.entity.Order;
|
||||
import com.wzj.soopin.order.domain.entity.VerificationCodes;
|
||||
import com.wzj.soopin.order.domain.entity.VerificationLogs;
|
||||
@ -95,7 +96,10 @@ public class VerificationCodeServiceImpl extends ServiceImpl<VerificationCodesM
|
||||
}
|
||||
|
||||
@Override
|
||||
public R verifyCode(String codeValue, Long usedMerchantId) {
|
||||
public R verifyCode(CodeVerificationDto codeVerificationDto) {
|
||||
|
||||
String codeValue = codeVerificationDto.getCodeValue();
|
||||
Long usedMerchantId = codeVerificationDto.getUsedMerchantId();
|
||||
// 参数校验
|
||||
if (StringUtils.isBlank(codeValue) || usedMerchantId == null) {
|
||||
recordVerificationLog(null, null, usedMerchantId, 0, "参数不能为空");
|
||||
|
@ -106,4 +106,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from oms_aftersale
|
||||
</select>
|
||||
|
||||
<select id="getlist" resultType="com.wzj.soopin.order.domain.vo.AftersaleVO">
|
||||
SELECT
|
||||
a.*,
|
||||
o.order_sn AS orderSn
|
||||
FROM
|
||||
oms_aftersale a
|
||||
LEFT JOIN
|
||||
oms_order o ON a.order_id = o.id
|
||||
where 1=1
|
||||
|
||||
<if test="query.memberId != null and query.memberId != ''">
|
||||
AND a.member_id LIKE CONCAT('%', #{query.memberId}, '%')
|
||||
</if>
|
||||
<if test="query.orderId != null and query.orderId != ''">
|
||||
AND a.order_id LIKE CONCAT('%', #{query.orderId}, '%')
|
||||
</if>
|
||||
<if test="query.returnAmount != null">
|
||||
AND a.return_amount = #{query.returnAmount}
|
||||
</if>
|
||||
<if test="query.quantity != null">
|
||||
AND a.quantity = #{query.quantity}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -298,14 +298,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="query.memberPhoneEncrypted != null and query.memberPhoneEncrypted != ''">
|
||||
AND um.phone_encrypted LIKE CONCAT('%', #{query.memberPhoneEncrypted}, '%')
|
||||
</if>
|
||||
<if test="query.receiverProvince != null and query.receiverProvince != ''">
|
||||
AND o.receiver_province LIKE CONCAT('%', #{query.receiverProvince}, '%')
|
||||
</if>
|
||||
<if test="query.receiverCity != null and query.receiverCity != ''">
|
||||
AND o.receiver_city LIKE CONCAT('%', #{query.receiverCity}, '%')
|
||||
</if>
|
||||
<if test="query.receiverDistrict != null and query.receiverDistrict != ''">
|
||||
AND o.receiver_district LIKE CONCAT('%', #{query.receiverDistrict}, '%')
|
||||
</if>
|
||||
<if test="query.receiverPhone != null and query.receiverPhone != ''">
|
||||
AND o.receiver_phone LIKE CONCAT('%', #{query.receiverPhone}, '%')
|
||||
</if>
|
||||
<if test="query.status != null and query.status != ''">
|
||||
AND o.status LIKE CONCAT('%', #{query.status}, '%')
|
||||
<if test="query.status != null">
|
||||
AND o.status = #{query.status}
|
||||
</if>
|
||||
<if test="query.type != null and query.type != ''">
|
||||
AND o.type LIKE CONCAT('%', #{query.type}, '%')
|
||||
<if test="query.type != null">
|
||||
AND o.type = #{query.type}
|
||||
</if>
|
||||
<if test="query.withdrawStatus != null and query.withdrawStatus != ''">
|
||||
AND o.withdraw_status LIKE CONCAT('%', #{query.withdrawStatus}, '%')
|
||||
|
@ -118,19 +118,26 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Jakarta WebSocket API -->
|
||||
<dependency>
|
||||
<groupId>jakarta.websocket</groupId>
|
||||
<artifactId>jakarta.websocket-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Jakarta WebSocket Implementation -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.4.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- RocketMQ -->
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
|
@ -0,0 +1,194 @@
|
||||
package org.dromara.system.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.SecurityUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.sql.SqlUtil;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.system.config.AjaxResult;
|
||||
import org.dromara.system.page.PageDomain;
|
||||
import org.dromara.system.page.TableSupport;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.InitBinder;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web层通用数据处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class BaseController
|
||||
{
|
||||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||
*/
|
||||
@InitBinder
|
||||
public void initBinder(WebDataBinder binder)
|
||||
{
|
||||
// Date 类型转换
|
||||
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
|
||||
{
|
||||
@Override
|
||||
public void setAsText(String text)
|
||||
{
|
||||
setValue(DateUtils.parseDate(text));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求分页数据
|
||||
*/
|
||||
protected void startPage()
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
Boolean reasonable = pageDomain.getReasonable();
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求排序数据
|
||||
*/
|
||||
protected void startOrderBy()
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.orderBy(orderBy);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应请求分页数据
|
||||
*/
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
protected TableDataInfo getDataTable(List<?> list) {
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
protected TableDataInfo getDataTable(Page<?> page) {
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(page.getContent());
|
||||
rspData.setTotal(page.getTotalElements());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
public AjaxResult success() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败消息
|
||||
*/
|
||||
public AjaxResult error()
|
||||
{
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*/
|
||||
public AjaxResult success(String message)
|
||||
{
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败消息
|
||||
*/
|
||||
public AjaxResult error(String message)
|
||||
{
|
||||
return AjaxResult.error(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
* @param rows 影响行数
|
||||
* @return 操作结果
|
||||
*/
|
||||
protected AjaxResult toAjax(int rows)
|
||||
{
|
||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
* @param result 结果
|
||||
* @return 操作结果
|
||||
*/
|
||||
protected AjaxResult toAjax(boolean result)
|
||||
{
|
||||
return result ? success() : error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面跳转
|
||||
*/
|
||||
public String redirect(String url)
|
||||
{
|
||||
return StringUtils.format("redirect:{}", url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户缓存信息
|
||||
*/
|
||||
public LoginUser getLoginUser()
|
||||
{
|
||||
return SecurityUtils.getLoginUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录用户id
|
||||
*/
|
||||
public Long getUserId()
|
||||
{
|
||||
return getLoginUser().getUserId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录部门id
|
||||
*/
|
||||
public Long getDeptId()
|
||||
{
|
||||
return getLoginUser().getDeptId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录用户名
|
||||
*/
|
||||
public String getUsername()
|
||||
{
|
||||
return getLoginUser().getUsername();
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package org.dromara.system.controller;
|
||||
|
||||
import org.dromara.system.config.AjaxResult;
|
||||
import org.dromara.system.domain.SysConfig;
|
||||
import org.dromara.system.domain.vo.SysConfigVo;
|
||||
import org.dromara.system.service.ISysConfigService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sys/config")
|
||||
public class ConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@GetMapping(value = "/configKey2/{configKey}")
|
||||
public AjaxResult getConfigKey2(@PathVariable String configKey) {
|
||||
return AjaxResult.success(configService.selectConfigByKey2(configKey));
|
||||
}
|
||||
|
||||
@PostMapping("/addOrUpdate")
|
||||
public AjaxResult addOrUpdate(@RequestBody SysConfigVo content) {
|
||||
SysConfig config = new SysConfig();
|
||||
BeanUtils.copyProperties(content,config);
|
||||
if (config.getConfigId() == null) {
|
||||
config.setCreateBy(getUserId());
|
||||
return toAjax(configService.insertConfig1(config));
|
||||
}
|
||||
config.setUpdateBy(getUserId());
|
||||
return toAjax(configService.updateConfig1(config));
|
||||
}
|
||||
}
|
@ -4,6 +4,8 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.system.domain.SysConfig;
|
||||
import org.dromara.system.domain.vo.SysConfigVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 数据层
|
||||
*
|
||||
@ -11,4 +13,62 @@ import org.dromara.system.domain.vo.SysConfigVo;
|
||||
*/
|
||||
public interface SysConfigMapper extends BaseMapperPlus<SysConfig, SysConfigVo> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
public SysConfig selectConfig(SysConfig config);
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<SysConfig> selectConfigList(SysConfig config);
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configKey 参数键名
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
public SysConfig checkConfigKeyUnique(String configKey);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertConfig(SysConfig config);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateConfig(SysConfig config);
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
*
|
||||
* @param configId 参数ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteConfigById(Long configId);
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
*
|
||||
* @param configIds 需要删除的参数ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteConfigByIds(Long[] configIds);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,16 +1,25 @@
|
||||
package org.dromara.system.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.dromara.system.domain.SysTenant;
|
||||
import org.dromara.system.domain.vo.SysTenantVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 租户Mapper接口
|
||||
*
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysTenantMapper extends BaseMapperPlus<SysTenant, SysTenantVo> {
|
||||
|
||||
@Select("SELECT COUNT(*) FROM sys_tenant WHERE status = 0")
|
||||
Object countStore();
|
||||
|
||||
@Select("SELECT " +
|
||||
"SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS count1, " +
|
||||
"SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) AS count2 " +
|
||||
"FROM sys_tenant")
|
||||
Map<String, Object> countProduct();
|
||||
}
|
||||
|
@ -0,0 +1,102 @@
|
||||
package org.dromara.system.page;
|
||||
|
||||
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PageDomain
|
||||
{
|
||||
/** 当前记录起始索引 */
|
||||
private Integer pageNum;
|
||||
|
||||
/** 每页显示记录数 */
|
||||
private Integer pageSize;
|
||||
|
||||
/** 排序列 */
|
||||
private String orderByColumn;
|
||||
|
||||
/** 排序的方向desc或者asc */
|
||||
private String isAsc = "asc";
|
||||
|
||||
/** 分页参数合理化 */
|
||||
private Boolean reasonable = true;
|
||||
|
||||
public String getOrderBy()
|
||||
{
|
||||
if (StringUtils.isEmpty(orderByColumn))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||
}
|
||||
|
||||
public Integer getPageNum()
|
||||
{
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum)
|
||||
{
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize()
|
||||
{
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize)
|
||||
{
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getOrderByColumn()
|
||||
{
|
||||
return orderByColumn;
|
||||
}
|
||||
|
||||
public void setOrderByColumn(String orderByColumn)
|
||||
{
|
||||
this.orderByColumn = orderByColumn;
|
||||
}
|
||||
|
||||
public String getIsAsc()
|
||||
{
|
||||
return isAsc;
|
||||
}
|
||||
|
||||
public void setIsAsc(String isAsc)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(isAsc))
|
||||
{
|
||||
// 兼容前端排序类型
|
||||
if ("ascending".equals(isAsc))
|
||||
{
|
||||
isAsc = "asc";
|
||||
}
|
||||
else if ("descending".equals(isAsc))
|
||||
{
|
||||
isAsc = "desc";
|
||||
}
|
||||
this.isAsc = isAsc;
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean getReasonable()
|
||||
{
|
||||
if (StringUtils.isNull(reasonable))
|
||||
{
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return reasonable;
|
||||
}
|
||||
|
||||
public void setReasonable(Boolean reasonable)
|
||||
{
|
||||
this.reasonable = reasonable;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package org.dromara.system.page;
|
||||
|
||||
|
||||
import org.dromara.common.core.utils.ServletUtils;
|
||||
|
||||
/**
|
||||
* 表格数据处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TableSupport
|
||||
{
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 分页参数合理化
|
||||
*/
|
||||
public static final String REASONABLE = "reasonable";
|
||||
|
||||
/**
|
||||
* 封装分页对象
|
||||
*/
|
||||
public static PageDomain getPageDomain()
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM));
|
||||
pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
|
||||
pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
|
||||
return pageDomain;
|
||||
}
|
||||
|
||||
public static PageDomain buildPageRequest()
|
||||
{
|
||||
return getPageDomain();
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package org.dromara.system.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.system.domain.SysConfig;
|
||||
import org.dromara.system.domain.bo.SysConfigBo;
|
||||
import org.dromara.system.domain.vo.SysConfigVo;
|
||||
|
||||
@ -64,6 +65,24 @@ public interface ISysConfigService {
|
||||
*/
|
||||
String updateConfig(SysConfigBo bo);
|
||||
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertConfig1(SysConfig config);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateConfig1(SysConfig config);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
*
|
||||
@ -84,4 +103,7 @@ public interface ISysConfigService {
|
||||
*/
|
||||
boolean checkConfigKeyUnique(SysConfigBo config);
|
||||
|
||||
|
||||
public SysConfig selectConfigByKey2(String configKey);
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.dromara.common.core.constant.CacheNames;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.domain.event.Constants;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.service.ConfigService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
@ -16,6 +17,7 @@ import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.redis.redis.RedisCache;
|
||||
import org.dromara.common.redis.utils.CacheUtils;
|
||||
import org.dromara.common.tenant.helper.TenantHelper;
|
||||
import org.dromara.system.domain.SysConfig;
|
||||
@ -24,6 +26,7 @@ import org.dromara.system.domain.vo.SysConfigVo;
|
||||
import org.dromara.system.mapper.SysConfigMapper;
|
||||
import org.dromara.system.service.ISysConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -43,6 +46,12 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
||||
|
||||
private final SysConfigMapper baseMapper;
|
||||
|
||||
@Autowired
|
||||
private SysConfigMapper configMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysConfigVo> selectPageConfigList(SysConfigBo config, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysConfig> lqw = buildQueryWrapper(config);
|
||||
@ -162,6 +171,31 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertConfig1(SysConfig config) {
|
||||
int row = configMapper.insertConfig(config);
|
||||
if (row > 0) {
|
||||
if ("Y".equals(config.getConfigType())){
|
||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateConfig1(SysConfig config) {
|
||||
int row = configMapper.updateConfig(config);
|
||||
if (row > 0) {
|
||||
if ("N".equals(config.getConfigType())){
|
||||
redisCache.setCacheObject(getCacheKey2(config.getConfigKey()), config);
|
||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
} else {
|
||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
*
|
||||
@ -214,4 +248,35 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
||||
return SpringUtils.getAopProxy(this).selectConfigByKey(configKey);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SysConfig selectConfigByKey2(String configKey) {
|
||||
SysConfig config = redisCache.getCacheObject(getCacheKey2(configKey));
|
||||
if (config != null) {
|
||||
return config;
|
||||
}
|
||||
SysConfig configQuery = new SysConfig();
|
||||
configQuery.setConfigKey(configKey);
|
||||
SysConfig retConfig = configMapper.selectConfig(configQuery);
|
||||
if (StringUtils.isNotNull(retConfig)) {
|
||||
redisCache.setCacheObject(getCacheKey2(configKey), retConfig);
|
||||
return retConfig;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
private String getCacheKey(String configKey) {
|
||||
return Constants.SYS_CONFIG_KEY + configKey;
|
||||
}
|
||||
|
||||
private String getCacheKey2(String configKey) {
|
||||
return Constants.SYS_CONFIG_KEY + configKey + "_all";
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user