Commit 4feea183 by 吕明尚

修改订单

parent 873ce676
package share.web.controller.system; package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import share.common.annotation.Log; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.Activity; import share.system.domain.Activity;
import share.system.service.ActivityService; import share.system.service.ActivityService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -36,17 +35,13 @@ public class ActivityController extends BaseController { ...@@ -36,17 +35,13 @@ public class ActivityController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** @GetMapping("/query")
* 导出活动列表 public AjaxResult query(Activity activity) {
*/
@Log(title = "活动", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Activity activity) {
List<Activity> list = activityService.selectActivityList(activity); List<Activity> list = activityService.selectActivityList(activity);
ExcelUtil<Activity> util = new ExcelUtil<Activity>(Activity.class); return success(list);
util.exportExcel(response, list, "活动数据");
} }
/** /**
* 获取活动详细信息 * 获取活动详细信息
*/ */
...@@ -55,30 +50,4 @@ public class ActivityController extends BaseController { ...@@ -55,30 +50,4 @@ public class ActivityController extends BaseController {
return success(activityService.selectActivityById(id)); return success(activityService.selectActivityById(id));
} }
/**
* 新增活动
*/
@Log(title = "活动", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Activity activity) {
return toAjax(activityService.insertActivity(activity));
}
/**
* 修改活动
*/
@Log(title = "活动", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Activity activity) {
return toAjax(activityService.updateActivity(activity));
}
/**
* 删除活动
*/
@Log(title = "活动", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(activityService.deleteActivityByIds(ids));
}
} }
package share.web.controller.system; package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import share.common.annotation.Log; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType; import share.system.domain.SConsumer;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.BalanceLog;
import share.system.domain.vo.BalanceLogVo; import share.system.domain.vo.BalanceLogVo;
import share.system.domain.vo.FrontTokenComponent;
import share.system.service.BalanceLogService; import share.system.service.BalanceLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -37,49 +36,11 @@ public class BalanceLogController extends BaseController { ...@@ -37,49 +36,11 @@ public class BalanceLogController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** @GetMapping("/query")
* 导出余额日志列表 public AjaxResult query(BalanceLogVo balanceLog) {
*/ SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
@Log(title = "余额日志", businessType = BusinessType.EXPORT) balanceLog.setConsumerId(user.getId());
@PostMapping("/export")
public void export(HttpServletResponse response, BalanceLogVo balanceLog) {
List<BalanceLogVo> list = balanceLogService.selectBalanceLogList(balanceLog); List<BalanceLogVo> list = balanceLogService.selectBalanceLogList(balanceLog);
ExcelUtil<BalanceLogVo> util = new ExcelUtil<BalanceLogVo>(BalanceLogVo.class); return success(list);
util.exportExcel(response, list, "余额日志数据");
}
/**
* 获取余额日志详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(balanceLogService.selectBalanceLogById(id));
}
/**
* 新增余额日志
*/
@Log(title = "余额日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BalanceLog balanceLog) {
return toAjax(balanceLogService.insertBalanceLog(balanceLog));
}
/**
* 修改余额日志
*/
@Log(title = "余额日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BalanceLog balanceLog) {
return toAjax(balanceLogService.updateBalanceLog(balanceLog));
}
/**
* 删除余额日志
*/
@Log(title = "余额日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(balanceLogService.deleteBalanceLogByIds(ids));
} }
} }
package share.web.controller.system; package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import share.common.annotation.Log; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.ConsumerMember;
import share.system.domain.vo.ConsumerMemberVo; import share.system.domain.vo.ConsumerMemberVo;
import share.system.service.ConsumerMemberService; import share.system.service.ConsumerMemberService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -37,49 +34,10 @@ public class ConsumerMemberController extends BaseController { ...@@ -37,49 +34,10 @@ public class ConsumerMemberController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 导出会员用户列表
*/
@Log(title = "会员用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ConsumerMemberVo consumerMember) {
List<ConsumerMemberVo> list = consumerMemberService.selectConsumerMemberList(consumerMember);
ExcelUtil<ConsumerMemberVo> util = new ExcelUtil<>(ConsumerMemberVo.class);
util.exportExcel(response, list, "会员用户数据");
}
/** @GetMapping("/query")
* 获取会员用户详细信息 public AjaxResult selectByConsumerId() {
*/ return success(consumerMemberService.selectByConsumerId());
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(consumerMemberService.selectConsumerMemberById(id));
} }
/**
* 新增会员用户
*/
@Log(title = "会员用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ConsumerMember consumerMember) {
return toAjax(consumerMemberService.insertConsumerMember(consumerMember));
}
/**
* 修改会员用户
*/
@Log(title = "会员用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ConsumerMember consumerMember) {
return toAjax(consumerMemberService.updateConsumerMember(consumerMember));
}
/**
* 删除会员用户
*/
@Log(title = "会员用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(consumerMemberService.deleteConsumerMemberByIds(ids));
}
} }
package share.web.controller.system; package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import share.common.annotation.Log; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.ConsumerWallet;
import share.system.domain.vo.ConsumerWalletVo; import share.system.domain.vo.ConsumerWalletVo;
import share.system.service.ConsumerWalletService; import share.system.service.ConsumerWalletService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -38,53 +35,8 @@ public class ConsumerWalletController extends BaseController { ...@@ -38,53 +35,8 @@ public class ConsumerWalletController extends BaseController {
} }
@GetMapping("/query") @GetMapping("/query")
public ConsumerWalletVo selectByConsumerId() { public AjaxResult selectByConsumerId() {
return consumerWalletService.selectByConsumerId(); return success(consumerWalletService.selectByConsumerId());
} }
/**
* 导出会员钱包列表
*/
@Log(title = "会员钱包", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ConsumerWalletVo consumerWallet) {
List<ConsumerWalletVo> list = consumerWalletService.selectConsumerWalletList(consumerWallet);
ExcelUtil<ConsumerWalletVo> util = new ExcelUtil<ConsumerWalletVo>(ConsumerWalletVo.class);
util.exportExcel(response, list, "会员钱包数据");
}
/**
* 获取会员钱包详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(consumerWalletService.selectConsumerWalletById(id));
}
/**
* 新增会员钱包
*/
@Log(title = "会员钱包", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ConsumerWallet consumerWallet) {
return toAjax(consumerWalletService.insertConsumerWallet(consumerWallet));
}
/**
* 修改会员钱包
*/
@Log(title = "会员钱包", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ConsumerWallet consumerWallet) {
return toAjax(consumerWalletService.updateConsumerWallet(consumerWallet));
}
/**
* 删除会员钱包
*/
@Log(title = "会员钱包", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(consumerWalletService.deleteConsumerWalletByIds(ids));
}
} }
package share.web.controller.system; package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import share.common.annotation.Log; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType; import share.system.domain.SConsumer;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.DurationLog;
import share.system.domain.vo.DurationLogVo; import share.system.domain.vo.DurationLogVo;
import share.system.domain.vo.FrontTokenComponent;
import share.system.service.DurationLogService; import share.system.service.DurationLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -37,49 +36,11 @@ public class DurationLogController extends BaseController { ...@@ -37,49 +36,11 @@ public class DurationLogController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** @GetMapping("/query")
* 导出时长日志列表 public AjaxResult query(DurationLogVo durationLog) {
*/ SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
@Log(title = "时长日志", businessType = BusinessType.EXPORT) durationLog.setConsumerId(user.getId());
@PostMapping("/export")
public void export(HttpServletResponse response, DurationLogVo durationLog) {
List<DurationLogVo> list = durationLogService.selectDurationLogList(durationLog); List<DurationLogVo> list = durationLogService.selectDurationLogList(durationLog);
ExcelUtil<DurationLogVo> util = new ExcelUtil<DurationLogVo>(DurationLogVo.class); return success(list);
util.exportExcel(response, list, "时长日志数据");
}
/**
* 获取时长日志详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(durationLogService.selectDurationLogById(id));
}
/**
* 新增时长日志
*/
@Log(title = "时长日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DurationLog durationLog) {
return toAjax(durationLogService.insertDurationLog(durationLog));
}
/**
* 修改时长日志
*/
@Log(title = "时长日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DurationLog durationLog) {
return toAjax(durationLogService.updateDurationLog(durationLog));
}
/**
* 删除时长日志
*/
@Log(title = "时长日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(durationLogService.deleteDurationLogByIds(ids));
} }
} }
...@@ -13,14 +13,13 @@ import share.common.core.page.TableDataInfo; ...@@ -13,14 +13,13 @@ import share.common.core.page.TableDataInfo;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.common.utils.poi.ExcelUtil; import share.system.domain.SConsumer;
import share.system.domain.EquityMembersOrder;
import share.system.domain.vo.EquityMembersOrderVo; import share.system.domain.vo.EquityMembersOrderVo;
import share.system.domain.vo.FrontTokenComponent;
import share.system.request.CreateEquityMembersRequest; import share.system.request.CreateEquityMembersRequest;
import share.system.response.EquityMembersResultResponse; import share.system.response.EquityMembersResultResponse;
import share.system.service.EquityMembersOrderService; import share.system.service.EquityMembersOrderService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -48,41 +47,12 @@ public class EquityMembersOrderController extends BaseController { ...@@ -48,41 +47,12 @@ public class EquityMembersOrderController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** @GetMapping("/query")
* 导出权益会员订单列表 public AjaxResult query(EquityMembersOrderVo equityMembersOrder) {
*/ SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
@Log(title = "权益会员订单", businessType = BusinessType.EXPORT) equityMembersOrder.setConsumerId(user.getId());
@PostMapping("/export")
public void export(HttpServletResponse response, EquityMembersOrderVo equityMembersOrder) {
List<EquityMembersOrderVo> list = equityMembersOrderService.selectEquityMembersOrderList(equityMembersOrder); List<EquityMembersOrderVo> list = equityMembersOrderService.selectEquityMembersOrderList(equityMembersOrder);
ExcelUtil<EquityMembersOrderVo> util = new ExcelUtil<EquityMembersOrderVo>(EquityMembersOrderVo.class); return success(list);
util.exportExcel(response, list, "权益会员订单数据");
}
/**
* 获取权益会员订单详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(equityMembersOrderService.selectEquityMembersOrderById(id));
}
/**
* 新增权益会员订单
*/
@Log(title = "权益会员订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquityMembersOrder equityMembersOrder) {
return toAjax(equityMembersOrderService.insertEquityMembersOrder(equityMembersOrder));
}
/**
* 修改权益会员订单
*/
@Log(title = "权益会员订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquityMembersOrder equityMembersOrder) {
return toAjax(equityMembersOrderService.updateEquityMembersOrder(equityMembersOrder));
} }
/** /**
......
package share.web.controller.system; package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import share.common.annotation.Log; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType; import share.system.domain.SConsumer;
import share.common.utils.poi.ExcelUtil; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.IntegralLog;
import share.system.domain.vo.IntegralLogVo; import share.system.domain.vo.IntegralLogVo;
import share.system.service.IntegralLogService; import share.system.service.IntegralLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -37,49 +36,11 @@ public class IntegralLogController extends BaseController { ...@@ -37,49 +36,11 @@ public class IntegralLogController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** @GetMapping("/query")
* 导出积分日志列表 public AjaxResult query(IntegralLogVo integralLog) {
*/ SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
@Log(title = "积分日志", businessType = BusinessType.EXPORT) integralLog.setConsumerId(user.getId());
@PostMapping("/export")
public void export(HttpServletResponse response, IntegralLogVo integralLog) {
List<IntegralLogVo> list = integralLogService.selectIntegralLogList(integralLog); List<IntegralLogVo> list = integralLogService.selectIntegralLogList(integralLog);
ExcelUtil<IntegralLogVo> util = new ExcelUtil<IntegralLogVo>(IntegralLogVo.class); return success(list);
util.exportExcel(response, list, "积分日志数据");
}
/**
* 获取积分日志详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(integralLogService.selectIntegralLogById(id));
}
/**
* 新增积分日志
*/
@Log(title = "积分日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody IntegralLog integralLog) {
return toAjax(integralLogService.insertIntegralLog(integralLog));
}
/**
* 修改积分日志
*/
@Log(title = "积分日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody IntegralLog integralLog) {
return toAjax(integralLogService.updateIntegralLog(integralLog));
}
/**
* 删除积分日志
*/
@Log(title = "积分日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(integralLogService.deleteIntegralLogByIds(ids));
} }
} }
package share.web.controller.system; package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import share.common.annotation.Log; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType; import share.system.domain.SConsumer;
import share.common.utils.poi.ExcelUtil; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.MemberProgressLog;
import share.system.domain.vo.MemberProgressLogVo; import share.system.domain.vo.MemberProgressLogVo;
import share.system.service.MemberProgressLogService; import share.system.service.MemberProgressLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -37,49 +36,11 @@ public class MemberProgressLogController extends BaseController { ...@@ -37,49 +36,11 @@ public class MemberProgressLogController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** @GetMapping("/query")
* 导出会员进度日志列表 public AjaxResult query(MemberProgressLogVo memberProgressLog) {
*/ SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
@Log(title = "会员进度日志", businessType = BusinessType.EXPORT) memberProgressLog.setConsumerId(user.getId());
@PostMapping("/export")
public void export(HttpServletResponse response, MemberProgressLogVo memberProgressLog) {
List<MemberProgressLogVo> list = memberProgressLogService.selectMemberProgressLogList(memberProgressLog); List<MemberProgressLogVo> list = memberProgressLogService.selectMemberProgressLogList(memberProgressLog);
ExcelUtil<MemberProgressLogVo> util = new ExcelUtil<MemberProgressLogVo>(MemberProgressLogVo.class); return success(list);
util.exportExcel(response, list, "会员进度日志数据");
}
/**
* 获取会员进度日志详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(memberProgressLogService.selectMemberProgressLogById(id));
}
/**
* 新增会员进度日志
*/
@Log(title = "会员进度日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MemberProgressLog memberProgressLog) {
return toAjax(memberProgressLogService.insertMemberProgressLog(memberProgressLog));
}
/**
* 修改会员进度日志
*/
@Log(title = "会员进度日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MemberProgressLog memberProgressLog) {
return toAjax(memberProgressLogService.updateMemberProgressLog(memberProgressLog));
}
/**
* 删除会员进度日志
*/
@Log(title = "会员进度日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(memberProgressLogService.deleteMemberProgressLogByIds(ids));
} }
} }
...@@ -5,22 +5,19 @@ import lombok.extern.slf4j.Slf4j; ...@@ -5,22 +5,19 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.domain.R; import share.common.core.domain.R;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
import share.common.enums.BusinessType;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.common.utils.poi.ExcelUtil; import share.system.domain.SConsumer;
import share.system.domain.Recharge; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.RechargeVo; import share.system.domain.vo.RechargeVo;
import share.system.request.CreateRechargeRequest; import share.system.request.CreateRechargeRequest;
import share.system.response.RechargePayResultResponse; import share.system.response.RechargePayResultResponse;
import share.system.service.RechargeService; import share.system.service.RechargeService;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -48,51 +45,14 @@ public class RechargeController extends BaseController { ...@@ -48,51 +45,14 @@ public class RechargeController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** @GetMapping("/query")
* 导出充值记录列表 public AjaxResult query(RechargeVo recharge) {
*/ SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
@Log(title = "充值记录", businessType = BusinessType.EXPORT) recharge.setConsumerId(user.getId());
@PostMapping("/export")
public void export(HttpServletResponse response, RechargeVo recharge) {
List<RechargeVo> list = rechargeService.selectRechargeList(recharge); List<RechargeVo> list = rechargeService.selectRechargeList(recharge);
ExcelUtil<RechargeVo> util = new ExcelUtil<RechargeVo>(RechargeVo.class); return success(list);
util.exportExcel(response, list, "充值记录数据");
} }
/**
* 获取充值记录详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(rechargeService.selectRechargeById(id));
}
/**
* 新增充值记录
*/
@Log(title = "充值记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Recharge recharge) {
return toAjax(rechargeService.insertRecharge(recharge));
}
/**
* 修改充值记录
*/
@Log(title = "充值记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Recharge recharge) {
return toAjax(rechargeService.updateRecharge(recharge));
}
/**
* 删除充值记录
*/
@Log(title = "充值记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(rechargeService.deleteRechargeByIds(ids));
}
@PostMapping("/createRecharge") @PostMapping("/createRecharge")
public R<RechargePayResultResponse> createOrder(@RequestBody @Validated CreateRechargeRequest request) { public R<RechargePayResultResponse> createOrder(@RequestBody @Validated CreateRechargeRequest request) {
......
...@@ -55,7 +55,7 @@ public class BalanceLog extends BaseEntity { ...@@ -55,7 +55,7 @@ public class BalanceLog extends BaseEntity {
/** /**
* 操作时间 * 操作时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime; private Date operationTime;
......
...@@ -55,7 +55,7 @@ public class DurationLog extends BaseEntity { ...@@ -55,7 +55,7 @@ public class DurationLog extends BaseEntity {
/** /**
* 操作时间 * 操作时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime; private Date operationTime;
......
...@@ -55,7 +55,7 @@ public class IntegralLog extends BaseEntity { ...@@ -55,7 +55,7 @@ public class IntegralLog extends BaseEntity {
/** /**
* 操作时间 * 操作时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime; private Date operationTime;
......
...@@ -55,7 +55,7 @@ public class MemberProgressLog extends BaseEntity { ...@@ -55,7 +55,7 @@ public class MemberProgressLog extends BaseEntity {
/** /**
* 操作时间 * 操作时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime; private Date operationTime;
......
...@@ -93,6 +93,12 @@ public class SOrder extends BaseEntity ...@@ -93,6 +93,12 @@ public class SOrder extends BaseEntity
@Excel(name = "订单时长(H)") @Excel(name = "订单时长(H)")
private String timeLong; private String timeLong;
@Excel(name = "使用时长")
private BigDecimal duration;
@Excel(name = "使用余额")
private BigDecimal balance;
@Excel(name = "优惠比例") @Excel(name = "优惠比例")
private BigDecimal discountRatio; private BigDecimal discountRatio;
......
...@@ -111,6 +111,18 @@ public class SOrderVo ...@@ -111,6 +111,18 @@ public class SOrderVo
@Excel(name = "实际支付金额") @Excel(name = "实际支付金额")
private BigDecimal payPrice; private BigDecimal payPrice;
@ApiModelProperty(value = "使用时长")
@Excel(name = "使用时长")
private BigDecimal duration;
@ApiModelProperty(value = "使用余额")
@Excel(name = "使用余额")
private BigDecimal balance;
@ApiModelProperty(value = "优惠比例")
@Excel(name = "优惠比例")
private BigDecimal discountRatio;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "支付时间") @ApiModelProperty(value = "支付时间")
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
...@@ -169,11 +181,6 @@ public class SOrderVo ...@@ -169,11 +181,6 @@ public class SOrderVo
@ApiModelProperty(value = "支付类型(1:微信,2:支付宝)") @ApiModelProperty(value = "支付类型(1:微信,2:支付宝)")
private Integer payType; private Integer payType;
/**
* 优惠比例
*/
private BigDecimal discountRatio;
@ApiModelProperty(value = "支付状态(0:未支付,1:已支付)") @ApiModelProperty(value = "支付状态(0:未支付,1:已支付)")
private Integer payStatus; private Integer payStatus;
......
...@@ -60,4 +60,6 @@ public interface ConsumerMemberMapper extends BaseMapper<ConsumerMember> { ...@@ -60,4 +60,6 @@ public interface ConsumerMemberMapper extends BaseMapper<ConsumerMember> {
* @return 结果 * @return 结果
*/ */
public int deleteConsumerMemberByIds(Long[] ids); public int deleteConsumerMemberByIds(Long[] ids);
ConsumerMemberVo selectByConsumerId(ConsumerMemberVo consumerMemberVo);
} }
...@@ -60,4 +60,6 @@ public interface ConsumerMemberService extends IService<ConsumerMember> { ...@@ -60,4 +60,6 @@ public interface ConsumerMemberService extends IService<ConsumerMember> {
* @return 结果 * @return 结果
*/ */
public int deleteConsumerMemberById(Long id); public int deleteConsumerMemberById(Long id);
ConsumerMemberVo selectByConsumerId();
} }
...@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import share.system.domain.ConsumerMember; import share.system.domain.ConsumerMember;
import share.system.domain.SConsumer;
import share.system.domain.vo.ConsumerMemberVo; import share.system.domain.vo.ConsumerMemberVo;
import share.system.mapper.ConsumerMemberMapper; import share.system.mapper.ConsumerMemberMapper;
import share.system.service.ConsumerMemberService; import share.system.service.ConsumerMemberService;
...@@ -92,4 +93,12 @@ public class ConsumerMemberServiceImpl extends ServiceImpl<ConsumerMemberMapper, ...@@ -92,4 +93,12 @@ public class ConsumerMemberServiceImpl extends ServiceImpl<ConsumerMemberMapper,
public int deleteConsumerMemberById(Long id) { public int deleteConsumerMemberById(Long id) {
return consumerMemberMapper.deleteConsumerMemberById(id); return consumerMemberMapper.deleteConsumerMemberById(id);
} }
@Override
public ConsumerMemberVo selectByConsumerId() {
SConsumer info = sConsumerService.getInfo();
ConsumerMemberVo consumerMemberVo = new ConsumerMemberVo();
consumerMemberVo.setConsumerId(info.getId());
return consumerMemberMapper.selectByConsumerId(consumerMemberVo);
}
} }
...@@ -90,31 +90,6 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -90,31 +90,6 @@ public class OrderPayServiceImpl implements OrderPayService {
return response; return response;
} }
@Override
public OrderPayResultResponse saobeiPayment(SOrder sOrder) {
OrderPayResultResponse response = new OrderPayResultResponse();
response.setOrderNo(sOrder.getOrderNo());
response.setPayType(PayTypeEnum.getEnumByCode(sOrder.getPayType()).getValue());
response.setStatus(YesNoEnum.no.getFlag());
// 扫呗支付
ConcurrentHashMap<String, String> unifiedorder = saobeiUnifiedOrder(sOrder);
WxPayJsResultVo vo = new WxPayJsResultVo();
vo.setAppId(unifiedorder.get("appId"));
vo.setNonceStr(unifiedorder.get("nonceStr"));
vo.setPackages(unifiedorder.get("package"));
vo.setSignType(unifiedorder.get("signType"));
vo.setTimeStamp(unifiedorder.get("timeStamp"));
vo.setPaySign(unifiedorder.get("paySign"));
// 更新商户订单号
sOrder.setOutTradeNo(unifiedorder.get("outTradeNo"));
orderService.updateById(sOrder);
response.setJsConfig(vo);
return response;
}
/** /**
* 预下单 * 预下单
* @param sOrder 订单 * @param sOrder 订单
...@@ -178,6 +153,29 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -178,6 +153,29 @@ public class OrderPayServiceImpl implements OrderPayService {
return vo; return vo;
} }
@Override
public OrderPayResultResponse saobeiPayment(SOrder sOrder) {
OrderPayResultResponse response = new OrderPayResultResponse();
response.setOrderNo(sOrder.getOrderNo());
response.setPayType(PayTypeEnum.getEnumByCode(sOrder.getPayType()).getValue());
response.setStatus(YesNoEnum.no.getFlag());
// 扫呗支付
ConcurrentHashMap<String, String> unifiedorder = saobeiUnifiedOrder(sOrder);
WxPayJsResultVo vo = new WxPayJsResultVo();
vo.setAppId(unifiedorder.get("appId"));
vo.setNonceStr(unifiedorder.get("nonceStr"));
vo.setPackages(unifiedorder.get("package"));
vo.setSignType(unifiedorder.get("signType"));
vo.setTimeStamp(unifiedorder.get("timeStamp"));
vo.setPaySign(unifiedorder.get("paySign"));
// 更新商户订单号
sOrder.setOutTradeNo(unifiedorder.get("outTradeNo"));
orderService.updateById(sOrder);
response.setJsConfig(vo);
return response;
}
/** /**
* 预下单 (扫呗-微信) * 预下单 (扫呗-微信)
* @param sOrder 订单 * @param sOrder 订单
......
...@@ -76,6 +76,28 @@ ...@@ -76,6 +76,28 @@
<include refid="selectConsumerMemberVo"/> <include refid="selectConsumerMemberVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="selectByConsumerId" resultType="share.system.domain.vo.ConsumerMemberVo">
select m.id,
m.consumer_id,
c.nick_name,
c.phone,
c.avatar,
m.membership_level,
m.member_type,
m.member_config_id,
m.expiration_date,
m.membership_progress,
m.is_delete,
m.create_by,
m.create_time,
m.update_by,
m.update_time,
m.remark
from s_consumer_member m
join s_consumer c on m.consumer_id = c.id and m.is_delete = 0
where 1 = 1
and m.consumer_id = #{consumerId}
</select>
<insert id="insertConsumerMember" parameterType="ConsumerMember" useGeneratedKeys="true" keyProperty="id"> <insert id="insertConsumerMember" parameterType="ConsumerMember" useGeneratedKeys="true" keyProperty="id">
insert into s_consumer_member insert into s_consumer_member
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<result property="couponId" column="coupon_id"/> <result property="couponId" column="coupon_id"/>
<result property="couponPrice" column="coupon_price"/> <result property="couponPrice" column="coupon_price"/>
<result property="totalPrice" column="total_price"/> <result property="totalPrice" column="total_price"/>
<result property="duration" column="duration"/>
<result property="balance" column="balance"/>
<result property="discountRatio" column="discount_ratio"/> <result property="discountRatio" column="discount_ratio"/>
<result property="payPrice" column="pay_price"/> <result property="payPrice" column="pay_price"/>
<result property="payTime" column="pay_time"/> <result property="payTime" column="pay_time"/>
...@@ -63,6 +65,8 @@ ...@@ -63,6 +65,8 @@
coupon_price, coupon_price,
total_price, total_price,
pay_price, pay_price,
duration,
balance,
discount_ratio, discount_ratio,
pay_time, pay_time,
time_long, time_long,
...@@ -108,6 +112,8 @@ ...@@ -108,6 +112,8 @@
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if> <if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if> <if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if> <if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
<if test="balance != null and balance != ''">and balance = #{balance}</if>
<if test="discountRatio != null and discountRatio != ''">and discount_ratio = #{discountRatio}</if> <if test="discountRatio != null and discountRatio != ''">and discount_ratio = #{discountRatio}</if>
<if test="startPayTime != null"> <if test="startPayTime != null">
and DATE_FORMAT(pay_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d') and DATE_FORMAT(pay_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d')
...@@ -178,6 +184,9 @@ ...@@ -178,6 +184,9 @@
s.consumer_id, s.consumer_id,
s.consumer_name, s.consumer_name,
s.consumer_phone, s.consumer_phone,
s.duration,
s.balance,
s.discount_ratio,
s.pack_id, s.pack_id,
s.pack_price, s.pack_price,
s.coupon_id, s.coupon_id,
...@@ -223,6 +232,9 @@ ...@@ -223,6 +232,9 @@
s.consumer_id, s.consumer_id,
s.consumer_name, s.consumer_name,
s.consumer_phone, s.consumer_phone,
s.duration,
s.balance,
s.discount_ratio,
s.pack_id, s.pack_id,
s.pack_price, s.pack_price,
s.coupon_id, s.coupon_id,
...@@ -292,6 +304,8 @@ ...@@ -292,6 +304,8 @@
<if test="createTime != null and createTime != ''">create_time,</if> <if test="createTime != null and createTime != ''">create_time,</if>
<if test="arrivalTime != null and arrivalTime != ''">arrival_time,</if> <if test="arrivalTime != null and arrivalTime != ''">arrival_time,</if>
<if test="discountRatio != null and discountRatio != ''">discount_ratio,</if> <if test="discountRatio != null and discountRatio != ''">discount_ratio,</if>
<if test="duration != null and duration != ''">duration,</if>
<if test="balance != null and balance != '' ">balance,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null">#{orderNo},</if> <if test="orderNo != null">#{orderNo},</if>
...@@ -326,7 +340,9 @@ ...@@ -326,7 +340,9 @@
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="arrivalTime != null">#{arrivalTime},</if> <if test="arrivalTime != null">#{arrivalTime},</if>
<if test="discountRatio != null">#{discountRatio},</if>" <if test="discountRatio != null">#{discountRatio},</if>
<if test="duration != null">#{duration},</if>
<if test="balance != null">#{balance},</if>
</trim> </trim>
</insert> </insert>
...@@ -367,6 +383,8 @@ ...@@ -367,6 +383,8 @@
<if test="arrivalTime != null">arrival_time = #{arrivalTime},</if> <if test="arrivalTime != null">arrival_time = #{arrivalTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="discountRatio != null">discount_ratio = #{discountRatio},</if> <if test="discountRatio != null">discount_ratio = #{discountRatio},</if>
<if test="duration != null">duration = #{duration},</if>
<if test="balance != null">balance = #{balance},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
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