Commit c29a6e2e by 吕明尚

Merge branch 'refs/heads/test' into test-lms

parents 790fd56b af462e53
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.ConsumerMonthlyCard;
import share.system.domain.vo.ConsumerMonthlyCardVo;
import share.system.service.ConsumerMonthlyCardService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 用户月卡Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/system/consumerMonthlyCard")
public class ConsumerMonthlyCardController extends BaseController {
@Autowired
private ConsumerMonthlyCardService consumerMonthlyCardService;
/**
* 查询用户月卡列表
*/
@PreAuthorize("@ss.hasPermi('system:consumerMonthlyCard:list')")
@GetMapping("/list")
public TableDataInfo list(ConsumerMonthlyCardVo consumerMonthlyCard) {
startPage();
List<ConsumerMonthlyCardVo> list = consumerMonthlyCardService.selectConsumerMonthlyCardList(consumerMonthlyCard);
return getDataTable(list);
}
/**
* 导出用户月卡列表
*/
@PreAuthorize("@ss.hasPermi('system:consumerMonthlyCard:export')")
@Log(title = "用户月卡", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ConsumerMonthlyCardVo consumerMonthlyCard) {
List<ConsumerMonthlyCardVo> list = consumerMonthlyCardService.selectConsumerMonthlyCardList(consumerMonthlyCard);
ExcelUtil<ConsumerMonthlyCardVo> util = new ExcelUtil<ConsumerMonthlyCardVo>(ConsumerMonthlyCardVo.class);
util.exportExcel(response, list, "用户月卡数据");
}
/**
* 获取用户月卡详细信息
*/
@PreAuthorize("@ss.hasPermi('system:consumerMonthlyCard:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(consumerMonthlyCardService.selectConsumerMonthlyCardById(id));
}
/**
* 新增用户月卡
*/
@PreAuthorize("@ss.hasPermi('system:consumerMonthlyCard:add')")
@Log(title = "用户月卡", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ConsumerMonthlyCard consumerMonthlyCard) {
return toAjax(consumerMonthlyCardService.insertConsumerMonthlyCard(consumerMonthlyCard));
}
/**
* 修改用户月卡
*/
@PreAuthorize("@ss.hasPermi('system:consumerMonthlyCard:edit')")
@Log(title = "用户月卡", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ConsumerMonthlyCard consumerMonthlyCard) {
return toAjax(consumerMonthlyCardService.updateConsumerMonthlyCard(consumerMonthlyCard));
}
/**
* 删除用户月卡
*/
@PreAuthorize("@ss.hasPermi('system:consumerMonthlyCard:remove')")
@Log(title = "用户月卡", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(consumerMonthlyCardService.deleteConsumerMonthlyCardByIds(ids));
}
}
...@@ -96,12 +96,25 @@ public class DeviceController extends BaseController ...@@ -96,12 +96,25 @@ public class DeviceController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:device:edit')") @PreAuthorize("@ss.hasPermi('system:device:edit')")
@Log(title = "设备信息", businessType = BusinessType.UPDATE) @Log(title = "设备信息", businessType = BusinessType.UPDATE)
@PostMapping(value = "/updateDevicePassword")
public AjaxResult updateDevicePassword(@RequestBody Device device)
{
device.setDevPsw(device.getNewDevPsw());
return toAjax(deviceService.updateDevice(device));
}
/**
* 修改设备信息
*/
@PreAuthorize("@ss.hasPermi('system:device:edit')")
@Log(title = "设备信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody Device device) public AjaxResult edit(@RequestBody Device device)
{ {
return toAjax(deviceService.updateDevice(device)); return toAjax(deviceService.updateDevice(device));
} }
/** /**
* 删除设备信息 * 删除设备信息
*/ */
......
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.MonthlyCardConf;
import share.system.service.MonthlyCardConfService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 月卡配置Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/system/monthlyCardConf")
public class MonthlyCardConfController extends BaseController {
@Autowired
private MonthlyCardConfService monthlyCardConfService;
/**
* 查询月卡配置列表
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardConf:list')")
@GetMapping("/list")
public TableDataInfo list(MonthlyCardConf monthlyCardConf) {
startPage();
List<MonthlyCardConf> list = monthlyCardConfService.selectMonthlyCardConfList(monthlyCardConf);
return getDataTable(list);
}
/**
* 导出月卡配置列表
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardConf:export')")
@Log(title = "月卡配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MonthlyCardConf monthlyCardConf) {
List<MonthlyCardConf> list = monthlyCardConfService.selectMonthlyCardConfList(monthlyCardConf);
ExcelUtil<MonthlyCardConf> util = new ExcelUtil<MonthlyCardConf>(MonthlyCardConf.class);
util.exportExcel(response, list, "月卡配置数据");
}
/**
* 获取月卡配置详细信息
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardConf:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(monthlyCardConfService.selectMonthlyCardConfById(id));
}
/**
* 新增月卡配置
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardConf:add')")
@Log(title = "月卡配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MonthlyCardConf monthlyCardConf) {
return toAjax(monthlyCardConfService.insertMonthlyCardConf(monthlyCardConf));
}
/**
* 修改月卡配置
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardConf:edit')")
@Log(title = "月卡配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MonthlyCardConf monthlyCardConf) {
return toAjax(monthlyCardConfService.updateMonthlyCardConf(monthlyCardConf));
}
/**
* 删除月卡配置
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardConf:remove')")
@Log(title = "月卡配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(monthlyCardConfService.deleteMonthlyCardConfByIds(ids));
}
}
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.MonthlyCardLog;
import share.system.domain.vo.MonthlyCardLogVo;
import share.system.service.MonthlyCardLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 月卡使用记录Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/system/monthlyCardLog")
public class MonthlyCardLogController extends BaseController {
@Autowired
private MonthlyCardLogService monthlyCardLogService;
/**
* 查询月卡使用记录列表
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardLog:list')")
@GetMapping("/list")
public TableDataInfo list(MonthlyCardLogVo monthlyCardLog) {
startPage();
List<MonthlyCardLogVo> list = monthlyCardLogService.selectMonthlyCardLogList(monthlyCardLog);
return getDataTable(list);
}
/**
* 导出月卡使用记录列表
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardLog:export')")
@Log(title = "月卡使用记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MonthlyCardLogVo monthlyCardLog) {
List<MonthlyCardLogVo> list = monthlyCardLogService.selectMonthlyCardLogList(monthlyCardLog);
ExcelUtil<MonthlyCardLogVo> util = new ExcelUtil<MonthlyCardLogVo>(MonthlyCardLogVo.class);
util.exportExcel(response, list, "月卡使用记录数据");
}
/**
* 获取月卡使用记录详细信息
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(monthlyCardLogService.selectMonthlyCardLogById(id));
}
/**
* 新增月卡使用记录
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardLog:add')")
@Log(title = "月卡使用记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MonthlyCardLog monthlyCardLog) {
return toAjax(monthlyCardLogService.insertMonthlyCardLog(monthlyCardLog));
}
/**
* 修改月卡使用记录
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardLog:edit')")
@Log(title = "月卡使用记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MonthlyCardLog monthlyCardLog) {
return toAjax(monthlyCardLogService.updateMonthlyCardLog(monthlyCardLog));
}
/**
* 删除月卡使用记录
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardLog:remove')")
@Log(title = "月卡使用记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(monthlyCardLogService.deleteMonthlyCardLogByIds(ids));
}
}
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.MonthlyCardOrder;
import share.system.domain.vo.MonthlyCardOrderVo;
import share.system.service.MonthlyCardOrderService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 月卡订单Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/system/monthlyCardOrder")
public class MonthlyCardOrderController extends BaseController {
@Autowired
private MonthlyCardOrderService monthlyCardOrderService;
/**
* 查询月卡订单列表
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardOrder:list')")
@GetMapping("/list")
public TableDataInfo list(MonthlyCardOrderVo monthlyCardOrder) {
startPage();
List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder);
return getDataTable(list);
}
/**
* 导出月卡订单列表
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardOrder:export')")
@Log(title = "月卡订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MonthlyCardOrderVo monthlyCardOrder) {
List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder);
ExcelUtil<MonthlyCardOrderVo> util = new ExcelUtil<MonthlyCardOrderVo>(MonthlyCardOrderVo.class);
util.exportExcel(response, list, "月卡订单数据");
}
/**
* 获取月卡订单详细信息
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardOrder:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(monthlyCardOrderService.selectMonthlyCardOrderById(id));
}
/**
* 新增月卡订单
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardOrder:add')")
@Log(title = "月卡订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MonthlyCardOrder monthlyCardOrder) {
return toAjax(monthlyCardOrderService.insertMonthlyCardOrder(monthlyCardOrder));
}
/**
* 修改月卡订单
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardOrder:edit')")
@Log(title = "月卡订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MonthlyCardOrder monthlyCardOrder) {
return toAjax(monthlyCardOrderService.updateMonthlyCardOrder(monthlyCardOrder));
}
/**
* 删除月卡订单
*/
@PreAuthorize("@ss.hasPermi('system:monthlyCardOrder:remove')")
@Log(title = "月卡订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(monthlyCardOrderService.deleteMonthlyCardOrderByIds(ids));
}
}
...@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo; ...@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.system.domain.SecondaryCardLog; import share.system.domain.SecondaryCardLog;
import share.system.domain.vo.SecondaryCardLogVo;
import share.system.service.SecondaryCardLogService; import share.system.service.SecondaryCardLogService;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -32,9 +33,9 @@ public class SecondaryCardLogController extends BaseController { ...@@ -32,9 +33,9 @@ public class SecondaryCardLogController extends BaseController {
*/ */
@PreAuthorize("@ss.hasPermi('system:secondaryCardLog:list')") @PreAuthorize("@ss.hasPermi('system:secondaryCardLog:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SecondaryCardLog secondaryCardLog) { public TableDataInfo list(SecondaryCardLogVo secondaryCardLog) {
startPage(); startPage();
List<SecondaryCardLog> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog); List<SecondaryCardLogVo> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog);
return getDataTable(list); return getDataTable(list);
} }
...@@ -44,9 +45,9 @@ public class SecondaryCardLogController extends BaseController { ...@@ -44,9 +45,9 @@ public class SecondaryCardLogController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:secondaryCardLog:export')") @PreAuthorize("@ss.hasPermi('system:secondaryCardLog:export')")
@Log(title = "次卡使用记录", businessType = BusinessType.EXPORT) @Log(title = "次卡使用记录", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, SecondaryCardLog secondaryCardLog) { public void export(HttpServletResponse response, SecondaryCardLogVo secondaryCardLog) {
List<SecondaryCardLog> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog); List<SecondaryCardLogVo> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog);
ExcelUtil<SecondaryCardLog> util = new ExcelUtil<SecondaryCardLog>(SecondaryCardLog.class); ExcelUtil<SecondaryCardLogVo> util = new ExcelUtil<SecondaryCardLogVo>(SecondaryCardLogVo.class);
util.exportExcel(response, list, "次卡使用记录数据"); util.exportExcel(response, list, "次卡使用记录数据");
} }
......
...@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo; ...@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.system.domain.SecondaryCardOrder; import share.system.domain.SecondaryCardOrder;
import share.system.domain.vo.SecondaryCardOrderVo;
import share.system.service.SecondaryCardOrderService; import share.system.service.SecondaryCardOrderService;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -32,9 +33,9 @@ public class SecondaryCardOrderController extends BaseController { ...@@ -32,9 +33,9 @@ public class SecondaryCardOrderController extends BaseController {
*/ */
@PreAuthorize("@ss.hasPermi('system:secondaryCardOrder:list')") @PreAuthorize("@ss.hasPermi('system:secondaryCardOrder:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SecondaryCardOrder secondaryCardOrder) { public TableDataInfo list(SecondaryCardOrderVo secondaryCardOrder) {
startPage(); startPage();
List<SecondaryCardOrder> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder); List<SecondaryCardOrderVo> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder);
return getDataTable(list); return getDataTable(list);
} }
...@@ -44,9 +45,9 @@ public class SecondaryCardOrderController extends BaseController { ...@@ -44,9 +45,9 @@ public class SecondaryCardOrderController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:secondaryCardOrder:export')") @PreAuthorize("@ss.hasPermi('system:secondaryCardOrder:export')")
@Log(title = "次卡购买记录", businessType = BusinessType.EXPORT) @Log(title = "次卡购买记录", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, SecondaryCardOrder secondaryCardOrder) { public void export(HttpServletResponse response, SecondaryCardOrderVo secondaryCardOrder) {
List<SecondaryCardOrder> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder); List<SecondaryCardOrderVo> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder);
ExcelUtil<SecondaryCardOrder> util = new ExcelUtil<SecondaryCardOrder>(SecondaryCardOrder.class); ExcelUtil<SecondaryCardOrderVo> util = new ExcelUtil<SecondaryCardOrderVo>(SecondaryCardOrderVo.class);
util.exportExcel(response, list, "次卡购买记录数据"); util.exportExcel(response, list, "次卡购买记录数据");
} }
......
package share.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType;
import share.system.domain.SharingActivities;
import share.system.service.SharingActivitiesService;
import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo;
/**
* 分享活动绑定关系Controller
*
* @author wuwenlong
* @date 2024-09-02
*/
@RestController
@RequestMapping("/system/activities")
public class SharingActivitiesController extends BaseController
{
@Autowired
private SharingActivitiesService sharingActivitiesService;
/**
* 查询分享活动绑定关系列表
*/
@PreAuthorize("@ss.hasPermi('system:activities:list')")
@GetMapping("/list")
public TableDataInfo list(SharingActivities sharingActivities)
{
startPage();
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
return getDataTable(list);
}
/**
* 导出分享活动绑定关系列表
*/
@PreAuthorize("@ss.hasPermi('system:activities:export')")
@Log(title = "分享活动绑定关系", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SharingActivities sharingActivities)
{
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
ExcelUtil<SharingActivities> util = new ExcelUtil<SharingActivities>(SharingActivities.class);
util.exportExcel(response, list, "分享活动绑定关系数据");
}
/**
* 获取分享活动绑定关系详细信息
*/
@PreAuthorize("@ss.hasPermi('system:activities:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sharingActivitiesService.selectSharingActivitiesById(id));
}
/**
* 新增分享活动绑定关系
*/
@PreAuthorize("@ss.hasPermi('system:activities:add')")
@Log(title = "分享活动绑定关系", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SharingActivities sharingActivities)
{
return toAjax(sharingActivitiesService.insertSharingActivities(sharingActivities));
}
/**
* 修改分享活动绑定关系
*/
@PreAuthorize("@ss.hasPermi('system:activities:edit')")
@Log(title = "分享活动绑定关系", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SharingActivities sharingActivities)
{
return toAjax(sharingActivitiesService.updateSharingActivities(sharingActivities));
}
/**
* 删除分享活动绑定关系
*/
@PreAuthorize("@ss.hasPermi('system:activities:remove')")
@Log(title = "分享活动绑定关系", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sharingActivitiesService.deleteSharingActivitiesByIds(ids));
}
}
...@@ -47,4 +47,8 @@ public class PayConstants { ...@@ -47,4 +47,8 @@ public class PayConstants {
// 扫呗支付回调地址 // 扫呗支付回调地址
public static final String SAOBEI_PAY_NOTIFY_API_URI = "/prod-api/admin/payment/callback/saobei/wechat"; public static final String SAOBEI_PAY_NOTIFY_API_URI = "/prod-api/admin/payment/callback/saobei/wechat";
// 微信商家给用户转账到零钱-回调地址
public static final String WX_INITIATEBATCHTRANSFER_NOTIFY_API_URI = "/prod-api/admin/payment/callback/wechat/initiateBatchTransfer";
} }
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.system.domain.vo.ConsumerMonthlyCardVo;
import share.system.service.ConsumerMonthlyCardService;
import java.util.List;
/**
* 用户月卡Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/consumerMonthlyCard")
public class ConsumerMonthlyCardController extends BaseController {
@Autowired
private ConsumerMonthlyCardService consumerMonthlyCardService;
/**
* 查询用户月卡列表
*/
@GetMapping("/list")
public TableDataInfo list(ConsumerMonthlyCardVo consumerMonthlyCard) {
startPage();
List<ConsumerMonthlyCardVo> list = consumerMonthlyCardService.selectConsumerMonthlyCardList(consumerMonthlyCard);
return getDataTable(list);
}
@GetMapping("/query")
public AjaxResult selectByConsumerId() {
return success(consumerMonthlyCardService.selectByConsumerId());
}
}
...@@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; 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.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.system.domain.vo.ConsumerSecondaryCardVo; import share.system.domain.vo.ConsumerSecondaryCardVo;
import share.system.service.ConsumerSecondaryCardService; import share.system.service.ConsumerSecondaryCardService;
...@@ -33,4 +34,9 @@ public class ConsumerSecondaryCardController extends BaseController { ...@@ -33,4 +34,9 @@ public class ConsumerSecondaryCardController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/query")
public AjaxResult selectByConsumerId() {
return success(consumerSecondaryCardService.selectByConsumerId());
}
} }
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController;
import share.common.core.domain.R;
import share.common.core.page.TableDataInfo;
import share.system.domain.MonthlyCardConf;
import share.system.service.MonthlyCardConfService;
import java.util.List;
/**
* 月卡配置Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/monthlyCardConf")
public class MonthlyCardConfController extends BaseController {
@Autowired
private MonthlyCardConfService monthlyCardConfService;
/**
* 查询月卡配置列表
*/
@GetMapping("/list")
public TableDataInfo list(MonthlyCardConf monthlyCardConf) {
startPage();
List<MonthlyCardConf> list = monthlyCardConfService.selectMonthlyCardConfList(monthlyCardConf);
return getDataTable(list);
}
/**
* 查询月卡配置列表
*/
@GetMapping("/query")
public R<List<MonthlyCardConf>> query() {
return R.ok(monthlyCardConfService.selectMonthlyCardConfList(null));
}
}
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.system.domain.SConsumer;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.MonthlyCardLogVo;
import share.system.service.MonthlyCardLogService;
import java.util.List;
/**
* 月卡使用记录Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/monthlyCardLog")
public class MonthlyCardLogController extends BaseController {
@Autowired
private MonthlyCardLogService monthlyCardLogService;
/**
* 查询月卡使用记录列表
*/
@GetMapping("/list")
public TableDataInfo list(MonthlyCardLogVo monthlyCardLog) {
startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
monthlyCardLog.setConsumerId(user.getId());
List<MonthlyCardLogVo> list = monthlyCardLogService.selectMonthlyCardLogList(monthlyCardLog);
return getDataTable(list);
}
@GetMapping("/query")
public AjaxResult query(MonthlyCardLogVo monthlyCardLog) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
monthlyCardLog.setConsumerId(user.getId());
return success(monthlyCardLogService.selectMonthlyCardLogList(monthlyCardLog));
}
}
package share.web.controller.system;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.domain.R;
import share.common.core.page.TableDataInfo;
import share.common.core.redis.RedisUtil;
import share.common.utils.JsonConvertUtil;
import share.system.domain.SConsumer;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.MonthlyCardOrderVo;
import share.system.request.CreateMonthlyCardRequest;
import share.system.response.MonthlyyCardPayResultResponse;
import share.system.service.MonthlyCardOrderService;
import java.util.List;
/**
* 月卡订单Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@Slf4j
@RestController
@RequestMapping("/monthlyCardOrder")
public class MonthlyCardOrderController extends BaseController {
@Autowired
private MonthlyCardOrderService monthlyCardOrderService;
@Autowired
private RedisUtil redisUtil;
/**
* 查询月卡订单列表
*/
@GetMapping("/list")
public TableDataInfo list(MonthlyCardOrderVo monthlyCardOrder) {
startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
monthlyCardOrder.setConsumerId(user.getId());
List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder);
return getDataTable(list);
}
@GetMapping("/query")
public AjaxResult query(MonthlyCardOrderVo monthlyCardOrder) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
monthlyCardOrder.setConsumerId(user.getId());
List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder);
return success(list);
}
@PostMapping("/createMonthlyCard")
public R<MonthlyyCardPayResultResponse> createOrder(@RequestBody @Validated CreateMonthlyCardRequest request) {
if ("1".equals(redisUtil.frontInOutLogSwitch())) {
log.debug("MonthlyCardOrderController method preOrder 入参 {}", JsonConvertUtil.write2JsonStr(request));
}
MonthlyyCardPayResultResponse response = monthlyCardOrderService.createMonthlyCard(request);
if ("1".equals(redisUtil.frontInOutLogSwitch())) {
log.debug("MonthlyCardOrderController method preOrder 出参 {}", JsonConvertUtil.write2JsonStr(response));
}
return R.ok(response);
}
@ApiOperation(value = "通过订单编号查询订单")
@GetMapping(value = "/{monthlyCardNo}")
public R<MonthlyCardOrderVo> queryMonthlyCardInfoByNo(@PathVariable("monthlyCardNo") String monthlyCardNo) {
return R.ok(monthlyCardOrderService.queryMonthlyCardInfoByNo(monthlyCardNo));
}
}
...@@ -13,7 +13,9 @@ import share.common.core.page.TableDataInfo; ...@@ -13,7 +13,9 @@ import share.common.core.page.TableDataInfo;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.system.domain.SOrder; import share.system.domain.SOrder;
import share.system.domain.vo.OrderVo;
import share.system.domain.vo.SOrderVo; import share.system.domain.vo.SOrderVo;
import share.system.mapper.SStoreConsumerMapper;
import share.system.request.CreateOrderRequest; import share.system.request.CreateOrderRequest;
import share.system.request.OrderComputedPriceRequest; import share.system.request.OrderComputedPriceRequest;
import share.system.request.OrderRefundRequest; import share.system.request.OrderRefundRequest;
...@@ -42,6 +44,8 @@ public class SOrderController extends BaseController ...@@ -42,6 +44,8 @@ public class SOrderController extends BaseController
private ISOrderService sOrderService; private ISOrderService sOrderService;
@Autowired @Autowired
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired
private SStoreConsumerMapper storeConsumerMapper;
/** /**
* 查询订单列表 * 查询订单列表
...@@ -147,4 +151,13 @@ public class SOrderController extends BaseController ...@@ -147,4 +151,13 @@ public class SOrderController extends BaseController
return R.ok(sOrderService.statistics(request)); return R.ok(sOrderService.statistics(request));
} }
// @PostMapping("/statistics/orderList")
@RequestMapping(value = "/statistics/orderList", method = RequestMethod.GET)
public R<List<OrderVo>> statisticsOrderList(OrderStatisticsRequest request) {
startPage();
return R.ok(sOrderService.statisticsOrderList(request));
}
} }
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.system.domain.SecondaryCardLog; import share.system.domain.vo.SecondaryCardLogVo;
import share.system.service.SecondaryCardLogService; import share.system.service.SecondaryCardLogService;
import java.util.List; import java.util.List;
...@@ -27,9 +27,9 @@ public class SecondaryCardLogController extends BaseController { ...@@ -27,9 +27,9 @@ public class SecondaryCardLogController extends BaseController {
* 查询次卡使用记录列表 * 查询次卡使用记录列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SecondaryCardLog secondaryCardLog) { public TableDataInfo list(SecondaryCardLogVo secondaryCardLog) {
startPage(); startPage();
List<SecondaryCardLog> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog); List<SecondaryCardLogVo> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog);
return getDataTable(list); return getDataTable(list);
} }
......
package share.web.controller.system; package share.web.controller.system;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; 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;
...@@ -9,7 +10,7 @@ import share.common.core.domain.R; ...@@ -9,7 +10,7 @@ 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.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.system.domain.SecondaryCardOrder; import share.system.domain.vo.SecondaryCardOrderVo;
import share.system.request.SecondaryCardOrderRequest; import share.system.request.SecondaryCardOrderRequest;
import share.system.response.SecondaryCardOrderPayResultResponse; import share.system.response.SecondaryCardOrderPayResultResponse;
import share.system.service.SecondaryCardOrderService; import share.system.service.SecondaryCardOrderService;
...@@ -35,9 +36,9 @@ public class SecondaryCardOrderController extends BaseController { ...@@ -35,9 +36,9 @@ public class SecondaryCardOrderController extends BaseController {
* 查询次卡购买记录列表 * 查询次卡购买记录列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SecondaryCardOrder secondaryCardOrder) { public TableDataInfo list(SecondaryCardOrderVo secondaryCardOrder) {
startPage(); startPage();
List<SecondaryCardOrder> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder); List<SecondaryCardOrderVo> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder);
return getDataTable(list); return getDataTable(list);
} }
...@@ -53,4 +54,10 @@ public class SecondaryCardOrderController extends BaseController { ...@@ -53,4 +54,10 @@ public class SecondaryCardOrderController extends BaseController {
} }
return R.ok(response); return R.ok(response);
} }
@ApiOperation(value = "通过订单编号查询订单")
@GetMapping(value = "/{secondaryCardNo}")
public R<SecondaryCardOrderVo> querySecondaryCardInfoByNo(@PathVariable("secondaryCardNo") String secondaryCardNo) {
return R.ok(secondaryCardOrderService.querySecondaryCardInfoByNo(secondaryCardNo));
}
} }
...@@ -12,10 +12,8 @@ import org.springframework.validation.annotation.Validated; ...@@ -12,10 +12,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import share.common.core.domain.R; import share.common.core.domain.R;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
import share.common.enums.MessageReminderEnum;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.system.domain.SConsumerToken; import share.system.domain.SConsumerToken;
import share.system.domain.SOrder;
import share.system.domain.TemplateMessage; import share.system.domain.TemplateMessage;
import share.system.request.RegisterThirdSConsumerRequest; import share.system.request.RegisterThirdSConsumerRequest;
import share.system.request.WxBindingPhoneRequest; import share.system.request.WxBindingPhoneRequest;
...@@ -199,13 +197,13 @@ public class WeChatController { ...@@ -199,13 +197,13 @@ public class WeChatController {
logger.debug("更新完成的消费者令牌列表: {}", sConsumerTokenList); logger.debug("更新完成的消费者令牌列表: {}", sConsumerTokenList);
} }
@GetMapping("/test1") // @GetMapping("/test1")
public void test(String orderNo) { // public void test(String orderNo) {
SOrder byOrderN = sOrderService.getByOrderNo(orderNo); // SOrder byOrderN = sOrderService.getByOrderNo(orderNo);
wechatNewService.sendPublicTemplateMessage(byOrderN, MessageReminderEnum.CLEANING, byOrderN.getConsumerId()); // wechatNewService.sendPublicTemplateMessage(byOrderN, MessageReminderEnum.CLEANING, byOrderN.getConsumerId());
wechatNewService.sendPublicTemplateMessage(byOrderN, MessageReminderEnum.ORDER_RESERVE, byOrderN.getConsumerId()); // wechatNewService.sendPublicTemplateMessage(byOrderN, MessageReminderEnum.ORDER_RESERVE, byOrderN.getConsumerId());
//
} // }
} }
......
...@@ -76,7 +76,7 @@ public class CouponRetryTask { ...@@ -76,7 +76,7 @@ public class CouponRetryTask {
List<SConsumerCoupon> sConsumerCoupons = sConsumerCouponService.list(consumerCouponWrapper); List<SConsumerCoupon> sConsumerCoupons = sConsumerCouponService.list(consumerCouponWrapper);
if (sConsumerCoupons.size() > 100) { if (sConsumerCoupons.size() > 100) {
sConsumerCoupons.subList(0, 100); sConsumerCoupons = sConsumerCoupons.subList(0, 100);
} }
if (!CollectionUtils.isEmpty(sConsumerCoupons)) { if (!CollectionUtils.isEmpty(sConsumerCoupons)) {
List<SConsumerCoupon> updatedCoupons = new ArrayList<>(); List<SConsumerCoupon> updatedCoupons = new ArrayList<>();
...@@ -90,11 +90,27 @@ public class CouponRetryTask { ...@@ -90,11 +90,27 @@ public class CouponRetryTask {
.getOpenShopUuid(); .getOpenShopUuid();
TuangouReceiptGetConsumedReponseEntity getconsumed = qpService.getconsumed(item.getCouponCode(), openShopUuid); TuangouReceiptGetConsumedReponseEntity getconsumed = qpService.getconsumed(item.getCouponCode(), openShopUuid);
if (!ObjectUtils.isEmpty(getconsumed)) { if (!ObjectUtils.isEmpty(getconsumed)) {
item.setCouponPayPrice(BigDecimal.valueOf(getconsumed.getDeal_price())); item.setCouponPayPrice(BigDecimal.valueOf(getconsumed.getDeal_price()).subtract(BigDecimal.valueOf(getconsumed.getOrder_shoppromo_amount())));
logger.debug("美团优惠卷购买金额为:" + item.getCouponPayPrice()); logger.debug("美团优惠卷购买金额为:" + item.getCouponPayPrice());
} else { } else {
finalList.stream().forEach(store -> {
TuangouReceiptGetConsumedReponseEntity newGetconsumed = qpService.getconsumed(item.getCouponCode(), store.getOpenShopUuid());
logger.debug("门店:" + store.getName() + "优惠券码:" + item.getCouponCode());
if (!ObjectUtils.isEmpty(newGetconsumed)) {
item.setStoreId(store.getId());
item.setCouponPayPrice(BigDecimal.valueOf(newGetconsumed.getDeal_price()).subtract(BigDecimal.valueOf(newGetconsumed.getOrder_shoppromo_amount())));
logger.debug("门店:" + store.getName() + "优惠券码:" + item.getCouponCode());
logger.debug("美团优惠卷购买金额为:" + item.getCouponPayPrice());
//跳出循环
return;
}
logger.debug("门店:" + store.getName() + "优惠券码:" + item.getCouponCode() + "查询优惠券失败" + newGetconsumed);
});
if (item.getCouponPayPrice() == null) {
item.setCouponPayPrice(BigDecimal.ZERO);
item.setUseStatus(UserStatusEnum.EXPIRED.getCode()); item.setUseStatus(UserStatusEnum.EXPIRED.getCode());
} }
}
} else if (PlatformTypeEnum.TIKTOK.getCode().equals(item.getPlatformType())) { } else if (PlatformTypeEnum.TIKTOK.getCode().equals(item.getPlatformType())) {
JSONObject data = tiktokService.certificateGet(item.getEncryptedCode()); JSONObject data = tiktokService.certificateGet(item.getEncryptedCode());
JSONObject certificate = data.getJSONObject("certificate"); JSONObject certificate = data.getJSONObject("certificate");
......
...@@ -107,6 +107,9 @@ public class RedisTask { ...@@ -107,6 +107,9 @@ public class RedisTask {
@Autowired @Autowired
private MemberConfigService memberConfigService; private MemberConfigService memberConfigService;
@Autowired
private SharingActivitiesService sharingActivitiesService;
//15分钟的常量 //15分钟的常量
final long FIFTEEN_MINUTES = 60 * 15; final long FIFTEEN_MINUTES = 60 * 15;
...@@ -296,10 +299,14 @@ public class RedisTask { ...@@ -296,10 +299,14 @@ public class RedisTask {
logger.debug("保洁工单派单通知发送开始"); logger.debug("保洁工单派单通知发送开始");
//通知保洁人员 //通知保洁人员
sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> { sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
if (item.getTextMessage().equals(YesNoEnum.yes.getIndex())) {
// 循环发送短信提示门店保洁打扫卫生 // 循环发送短信提示门店保洁打扫卫生
smsService.sendSmsCleanRecordsRemind15(item.getPhone(), sStore, sRoom); smsService.sendSmsCleanRecordsRemind15(item.getPhone(), sStore, sRoom);
}
if (item.getOfficialAccount().equals(YesNoEnum.yes.getIndex())) {
//公众号发送保洁工单派单通知 //公众号发送保洁工单派单通知
wechatNewService.sendPublicTemplateMessage(finalSOrder, MessageReminderEnum.CLEANING, item.getId()); wechatNewService.sendPublicTemplateMessage(finalSOrder, MessageReminderEnum.CLEANING, item.getId());
}
}); });
logger.debug("保洁工单派单通知发送结束"); logger.debug("保洁工单派单通知发送结束");
return; return;
...@@ -320,6 +327,48 @@ public class RedisTask { ...@@ -320,6 +327,48 @@ public class RedisTask {
redisUtil.delete(o); redisUtil.delete(o);
throw new BaseException("订单不存在!"); throw new BaseException("订单不存在!");
} }
//查询当前用户是否只有一个订单
LambdaQueryWrapper<SOrder> sOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
sOrderLambdaQueryWrapper.eq(SOrder :: getConsumerId,sOrder.getConsumerId());
sOrderLambdaQueryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex());
sOrderLambdaQueryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus());
sOrderLambdaQueryWrapper.in(SOrder::getStatus, OrderStatusEnum.getUnfinishOrderStatus());
sOrderLambdaQueryWrapper.eq(SOrder::getIsDelete, YesNoEnum.no.getIndex());
List<SOrder> sOrderList = isOrderService.list(sOrderLambdaQueryWrapper);
if (sOrderList.size() == 1){
//查询是否有上级
LambdaQueryWrapper<SharingActivities> sharingActivitiesLambdaQueryWrapper = new LambdaQueryWrapper<>();
sharingActivitiesLambdaQueryWrapper.eq(SharingActivities :: getNewUid,sOrder.getConsumerId());
SharingActivities sharingActivities = sharingActivitiesService.getOne(sharingActivitiesLambdaQueryWrapper);
if (ObjectUtil.isNotEmpty(sharingActivities)){
LambdaQueryWrapper<ConsumerWallet> consumerWalletLambdaQueryWrapper = new LambdaQueryWrapper<>();
consumerWalletLambdaQueryWrapper.eq(ConsumerWallet::getConsumerId,sharingActivities.getUid());
ConsumerWallet consumerWallet = consumerWalletService.getOne(consumerWalletLambdaQueryWrapper);
if (ObjectUtil.isNotEmpty(consumerWallet)){
//添加时长
BigDecimal anHour = new BigDecimal(1.0);
consumerWallet.setRemainingDuration(consumerWallet.getRemainingDuration().add(anHour));
consumerWallet.setUpdateTime(DateUtils.getNowDate());
consumerWalletService.updateConsumerWallet(consumerWallet);
}else {
//新增钱包
ConsumerWallet newConsumerWallet = new ConsumerWallet();
BigDecimal defaultVlue = new BigDecimal(0.0);
newConsumerWallet.setCreateTime(DateUtils.getNowDate());
newConsumerWallet.setConsumerId(sharingActivities.getUid());
newConsumerWallet.setBalance(defaultVlue);
newConsumerWallet.setRemainingIntegral(defaultVlue);
newConsumerWallet.setRemainingDuration(defaultVlue);
newConsumerWallet.setEquityFund(defaultVlue);
newConsumerWallet.setAccumulateEquityFund(defaultVlue);
consumerWalletService.save(newConsumerWallet);
BigDecimal anHour = new BigDecimal(1.0);
newConsumerWallet.setRemainingDuration(newConsumerWallet.getRemainingDuration().add(anHour));
newConsumerWallet.setUpdateTime(DateUtils.getNowDate());
consumerWalletService.updateConsumerWallet(newConsumerWallet);
}
}
}
if (extracted(o, sOrders, sOrder)) return; if (extracted(o, sOrders, sOrder)) return;
//更改订单状态 //更改订单状态
sOrder.setStatus(OrderStatusEnum.USED.getCode()); sOrder.setStatus(OrderStatusEnum.USED.getCode());
...@@ -348,7 +397,7 @@ public class RedisTask { ...@@ -348,7 +397,7 @@ public class RedisTask {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("orderNo", sOrder.getOrderNo()); map.put("orderNo", sOrder.getOrderNo());
//当前时间加15分钟 //当前时间加15分钟
Date date = DateUtil.offsetMinute(new Date(), 15); Date date = DateUtil.offsetMinute(sOrder.getEndDate(), 15);
map.put("expirationTime", date.toString()); map.put("expirationTime", date.toString());
JSONObject json = new JSONObject(map); JSONObject json = new JSONObject(map);
redisUtil.set(ReceiptRdeisEnum.ROOM_EXPIRE_TIME.getValue() + sOrder.getOrderNo(), json.toString()); redisUtil.set(ReceiptRdeisEnum.ROOM_EXPIRE_TIME.getValue() + sOrder.getOrderNo(), json.toString());
......
...@@ -156,5 +156,10 @@ ...@@ -156,5 +156,10 @@
<artifactId>cron-utils</artifactId> <artifactId>cron-utils</artifactId>
<version>9.1.3</version> <version>9.1.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-java</artifactId>
<version>0.2.14</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 用户月卡对象 s_consumer_monthly_card
*
* @author wuwenlong
* @date 2024-08-27
*/
@Data
@TableName(value = "s_consumer_monthly_card")
public class ConsumerMonthlyCard extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 月卡配置表id
*/
@Excel(name = "月卡配置表id")
private Long monthlyCardConfId;
/**
* 用户ID
*/
@Excel(name = "用户ID")
private Long consumerId;
/**
* 用户手机号
*/
@Excel(name = "用户手机号")
private String phone;
/**
* 免费时长
*/
@Excel(name = "免费时长")
private Long freeDuration;
/**
* 月卡天数
*/
@Excel(name = "月卡天数")
private Long monthlyCardDays;
/**
* 次卡有效期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "次卡有效期", width = 30, dateFormat = "yyyy-MM-dd")
private Date expirationDate;
/**
* 删除标记:1-删除,0-正常
*/
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("monthlyCardConfId", getMonthlyCardConfId())
.append("consumerId", getConsumerId())
.append("phone", getPhone())
.append("freeDuration", getFreeDuration())
.append("monthlyCardDays", getMonthlyCardDays())
.append("expirationDate", getExpirationDate())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
...@@ -2,6 +2,7 @@ package share.system.domain; ...@@ -2,6 +2,7 @@ package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -18,6 +19,7 @@ import java.util.Date; ...@@ -18,6 +19,7 @@ import java.util.Date;
* @date 2024-08-22 * @date 2024-08-22
*/ */
@Data @Data
@TableName(value = "s_consumer_secondary_card")
public class ConsumerSecondaryCard extends BaseEntity { public class ConsumerSecondaryCard extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -58,6 +58,18 @@ public class ConsumerWallet extends BaseEntity { ...@@ -58,6 +58,18 @@ public class ConsumerWallet extends BaseEntity {
@TableField(select = false) @TableField(select = false)
private Long isDelete; private Long isDelete;
/**
* 权益金
*/
@Excel(name = "权益金")
private BigDecimal equityFund;
/**
* 累计权益金
*/
@Excel(name = "累计权益金")
private BigDecimal accumulateEquityFund;
@Override @Override
public String toString() { public String toString() {
......
...@@ -83,6 +83,9 @@ public class Device extends BaseEntity ...@@ -83,6 +83,9 @@ public class Device extends BaseEntity
/** 门店房间ID */ /** 门店房间ID */
private Long roomId; private Long roomId;
/** 设备新密码*/
private String newDevPsw;
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -26,6 +26,9 @@ public class EquityMembersOrderConfig extends BaseEntity { ...@@ -26,6 +26,9 @@ public class EquityMembersOrderConfig extends BaseEntity {
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Long id; private Long id;
@Excel(name = "配置名称")
private String name;
/** /**
* 默认会员等级 * 默认会员等级
*/ */
...@@ -50,6 +53,9 @@ public class EquityMembersOrderConfig extends BaseEntity { ...@@ -50,6 +53,9 @@ public class EquityMembersOrderConfig extends BaseEntity {
@Excel(name = "会员有效期") @Excel(name = "会员有效期")
private Long validityPeriod; private Long validityPeriod;
@Excel(name = "赠送积分")
private BigDecimal giftPoints;
/** /**
* 是否删除 * 是否删除
*/ */
......
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import java.math.BigDecimal;
/**
* 月卡配置对象 s_monthly_card_conf
*
* @author wuwenlong
* @date 2024-08-27
*/
@Data
@TableName(value = "s_monthly_card_conf")
public class MonthlyCardConf extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 配置名称
*/
@Excel(name = "配置名称")
private String name;
/**
* 月卡金额
*/
@Excel(name = "月卡金额")
private BigDecimal monthlyCardAmount;
/**
* 免费时长
*/
@Excel(name = "免费时长")
private Long freeDuration;
/**
* 月卡天数
*/
@Excel(name = "月卡天数")
private Long monthlyCardDays;
/**
* 是否删除(0:否,1:是)
*/
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("monthlyCardAmount", getMonthlyCardAmount())
.append("freeDuration", getFreeDuration())
.append("monthlyCardDays", getMonthlyCardDays())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
/**
* 月卡使用记录对象 s_monthly_card_log
*
* @author wuwenlong
* @date 2024-08-27
*/
@Data
@TableName(value = "s_monthly_card_log")
public class MonthlyCardLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 用户月卡id
*/
@Excel(name = "用户月卡id")
private Long consumerMonthlyCardId;
/**
* 用户ID
*/
@Excel(name = "用户ID")
private Long consumerId;
/**
* 用户手机号
*/
@Excel(name = "用户手机号")
private String phone;
/**
* 使用时长
*/
@Excel(name = "使用时长")
private Long useDuration;
/**
* 剩余时长
*/
@Excel(name = "剩余时长")
private Long residueDuration;
/**
* 删除标记:1-删除,0-正常
*/
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("consumerMonthlyCardId", getConsumerMonthlyCardId())
.append("consumerId", getConsumerId())
.append("phone", getPhone())
.append("useDuration", getUseDuration())
.append("residueDuration", getResidueDuration())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package share.system.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
* 月卡订单对象 s_monthly_card_order
*
* @author wuwenlong
* @date 2024-08-27
*/
@Data
@TableName(value = "s_monthly_card_order")
public class MonthlyCardOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 月卡购买记录编号
*/
@Excel(name = "月卡购买记录编号")
private String monthlyCardNo;
/**
* 扫呗平台唯一订单号
*/
@Excel(name = "扫呗平台唯一订单号")
private String outTradeNo;
/**
* 商户订单号
*/
@Excel(name = "商户订单号")
private String terminalTrace;
/**
* 月卡购买金额
*/
@Excel(name = "月卡购买金额")
private BigDecimal monthlyCardAmount;
/**
* 月卡配置id
*/
@Excel(name = "月卡配置id")
private Long monthlyCardConfId;
/**
* 用户ID
*/
@Excel(name = "用户ID")
private Long consumerId;
/**
* 用户手机号
*/
@Excel(name = "用户手机号")
private String phone;
/**
* 支付方式
*/
@Excel(name = "支付方式")
private Integer payType;
/**
* 状态:0-待支付,1-支付成功,2-退款中,3-退款完成
*/
@Excel(name = "状态:0-待支付,1-支付成功,2-退款中,3-退款完成")
private Integer payStatus;
/**
* 支付时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date payTime;
/**
* 是否删除(0:否,1:是)
*/
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("monthlyCardNo", getMonthlyCardNo())
.append("outTradeNo", getOutTradeNo())
.append("terminalTrace", getTerminalTrace())
.append("monthlyCardAmount", getMonthlyCardAmount())
.append("monthlyCardConfId", getMonthlyCardConfId())
.append("consumerId", getConsumerId())
.append("phone", getPhone())
.append("payType", getPayType())
.append("payStatus", getPayStatus())
.append("payTime", getPayTime())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
...@@ -108,4 +108,10 @@ public class SConsumer implements Serializable ...@@ -108,4 +108,10 @@ public class SConsumer implements Serializable
@TableField(exist = false) @TableField(exist = false)
private Integer position; private Integer position;
@TableField(exist = false)
private Integer textMessage;
@TableField(exist = false)
private Integer officialAccount;
} }
...@@ -18,10 +18,14 @@ public class SStoreConsumer { ...@@ -18,10 +18,14 @@ public class SStoreConsumer {
private Integer position; private Integer position;
//电控 是否接收公众号 //电控
private Integer controller; private Integer controller;
//门控 是否接收短信 //门控
private Integer gating; private Integer gating;
//是否接收短信
private Integer textMessage;
//是否接收公众号
private Integer officialAccount;
} }
...@@ -2,6 +2,7 @@ package share.system.domain; ...@@ -2,6 +2,7 @@ package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
...@@ -17,6 +18,7 @@ import java.math.BigDecimal; ...@@ -17,6 +18,7 @@ import java.math.BigDecimal;
* @date 2024-08-22 * @date 2024-08-22
*/ */
@Data @Data
@TableName(value = "s_secondary_card_conf")
public class SecondaryCardConf extends BaseEntity { public class SecondaryCardConf extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -2,6 +2,7 @@ package share.system.domain; ...@@ -2,6 +2,7 @@ package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
...@@ -15,6 +16,7 @@ import share.common.core.domain.BaseEntity; ...@@ -15,6 +16,7 @@ import share.common.core.domain.BaseEntity;
* @date 2024-08-22 * @date 2024-08-22
*/ */
@Data @Data
@TableName("s_secondary_card_log")
public class SecondaryCardLog extends BaseEntity { public class SecondaryCardLog extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package share.system.domain; package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -19,12 +18,14 @@ import java.util.Date; ...@@ -19,12 +18,14 @@ import java.util.Date;
* @date 2024-08-22 * @date 2024-08-22
*/ */
@Data @Data
@TableName("s_secondary_card_order")
public class SecondaryCardOrder extends BaseEntity { public class SecondaryCardOrder extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
*/ */
@TableId(type = IdType.AUTO)
private Long id; private Long id;
/** /**
......
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
/**
* 分享活动绑定关系对象 s_sharing_activities
*
* @author wuwenlong
* @date 2024-09-02
*/
@Data
@TableName("s_sharing_activities")
public class SharingActivities extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 活动类型(0-新用户注册,1-权益金会员分享) */
@Excel(name = "活动类型(0-新用户注册,1-权益金会员分享)")
private String activityType;
/** 上级id */
@Excel(name = "上级id")
private Long uid;
/** 下级id */
@Excel(name = "下级id")
private Long newUid;
/** 删除标记:1-删除,0-正常 */
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("activityType", getActivityType())
.append("uid", getUid())
.append("newUid", getNewUid())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
* 提现记录对象 s_withdraw_log
*
* @author lwj
* @date 2024-08-28
*/
@Data
public class WithdrawLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 提现用户ID */
@Excel(name = "提现用户ID")
private Long consumerId;
/** 提现金额 */
@Excel(name = "提现金额")
private BigDecimal amount;
/** 状态:1-提现申请,2-审核通过,3-审核不通过,4-已撤销,5-交易成功,6-交易失败 */
@Excel(name = "状态")
private Integer status;
/** 提现订单号,系统自动生成的 */
@Excel(name = "提现订单号")
private String withdrawOrder;
/** 提现手续费 */
@Excel(name = "提现手续费")
private BigDecimal withdrawCharge;
/** 申请提现时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "申请提现时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date withdrawApplyTime;
/** 提现备注 */
@Excel(name = "提现备注")
private String withdrawRemark;
/** 提现方式:1-微信 */
@Excel(name = "提现方式:1-微信")
private Integer withdrawType;
/** 是否删除 */
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Long isDelete;
/** 微信转账场景 */
@Excel(name = "微信转账场景")
private String transferSceneId;
/** 用户的openid */
@Excel(name = "用户的openid")
private String openid;
/** 微信批次单号 */
@Excel(name = "微信批次单号")
private String batchId;
/** 微信批次状态 */
@Excel(name = "微信批次状态")
private String batchStatus;
/** 微信接口错误描述 */
@Excel(name = "微信接口错误描述")
private String errorDesc;
/** 错误码 */
@Excel(name = "错误码")
private String errorCode;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("consumerId", getConsumerId())
.append("amount", getAmount())
.append("status", getStatus())
.append("withdrawOrder", getWithdrawOrder())
.append("withdrawCharge", getWithdrawCharge())
.append("withdrawApplyTime", getWithdrawApplyTime())
.append("withdrawRemark", getWithdrawRemark())
.append("withdrawType", getWithdrawType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDelete", getIsDelete())
.append("transferSceneId", getTransferSceneId())
.append("openid", getOpenid())
.append("batchId", getBatchId())
.append("batchStatus", getBatchStatus())
.append("errorDesc", getErrorDesc())
.append("errorCode", getErrorCode())
.toString();
}
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.ConsumerMonthlyCard;
import java.math.BigDecimal;
@Data
public class ConsumerMonthlyCardVo extends ConsumerMonthlyCard {
//用户昵称
private String nickName;
//用户头像
private String avatar;
//配置名称
private String confName;
//月卡金额
private BigDecimal confAmount;
}
...@@ -7,6 +7,8 @@ import java.math.BigDecimal; ...@@ -7,6 +7,8 @@ import java.math.BigDecimal;
@Data @Data
public class MemberConfigVo extends MemberConfig { public class MemberConfigVo extends MemberConfig {
//到下一级的额度差
private BigDecimal nextDifference;
//下一级的额度要求 //下一级的额度要求
private Long nextLimitRequirements; private Long nextLimitRequirements;
//下一级的会员等级 //下一级的会员等级
......
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.MonthlyCardLog;
import java.math.BigDecimal;
@Data
public class MonthlyCardLogVo extends MonthlyCardLog {
//用户昵称
private String nickName;
//用户头像
private String avatar;
//配置名称
private String confName;
//次卡金额
private BigDecimal confAmount;
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.MonthlyCardOrder;
import java.math.BigDecimal;
@Data
public class MonthlyCardOrderVo extends MonthlyCardOrder {
//用户昵称
private String nickName;
//用户头像
private String avatar;
//配置名称
private String confName;
//次卡金额
private BigDecimal confAmount;
}
...@@ -29,6 +29,10 @@ public class SConsumerVo extends SConsumer { ...@@ -29,6 +29,10 @@ public class SConsumerVo extends SConsumer {
private Integer controller; private Integer controller;
private Integer gating; private Integer gating;
//是否接收短信
private Integer textMessage;
//是否接收公众号
private Integer officialAccount;
private ConsumerMember consumerMember; private ConsumerMember consumerMember;
......
...@@ -14,11 +14,19 @@ public class SStoreConsumerVo { ...@@ -14,11 +14,19 @@ public class SStoreConsumerVo {
*/ */
private Long consumerId; private Long consumerId;
//电控 是否接收公众号
private Integer controller; private Integer controller;
//门控 是否接收短信
private Integer gating; private Integer gating;
private Integer position; private Integer position;
//是否接收短信
private Integer textMessage;
//是否接收公众号
private Integer officialAccount;
private Long[] consumerIds; private Long[] consumerIds;
} }
...@@ -15,4 +15,8 @@ public class SecondaryCardLogVo extends SecondaryCardLog { ...@@ -15,4 +15,8 @@ public class SecondaryCardLogVo extends SecondaryCardLog {
private String packName; private String packName;
//套餐金额 //套餐金额
private BigDecimal packPrice; private BigDecimal packPrice;
//配置名称
private String confName;
//次卡金额
private BigDecimal confAmount;
} }
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.ConsumerMonthlyCard;
import share.system.domain.vo.ConsumerMonthlyCardVo;
import java.util.List;
/**
* 用户月卡Mapper接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface ConsumerMonthlyCardMapper extends BaseMapper<ConsumerMonthlyCard> {
/**
* 查询用户月卡
*
* @param id 用户月卡主键
* @return 用户月卡
*/
public ConsumerMonthlyCard selectConsumerMonthlyCardById(Long id);
/**
* 查询用户月卡列表
*
* @param consumerMonthlyCard 用户月卡
* @return 用户月卡集合
*/
public List<ConsumerMonthlyCardVo> selectConsumerMonthlyCardList(ConsumerMonthlyCardVo consumerMonthlyCard);
/**
* 新增用户月卡
*
* @param consumerMonthlyCard 用户月卡
* @return 结果
*/
public int insertConsumerMonthlyCard(ConsumerMonthlyCard consumerMonthlyCard);
/**
* 修改用户月卡
*
* @param consumerMonthlyCard 用户月卡
* @return 结果
*/
public int updateConsumerMonthlyCard(ConsumerMonthlyCard consumerMonthlyCard);
/**
* 删除用户月卡
*
* @param id 用户月卡主键
* @return 结果
*/
public int deleteConsumerMonthlyCardById(Long id);
/**
* 批量删除用户月卡
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteConsumerMonthlyCardByIds(Long[] ids);
ConsumerMonthlyCardVo selectByConsumerId(ConsumerMonthlyCardVo consumerMemberVo);
}
...@@ -60,4 +60,6 @@ public interface ConsumerSecondaryCardMapper extends BaseMapper<ConsumerSecondar ...@@ -60,4 +60,6 @@ public interface ConsumerSecondaryCardMapper extends BaseMapper<ConsumerSecondar
* @return 结果 * @return 结果
*/ */
public int deleteConsumerSecondaryCardByIds(Long[] ids); public int deleteConsumerSecondaryCardByIds(Long[] ids);
List<ConsumerSecondaryCardVo> selectByConsumerId(ConsumerSecondaryCardVo vo);
} }
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.MonthlyCardConf;
import java.util.List;
/**
* 月卡配置Mapper接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface MonthlyCardConfMapper extends BaseMapper<MonthlyCardConf> {
/**
* 查询月卡配置
*
* @param id 月卡配置主键
* @return 月卡配置
*/
public MonthlyCardConf selectMonthlyCardConfById(Long id);
/**
* 查询月卡配置列表
*
* @param monthlyCardConf 月卡配置
* @return 月卡配置集合
*/
public List<MonthlyCardConf> selectMonthlyCardConfList(MonthlyCardConf monthlyCardConf);
/**
* 新增月卡配置
*
* @param monthlyCardConf 月卡配置
* @return 结果
*/
public int insertMonthlyCardConf(MonthlyCardConf monthlyCardConf);
/**
* 修改月卡配置
*
* @param monthlyCardConf 月卡配置
* @return 结果
*/
public int updateMonthlyCardConf(MonthlyCardConf monthlyCardConf);
/**
* 删除月卡配置
*
* @param id 月卡配置主键
* @return 结果
*/
public int deleteMonthlyCardConfById(Long id);
/**
* 批量删除月卡配置
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMonthlyCardConfByIds(Long[] ids);
}
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.MonthlyCardLog;
import share.system.domain.vo.MonthlyCardLogVo;
import java.util.List;
/**
* 月卡使用记录Mapper接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface MonthlyCardLogMapper extends BaseMapper<MonthlyCardLog> {
/**
* 查询月卡使用记录
*
* @param id 月卡使用记录主键
* @return 月卡使用记录
*/
public MonthlyCardLog selectMonthlyCardLogById(Long id);
/**
* 查询月卡使用记录列表
*
* @param monthlyCardLog 月卡使用记录
* @return 月卡使用记录集合
*/
public List<MonthlyCardLogVo> selectMonthlyCardLogList(MonthlyCardLogVo monthlyCardLog);
/**
* 新增月卡使用记录
*
* @param monthlyCardLog 月卡使用记录
* @return 结果
*/
public int insertMonthlyCardLog(MonthlyCardLog monthlyCardLog);
/**
* 修改月卡使用记录
*
* @param monthlyCardLog 月卡使用记录
* @return 结果
*/
public int updateMonthlyCardLog(MonthlyCardLog monthlyCardLog);
/**
* 删除月卡使用记录
*
* @param id 月卡使用记录主键
* @return 结果
*/
public int deleteMonthlyCardLogById(Long id);
/**
* 批量删除月卡使用记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMonthlyCardLogByIds(Long[] ids);
}
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.MonthlyCardOrder;
import share.system.domain.vo.MonthlyCardOrderVo;
import java.util.List;
/**
* 月卡订单Mapper接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface MonthlyCardOrderMapper extends BaseMapper<MonthlyCardOrder> {
/**
* 查询月卡订单
*
* @param id 月卡订单主键
* @return 月卡订单
*/
public MonthlyCardOrder selectMonthlyCardOrderById(Long id);
/**
* 查询月卡订单列表
*
* @param monthlyCardOrder 月卡订单
* @return 月卡订单集合
*/
public List<MonthlyCardOrderVo> selectMonthlyCardOrderList(MonthlyCardOrderVo monthlyCardOrder);
/**
* 新增月卡订单
*
* @param monthlyCardOrder 月卡订单
* @return 结果
*/
public int insertMonthlyCardOrder(MonthlyCardOrder monthlyCardOrder);
/**
* 修改月卡订单
*
* @param monthlyCardOrder 月卡订单
* @return 结果
*/
public int updateMonthlyCardOrder(MonthlyCardOrder monthlyCardOrder);
/**
* 删除月卡订单
*
* @param id 月卡订单主键
* @return 结果
*/
public int deleteMonthlyCardOrderById(Long id);
/**
* 批量删除月卡订单
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMonthlyCardOrderByIds(Long[] ids);
MonthlyCardOrder getInfoByEntity(MonthlyCardOrder monthlyCardOrder);
}
...@@ -2,6 +2,7 @@ package share.system.mapper; ...@@ -2,6 +2,7 @@ package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.SecondaryCardLog; import share.system.domain.SecondaryCardLog;
import share.system.domain.vo.SecondaryCardLogVo;
import java.util.List; import java.util.List;
...@@ -26,7 +27,7 @@ public interface SecondaryCardLogMapper extends BaseMapper<SecondaryCardLog> { ...@@ -26,7 +27,7 @@ public interface SecondaryCardLogMapper extends BaseMapper<SecondaryCardLog> {
* @param secondaryCardLog 次卡使用记录 * @param secondaryCardLog 次卡使用记录
* @return 次卡使用记录集合 * @return 次卡使用记录集合
*/ */
public List<SecondaryCardLog> selectSecondaryCardLogList(SecondaryCardLog secondaryCardLog); public List<SecondaryCardLogVo> selectSecondaryCardLogList(SecondaryCardLogVo secondaryCardLog);
/** /**
* 新增次卡使用记录 * 新增次卡使用记录
......
...@@ -2,6 +2,7 @@ package share.system.mapper; ...@@ -2,6 +2,7 @@ package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.SecondaryCardOrder; import share.system.domain.SecondaryCardOrder;
import share.system.domain.vo.SecondaryCardOrderVo;
import java.util.List; import java.util.List;
...@@ -26,7 +27,7 @@ public interface SecondaryCardOrderMapper extends BaseMapper<SecondaryCardOrder> ...@@ -26,7 +27,7 @@ public interface SecondaryCardOrderMapper extends BaseMapper<SecondaryCardOrder>
* @param secondaryCardOrder 次卡购买记录 * @param secondaryCardOrder 次卡购买记录
* @return 次卡购买记录集合 * @return 次卡购买记录集合
*/ */
public List<SecondaryCardOrder> selectSecondaryCardOrderList(SecondaryCardOrder secondaryCardOrder); public List<SecondaryCardOrderVo> selectSecondaryCardOrderList(SecondaryCardOrderVo secondaryCardOrder);
/** /**
* 新增次卡购买记录 * 新增次卡购买记录
......
package share.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.SharingActivities;
/**
* 分享活动绑定关系Mapper接口
*
* @author wuwenlong
* @date 2024-09-02
*/
public interface SharingActivitiesMapper extends BaseMapper<SharingActivities>
{
/**
* 查询分享活动绑定关系
*
* @param id 分享活动绑定关系主键
* @return 分享活动绑定关系
*/
public SharingActivities selectSharingActivitiesById(Long id);
/**
* 查询分享活动绑定关系列表
*
* @param sharingActivities 分享活动绑定关系
* @return 分享活动绑定关系集合
*/
public List<SharingActivities> selectSharingActivitiesList(SharingActivities sharingActivities);
/**
* 新增分享活动绑定关系
*
* @param sharingActivities 分享活动绑定关系
* @return 结果
*/
public int insertSharingActivities(SharingActivities sharingActivities);
/**
* 修改分享活动绑定关系
*
* @param sharingActivities 分享活动绑定关系
* @return 结果
*/
public int updateSharingActivities(SharingActivities sharingActivities);
/**
* 删除分享活动绑定关系
*
* @param id 分享活动绑定关系主键
* @return 结果
*/
public int deleteSharingActivitiesById(Long id);
/**
* 批量删除分享活动绑定关系
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSharingActivitiesByIds(Long[] ids);
}
package share.system.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "CreateMonthlyCardRequest对象", description = "下单请求对象")
public class CreateMonthlyCardRequest {
@ApiModelProperty(value = "支付类型(1:微信,2:支付宝)", required = true)
@NotNull(message = "支付类型不能为空")
private Integer payType;
@ApiModelProperty(value = "充值配置表id")
@NotNull(message = "充值配置表id")
private Long monthlyCardConfId;
}
package share.system.request; package share.system.request;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
@Data @Data
public class OrderStatisticsRequest { @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "OrderStatisticsRequest对象", description = "门店数据查询请求对象")
public class OrderStatisticsRequest implements Serializable {
private static final long serialVersionUID = 1L;
//门店id //门店id
private Long storeId; private Long storeId;
//开始时间 //开始时间
......
...@@ -46,4 +46,10 @@ public class WxRegisterPhoneRequest implements Serializable { ...@@ -46,4 +46,10 @@ public class WxRegisterPhoneRequest implements Serializable {
@NotBlank(message = "手机号code不能为空") @NotBlank(message = "手机号code不能为空")
private String phoneCode; private String phoneCode;
@ApiModelProperty(value = "上级id")
private Long uid;
@ApiModelProperty(value = "活动类型")
private String activityType;
} }
...@@ -27,7 +27,7 @@ public class EquityMembersResultResponse { ...@@ -27,7 +27,7 @@ public class EquityMembersResultResponse {
private String payType; private String payType;
@ApiModelProperty(value = "订单编号") @ApiModelProperty(value = "订单编号")
private String rechargeNo; private String equityOrderNo;
@ApiModelProperty(value = "微信支付回调的url") @ApiModelProperty(value = "微信支付回调的url")
private String notifyUrl; private String notifyUrl;
......
package share.system.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import share.system.domain.vo.WxPayJsResultVo;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "MonthlyyCardPayResultResponse对象", description = "订单支付结果响应对象")
public class MonthlyyCardPayResultResponse {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "支付状态")
private Boolean status;
@ApiModelProperty(value = "微信调起支付参数对象")
private WxPayJsResultVo jsConfig;
@ApiModelProperty(value = "支付类型")
private String payType;
@ApiModelProperty(value = "订单编号")
private String monthlyCardNo;
@ApiModelProperty(value = "微信支付回调的url")
private String notifyUrl;
}
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.ConsumerMonthlyCard;
import share.system.domain.vo.ConsumerMonthlyCardVo;
import java.util.List;
/**
* 用户月卡Service接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface ConsumerMonthlyCardService extends IService<ConsumerMonthlyCard> {
/**
* 查询用户月卡
*
* @param id 用户月卡主键
* @return 用户月卡
*/
public ConsumerMonthlyCard selectConsumerMonthlyCardById(Long id);
/**
* 查询用户月卡列表
*
* @param consumerMonthlyCard 用户月卡
* @return 用户月卡集合
*/
public List<ConsumerMonthlyCardVo> selectConsumerMonthlyCardList(ConsumerMonthlyCardVo consumerMonthlyCard);
/**
* 新增用户月卡
*
* @param consumerMonthlyCard 用户月卡
* @return 结果
*/
public int insertConsumerMonthlyCard(ConsumerMonthlyCard consumerMonthlyCard);
/**
* 修改用户月卡
*
* @param consumerMonthlyCard 用户月卡
* @return 结果
*/
public int updateConsumerMonthlyCard(ConsumerMonthlyCard consumerMonthlyCard);
/**
* 批量删除用户月卡
*
* @param ids 需要删除的用户月卡主键集合
* @return 结果
*/
public int deleteConsumerMonthlyCardByIds(Long[] ids);
/**
* 删除用户月卡信息
*
* @param id 用户月卡主键
* @return 结果
*/
public int deleteConsumerMonthlyCardById(Long id);
ConsumerMonthlyCardVo selectByConsumerId();
}
...@@ -60,4 +60,6 @@ public interface ConsumerSecondaryCardService extends IService<ConsumerSecondary ...@@ -60,4 +60,6 @@ public interface ConsumerSecondaryCardService extends IService<ConsumerSecondary
* @return 结果 * @return 结果
*/ */
public int deleteConsumerSecondaryCardById(Long id); public int deleteConsumerSecondaryCardById(Long id);
List<ConsumerSecondaryCardVo> selectByConsumerId();
} }
...@@ -68,4 +68,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> { ...@@ -68,4 +68,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> {
boolean addConsumerWallet(ConsumerWallet consumerWallet); boolean addConsumerWallet(ConsumerWallet consumerWallet);
boolean editConsumerWallet(ConsumerWallet consumerWallet, Recharge recharge, ConsumerMember one); boolean editConsumerWallet(ConsumerWallet consumerWallet, Recharge recharge, ConsumerMember one);
void accumulatedConsumptionStatistics(Long consumerId);
} }
...@@ -5,6 +5,7 @@ import share.common.core.page.TableDataInfo; ...@@ -5,6 +5,7 @@ import share.common.core.page.TableDataInfo;
import share.common.vo.TableDataInfoVo; import share.common.vo.TableDataInfoVo;
import share.system.domain.SConsumerCoupon; import share.system.domain.SConsumerCoupon;
import share.system.domain.SOrder; import share.system.domain.SOrder;
import share.system.domain.vo.OrderVo;
import share.system.domain.vo.SOrderDto; import share.system.domain.vo.SOrderDto;
import share.system.domain.vo.SOrderVo; import share.system.domain.vo.SOrderVo;
import share.system.domain.vo.SRoomVo; import share.system.domain.vo.SRoomVo;
...@@ -218,4 +219,5 @@ public interface ISOrderService extends IService<SOrder> ...@@ -218,4 +219,5 @@ public interface ISOrderService extends IService<SOrder>
List<Long> couponIds(SOrder sOrder); List<Long> couponIds(SOrder sOrder);
List<OrderVo> statisticsOrderList(OrderStatisticsRequest request);
} }
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.MonthlyCardConf;
import java.util.List;
/**
* 月卡配置Service接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface MonthlyCardConfService extends IService<MonthlyCardConf> {
/**
* 查询月卡配置
*
* @param id 月卡配置主键
* @return 月卡配置
*/
public MonthlyCardConf selectMonthlyCardConfById(Long id);
/**
* 查询月卡配置列表
*
* @param monthlyCardConf 月卡配置
* @return 月卡配置集合
*/
public List<MonthlyCardConf> selectMonthlyCardConfList(MonthlyCardConf monthlyCardConf);
/**
* 新增月卡配置
*
* @param monthlyCardConf 月卡配置
* @return 结果
*/
public int insertMonthlyCardConf(MonthlyCardConf monthlyCardConf);
/**
* 修改月卡配置
*
* @param monthlyCardConf 月卡配置
* @return 结果
*/
public int updateMonthlyCardConf(MonthlyCardConf monthlyCardConf);
/**
* 批量删除月卡配置
*
* @param ids 需要删除的月卡配置主键集合
* @return 结果
*/
public int deleteMonthlyCardConfByIds(Long[] ids);
/**
* 删除月卡配置信息
*
* @param id 月卡配置主键
* @return 结果
*/
public int deleteMonthlyCardConfById(Long id);
}
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.MonthlyCardLog;
import share.system.domain.vo.MonthlyCardLogVo;
import java.util.List;
/**
* 月卡使用记录Service接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface MonthlyCardLogService extends IService<MonthlyCardLog> {
/**
* 查询月卡使用记录
*
* @param id 月卡使用记录主键
* @return 月卡使用记录
*/
public MonthlyCardLog selectMonthlyCardLogById(Long id);
/**
* 查询月卡使用记录列表
*
* @param monthlyCardLog 月卡使用记录
* @return 月卡使用记录集合
*/
public List<MonthlyCardLogVo> selectMonthlyCardLogList(MonthlyCardLogVo monthlyCardLog);
/**
* 新增月卡使用记录
*
* @param monthlyCardLog 月卡使用记录
* @return 结果
*/
public int insertMonthlyCardLog(MonthlyCardLog monthlyCardLog);
/**
* 修改月卡使用记录
*
* @param monthlyCardLog 月卡使用记录
* @return 结果
*/
public int updateMonthlyCardLog(MonthlyCardLog monthlyCardLog);
/**
* 批量删除月卡使用记录
*
* @param ids 需要删除的月卡使用记录主键集合
* @return 结果
*/
public int deleteMonthlyCardLogByIds(Long[] ids);
/**
* 删除月卡使用记录信息
*
* @param id 月卡使用记录主键
* @return 结果
*/
public int deleteMonthlyCardLogById(Long id);
}
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.MonthlyCardOrder;
import share.system.domain.vo.MonthlyCardOrderVo;
import share.system.request.CreateMonthlyCardRequest;
import share.system.response.MonthlyyCardPayResultResponse;
import java.util.List;
/**
* 月卡订单Service接口
*
* @author wuwenlong
* @date 2024-08-27
*/
public interface MonthlyCardOrderService extends IService<MonthlyCardOrder> {
/**
* 查询月卡订单
*
* @param id 月卡订单主键
* @return 月卡订单
*/
public MonthlyCardOrder selectMonthlyCardOrderById(Long id);
/**
* 查询月卡订单列表
*
* @param monthlyCardOrder 月卡订单
* @return 月卡订单集合
*/
public List<MonthlyCardOrderVo> selectMonthlyCardOrderList(MonthlyCardOrderVo monthlyCardOrder);
/**
* 新增月卡订单
*
* @param monthlyCardOrder 月卡订单
* @return 结果
*/
public int insertMonthlyCardOrder(MonthlyCardOrder monthlyCardOrder);
/**
* 修改月卡订单
*
* @param monthlyCardOrder 月卡订单
* @return 结果
*/
public int updateMonthlyCardOrder(MonthlyCardOrder monthlyCardOrder);
/**
* 批量删除月卡订单
*
* @param ids 需要删除的月卡订单主键集合
* @return 结果
*/
public int deleteMonthlyCardOrderByIds(Long[] ids);
/**
* 删除月卡订单信息
*
* @param id 月卡订单主键
* @return 结果
*/
public int deleteMonthlyCardOrderById(Long id);
MonthlyyCardPayResultResponse createMonthlyCard(CreateMonthlyCardRequest request);
MonthlyCardOrderVo queryMonthlyCardInfoByNo(String monthlyCardNo);
void paymentSuccessful(MonthlyCardOrder monthlyCardOrder);
MonthlyCardOrder getInfoByEntity(MonthlyCardOrder monthlyCardOrder);
}
package share.system.service; package share.system.service;
import share.system.domain.EquityMembersOrder; import share.system.domain.*;
import share.system.domain.Recharge; import share.system.response.*;
import share.system.domain.SOrder;
import share.system.domain.SecondaryCardOrder;
import share.system.response.EquityMembersResultResponse;
import share.system.response.OrderPayResultResponse;
import share.system.response.RechargePayResultResponse;
import share.system.response.SecondaryCardOrderPayResultResponse;
/** /**
* @Author wwl * @Author wwl
...@@ -39,4 +33,6 @@ public interface OrderPayService { ...@@ -39,4 +33,6 @@ public interface OrderPayService {
EquityMembersResultResponse saobeiEquityMembersOrderPayment(EquityMembersOrder equityMembersOrder); EquityMembersResultResponse saobeiEquityMembersOrderPayment(EquityMembersOrder equityMembersOrder);
SecondaryCardOrderPayResultResponse saobeiSecondaryCardOrderPayment(SecondaryCardOrder secondaryCardOrder); SecondaryCardOrderPayResultResponse saobeiSecondaryCardOrderPayment(SecondaryCardOrder secondaryCardOrder);
MonthlyyCardPayResultResponse saobeiCreateMonthlyCardOrderPayment(MonthlyCardOrder monthlyCardOrder);
} }
...@@ -2,6 +2,7 @@ package share.system.service; ...@@ -2,6 +2,7 @@ package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SecondaryCardLog; import share.system.domain.SecondaryCardLog;
import share.system.domain.vo.SecondaryCardLogVo;
import java.util.List; import java.util.List;
...@@ -26,7 +27,7 @@ public interface SecondaryCardLogService extends IService<SecondaryCardLog> { ...@@ -26,7 +27,7 @@ public interface SecondaryCardLogService extends IService<SecondaryCardLog> {
* @param secondaryCardLog 次卡使用记录 * @param secondaryCardLog 次卡使用记录
* @return 次卡使用记录集合 * @return 次卡使用记录集合
*/ */
public List<SecondaryCardLog> selectSecondaryCardLogList(SecondaryCardLog secondaryCardLog); public List<SecondaryCardLogVo> selectSecondaryCardLogList(SecondaryCardLogVo secondaryCardLog);
/** /**
* 新增次卡使用记录 * 新增次卡使用记录
......
...@@ -2,6 +2,7 @@ package share.system.service; ...@@ -2,6 +2,7 @@ package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SecondaryCardOrder; import share.system.domain.SecondaryCardOrder;
import share.system.domain.vo.SecondaryCardOrderVo;
import share.system.request.SecondaryCardOrderRequest; import share.system.request.SecondaryCardOrderRequest;
import share.system.response.SecondaryCardOrderPayResultResponse; import share.system.response.SecondaryCardOrderPayResultResponse;
...@@ -28,7 +29,7 @@ public interface SecondaryCardOrderService extends IService<SecondaryCardOrder> ...@@ -28,7 +29,7 @@ public interface SecondaryCardOrderService extends IService<SecondaryCardOrder>
* @param secondaryCardOrder 次卡购买记录 * @param secondaryCardOrder 次卡购买记录
* @return 次卡购买记录集合 * @return 次卡购买记录集合
*/ */
public List<SecondaryCardOrder> selectSecondaryCardOrderList(SecondaryCardOrder secondaryCardOrder); public List<SecondaryCardOrderVo> selectSecondaryCardOrderList(SecondaryCardOrderVo secondaryCardOrder);
/** /**
* 新增次卡购买记录 * 新增次卡购买记录
...@@ -67,4 +68,6 @@ public interface SecondaryCardOrderService extends IService<SecondaryCardOrder> ...@@ -67,4 +68,6 @@ public interface SecondaryCardOrderService extends IService<SecondaryCardOrder>
void paymentSuccessful(SecondaryCardOrder secondaryCardOrder); void paymentSuccessful(SecondaryCardOrder secondaryCardOrder);
SecondaryCardOrder getInfoByEntity(SecondaryCardOrder secondaryCardOrderParam); SecondaryCardOrder getInfoByEntity(SecondaryCardOrder secondaryCardOrderParam);
SecondaryCardOrderVo querySecondaryCardInfoByNo(String secondaryCardNo);
} }
package share.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SharingActivities;
/**
* 分享活动绑定关系Service接口
*
* @author wuwenlong
* @date 2024-09-02
*/
public interface SharingActivitiesService extends IService<SharingActivities>
{
/**
* 查询分享活动绑定关系
*
* @param id 分享活动绑定关系主键
* @return 分享活动绑定关系
*/
public SharingActivities selectSharingActivitiesById(Long id);
/**
* 查询分享活动绑定关系列表
*
* @param sharingActivities 分享活动绑定关系
* @return 分享活动绑定关系集合
*/
public List<SharingActivities> selectSharingActivitiesList(SharingActivities sharingActivities);
/**
* 新增分享活动绑定关系
*
* @param sharingActivities 分享活动绑定关系
* @return 结果
*/
public int insertSharingActivities(SharingActivities sharingActivities);
/**
* 修改分享活动绑定关系
*
* @param sharingActivities 分享活动绑定关系
* @return 结果
*/
public int updateSharingActivities(SharingActivities sharingActivities);
/**
* 批量删除分享活动绑定关系
*
* @param ids 需要删除的分享活动绑定关系主键集合
* @return 结果
*/
public int deleteSharingActivitiesByIds(Long[] ids);
/**
* 删除分享活动绑定关系信息
*
* @param id 分享活动绑定关系主键
* @return 结果
*/
public int deleteSharingActivitiesById(Long id);
}
...@@ -3,6 +3,7 @@ package share.system.service; ...@@ -3,6 +3,7 @@ package share.system.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import share.common.enums.MessageReminderEnum; import share.common.enums.MessageReminderEnum;
import share.system.domain.SOrder; import share.system.domain.SOrder;
import share.system.domain.WithdrawLog;
import share.system.domain.vo.*; import share.system.domain.vo.*;
import share.system.response.WeChatJsSdkConfigResponse; import share.system.response.WeChatJsSdkConfigResponse;
...@@ -192,4 +193,5 @@ public interface WechatNewService { ...@@ -192,4 +193,5 @@ public interface WechatNewService {
*/ */
WeChatPhoneNumberVo getPhoneNumber(String code); WeChatPhoneNumberVo getPhoneNumber(String code);
Boolean initiateBatchTransfer(WithdrawLog withdrawLog);
} }
...@@ -76,6 +76,9 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -76,6 +76,9 @@ public class CallbackServiceImpl implements CallbackService {
@Autowired @Autowired
private SecondaryCardOrderService secondaryCardOrderService; private SecondaryCardOrderService secondaryCardOrderService;
@Autowired
private MonthlyCardOrderService monthlyCardOrderService;
/** /**
* 微信支付回调 * 微信支付回调
*/ */
...@@ -618,6 +621,84 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -618,6 +621,84 @@ public class CallbackServiceImpl implements CallbackService {
return responseVo; return responseVo;
} }
break; break;
case MONTH_CARD:
logger.debug("开始月卡订单回调");
MonthlyCardOrder monthlyCardOrderParam = new MonthlyCardOrder();
monthlyCardOrderParam.setTerminalTrace(param.getTerminal_trace());
monthlyCardOrderParam.setConsumerId(attachVo.getUserId());
MonthlyCardOrder monthlyCardOrder = monthlyCardOrderService.getInfoByEntity(monthlyCardOrderParam);
if (ObjectUtil.isNull(monthlyCardOrder)) {
logger.error("saobei wechat pay error : 订单信息不存在==》" + param.getTerminal_trace());
responseVo.setReturn_code(SaobeiStatusEnum.FAIL.getCode());
responseVo.setReturn_msg("订单信息不存在!");
// 保存api日志
saobeiApiLog.setResponseParams(JSONUtil.toJsonStr(responseVo));
saobeiApiLog.setResult(responseVo.getReturn_code());
saobeiApiLog.setResultMsg(responseVo.getReturn_msg());
saobeiApiLog.setOutTradeNo(param.getOut_trade_no());
saobeiApiLogService.insertSaobeiApiLog(saobeiApiLog);
return responseVo;
}
if (YesNoEnum.yes.getIndex().equals(monthlyCardOrder.getPayStatus())) {
logger.error("saobei wechat pay error : 订单已处理==》" + param.getTerminal_trace());
responseVo.setReturn_code(SaobeiStatusEnum.SUCCESS.getCode());
responseVo.setReturn_msg("success");
// 保存api日志
saobeiApiLog.setResponseParams(JSONUtil.toJsonStr(responseVo));
saobeiApiLog.setResult(responseVo.getReturn_code());
saobeiApiLog.setResultMsg(responseVo.getReturn_msg());
saobeiApiLog.setOutTradeNo(param.getOut_trade_no());
saobeiApiLogService.insertSaobeiApiLog(saobeiApiLog);
return responseVo;
}
WechatPayInfo monthlyCardOrderPayInfo = wechatPayInfoService.getByNo(monthlyCardOrder.getTerminalTrace());
if (ObjectUtil.isNull(monthlyCardOrderPayInfo)) {
logger.error("saobei wechat pay error : 微信订单信息不存在==》" + param.getTerminal_trace());
responseVo.setReturn_code(SaobeiStatusEnum.FAIL.getCode());
responseVo.setReturn_msg("微信订单信息不存在!");
// 保存api日志
saobeiApiLog.setResponseParams(JSONUtil.toJsonStr(responseVo));
saobeiApiLog.setResult(responseVo.getReturn_code());
saobeiApiLog.setResultMsg(responseVo.getReturn_msg());
saobeiApiLog.setOutTradeNo(param.getOut_trade_no());
saobeiApiLogService.insertSaobeiApiLog(saobeiApiLog);
return responseVo;
}
// wechatPayInfo.setIsSubscribe(param.getIsSubscribe());
monthlyCardOrderPayInfo.setBankType(param.getBank_type());
monthlyCardOrderPayInfo.setCashFee(Integer.valueOf(param.getTotal_fee()));
// wechatPayInfo.setTransactionId(param.getOut_trade_no());
monthlyCardOrderPayInfo.setTimeEnd(param.getEnd_time());
monthlyCardOrderPayInfo.setTimeExpire(param.getEnd_time());
Boolean monthlyCardBoolean = Boolean.FALSE;
try {
monthlyCardOrder.setPayStatus(YesNoEnum.yes.getIndex());
monthlyCardOrder.setPayTime(DateUtils.getNowDate());
monthlyCardOrderService.paymentSuccessful(monthlyCardOrder);
monthlyCardOrderPayInfo.setTradeState("1");
monthlyCardOrderPayInfo.setTradeStateDesc("支付成功");
wechatPayInfoService.updateById(monthlyCardOrderPayInfo);
monthlyCardBoolean = Boolean.TRUE;
} catch (Exception e) {
logger.error("微信支付回调出错");
logger.error(e.toString());
}
logger.debug("结束权益会员订单回调");
if (!monthlyCardBoolean) {
logger.error("saobei wechat pay error : 订单更新失败==》" + param.getTerminal_trace());
responseVo.setReturn_code(SaobeiStatusEnum.FAIL.getCode());
responseVo.setReturn_msg("订单更新失败!");
// 保存api日志
saobeiApiLog.setResponseParams(JSONUtil.toJsonStr(responseVo));
saobeiApiLog.setResult(responseVo.getReturn_code());
saobeiApiLog.setResultMsg(responseVo.getReturn_msg());
saobeiApiLog.setOutTradeNo(param.getOut_trade_no());
saobeiApiLogService.insertSaobeiApiLog(saobeiApiLog);
return responseVo;
}
break;
default: default:
logger.error("wechat pay err : 未知的支付类型==》" + param.getTerminal_trace()); logger.error("wechat pay err : 未知的支付类型==》" + param.getTerminal_trace());
break; break;
......
package share.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.ConsumerMonthlyCard;
import share.system.domain.SConsumer;
import share.system.domain.vo.ConsumerMonthlyCardVo;
import share.system.mapper.ConsumerMonthlyCardMapper;
import share.system.service.ConsumerMonthlyCardService;
import share.system.service.SConsumerService;
import java.util.List;
/**
* 用户月卡Service业务层处理
*
* @author wuwenlong
* @date 2024-08-27
*/
@Service
public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyCardMapper, ConsumerMonthlyCard> implements ConsumerMonthlyCardService {
@Autowired
private ConsumerMonthlyCardMapper consumerMonthlyCardMapper;
@Autowired
private SConsumerService sConsumerService;
/**
* 查询用户月卡
*
* @param id 用户月卡主键
* @return 用户月卡
*/
@Override
public ConsumerMonthlyCard selectConsumerMonthlyCardById(Long id) {
return consumerMonthlyCardMapper.selectConsumerMonthlyCardById(id);
}
/**
* 查询用户月卡列表
*
* @param consumerMonthlyCard 用户月卡
* @return 用户月卡
*/
@Override
public List<ConsumerMonthlyCardVo> selectConsumerMonthlyCardList(ConsumerMonthlyCardVo consumerMonthlyCard) {
return consumerMonthlyCardMapper.selectConsumerMonthlyCardList(consumerMonthlyCard);
}
/**
* 新增用户月卡
*
* @param consumerMonthlyCard 用户月卡
* @return 结果
*/
@Override
public int insertConsumerMonthlyCard(ConsumerMonthlyCard consumerMonthlyCard) {
consumerMonthlyCard.setCreateTime(DateUtils.getNowDate());
return consumerMonthlyCardMapper.insertConsumerMonthlyCard(consumerMonthlyCard);
}
/**
* 修改用户月卡
*
* @param consumerMonthlyCard 用户月卡
* @return 结果
*/
@Override
public int updateConsumerMonthlyCard(ConsumerMonthlyCard consumerMonthlyCard) {
consumerMonthlyCard.setUpdateTime(DateUtils.getNowDate());
return consumerMonthlyCardMapper.updateConsumerMonthlyCard(consumerMonthlyCard);
}
/**
* 批量删除用户月卡
*
* @param ids 需要删除的用户月卡主键
* @return 结果
*/
@Override
public int deleteConsumerMonthlyCardByIds(Long[] ids) {
return consumerMonthlyCardMapper.deleteConsumerMonthlyCardByIds(ids);
}
/**
* 删除用户月卡信息
*
* @param id 用户月卡主键
* @return 结果
*/
@Override
public int deleteConsumerMonthlyCardById(Long id) {
return consumerMonthlyCardMapper.deleteConsumerMonthlyCardById(id);
}
@Override
public ConsumerMonthlyCardVo selectByConsumerId() {
SConsumer info = sConsumerService.getInfo();
ConsumerMonthlyCardVo vo = new ConsumerMonthlyCardVo();
vo.setConsumerId(info.getId());
return consumerMonthlyCardMapper.selectByConsumerId(vo);
}
}
...@@ -5,9 +5,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -5,9 +5,11 @@ 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.ConsumerSecondaryCard; import share.system.domain.ConsumerSecondaryCard;
import share.system.domain.SConsumer;
import share.system.domain.vo.ConsumerSecondaryCardVo; import share.system.domain.vo.ConsumerSecondaryCardVo;
import share.system.mapper.ConsumerSecondaryCardMapper; import share.system.mapper.ConsumerSecondaryCardMapper;
import share.system.service.ConsumerSecondaryCardService; import share.system.service.ConsumerSecondaryCardService;
import share.system.service.SConsumerService;
import java.util.List; import java.util.List;
...@@ -21,6 +23,8 @@ import java.util.List; ...@@ -21,6 +23,8 @@ import java.util.List;
public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecondaryCardMapper, ConsumerSecondaryCard> implements ConsumerSecondaryCardService { public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecondaryCardMapper, ConsumerSecondaryCard> implements ConsumerSecondaryCardService {
@Autowired @Autowired
private ConsumerSecondaryCardMapper consumerSecondaryCardMapper; private ConsumerSecondaryCardMapper consumerSecondaryCardMapper;
@Autowired
private SConsumerService sConsumerService;
/** /**
* 查询用户次卡 * 查询用户次卡
...@@ -89,4 +93,12 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond ...@@ -89,4 +93,12 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
public int deleteConsumerSecondaryCardById(Long id) { public int deleteConsumerSecondaryCardById(Long id) {
return consumerSecondaryCardMapper.deleteConsumerSecondaryCardById(id); return consumerSecondaryCardMapper.deleteConsumerSecondaryCardById(id);
} }
@Override
public List<ConsumerSecondaryCardVo> selectByConsumerId() {
SConsumer info = sConsumerService.getInfo();
ConsumerSecondaryCardVo vo = new ConsumerSecondaryCardVo();
vo.setConsumerId(info.getId());
return consumerSecondaryCardMapper.selectByConsumerId(vo);
}
} }
...@@ -202,6 +202,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -202,6 +202,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
LambdaQueryWrapper<Device> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<Device> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(Device::getDevType, DeviceType.DEVICE_CCEE.getCode()); queryWrapper.eq(Device::getDevType, DeviceType.DEVICE_CCEE.getCode());
queryWrapper.isNotNull(Device::getRoomId); queryWrapper.isNotNull(Device::getRoomId);
queryWrapper.inSql(Device::getRoomId, "select id from s_room where room_type not in ('4', '5')");
List<Device> list = deviceMapper.selectList(queryWrapper); List<Device> list = deviceMapper.selectList(queryWrapper);
if (list.size() > 0) { if (list.size() > 0) {
// 默认15天 // 默认15天
......
...@@ -54,6 +54,10 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -54,6 +54,10 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired @Autowired
private ConsumerWalletService consumerWalletService; private ConsumerWalletService consumerWalletService;
@Autowired
private IntegralLogService integralLogService;
@Autowired
private MemberProgressLogService memberProgressLogService;
/** /**
* 查询权益会员订单 * 查询权益会员订单
...@@ -176,7 +180,18 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -176,7 +180,18 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
newConsumerMember.setMemberConfigId(memberConfig.getId()); newConsumerMember.setMemberConfigId(memberConfig.getId());
newConsumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())), newConsumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())),
equityMembersOrderConfig.getValidityPeriod().intValue())); equityMembersOrderConfig.getValidityPeriod().intValue()));
newConsumerMember.setMembershipProgress(BigDecimal.ZERO); newConsumerMember.setMembershipProgress(equityMembersOrderConfig.getGiftPoints());
if (equityMembersOrderConfig.getGiftPoints().compareTo(BigDecimal.ZERO) > 0) {
MemberProgressLog memberProgressLog = new MemberProgressLog();
memberProgressLog.setConsumerId(equityMembersOrder.getConsumerId());
memberProgressLog.setCurrentProgress(BigDecimal.ZERO);
memberProgressLog.setVariableProgress(equityMembersOrderConfig.getGiftPoints());
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setOperationTime(new Date());
memberProgressLog.setCreateTime(new Date());
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Math.toIntExact(memberConfig.getValidityPeriod())));
memberProgressLogService.save(memberProgressLog);
}
newConsumerMember.setCreateTime(new Date()); newConsumerMember.setCreateTime(new Date());
newConsumerMember.setIsRights(YesNoEnum.yes.getIndex()); newConsumerMember.setIsRights(YesNoEnum.yes.getIndex());
consumerMemberService.save(newConsumerMember); consumerMemberService.save(newConsumerMember);
...@@ -189,21 +204,24 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -189,21 +204,24 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
redisUtil.set(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME.getValue() + equityMembersOrder.getConsumerId(), json.toString()); redisUtil.set(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME.getValue() + equityMembersOrder.getConsumerId(), json.toString());
logger.debug("redis新增权益会员有效期"); logger.debug("redis新增权益会员有效期");
} else { } else {
MemberConfig memberConfigServiceOne = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel())
.eq(MemberConfig::getMemberType, MemberTypeEnum.RIGHTS.getIndex()));
if (consumerMember.getMemberType().equals(MemberTypeEnum.RIGHTS.getIndex())) { if (consumerMember.getMemberType().equals(MemberTypeEnum.RIGHTS.getIndex())) {
//在原来的基础上增加有效期 //在原来的基础上增加有效期
consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, consumerMember.getExpirationDate())), consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, consumerMember.getExpirationDate())),
equityMembersOrderConfig.getValidityPeriod().intValue())); memberConfigServiceOne.getValidityPeriod().intValue()));
extracted(equityMembersOrder, equityMembersOrderConfig, consumerMember, consumerWallet, memberConfigServiceOne);
consumerMemberService.updateConsumerMember(consumerMember); consumerMemberService.updateConsumerMember(consumerMember);
logger.debug("权益会员原来的基础上增加有效期"); logger.debug("权益会员原来的基础上增加有效期");
} else { } else {
consumerMember.setIsRights(YesNoEnum.yes.getIndex()); consumerMember.setIsRights(YesNoEnum.yes.getIndex());
//修改会员类型为权益会员 //修改会员类型为权益会员
consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex()); consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
consumerMember.setMemberConfigId(memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>() consumerMember.setMemberConfigId(memberConfigServiceOne.getId());
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel())
.eq(MemberConfig::getMemberType, MemberTypeEnum.RIGHTS.getIndex())).getId());
consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())), consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())),
equityMembersOrderConfig.getValidityPeriod().intValue())); memberConfigServiceOne.getValidityPeriod().intValue()));
extracted(equityMembersOrder, equityMembersOrderConfig, consumerMember, consumerWallet, memberConfigServiceOne);
consumerMemberService.updateConsumerMember(consumerMember); consumerMemberService.updateConsumerMember(consumerMember);
logger.debug("修改会员类型为权益会员"); logger.debug("修改会员类型为权益会员");
} }
...@@ -220,12 +238,61 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -220,12 +238,61 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
consumerWalletOne.setBalance(BigDecimal.ZERO); consumerWalletOne.setBalance(BigDecimal.ZERO);
consumerWalletOne.setRemainingDuration(BigDecimal.ZERO); consumerWalletOne.setRemainingDuration(BigDecimal.ZERO);
consumerWalletOne.setRemainingIntegral(BigDecimal.ZERO); consumerWalletOne.setRemainingIntegral(BigDecimal.ZERO);
if (equityMembersOrderConfig.getGiftPoints().compareTo(BigDecimal.ZERO) > 0) {
consumerWalletOne.setRemainingIntegral(consumerWalletOne.getRemainingIntegral().add(equityMembersOrderConfig.getGiftPoints()));
IntegralLog integralLog = new IntegralLog();
integralLog.setConsumerId(equityMembersOrder.getConsumerId());
integralLog.setCurrentIntegral(BigDecimal.ZERO);
integralLog.setVariableIntegral(equityMembersOrderConfig.getGiftPoints());
integralLog.setOperationType(YesNoEnum.yes.getIndex());
integralLog.setOperationTime(new Date());
integralLog.setCreateTime(new Date());
integralLogService.save(integralLog);
}
consumerWalletOne.setCreateTime(new Date()); consumerWalletOne.setCreateTime(new Date());
consumerWalletService.save(consumerWalletOne); consumerWalletService.save(consumerWalletOne);
consumerWalletService.accumulatedConsumptionStatistics(equityMembersOrder.getConsumerId());
} }
updateEquityMembersOrder(equityMembersOrder); updateEquityMembersOrder(equityMembersOrder);
} }
private void extracted(EquityMembersOrder equityMembersOrder, EquityMembersOrderConfig equityMembersOrderConfig,
ConsumerMember consumerMember, ConsumerWallet consumerWallet, MemberConfig memberConfigServiceOne) {
if (equityMembersOrderConfig.getGiftPoints().compareTo(BigDecimal.ZERO) > 0) {
MemberProgressLog memberProgressLog = new MemberProgressLog();
memberProgressLog.setConsumerId(equityMembersOrder.getConsumerId());
memberProgressLog.setCurrentProgress(consumerMember.getMembershipProgress());
consumerMember.setMembershipProgress(equityMembersOrderConfig.getGiftPoints().add(consumerMember.getMembershipProgress()));
memberProgressLog.setVariableProgress(equityMembersOrderConfig.getGiftPoints().add(consumerMember.getMembershipProgress()));
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setOperationTime(new Date());
memberProgressLog.setCreateTime(new Date());
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Math.toIntExact(memberConfigServiceOne.getValidityPeriod())));
IntegralLog integralLog = new IntegralLog();
integralLog.setConsumerId(equityMembersOrder.getConsumerId());
integralLog.setCurrentIntegral(consumerMember.getMembershipProgress());
consumerWallet.setRemainingIntegral(consumerWallet.getRemainingIntegral().add(equityMembersOrderConfig.getGiftPoints()));
integralLog.setVariableIntegral(equityMembersOrderConfig.getGiftPoints().add(consumerWallet.getRemainingIntegral()));
integralLog.setOperationType(YesNoEnum.yes.getIndex());
integralLog.setOperationTime(new Date());
integralLog.setCreateTime(new Date());
integralLogService.save(integralLog);
memberProgressLogService.save(memberProgressLog);
consumerWalletService.updateById(consumerWallet);
}
//查询当前会员类型和下一级的会员配置
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() + 1L));
if (ObjectUtil.isNotEmpty(one)) {
//判断是否升级
if (ObjectUtil.isNotEmpty(one) && consumerMember.getMembershipProgress().compareTo(BigDecimal.valueOf(one.getLimitRequirements())) >= 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() + 1L);
consumerMember.setMemberConfigId(one.getId());
}
}
}
@Override @Override
public Boolean cancelPay(String equityOrderNo) { public Boolean cancelPay(String equityOrderNo) {
EquityMembersOrder equityMembersOrder = getByEquityOrderNo(equityOrderNo); EquityMembersOrder equityMembersOrder = getByEquityOrderNo(equityOrderNo);
......
package share.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.MonthlyCardConf;
import share.system.mapper.MonthlyCardConfMapper;
import share.system.service.MonthlyCardConfService;
import java.util.List;
/**
* 月卡配置Service业务层处理
*
* @author wuwenlong
* @date 2024-08-27
*/
@Service
public class MonthlyCardConfServiceImpl extends ServiceImpl<MonthlyCardConfMapper, MonthlyCardConf> implements MonthlyCardConfService {
@Autowired
private MonthlyCardConfMapper monthlyCardConfMapper;
/**
* 查询月卡配置
*
* @param id 月卡配置主键
* @return 月卡配置
*/
@Override
public MonthlyCardConf selectMonthlyCardConfById(Long id) {
return monthlyCardConfMapper.selectMonthlyCardConfById(id);
}
/**
* 查询月卡配置列表
*
* @param monthlyCardConf 月卡配置
* @return 月卡配置
*/
@Override
public List<MonthlyCardConf> selectMonthlyCardConfList(MonthlyCardConf monthlyCardConf) {
return monthlyCardConfMapper.selectMonthlyCardConfList(monthlyCardConf);
}
/**
* 新增月卡配置
*
* @param monthlyCardConf 月卡配置
* @return 结果
*/
@Override
public int insertMonthlyCardConf(MonthlyCardConf monthlyCardConf) {
monthlyCardConf.setCreateTime(DateUtils.getNowDate());
return monthlyCardConfMapper.insertMonthlyCardConf(monthlyCardConf);
}
/**
* 修改月卡配置
*
* @param monthlyCardConf 月卡配置
* @return 结果
*/
@Override
public int updateMonthlyCardConf(MonthlyCardConf monthlyCardConf) {
monthlyCardConf.setUpdateTime(DateUtils.getNowDate());
return monthlyCardConfMapper.updateMonthlyCardConf(monthlyCardConf);
}
/**
* 批量删除月卡配置
*
* @param ids 需要删除的月卡配置主键
* @return 结果
*/
@Override
public int deleteMonthlyCardConfByIds(Long[] ids) {
return monthlyCardConfMapper.deleteMonthlyCardConfByIds(ids);
}
/**
* 删除月卡配置信息
*
* @param id 月卡配置主键
* @return 结果
*/
@Override
public int deleteMonthlyCardConfById(Long id) {
return monthlyCardConfMapper.deleteMonthlyCardConfById(id);
}
}
package share.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.MonthlyCardLog;
import share.system.domain.vo.MonthlyCardLogVo;
import share.system.mapper.MonthlyCardLogMapper;
import share.system.service.MonthlyCardLogService;
import java.util.List;
/**
* 月卡使用记录Service业务层处理
*
* @author wuwenlong
* @date 2024-08-27
*/
@Service
public class MonthlyCardLogServiceImpl extends ServiceImpl<MonthlyCardLogMapper, MonthlyCardLog> implements MonthlyCardLogService {
@Autowired
private MonthlyCardLogMapper monthlyCardLogMapper;
/**
* 查询月卡使用记录
*
* @param id 月卡使用记录主键
* @return 月卡使用记录
*/
@Override
public MonthlyCardLog selectMonthlyCardLogById(Long id) {
return monthlyCardLogMapper.selectMonthlyCardLogById(id);
}
/**
* 查询月卡使用记录列表
*
* @param monthlyCardLog 月卡使用记录
* @return 月卡使用记录
*/
@Override
public List<MonthlyCardLogVo> selectMonthlyCardLogList(MonthlyCardLogVo monthlyCardLog) {
return monthlyCardLogMapper.selectMonthlyCardLogList(monthlyCardLog);
}
/**
* 新增月卡使用记录
*
* @param monthlyCardLog 月卡使用记录
* @return 结果
*/
@Override
public int insertMonthlyCardLog(MonthlyCardLog monthlyCardLog) {
monthlyCardLog.setCreateTime(DateUtils.getNowDate());
return monthlyCardLogMapper.insertMonthlyCardLog(monthlyCardLog);
}
/**
* 修改月卡使用记录
*
* @param monthlyCardLog 月卡使用记录
* @return 结果
*/
@Override
public int updateMonthlyCardLog(MonthlyCardLog monthlyCardLog) {
monthlyCardLog.setUpdateTime(DateUtils.getNowDate());
return monthlyCardLogMapper.updateMonthlyCardLog(monthlyCardLog);
}
/**
* 批量删除月卡使用记录
*
* @param ids 需要删除的月卡使用记录主键
* @return 结果
*/
@Override
public int deleteMonthlyCardLogByIds(Long[] ids) {
return monthlyCardLogMapper.deleteMonthlyCardLogByIds(ids);
}
/**
* 删除月卡使用记录信息
*
* @param id 月卡使用记录主键
* @return 结果
*/
@Override
public int deleteMonthlyCardLogById(Long id) {
return monthlyCardLogMapper.deleteMonthlyCardLogById(id);
}
}
package share.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.enums.YesNoEnum;
import share.common.exception.base.BaseException;
import share.common.utils.BaseUtil;
import share.common.utils.DateUtils;
import share.common.utils.bean.BeanUtils;
import share.system.domain.ConsumerMonthlyCard;
import share.system.domain.MonthlyCardConf;
import share.system.domain.MonthlyCardOrder;
import share.system.domain.SConsumer;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.MonthlyCardOrderVo;
import share.system.mapper.MonthlyCardOrderMapper;
import share.system.request.CreateMonthlyCardRequest;
import share.system.response.MonthlyyCardPayResultResponse;
import share.system.service.*;
import java.util.Date;
import java.util.List;
/**
* 月卡订单Service业务层处理
*
* @author wuwenlong
* @date 2024-08-27
*/
@Service
public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMapper, MonthlyCardOrder> implements MonthlyCardOrderService {
@Autowired
private MonthlyCardOrderMapper monthlyCardOrderMapper;
@Autowired
private SConsumerService sConsumerService;
@Autowired
private OrderPayService orderPayService;
@Autowired
private MonthlyCardConfService monthlyCardConfService;
@Autowired
private ConsumerMonthlyCardService consumerMonthlyCardService;
/**
* 查询月卡订单
*
* @param id 月卡订单主键
* @return 月卡订单
*/
@Override
public MonthlyCardOrder selectMonthlyCardOrderById(Long id) {
return monthlyCardOrderMapper.selectMonthlyCardOrderById(id);
}
/**
* 查询月卡订单列表
*
* @param monthlyCardOrder 月卡订单
* @return 月卡订单
*/
@Override
public List<MonthlyCardOrderVo> selectMonthlyCardOrderList(MonthlyCardOrderVo monthlyCardOrder) {
return monthlyCardOrderMapper.selectMonthlyCardOrderList(monthlyCardOrder);
}
/**
* 新增月卡订单
*
* @param monthlyCardOrder 月卡订单
* @return 结果
*/
@Override
public int insertMonthlyCardOrder(MonthlyCardOrder monthlyCardOrder) {
monthlyCardOrder.setCreateTime(DateUtils.getNowDate());
return monthlyCardOrderMapper.insertMonthlyCardOrder(monthlyCardOrder);
}
/**
* 修改月卡订单
*
* @param monthlyCardOrder 月卡订单
* @return 结果
*/
@Override
public int updateMonthlyCardOrder(MonthlyCardOrder monthlyCardOrder) {
monthlyCardOrder.setUpdateTime(DateUtils.getNowDate());
return monthlyCardOrderMapper.updateMonthlyCardOrder(monthlyCardOrder);
}
/**
* 批量删除月卡订单
*
* @param ids 需要删除的月卡订单主键
* @return 结果
*/
@Override
public int deleteMonthlyCardOrderByIds(Long[] ids) {
return monthlyCardOrderMapper.deleteMonthlyCardOrderByIds(ids);
}
/**
* 删除月卡订单信息
*
* @param id 月卡订单主键
* @return 结果
*/
@Override
public int deleteMonthlyCardOrderById(Long id) {
return monthlyCardOrderMapper.deleteMonthlyCardOrderById(id);
}
@Override
public MonthlyyCardPayResultResponse createMonthlyCard(CreateMonthlyCardRequest request) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
if (ObjectUtil.isNull(user)) {
throw new BaseException("您的登录已过期,请先登录");
}
if (StringUtils.isEmpty(user.getPhone())) {
user = sConsumerService.getById(user.getId());
if (StringUtils.isEmpty(user.getPhone())) {
throw new BaseException("请绑定手机号");
}
}
MonthlyCardOrder monthlyCardOrder = generatMonthlyCarddOrder(request, user);
monthlyCardOrder.setCreateTime(new Date());
save(monthlyCardOrder);
MonthlyyCardPayResultResponse response = orderPayService.saobeiCreateMonthlyCardOrderPayment(monthlyCardOrder);
return response;
}
private MonthlyCardOrder generatMonthlyCarddOrder(CreateMonthlyCardRequest request, SConsumer user) {
MonthlyCardOrder monthlyCardOrder = new MonthlyCardOrder();
BeanUtils.copyProperties(request, monthlyCardOrder);
MonthlyCardConf byId = monthlyCardConfService.getById(request.getMonthlyCardConfId());
if (ObjectUtil.isEmpty(byId)) {
throw new BaseException("月卡配置异常");
}
monthlyCardOrder.setMonthlyCardNo(BaseUtil.getOrderNo("YK"));
monthlyCardOrder.setMonthlyCardAmount(byId.getMonthlyCardAmount());
monthlyCardOrder.setPayStatus(YesNoEnum.no.getIndex());
monthlyCardOrder.setConsumerId(user.getId());
monthlyCardOrder.setPhone(user.getPhone());
return monthlyCardOrder;
}
@Override
public MonthlyCardOrderVo queryMonthlyCardInfoByNo(String monthlyCardNo) {
LambdaQueryWrapper<MonthlyCardOrder> lqw = Wrappers.lambdaQuery();
lqw.eq(MonthlyCardOrder::getMonthlyCardNo, monthlyCardNo);
MonthlyCardOrder one = getOne(lqw);
MonthlyCardOrderVo vo = new MonthlyCardOrderVo();
BeanUtils.copyProperties(one, vo);
return vo;
}
@Override
public void paymentSuccessful(MonthlyCardOrder monthlyCardOrder) {
ConsumerMonthlyCard consumerMonthlyCard = new ConsumerMonthlyCard();
MonthlyCardConf byId = monthlyCardConfService.getById(monthlyCardOrder.getMonthlyCardConfId());
consumerMonthlyCard.setMonthlyCardConfId(byId.getId());
consumerMonthlyCard.setConsumerId(monthlyCardOrder.getConsumerId());
consumerMonthlyCard.setPhone(monthlyCardOrder.getPhone());
consumerMonthlyCard.setExpirationDate(DateUtils.addYears(new Date(), byId.getMonthlyCardDays().intValue()));
consumerMonthlyCard.setFreeDuration(byId.getFreeDuration());
consumerMonthlyCard.setMonthlyCardDays(byId.getMonthlyCardDays());
consumerMonthlyCardService.save(consumerMonthlyCard);
}
@Override
public MonthlyCardOrder getInfoByEntity(MonthlyCardOrder monthlyCardOrder) {
return monthlyCardOrderMapper.getInfoByEntity(monthlyCardOrder);
}
}
...@@ -9,6 +9,8 @@ import cn.hutool.json.JSONArray; ...@@ -9,6 +9,8 @@ import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -40,6 +42,8 @@ import java.util.stream.Collectors; ...@@ -40,6 +42,8 @@ import java.util.stream.Collectors;
@Service @Service
public class MqttxServiceImpl implements MqttxService { public class MqttxServiceImpl implements MqttxService {
private static final Logger log = LoggerFactory.getLogger(MqttxServiceImpl.class);
@Autowired @Autowired
private DeviceGatewayMapper deviceGatewayMapper; private DeviceGatewayMapper deviceGatewayMapper;
@Autowired @Autowired
...@@ -148,7 +152,7 @@ public class MqttxServiceImpl implements MqttxService { ...@@ -148,7 +152,7 @@ public class MqttxServiceImpl implements MqttxService {
@Override @Override
public boolean mqttReport(String topic, String payload) { public boolean mqttReport(String topic, String payload) {
boolean isSuccess = false; boolean isSuccess = false;
System.out.println("cespayload: "+payload); log.info("cespayload: "+payload);
if (topic.endsWith(MqttReportType.getTopicStr("batch_report"))) { if (topic.endsWith(MqttReportType.getTopicStr("batch_report"))) {
JSONObject json = JSONUtil.parseObj(payload); JSONObject json = JSONUtil.parseObj(payload);
if (json.size() > 0) { if (json.size() > 0) {
...@@ -757,7 +761,7 @@ public class MqttxServiceImpl implements MqttxService { ...@@ -757,7 +761,7 @@ public class MqttxServiceImpl implements MqttxService {
l = 10L - betweenDay; l = 10L - betweenDay;
} }
} }
System.out.println("测试设备消息间隔:"+ l); log.info("测试设备消息间隔:"+ l);
// 异步执行 // 异步执行
this.supplyAsync(l, vo, room.getStoreId()); this.supplyAsync(l, vo, room.getStoreId());
......
...@@ -22,10 +22,7 @@ import share.common.utils.DateUtil; ...@@ -22,10 +22,7 @@ import share.common.utils.DateUtil;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.system.domain.*; import share.system.domain.*;
import share.system.domain.vo.*; import share.system.domain.vo.*;
import share.system.response.EquityMembersResultResponse; import share.system.response.*;
import share.system.response.OrderPayResultResponse;
import share.system.response.RechargePayResultResponse;
import share.system.response.SecondaryCardOrderPayResultResponse;
import share.system.service.*; import share.system.service.*;
import share.system.util.WxPayUtil; import share.system.util.WxPayUtil;
...@@ -64,6 +61,10 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -64,6 +61,10 @@ public class OrderPayServiceImpl implements OrderPayService {
private SecondaryCardOrderService secondaryCardOrderService; private SecondaryCardOrderService secondaryCardOrderService;
@Autowired @Autowired
private SecondaryCardConfService secondaryCardConfService; private SecondaryCardConfService secondaryCardConfService;
@Autowired
private MonthlyCardOrderService monthlyCardOrderService;
@Autowired
private MonthlyCardConfService monthlyCardConfService;
/** /**
* 获取域名 * 获取域名
...@@ -337,7 +338,7 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -337,7 +338,7 @@ public class OrderPayServiceImpl implements OrderPayService {
@Override @Override
public EquityMembersResultResponse saobeiEquityMembersOrderPayment(EquityMembersOrder equityMembersOrder) { public EquityMembersResultResponse saobeiEquityMembersOrderPayment(EquityMembersOrder equityMembersOrder) {
EquityMembersResultResponse response = new EquityMembersResultResponse(); EquityMembersResultResponse response = new EquityMembersResultResponse();
response.setRechargeNo(equityMembersOrder.getEquityOrderNo()); response.setEquityOrderNo(equityMembersOrder.getEquityOrderNo());
response.setPayType(PayTypeEnum.getEnumByCode(equityMembersOrder.getPayType().intValue()).getValue()); response.setPayType(PayTypeEnum.getEnumByCode(equityMembersOrder.getPayType().intValue()).getValue());
response.setStatus(YesNoEnum.no.getFlag()); response.setStatus(YesNoEnum.no.getFlag());
// 扫呗支付 // 扫呗支付
...@@ -480,4 +481,77 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -480,4 +481,77 @@ public class OrderPayServiceImpl implements OrderPayService {
return vo; return vo;
} }
@Override
public MonthlyyCardPayResultResponse saobeiCreateMonthlyCardOrderPayment(MonthlyCardOrder monthlyCardOrder) {
MonthlyyCardPayResultResponse response = new MonthlyyCardPayResultResponse();
response.setMonthlyCardNo(monthlyCardOrder.getMonthlyCardNo());
response.setPayType(PayTypeEnum.getEnumByCode(monthlyCardOrder.getPayType()).getValue());
response.setStatus(YesNoEnum.no.getFlag());
// 扫呗支付
ConcurrentHashMap<String, String> unifiedorder = saobeiUnifiedMonthlyCardOrder(monthlyCardOrder);
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"));
// 更新商户订单号
monthlyCardOrder.setOutTradeNo(unifiedorder.get("outTradeNo"));
monthlyCardOrder.setTerminalTrace(unifiedorder.get("terminalTrace"));
monthlyCardOrderService.updateById(monthlyCardOrder);
response.setJsConfig(vo);
return response;
}
private ConcurrentHashMap<String, String> saobeiUnifiedMonthlyCardOrder(MonthlyCardOrder monthlyCardOrder) {
// 获取用户openId
SConsumerToken userToken = consumerTokenService.getTokenByUserId(monthlyCardOrder.getConsumerId());
if (ObjectUtil.isNull(userToken)) {
throw new BaseException("该用户没有openId");
}
// 获取appid、mch_id
// 微信签名key
String appId = weChatConfig.getAppId();
String mchId = weChatConfig.getMchId();
String signKey = weChatConfig.getSignKey();
// 获取扫呗微信预下单对象
SaobeiMiniPayRequestVo unifiedorderVo = getSaobeiUnifiedMonthlyCardOrderVo(monthlyCardOrder, userToken.getToken(), appId, mchId, signKey);
// 预下单(统一下单)
SaobeiMiniPayResponse response = saobeiService.wechatMinipay(unifiedorderVo);
logger.debug("SaobeiMiniPayResponse :", JsonConvertUtil.write2JsonStr(response));
// 组装前端预下单参数
ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
map.put("appId", response.getAppId());
map.put("nonceStr", response.getNonceStr());
map.put("package", response.getPackage_str());
map.put("signType", response.getSignType());
map.put("timeStamp", response.getTimeStamp());
map.put("paySign", response.getPaySign());
map.put("prepayTime", DateUtil.nowDateTimeStr());
map.put("outTradeNo", response.getOut_trade_no());
map.put("terminalTrace", unifiedorderVo.getTerminal_trace());
return map;
}
private SaobeiMiniPayRequestVo getSaobeiUnifiedMonthlyCardOrderVo(MonthlyCardOrder monthlyCardOrder, String openid, String appId, String mchId, String signKey) {
AttachVo attachVo = new AttachVo(OrderTypeEnum.MONTH_CARD.getValue(), monthlyCardOrder.getConsumerId());
MonthlyCardConf byId = monthlyCardConfService.getById(monthlyCardOrder.getMonthlyCardConfId());
SaobeiMiniPayRequestVo vo = new SaobeiMiniPayRequestVo();
vo.setSub_appid(appId);
vo.setMerchant_no(saobeiConfig.getMerchantNo());
vo.setTerminal_id(saobeiConfig.getTerminalId());
vo.setAttach(JSONObject.toJSONString(attachVo));
vo.setTerminal_trace(BaseUtil.getOrderNo("WXNO"));
vo.setTerminal_time(DateUtil.nowDate(Constants.DATE_TIME_FORMAT_NUM));
vo.setOrder_body(StrUtil.concat(true, "购买" + byId.getMonthlyCardAmount() + "元" + byId.getName() + "月卡"));
// 订单中使用的是BigDecimal,这里要转为Integer类型
vo.setTotal_fee(String.valueOf(monthlyCardOrder.getMonthlyCardAmount().multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue()));
vo.setNotify_url(apiDomain + PayConstants.SAOBEI_PAY_NOTIFY_API_URI);
vo.setTrade_type(PayConstants.WX_PAY_TRADE_TYPE_JS);
vo.setOpen_id(openid);
vo.setDevice_no("WEB");
return vo;
}
} }
...@@ -138,7 +138,7 @@ public class QPServiceImpl implements QPService { ...@@ -138,7 +138,7 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon.setCreateBy(String.valueOf(user.getId())); sConsumerCoupon.setCreateBy(String.valueOf(user.getId()));
sConsumerCoupon.setCreateTime(new Date()); sConsumerCoupon.setCreateTime(new Date());
sConsumerCoupon.setOriginalPrice(BigDecimal.valueOf(prepare.getDeal_marketprice())); sConsumerCoupon.setOriginalPrice(BigDecimal.valueOf(prepare.getDeal_marketprice()));
sConsumerCoupon.setCouponPayPrice(BigDecimal.valueOf(prepare.getDeal_price())); sConsumerCoupon.setCouponPayPrice(prepare.getPayment_detail().get(0).getAmount());
//查询美团团购信息 //查询美团团购信息
List<TuangouDealQueryShopDealResponseEntity> groupActivities = queryshopdeal(sStore.getOpenShopUuid()); List<TuangouDealQueryShopDealResponseEntity> groupActivities = queryshopdeal(sStore.getOpenShopUuid());
groupActivities.forEach(o -> { groupActivities.forEach(o -> {
......
...@@ -299,14 +299,20 @@ public class RoomStatusServiceImpl implements RoomStatusService { ...@@ -299,14 +299,20 @@ public class RoomStatusServiceImpl implements RoomStatusService {
if (!ObjectUtils.isEmpty(orderId)) { if (!ObjectUtils.isEmpty(orderId)) {
if (!order.getId().equals(orderId)) { if (!order.getId().equals(orderId)) {
if (order.getOrderType().equals(OrderTypeEnum.RENEW.getCode())) { if (order.getOrderType().equals(OrderTypeEnum.RENEW.getCode())) {
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.OPEN_DOOR_AHEAD_HOUR); // orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.OPEN_DOOR_AHEAD_HOUR);
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROMM_LOCK_LAZY_MINUTE);
} }
} }
} else { } else {
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROOM_LOCK_DELAY_MINUTE); orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROOM_LOCK_DELAY_MINUTE);
// orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROMM_LOCK_LAZY_MINUTE);
} }
} }
if (OrderTypeEnum.RESERVER.getCode().compareTo(orderType) == 0) {
orderStartDate = DateUtils.addMinutes(orderStartDate, -Constants.ROOM_LOCK_DELAY_MINUTE); orderStartDate = DateUtils.addMinutes(orderStartDate, -Constants.ROOM_LOCK_DELAY_MINUTE);
} else {
orderStartDate = DateUtils.addMinutes(orderStartDate, -Constants.ROMM_LOCK_LAZY_MINUTE);
}
} }
if (DateUtils.addSeconds(timeHourDate, 59 * 60 + 59).compareTo(orderStartDate) >= 0 && timeHourDate.compareTo(orderEndDate) <= 0) { if (DateUtils.addSeconds(timeHourDate, 59 * 60 + 59).compareTo(orderStartDate) >= 0 && timeHourDate.compareTo(orderEndDate) <= 0) {
......
...@@ -526,8 +526,10 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -526,8 +526,10 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
private void sendSms(Long storeId,SStore store, SRoom room) { private void sendSms(Long storeId,SStore store, SRoom room) {
sConsumerMapper.selectListByStoreId(storeId).stream().forEach(item -> { sConsumerMapper.selectListByStoreId(storeId).stream().forEach(item -> {
if (item.getTextMessage().equals(YesNoEnum.yes.getIndex())) {
// 循环发送短信提示门店保洁打扫卫生 // 循环发送短信提示门店保洁打扫卫生
smsService.sendSmsCleanRecords(item.getPhone(), store, room); smsService.sendSmsCleanRecords(item.getPhone(), store, room);
}
}); });
} }
......
...@@ -21,9 +21,11 @@ import share.common.core.redis.RedisUtil; ...@@ -21,9 +21,11 @@ import share.common.core.redis.RedisUtil;
import share.common.exception.base.BaseException; import share.common.exception.base.BaseException;
import share.common.utils.CommonUtil; import share.common.utils.CommonUtil;
import share.common.utils.DateUtil; import share.common.utils.DateUtil;
import share.common.utils.DateUtils;
import share.common.utils.wx.WxUtil; import share.common.utils.wx.WxUtil;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
import share.system.domain.SConsumerToken; import share.system.domain.SConsumerToken;
import share.system.domain.SharingActivities;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.WeChatMiniAuthorizeVo; import share.system.domain.vo.WeChatMiniAuthorizeVo;
import share.system.domain.vo.WeChatPhoneNumberVo; import share.system.domain.vo.WeChatPhoneNumberVo;
...@@ -32,10 +34,7 @@ import share.system.request.RegisterThirdSConsumerRequest; ...@@ -32,10 +34,7 @@ import share.system.request.RegisterThirdSConsumerRequest;
import share.system.request.WxBindingPhoneRequest; import share.system.request.WxBindingPhoneRequest;
import share.system.request.WxRegisterPhoneRequest; import share.system.request.WxRegisterPhoneRequest;
import share.system.response.LoginResponse; import share.system.response.LoginResponse;
import share.system.service.SConsumerCenterService; import share.system.service.*;
import share.system.service.SConsumerService;
import share.system.service.SConsumerTokenService;
import share.system.service.WechatNewService;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -66,6 +65,9 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo ...@@ -66,6 +65,9 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo
@Autowired @Autowired
private WechatNewService wechatNewService; private WechatNewService wechatNewService;
@Autowired
private SharingActivitiesService sharingActivitiesService;
/** /**
* 小程序登录 * 小程序登录
...@@ -306,6 +308,17 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo ...@@ -306,6 +308,17 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo
if (finalIsNew) {// 新用户 if (finalIsNew) {// 新用户
Long id = sConsumerService.saveSConsumer(finalSConsumer); Long id = sConsumerService.saveSConsumer(finalSConsumer);
finalSConsumer.setId(id); finalSConsumer.setId(id);
Long uid = request.getUid();
//判断是否为分享新用户
if (uid != null){
//添加绑定关系
SharingActivities sharingActivities = new SharingActivities();
sharingActivities.setActivityType(request.getActivityType());
sharingActivities.setUid(uid);
sharingActivities.setNewUid(id);
sharingActivities.setCreateTime(DateUtils.getNowDate());
sharingActivitiesService.save(sharingActivities);
}
} }
sConsumerTokenService.bind(registerThirdSConsumerRequest.getOpenId(), finalSConsumer.getId(), response.getUnionId()); sConsumerTokenService.bind(registerThirdSConsumerRequest.getOpenId(), finalSConsumer.getId(), response.getUnionId());
sConsumer.setLastLoginTime(DateUtil.nowDateTime()); sConsumer.setLastLoginTime(DateUtil.nowDateTime());
...@@ -418,7 +431,6 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo ...@@ -418,7 +431,6 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo
} }
/** /**
* 检测手机验证码 * 检测手机验证码
* *
......
...@@ -209,6 +209,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer ...@@ -209,6 +209,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
.eq(MemberConfig::getMembershipLevel, memberConfig.getMembershipLevel() + 1) .eq(MemberConfig::getMembershipLevel, memberConfig.getMembershipLevel() + 1)
); );
if (ObjectUtil.isNotEmpty(nexMemberConfig)) { if (ObjectUtil.isNotEmpty(nexMemberConfig)) {
memberConfigVo.setNextDifference(new BigDecimal(nexMemberConfig.getLimitRequirements()).subtract(consumerMember.getMembershipProgress()));
memberConfigVo.setNextLimitRequirements(nexMemberConfig.getLimitRequirements()); memberConfigVo.setNextLimitRequirements(nexMemberConfig.getLimitRequirements());
memberConfigVo.setNextMembershipLevel(nexMemberConfig.getMembershipLevel()); memberConfigVo.setNextMembershipLevel(nexMemberConfig.getMembershipLevel());
memberConfigVo.setNextMembershipName(nexMemberConfig.getLevelName()); memberConfigVo.setNextMembershipName(nexMemberConfig.getLevelName());
......
...@@ -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.SecondaryCardLog; import share.system.domain.SecondaryCardLog;
import share.system.domain.vo.SecondaryCardLogVo;
import share.system.mapper.SecondaryCardLogMapper; import share.system.mapper.SecondaryCardLogMapper;
import share.system.service.SecondaryCardLogService; import share.system.service.SecondaryCardLogService;
...@@ -39,7 +40,7 @@ public class SecondaryCardLogServiceImpl extends ServiceImpl<SecondaryCardLogMap ...@@ -39,7 +40,7 @@ public class SecondaryCardLogServiceImpl extends ServiceImpl<SecondaryCardLogMap
* @return 次卡使用记录 * @return 次卡使用记录
*/ */
@Override @Override
public List<SecondaryCardLog> selectSecondaryCardLogList(SecondaryCardLog secondaryCardLog) { public List<SecondaryCardLogVo> selectSecondaryCardLogList(SecondaryCardLogVo secondaryCardLog) {
return secondaryCardLogMapper.selectSecondaryCardLogList(secondaryCardLog); return secondaryCardLogMapper.selectSecondaryCardLogList(secondaryCardLog);
} }
......
package share.system.service.impl; package share.system.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,6 +16,7 @@ import share.system.domain.SConsumer; ...@@ -15,6 +16,7 @@ import share.system.domain.SConsumer;
import share.system.domain.SecondaryCardConf; import share.system.domain.SecondaryCardConf;
import share.system.domain.SecondaryCardOrder; import share.system.domain.SecondaryCardOrder;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SecondaryCardOrderVo;
import share.system.mapper.SecondaryCardOrderMapper; import share.system.mapper.SecondaryCardOrderMapper;
import share.system.request.SecondaryCardOrderRequest; import share.system.request.SecondaryCardOrderRequest;
import share.system.response.SecondaryCardOrderPayResultResponse; import share.system.response.SecondaryCardOrderPayResultResponse;
...@@ -60,7 +62,7 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde ...@@ -60,7 +62,7 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
* @return 次卡购买记录 * @return 次卡购买记录
*/ */
@Override @Override
public List<SecondaryCardOrder> selectSecondaryCardOrderList(SecondaryCardOrder secondaryCardOrder) { public List<SecondaryCardOrderVo> selectSecondaryCardOrderList(SecondaryCardOrderVo secondaryCardOrder) {
return secondaryCardOrderMapper.selectSecondaryCardOrderList(secondaryCardOrder); return secondaryCardOrderMapper.selectSecondaryCardOrderList(secondaryCardOrder);
} }
...@@ -162,4 +164,14 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde ...@@ -162,4 +164,14 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
public SecondaryCardOrder getInfoByEntity(SecondaryCardOrder secondaryCardOrderParam) { public SecondaryCardOrder getInfoByEntity(SecondaryCardOrder secondaryCardOrderParam) {
return secondaryCardOrderMapper.getInfoByEntity(secondaryCardOrderParam); return secondaryCardOrderMapper.getInfoByEntity(secondaryCardOrderParam);
} }
@Override
public SecondaryCardOrderVo querySecondaryCardInfoByNo(String secondaryCardNo) {
LambdaQueryWrapper<SecondaryCardOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SecondaryCardOrder::getSecondaryCardNo, secondaryCardNo);
SecondaryCardOrder secondaryCardOrder = getOne(wrapper);
SecondaryCardOrderVo vo = new SecondaryCardOrderVo();
BeanUtils.copyProperties(secondaryCardOrder, vo);
return vo;
}
} }
package share.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.system.mapper.SharingActivitiesMapper;
import share.system.domain.SharingActivities;
import share.system.service.SharingActivitiesService;
/**
* 分享活动绑定关系Service业务层处理
*
* @author wuwenlong
* @date 2024-09-02
*/
@Service
public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesMapper, SharingActivities> implements SharingActivitiesService
{
@Autowired
private SharingActivitiesMapper sharingActivitiesMapper;
/**
* 查询分享活动绑定关系
*
* @param id 分享活动绑定关系主键
* @return 分享活动绑定关系
*/
@Override
public SharingActivities selectSharingActivitiesById(Long id)
{
return sharingActivitiesMapper.selectSharingActivitiesById(id);
}
/**
* 查询分享活动绑定关系列表
*
* @param sharingActivities 分享活动绑定关系
* @return 分享活动绑定关系
*/
@Override
public List<SharingActivities> selectSharingActivitiesList(SharingActivities sharingActivities)
{
return sharingActivitiesMapper.selectSharingActivitiesList(sharingActivities);
}
/**
* 新增分享活动绑定关系
*
* @param sharingActivities 分享活动绑定关系
* @return 结果
*/
@Override
public int insertSharingActivities(SharingActivities sharingActivities)
{
sharingActivities.setCreateTime(DateUtils.getNowDate());
return sharingActivitiesMapper.insertSharingActivities(sharingActivities);
}
/**
* 修改分享活动绑定关系
*
* @param sharingActivities 分享活动绑定关系
* @return 结果
*/
@Override
public int updateSharingActivities(SharingActivities sharingActivities)
{
sharingActivities.setUpdateTime(DateUtils.getNowDate());
return sharingActivitiesMapper.updateSharingActivities(sharingActivities);
}
/**
* 批量删除分享活动绑定关系
*
* @param ids 需要删除的分享活动绑定关系主键
* @return 结果
*/
@Override
public int deleteSharingActivitiesByIds(Long[] ids)
{
return sharingActivitiesMapper.deleteSharingActivitiesByIds(ids);
}
/**
* 删除分享活动绑定关系信息
*
* @param id 分享活动绑定关系主键
* @return 结果
*/
@Override
public int deleteSharingActivitiesById(Long id)
{
return sharingActivitiesMapper.deleteSharingActivitiesById(id);
}
}
...@@ -420,7 +420,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -420,7 +420,7 @@ public class TiktokServiceImpl implements TiktokService {
sConsumerCoupon.setCreateTime(new Date()); sConsumerCoupon.setCreateTime(new Date());
Integer originalAmount = amount.getInt("list_market_amount"); Integer originalAmount = amount.getInt("list_market_amount");
sConsumerCoupon.setOriginalPrice(BigDecimal.valueOf(originalAmount / 100)); sConsumerCoupon.setOriginalPrice(BigDecimal.valueOf(originalAmount / 100));
sConsumerCoupon.setCouponPayPrice(BigDecimal.valueOf(amount.getInt("coupon_pay_amount") / 100)); sConsumerCoupon.setCouponPayPrice(BigDecimal.valueOf(amount.getInt("pay_amount") / 100));
//时间戳转年月日时分秒 //时间戳转年月日时分秒
sConsumerCoupon.setEndDate(new Date(entries.getInt("expire_time") * 1000L)); sConsumerCoupon.setEndDate(new Date(entries.getInt("expire_time") * 1000L));
//获取本日的00:00:00 //获取本日的00:00:00
......
...@@ -3,11 +3,18 @@ package share.system.service.impl; ...@@ -3,11 +3,18 @@ package share.system.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.wechat.pay.java.core.Config;
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
import com.wechat.pay.java.service.transferbatch.TransferBatchService;
import com.wechat.pay.java.service.transferbatch.model.InitiateBatchTransferRequest;
import com.wechat.pay.java.service.transferbatch.model.InitiateBatchTransferResponse;
import com.wechat.pay.java.service.transferbatch.model.TransferDetailInput;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -78,6 +85,11 @@ public class WechatNewServiceImpl implements WechatNewService { ...@@ -78,6 +85,11 @@ public class WechatNewServiceImpl implements WechatNewService {
@Value("${wechat.miniprogram_state}") @Value("${wechat.miniprogram_state}")
private String miniprogramState; private String miniprogramState;
/**
* 获取域名
*/
@Value("${api.domain}")
private String apiDomain;
/** /**
* 获取公众号accessToken * 获取公众号accessToken
...@@ -1100,6 +1112,52 @@ public class WechatNewServiceImpl implements WechatNewService { ...@@ -1100,6 +1112,52 @@ public class WechatNewServiceImpl implements WechatNewService {
} }
/** /**
* 微信商家给用户转账到零钱
* @param withdrawLog 提现记录
* @return
*/
@Override
public Boolean initiateBatchTransfer(WithdrawLog withdrawLog) {
Config config = new RSAAutoCertificateConfig.Builder()
.merchantId(weChatConfig.getMchId()) // 商户号
.privateKeyFromPath("商户API私钥路径") // 商户API私钥路径
.merchantSerialNumber("商户证书序列号") // 商户证书序列号
.apiV3Key("商户APIV3密钥") // 商户APIV3密钥
.build();
TransferBatchService service = new TransferBatchService.Builder().config(config).build();
InitiateBatchTransferRequest initiateBatchTransferRequest =
new InitiateBatchTransferRequest();
initiateBatchTransferRequest.setAppid(weChatConfig.getAppId());
initiateBatchTransferRequest.setOutBatchNo(withdrawLog.getWithdrawOrder());
initiateBatchTransferRequest.setBatchName(withdrawLog.getWithdrawRemark());
initiateBatchTransferRequest.setBatchRemark(withdrawLog.getWithdrawRemark());
initiateBatchTransferRequest.setTotalAmount(NumberUtil.mul(withdrawLog.getAmount(), 100).longValue());
initiateBatchTransferRequest.setTotalNum(1);
List<TransferDetailInput> transferDetailListList = new ArrayList<>();
{
TransferDetailInput transferDetailInput = new TransferDetailInput();
transferDetailInput.setOutDetailNo(withdrawLog.getWithdrawOrder());
transferDetailInput.setTransferAmount(NumberUtil.mul(withdrawLog.getAmount(), 100).longValue());
transferDetailInput.setTransferRemark(withdrawLog.getWithdrawRemark());
transferDetailInput.setOpenid(withdrawLog.getOpenid());
transferDetailListList.add(transferDetailInput);
}
initiateBatchTransferRequest.setTransferDetailList(transferDetailListList);
initiateBatchTransferRequest.setTransferSceneId(withdrawLog.getTransferSceneId());
initiateBatchTransferRequest.setNotifyUrl(apiDomain + PayConstants.WX_INITIATEBATCHTRANSFER_NOTIFY_API_URI);
InitiateBatchTransferResponse response = service.initiateBatchTransfer(initiateBatchTransferRequest);
if (response != null) {
// 回填记录数据
withdrawLog.setBatchId(response.getBatchId());
withdrawLog.setBatchStatus(response.getBatchStatus());
return Boolean.TRUE;
} else {
return Boolean.FALSE;
}
}
/**
* 获取JS-SDK的签名 * 获取JS-SDK的签名
* *
* @param nonceStr 随机字符串 * @param nonceStr 随机字符串
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.ConsumerMonthlyCardMapper">
<resultMap type="ConsumerMonthlyCardVo" id="ConsumerMonthlyCardResult">
<result property="id" column="id"/>
<result property="monthlyCardConfId" column="monthly_card_conf_id"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="avatar" column="avatar"/>
<result property="confName" column="conf_name"/>
<result property="confAmount" column="conf_amount"/>
<result property="phone" column="phone"/>
<result property="freeDuration" column="free_duration"/>
<result property="monthlyCardDays" column="monthly_card_days"/>
<result property="expirationDate" column="expiration_date"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectConsumerMonthlyCardVo">
select id,
monthly_card_conf_id,
consumer_id,
phone,
free_duration,
monthly_card_days,
expiration_date,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_consumer_monthly_card
</sql>
<select id="selectConsumerMonthlyCardList" parameterType="ConsumerMonthlyCardVo"
resultMap="ConsumerMonthlyCardResult">
select c.id,
c.monthly_card_conf_id,
c1.name as 'conf_name',
c1.monthly_card_amount as 'conf_amount',
c.consumer_id,
c2.nick_name,
c2.avatar,
c.phone,
c.free_duration,
c.monthly_card_days,
c.expiration_date,
c.is_delete,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.remark
from s_consumer_monthly_card c join s_monthly_card_conf c1 on c.monthly_card_conf_id = c1.id
join s_consumer c2 on c.consumer_id = c2.id
where c.is_delete = 0
<if test="monthlyCardConfId != null ">and c.monthly_card_conf_id = #{monthlyCardConfId}</if>
<if test="consumerId != null ">and c.consumer_id = #{consumerId}</if>
<if test="phone != null and phone != ''">and c.phone = #{phone}</if>
<if test="freeDuration != null ">and c.free_duration = #{freeDuration}</if>
<if test="monthlyCardDays != null ">and c.monthly_card_days = #{monthlyCardDays}</if>
<if test="expirationDate != null ">and c.expiration_date = #{expirationDate}</if>
</select>
<select id="selectConsumerMonthlyCardById" parameterType="Long" resultMap="ConsumerMonthlyCardResult">
<include refid="selectConsumerMonthlyCardVo"/>
where id = #{id}
</select>
<select id="selectByConsumerId" resultMap="ConsumerMonthlyCardResult">
select c.id,
c.monthly_card_conf_id,
c.consumer_id,
c2.nick_name,
c2.avatar,
c.phone,
c.free_duration,
c.monthly_card_days,
c.expiration_date,
c.is_delete,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.remark
from s_consumer_monthly_card c
join s_consumer c2 on c.consumer_id = c2.id
where c.is_delete = 0
and c.consumer_id = #{consumerId}
</select>
<insert id="insertConsumerMonthlyCard" parameterType="ConsumerMonthlyCard" useGeneratedKeys="true" keyProperty="id">
insert into s_consumer_monthly_card
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monthlyCardConfId != null">monthly_card_conf_id,</if>
<if test="consumerId != null">consumer_id,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="freeDuration != null">free_duration,</if>
<if test="monthlyCardDays != null">monthly_card_days,</if>
<if test="expirationDate != null">expiration_date,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monthlyCardConfId != null">#{monthlyCardConfId},</if>
<if test="consumerId != null">#{consumerId},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="freeDuration != null">#{freeDuration},</if>
<if test="monthlyCardDays != null">#{monthlyCardDays},</if>
<if test="expirationDate != null">#{expirationDate},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateConsumerMonthlyCard" parameterType="ConsumerMonthlyCard">
update s_consumer_monthly_card
<trim prefix="SET" suffixOverrides=",">
<if test="monthlyCardConfId != null">monthly_card_conf_id = #{monthlyCardConfId},</if>
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="freeDuration != null">free_duration = #{freeDuration},</if>
<if test="monthlyCardDays != null">monthly_card_days = #{monthlyCardDays},</if>
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteConsumerMonthlyCardById" parameterType="Long">
delete
from s_consumer_monthly_card
where id = #{id}
</delete>
<delete id="deleteConsumerMonthlyCardByIds" parameterType="String">
delete from s_consumer_monthly_card where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -74,14 +74,33 @@ ...@@ -74,14 +74,33 @@
<if test="packId != null ">and c.pack_id = #{packId}</if> <if test="packId != null ">and c.pack_id = #{packId}</if>
<if test="expirationDate != null ">and c.expiration_date = #{expirationDate}</if> <if test="expirationDate != null ">and c.expiration_date = #{expirationDate}</if>
<if test="number != null ">and c.number = #{number}</if> <if test="number != null ">and c.number = #{number}</if>
<if test="isDelete != null ">and c.is_delete = #{isDelete}</if>
</select> </select>
<select id="selectConsumerSecondaryCardById" parameterType="Long" resultMap="ConsumerSecondaryCardResult"> <select id="selectConsumerSecondaryCardById" parameterType="Long" resultMap="ConsumerSecondaryCardResult">
<include refid="selectConsumerSecondaryCardVo"/> <include refid="selectConsumerSecondaryCardVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="selectByConsumerId" resultMap="ConsumerSecondaryCardResult">
select c.id,
c.secondary_card_conf_id,
c.consumer_id,
c.phone,
m.nick_name,
m.avatar,
c.pack_id,
c.expiration_date,
c.number,
c.is_delete,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.remark
from s_consumer_secondary_card c
join s_consumer m on c.consumer_id = m.id
where c.is_delete = 0
and c.consumer_id = #{consumerId}
</select>
<insert id="insertConsumerSecondaryCard" parameterType="ConsumerSecondaryCard" useGeneratedKeys="true" <insert id="insertConsumerSecondaryCard" parameterType="ConsumerSecondaryCard" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="equityFund" column="equity_fund"/>
<result property="accumulateEquityFund" column="accumulate_equity_fund"/>
</resultMap> </resultMap>
<sql id="selectConsumerWalletVo"> <sql id="selectConsumerWalletVo">
...@@ -32,7 +34,9 @@ ...@@ -32,7 +34,9 @@
create_time, create_time,
update_by, update_by,
update_time, update_time,
remark remark,
equity_fund,
accumulate_equity_fund
from s_consumer_wallet from s_consumer_wallet
</sql> </sql>
...@@ -83,7 +87,9 @@ ...@@ -83,7 +87,9 @@
w.create_time, w.create_time,
w.update_by, w.update_by,
w.update_time, w.update_time,
w.remark w.remark,
w.equity_fund,
w.accumulate_equity_fund
from s_consumer_wallet w join s_consumer c on w.consumer_id = c.id from s_consumer_wallet w join s_consumer c on w.consumer_id = c.id
<where> <where>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%') <if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')
...@@ -111,6 +117,8 @@ ...@@ -111,6 +117,8 @@
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="equityFund != null">equity_fund,</if>
<if test="accumulateEquityFund != null">accumulate_equity_fund,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if> <if test="consumerId != null">#{consumerId},</if>
...@@ -123,6 +131,8 @@ ...@@ -123,6 +131,8 @@
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="equityFund != null">#{equityFund},</if>
<if test="accumulateEquityFund != null">#{accumulateEquityFund},</if>
</trim> </trim>
</insert> </insert>
...@@ -139,6 +149,8 @@ ...@@ -139,6 +149,8 @@
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="equityFund != null">equity_fund = #{equityFund},</if>
<if test="accumulateEquityFund != null">accumulate_equity_fund = #{accumulateEquityFund},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
<resultMap type="EquityMembersOrderConfig" id="EquityMembersOrderConfigResult"> <resultMap type="EquityMembersOrderConfig" id="EquityMembersOrderConfigResult">
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="name" column="name"/>
<result property="defaultLevel" column="default_level"/> <result property="defaultLevel" column="default_level"/>
<result property="memberConfigId" column="member_config_id"/> <result property="memberConfigId" column="member_config_id"/>
<result property="requiredAmount" column="required_amount"/> <result property="requiredAmount" column="required_amount"/>
<result property="validityPeriod" column="validity_period"/> <result property="validityPeriod" column="validity_period"/>
<result property="giftPoints" column="gift_points"/>
<result property="isDelete" column="is_delete"/> <result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
...@@ -20,10 +22,12 @@ ...@@ -20,10 +22,12 @@
<sql id="selectEquityMembersOrderConfigVo"> <sql id="selectEquityMembersOrderConfigVo">
select id, select id,
name,
default_level, default_level,
member_config_id, member_config_id,
required_amount, required_amount,
validity_period, validity_period,
gift_points,
is_delete, is_delete,
create_by, create_by,
create_time, create_time,
...@@ -38,9 +42,11 @@ ...@@ -38,9 +42,11 @@
<include refid="selectEquityMembersOrderConfigVo"/> <include refid="selectEquityMembersOrderConfigVo"/>
<where> <where>
<if test="defaultLevel != null ">and default_level = #{defaultLevel}</if> <if test="defaultLevel != null ">and default_level = #{defaultLevel}</if>
<if test="name != null">and name = #{name}</if>
<if test="memberConfigId != null ">and member_config_id = #{memberConfigId}</if> <if test="memberConfigId != null ">and member_config_id = #{memberConfigId}</if>
<if test="requiredAmount != null ">and required_amount = #{requiredAmount}</if> <if test="requiredAmount != null ">and required_amount = #{requiredAmount}</if>
<if test="validityPeriod != null ">and validity_period = #{validityPeriod}</if> <if test="validityPeriod != null ">and validity_period = #{validityPeriod}</if>
<if test="giftPoints != null ">and gift_points = #{giftPoints}</if>
<if test="isDelete != null ">and is_delete = #{isDelete}</if> <if test="isDelete != null ">and is_delete = #{isDelete}</if>
</where> </where>
</select> </select>
...@@ -54,10 +60,12 @@ ...@@ -54,10 +60,12 @@
keyProperty="id"> keyProperty="id">
insert into s_equity_members_order_config insert into s_equity_members_order_config
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name !=null">name,</if>
<if test="defaultLevel != null">default_level,</if> <if test="defaultLevel != null">default_level,</if>
<if test="memberConfigId != null">member_config_id,</if> <if test="memberConfigId != null">member_config_id,</if>
<if test="requiredAmount != null">required_amount,</if> <if test="requiredAmount != null">required_amount,</if>
<if test="validityPeriod != null">validity_period,</if> <if test="validityPeriod != null">validity_period,</if>
<if test="giftPoints != null">gift_points,</if>
<if test="isDelete != null">is_delete,</if> <if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
...@@ -66,10 +74,12 @@ ...@@ -66,10 +74,12 @@
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name !=null">#{name},</if>
<if test="defaultLevel != null">#{defaultLevel},</if> <if test="defaultLevel != null">#{defaultLevel},</if>
<if test="memberConfigId != null">#{memberConfigId},</if> <if test="memberConfigId != null">#{memberConfigId},</if>
<if test="requiredAmount != null">#{requiredAmount},</if> <if test="requiredAmount != null">#{requiredAmount},</if>
<if test="validityPeriod != null">#{validityPeriod},</if> <if test="validityPeriod != null">#{validityPeriod},</if>
<if test="giftPoints != null">#{giftPoints},</if>
<if test="isDelete != null">#{isDelete},</if> <if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
...@@ -82,10 +92,12 @@ ...@@ -82,10 +92,12 @@
<update id="updateEquityMembersOrderConfig" parameterType="EquityMembersOrderConfig"> <update id="updateEquityMembersOrderConfig" parameterType="EquityMembersOrderConfig">
update s_equity_members_order_config update s_equity_members_order_config
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="name !=null">name = #{name},</if>
<if test="defaultLevel != null">default_level = #{defaultLevel},</if> <if test="defaultLevel != null">default_level = #{defaultLevel},</if>
<if test="memberConfigId != null">member_config_id = #{memberConfigId},</if> <if test="memberConfigId != null">member_config_id = #{memberConfigId},</if>
<if test="requiredAmount != null">required_amount = #{requiredAmount},</if> <if test="requiredAmount != null">required_amount = #{requiredAmount},</if>
<if test="validityPeriod != null">validity_period = #{validityPeriod},</if> <if test="validityPeriod != null">validity_period = #{validityPeriod},</if>
<if test="giftPoints != null">gift_points = #{giftPoints},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if> <if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.MonthlyCardConfMapper">
<resultMap type="MonthlyCardConf" id="MonthlyCardConfResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="monthlyCardAmount" column="monthly_card_amount"/>
<result property="freeDuration" column="free_duration"/>
<result property="monthlyCardDays" column="monthly_card_days"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectMonthlyCardConfVo">
select id,
name,
monthly_card_amount,
free_duration,
monthly_card_days,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_monthly_card_conf
</sql>
<select id="selectMonthlyCardConfList" parameterType="MonthlyCardConf" resultMap="MonthlyCardConfResult">
<include refid="selectMonthlyCardConfVo"/>
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="monthlyCardAmount != null ">and monthly_card_amount = #{monthlyCardAmount}</if>
<if test="freeDuration != null ">and free_duration = #{freeDuration}</if>
<if test="monthlyCardDays != null ">and monthly_card_days = #{monthlyCardDays}</if>
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectMonthlyCardConfById" parameterType="Long" resultMap="MonthlyCardConfResult">
<include refid="selectMonthlyCardConfVo"/>
where id = #{id}
</select>
<insert id="insertMonthlyCardConf" parameterType="MonthlyCardConf" useGeneratedKeys="true" keyProperty="id">
insert into s_monthly_card_conf
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="monthlyCardAmount != null">monthly_card_amount,</if>
<if test="freeDuration != null">free_duration,</if>
<if test="monthlyCardDays != null">monthly_card_days,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="monthlyCardAmount != null">#{monthlyCardAmount},</if>
<if test="freeDuration != null">#{freeDuration},</if>
<if test="monthlyCardDays != null">#{monthlyCardDays},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMonthlyCardConf" parameterType="MonthlyCardConf">
update s_monthly_card_conf
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="monthlyCardAmount != null">monthly_card_amount = #{monthlyCardAmount},</if>
<if test="freeDuration != null">free_duration = #{freeDuration},</if>
<if test="monthlyCardDays != null">monthly_card_days = #{monthlyCardDays},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMonthlyCardConfById" parameterType="Long">
delete
from s_monthly_card_conf
where id = #{id}
</delete>
<delete id="deleteMonthlyCardConfByIds" parameterType="String">
delete from s_monthly_card_conf where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.MonthlyCardLogMapper">
<resultMap type="MonthlyCardLogVo" id="MonthlyCardLogResult">
<result property="id" column="id"/>
<result property="consumerMonthlyCardId" column="consumer_monthly_card_id"/>
<result property="consumerId" column="consumer_id"/>
<result property="avatar" column="avatar"/>
<result property="nickName" column="nick_name"/>
<result property="confName" column="conf_name"/>
<result property="confAmount" column="conf_amount"/>
<result property="phone" column="phone"/>
<result property="useDuration" column="use_duration"/>
<result property="residueDuration" column="residue_duration"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectMonthlyCardLogVo">
select id,
consumer_monthly_card_id,
consumer_id,
phone,
use_duration,
residue_duration,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_monthly_card_log
</sql>
<select id="selectMonthlyCardLogList" parameterType="MonthlyCardLogVo" resultMap="MonthlyCardLogResult">
select l.id,
l.consumer_monthly_card_id,
l.consumer_id,
c.nick_name,
c.avatar,
mcc.name as 'conf_name',
mcc.monthly_card_amount as 'conf_amount',
l.phone,
l.use_duration,
l.residue_duration,
l.is_delete,
l.create_by,
l.create_time,
l.update_by,
l.update_time,
l.remark
from s_monthly_card_log l join s_consumer c on l.consumer_id = c.id
join s_consumer_monthly_card cm on l.consumer_monthly_card_id = cm.id
join s_monthly_card_conf mcc on cm.monthly_card_conf_id = mcc.id
where l.is_delete = 0
<if test="consumerMonthlyCardId != null ">and l.consumer_monthly_card_id = #{consumerMonthlyCardId}</if>
<if test="consumerId != null ">and l.consumer_id = #{consumerId}</if>
<if test="phone != null and phone != ''">and l.phone = #{phone}</if>
<if test="useDuration != null ">and l.use_duration = #{useDuration}</if>
<if test="residueDuration != null ">and l.residue_duration = #{residueDuration}</if>
</select>
<select id="selectMonthlyCardLogById" parameterType="Long" resultMap="MonthlyCardLogResult">
<include refid="selectMonthlyCardLogVo"/>
where id = #{id}
</select>
<insert id="insertMonthlyCardLog" parameterType="MonthlyCardLog" useGeneratedKeys="true" keyProperty="id">
insert into s_monthly_card_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="consumerMonthlyCardId != null">consumer_monthly_card_id,</if>
<if test="consumerId != null">consumer_id,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="useDuration != null">use_duration,</if>
<if test="residueDuration != null">residue_duration,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerMonthlyCardId != null">#{consumerMonthlyCardId},</if>
<if test="consumerId != null">#{consumerId},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="useDuration != null">#{useDuration},</if>
<if test="residueDuration != null">#{residueDuration},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMonthlyCardLog" parameterType="MonthlyCardLog">
update s_monthly_card_log
<trim prefix="SET" suffixOverrides=",">
<if test="consumerMonthlyCardId != null">consumer_monthly_card_id = #{consumerMonthlyCardId},</if>
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="useDuration != null">use_duration = #{useDuration},</if>
<if test="residueDuration != null">residue_duration = #{residueDuration},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMonthlyCardLogById" parameterType="Long">
delete
from s_monthly_card_log
where id = #{id}
</delete>
<delete id="deleteMonthlyCardLogByIds" parameterType="String">
delete from s_monthly_card_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.MonthlyCardOrderMapper">
<resultMap type="MonthlyCardOrderVo" id="MonthlyCardOrderResult">
<result property="id" column="id"/>
<result property="monthlyCardNo" column="monthly_card_no"/>
<result property="outTradeNo" column="out_trade_no"/>
<result property="terminalTrace" column="terminal_trace"/>
<result property="monthlyCardAmount" column="monthly_card_amount"/>
<result property="monthlyCardConfId" column="monthly_card_conf_id"/>
<result property="confAmount" column="conf_amount"/>
<result property="confName" column="conf_name"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="avatar" column="avatar"/>
<result property="phone" column="phone"/>
<result property="payType" column="pay_type"/>
<result property="payStatus" column="pay_status"/>
<result property="payTime" column="pay_time"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectMonthlyCardOrderVo">
select id,
monthly_card_no,
out_trade_no,
terminal_trace,
monthly_card_amount,
monthly_card_conf_id,
consumer_id,
phone,
pay_type,
pay_status,
pay_time,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_monthly_card_order
</sql>
<select id="selectMonthlyCardOrderList" parameterType="MonthlyCardOrderVo" resultMap="MonthlyCardOrderResult">
select o.id,
o.monthly_card_no,
o.out_trade_no,
o.terminal_trace,
o.monthly_card_amount,
o.monthly_card_conf_id,
o.consumer_id,
c.nick_name,
c.avatar,
m.name as conf_name,
m.monthly_card_amount as conf_amount,
o.phone,
o.pay_type,
o.pay_status,
o.pay_time,
o.is_delete,
o.create_by,
o.create_time,
o.update_by,
o.update_time,
o.remark
from s_monthly_card_order o join s_consumer c on o.consumer_id = c.id
join s_monthly_card_conf m on o.monthly_card_conf_id = m.id
where o.is_delete = 0
<if test="monthlyCardNo != null and monthlyCardNo != ''">and o.monthly_card_no = #{monthlyCardNo}</if>
<if test="outTradeNo != null and outTradeNo != ''">and o.out_trade_no = #{outTradeNo}</if>
<if test="terminalTrace != null and terminalTrace != ''">and o.terminal_trace = #{terminalTrace}</if>
<if test="monthlyCardAmount != null ">and o.monthly_card_amount = #{monthlyCardAmount}</if>
<if test="monthlyCardConfId != null ">and o.monthly_card_conf_id = #{monthlyCardConfId}</if>
<if test="consumerId != null ">and o.consumer_id = #{consumerId}</if>
<if test="phone != null and phone != ''">and o.phone = #{phone}</if>
<if test="payType != null ">and o.pay_type = #{payType}</if>
<if test="payStatus != null ">and o.pay_status = #{payStatus}</if>
<if test="payTime != null ">and o.pay_time = #{payTime}</if>
</select>
<select id="selectMonthlyCardOrderById" parameterType="Long" resultMap="MonthlyCardOrderResult">
<include refid="selectMonthlyCardOrderVo"/>
where id = #{id}
</select>
<select id="getInfoByEntity" resultType="share.system.domain.MonthlyCardOrder">
<include refid="selectMonthlyCardOrderVo"/>
where terminal_trace=#{terminalTrace} and consumer_id=#{consumerId}
</select>
<insert id="insertMonthlyCardOrder" parameterType="MonthlyCardOrder" useGeneratedKeys="true" keyProperty="id">
insert into s_monthly_card_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monthlyCardNo != null and monthlyCardNo != ''">monthly_card_no,</if>
<if test="outTradeNo != null">out_trade_no,</if>
<if test="terminalTrace != null">terminal_trace,</if>
<if test="monthlyCardAmount != null">monthly_card_amount,</if>
<if test="monthlyCardConfId != null">monthly_card_conf_id,</if>
<if test="consumerId != null">consumer_id,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="payType != null">pay_type,</if>
<if test="payStatus != null">pay_status,</if>
<if test="payTime != null">pay_time,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monthlyCardNo != null and monthlyCardNo != ''">#{monthlyCardNo},</if>
<if test="outTradeNo != null">#{outTradeNo},</if>
<if test="terminalTrace != null">#{terminalTrace},</if>
<if test="monthlyCardAmount != null">#{monthlyCardAmount},</if>
<if test="monthlyCardConfId != null">#{monthlyCardConfId},</if>
<if test="consumerId != null">#{consumerId},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="payType != null">#{payType},</if>
<if test="payStatus != null">#{payStatus},</if>
<if test="payTime != null">#{payTime},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMonthlyCardOrder" parameterType="MonthlyCardOrder">
update s_monthly_card_order
<trim prefix="SET" suffixOverrides=",">
<if test="monthlyCardNo != null and monthlyCardNo != ''">monthly_card_no = #{monthlyCardNo},</if>
<if test="outTradeNo != null">out_trade_no = #{outTradeNo},</if>
<if test="terminalTrace != null">terminal_trace = #{terminalTrace},</if>
<if test="monthlyCardAmount != null">monthly_card_amount = #{monthlyCardAmount},</if>
<if test="monthlyCardConfId != null">monthly_card_conf_id = #{monthlyCardConfId},</if>
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="payType != null">pay_type = #{payType},</if>
<if test="payStatus != null">pay_status = #{payStatus},</if>
<if test="payTime != null">pay_time = #{payTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMonthlyCardOrderById" parameterType="Long">
delete
from s_monthly_card_order
where id = #{id}
</delete>
<delete id="deleteMonthlyCardOrderByIds" parameterType="String">
delete from s_monthly_card_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<result property="controller" column="controller"/> <result property="controller" column="controller"/>
<result property="gating" column="gating"/> <result property="gating" column="gating"/>
<result property="position" column="position"/> <result property="position" column="position"/>
<result property="textMessage" column="text_message"/>
<result property="officialAccount" column="official_account"/>
</resultMap> </resultMap>
<sql id="selectSConsumerVo"> <sql id="selectSConsumerVo">
...@@ -112,7 +114,15 @@ ...@@ -112,7 +114,15 @@
t1.sex, t1.sex,
t1.addres, t1.addres,
t1.amount, t1.amount,
t1.free_amount, t1.total_times, t1.duration, t1.status, t1.pwd, t1.create_time, t1.last_login_time t1.free_amount,
t1.total_times,
t1.duration,
t1.status,
t1.pwd,
t1.create_time,
t1.last_login_time,
t2.text_message,
t2.official_account
from s_consumer t1 from s_consumer t1
left join s_store_consumer t2 on t2.consumer_id = t1.id left join s_store_consumer t2 on t2.consumer_id = t1.id
where t1.role_type = '1' where t1.role_type = '1'
......
...@@ -10,11 +10,17 @@ ...@@ -10,11 +10,17 @@
<result property="position" column="position"/> <result property="position" column="position"/>
<result property="gating" column="gating"/> <result property="gating" column="gating"/>
<result property="controller" column="controller"/> <result property="controller" column="controller"/>
<result property="textMessage" column="text_message"/>
<result property="officialAccount" column="official_account"/>
</resultMap> </resultMap>
<update id="updateBySStoreConsumer"> <update id="updateBySStoreConsumer">
update s_store_consumer update s_store_consumer
set controller = #{controller}, <trim prefix="SET" suffixOverrides=",">
gating = #{gating} <if test="controller != null">controller = #{controller},</if>
<if test="gating != null">gating = #{gating},</if>
<if test="textMessage != null">text_message = #{textMessage},</if>
<if test="officialAccount != null">official_account = #{officialAccount},</if>
</trim>
where store_id = #{storeId} where store_id = #{storeId}
and consumer_id = #{consumerId} and consumer_id = #{consumerId}
and position = #{position} and position = #{position}
...@@ -36,7 +42,7 @@ ...@@ -36,7 +42,7 @@
</if> </if>
</select> </select>
<select id="queryByConsumerId" resultMap="SStoreConsumerResult"> <select id="queryByConsumerId" resultMap="SStoreConsumerResult">
select store_id, consumer_id, position select store_id, consumer_id, position, text_message, official_account
from s_store_consumer from s_store_consumer
where consumer_id = #{consumerId} where consumer_id = #{consumerId}
</select> </select>
...@@ -59,7 +65,9 @@ ...@@ -59,7 +65,9 @@
t1.create_time, t1.create_time,
t1.last_login_time, t1.last_login_time,
t2.gating, t2.gating,
t2.controller t2.controller,
t2.text_message,
t2.official_account
from s_consumer t1 from s_consumer t1
left join s_store_consumer t2 on t2.consumer_id = t1.id left join s_store_consumer t2 on t2.consumer_id = t1.id
where t1.role_type = '1' where t1.role_type = '1'
......
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