| @@ -9,45 +9,45 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCouponTarget; | |||
| import com.simple.service.WxCouponTargetService; | |||
| import com.simple.domain.po.WxCouponChannel; | |||
| import com.simple.service.WxCouponChannelService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxCouponTarget") | |||
| public class WxCouponTargetController extends BaseController | |||
| @RequestMapping("wxCouponChannel") | |||
| public class WxCouponChannelController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxCouponTargetService wxCouponTargetService; | |||
| private WxCouponChannelService wxCouponChannelService; | |||
| private Logger logger = Logger.getLogger(WxCouponTargetController.class); | |||
| private Logger logger = Logger.getLogger(WxCouponChannelController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxCouponTarget wxCouponTarget,Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponTarget) wxCouponTarget = new WxCouponTarget(); | |||
| final PageInfo<WxCouponTarget> page = wxCouponTargetService.listAsPage(wxCouponTarget, pageNum, pageSize); | |||
| public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | |||
| final PageInfo<WxCouponChannel> page = wxCouponChannelService.listAsPage(wxCouponChannel, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxCouponTarget wxCouponTarget) { | |||
| //Assert.notNull(wxCouponTarget.getName(), "角色名不能为空"); | |||
| public ResultData add(@RequestBody WxCouponChannel wxCouponChannel) { | |||
| //Assert.notNull(wxCouponChannel.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxCouponTargetService.saveOrUpdate(wxCouponTarget); | |||
| wxCouponChannelService.saveOrUpdate(wxCouponChannel); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCouponTarget wxCouponTarget) { | |||
| wxCouponTargetService.saveOrUpdate(wxCouponTarget); | |||
| public ResultData update(@RequestBody WxCouponChannel wxCouponChannel) { | |||
| wxCouponChannelService.saveOrUpdate(wxCouponChannel); | |||
| return new ResultData(); | |||
| } | |||
| @@ -55,7 +55,7 @@ public class WxCouponTargetController extends BaseController | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxCouponTargetService.deleteById(id); | |||
| wxCouponChannelService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -63,7 +63,7 @@ public class WxCouponTargetController extends BaseController | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponTargetService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponChannelService.getById(id)); | |||
| } | |||
| @@ -9,45 +9,45 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxOrders; | |||
| import com.simple.service.WxOrdersService; | |||
| import com.simple.domain.po.WxOrder; | |||
| import com.simple.service.WxOrderService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxOrders") | |||
| public class WxOrdersController extends BaseController | |||
| @RequestMapping("wxOrder") | |||
| public class WxOrderController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxOrdersService wxOrdersService; | |||
| private WxOrderService wxOrderService; | |||
| private Logger logger = Logger.getLogger(WxOrdersController.class); | |||
| private Logger logger = Logger.getLogger(WxOrderController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxOrders wxOrders,Integer pageNum, Integer pageSize) { | |||
| if (null == wxOrders) wxOrders = new WxOrders(); | |||
| final PageInfo<WxOrders> page = wxOrdersService.listAsPage(wxOrders, pageNum, pageSize); | |||
| public ResultData list(@ModelAttribute WxOrder wxOrder,Integer pageNum, Integer pageSize) { | |||
| if (null == wxOrder) wxOrder = new WxOrder(); | |||
| final PageInfo<WxOrder> page = wxOrderService.listAsPage(wxOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxOrders wxOrders) { | |||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | |||
| public ResultData add(@RequestBody WxOrder wxOrder) { | |||
| //Assert.notNull(wxOrder.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxOrdersService.saveOrUpdate(wxOrders); | |||
| wxOrderService.saveOrUpdate(wxOrder); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxOrders wxOrders) { | |||
| wxOrdersService.saveOrUpdate(wxOrders); | |||
| public ResultData update(@RequestBody WxOrder wxOrder) { | |||
| wxOrderService.saveOrUpdate(wxOrder); | |||
| return new ResultData(); | |||
| } | |||
| @@ -55,7 +55,7 @@ public class WxOrdersController extends BaseController | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxOrdersService.deleteById(id); | |||
| wxOrderService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -63,7 +63,7 @@ public class WxOrdersController extends BaseController | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxOrdersService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxOrderService.getById(id)); | |||
| } | |||
| @@ -9,45 +9,45 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxFlashSale; | |||
| import com.simple.service.WxFlashSaleService; | |||
| import com.simple.domain.po.WxPayOrder; | |||
| import com.simple.service.WxPayOrderService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxFlashSale") | |||
| public class WxFlashSaleController extends BaseController | |||
| @RequestMapping("wxPayOrder") | |||
| public class WxPayOrderController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxFlashSaleService wxFlashSaleService; | |||
| private WxPayOrderService wxPayOrderService; | |||
| private Logger logger = Logger.getLogger(WxFlashSaleController.class); | |||
| private Logger logger = Logger.getLogger(WxPayOrderController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxFlashSale wxFlashSale,Integer pageNum, Integer pageSize) { | |||
| if (null == wxFlashSale) wxFlashSale = new WxFlashSale(); | |||
| final PageInfo<WxFlashSale> page = wxFlashSaleService.listAsPage(wxFlashSale, pageNum, pageSize); | |||
| public ResultData list(@ModelAttribute WxPayOrder wxPayOrder,Integer pageNum, Integer pageSize) { | |||
| if (null == wxPayOrder) wxPayOrder = new WxPayOrder(); | |||
| final PageInfo<WxPayOrder> page = wxPayOrderService.listAsPage(wxPayOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxFlashSale wxFlashSale) { | |||
| //Assert.notNull(wxFlashSale.getName(), "角色名不能为空"); | |||
| public ResultData add(@RequestBody WxPayOrder wxPayOrder) { | |||
| //Assert.notNull(wxPayOrder.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxFlashSaleService.saveOrUpdate(wxFlashSale); | |||
| wxPayOrderService.saveOrUpdate(wxPayOrder); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxFlashSale wxFlashSale) { | |||
| wxFlashSaleService.saveOrUpdate(wxFlashSale); | |||
| public ResultData update(@RequestBody WxPayOrder wxPayOrder) { | |||
| wxPayOrderService.saveOrUpdate(wxPayOrder); | |||
| return new ResultData(); | |||
| } | |||
| @@ -55,7 +55,7 @@ public class WxFlashSaleController extends BaseController | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxFlashSaleService.deleteById(id); | |||
| wxPayOrderService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -63,7 +63,7 @@ public class WxFlashSaleController extends BaseController | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxFlashSaleService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxPayOrderService.getById(id)); | |||
| } | |||
| @@ -9,45 +9,45 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCouponTarget; | |||
| import com.simple.service.WxCouponTargetService; | |||
| import com.simple.domain.po.WxCouponChannel; | |||
| import com.simple.service.WxCouponChannelService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxCouponTarget") | |||
| public class WxCouponTargetController extends BaseController | |||
| @RequestMapping("wxCouponChannel") | |||
| public class WxCouponChannelController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxCouponTargetService wxCouponTargetService; | |||
| private WxCouponChannelService wxCouponChannelService; | |||
| private Logger logger = Logger.getLogger(WxCouponTargetController.class); | |||
| private Logger logger = Logger.getLogger(WxCouponChannelController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxCouponTarget wxCouponTarget,Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponTarget) wxCouponTarget = new WxCouponTarget(); | |||
| final PageInfo<WxCouponTarget> page = wxCouponTargetService.listAsPage(wxCouponTarget, pageNum, pageSize); | |||
| public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | |||
| final PageInfo<WxCouponChannel> page = wxCouponChannelService.listAsPage(wxCouponChannel, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxCouponTarget wxCouponTarget) { | |||
| //Assert.notNull(wxCouponTarget.getName(), "角色名不能为空"); | |||
| public ResultData add(@RequestBody WxCouponChannel wxCouponChannel) { | |||
| //Assert.notNull(wxCouponChannel.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxCouponTargetService.saveOrUpdate(wxCouponTarget); | |||
| wxCouponChannelService.saveOrUpdate(wxCouponChannel); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCouponTarget wxCouponTarget) { | |||
| wxCouponTargetService.saveOrUpdate(wxCouponTarget); | |||
| public ResultData update(@RequestBody WxCouponChannel wxCouponChannel) { | |||
| wxCouponChannelService.saveOrUpdate(wxCouponChannel); | |||
| return new ResultData(); | |||
| } | |||
| @@ -55,7 +55,7 @@ public class WxCouponTargetController extends BaseController | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxCouponTargetService.deleteById(id); | |||
| wxCouponChannelService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -63,7 +63,7 @@ public class WxCouponTargetController extends BaseController | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponTargetService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponChannelService.getById(id)); | |||
| } | |||
| @@ -10,30 +10,29 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxOrders; | |||
| import com.simple.service.WxOrdersService; | |||
| import com.simple.domain.po.WxOrder; | |||
| import com.simple.service.WxOrderService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxOrders") | |||
| public class WxOrdersController extends BaseController { | |||
| @Autowired | |||
| private WxOrdersService wxOrdersService; | |||
| private Logger logger = Logger.getLogger(WxOrdersController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @RequestMapping("wxOrder") | |||
| public class WxOrderController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxOrderService wxOrderService; | |||
| private Logger logger = Logger.getLogger(WxOrderController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "cUserId", value = "用户ID", dataType = "bigint", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "status", value = "订单状态:-1全部;0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款);3-未退款/待退款;4-已退款;5-退款失败", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute WxOrders wxOrders, Integer pageNum, Integer pageSize) { | |||
| if (null == wxOrders) wxOrders = new WxOrders(); | |||
| final PageInfo<WxOrders> page = wxOrdersService.listAsPage(wxOrders, pageNum, pageSize); | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxOrder wxOrder,Integer pageNum, Integer pageSize) { | |||
| if (null == wxOrder) wxOrder = new WxOrder(); | |||
| final PageInfo<WxOrder> page = wxOrderService.listAsPage(wxOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -45,10 +44,10 @@ public class WxOrdersController extends BaseController { | |||
| @ApiImplicitParam(name = "payment", value = "支付金额", required = true, dataType = "BigDecimal"), | |||
| @ApiImplicitParam(name = "status", value = "订单状态:-1全部;0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款);3-未退款/待退款;4-已退款;5-退款失败", defaultValue = "0", required = false, dataType = "Integer") | |||
| }) | |||
| public ResultData saveOrder(@RequestBody WxOrders wxOrders) { | |||
| public ResultData saveOrder(@RequestBody WxOrder wxOrder) { | |||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxOrdersService.saveOrder(wxOrders); | |||
| wxOrderService.saveOrder(wxOrder); | |||
| return new ResultData(); | |||
| } | |||
| @@ -58,10 +57,10 @@ public class WxOrdersController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), | |||
| @ApiImplicitParam(name = "cUserId", value = "用户ID", required = true, dataType = "Long") | |||
| }) | |||
| public ResultData cancelOrder(@RequestBody WxOrders wxOrders) { | |||
| public ResultData cancelOrder(@RequestBody WxOrder wxOrder) { | |||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxOrdersService.updateOrderStatus(wxOrders.getId(), EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); | |||
| wxOrderService.updateOrderStatus(wxOrder.getId(), EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); | |||
| return new ResultData(); | |||
| } | |||
| @@ -71,10 +70,10 @@ public class WxOrdersController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), | |||
| @ApiImplicitParam(name = "cUserId", value = "用户ID", required = true, dataType = "Long") | |||
| }) | |||
| public ResultData expiringOrder(@RequestBody WxOrders wxOrders) { | |||
| public ResultData expiringOrder(@RequestBody WxOrder wxOrder) { | |||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxOrdersService.updateOrderStatus(wxOrders.getId(), EnumOrderStatus.ORDER_STATUS_PENDING_REFUND); | |||
| wxOrderService.updateOrderStatus(wxOrder.getId(), EnumOrderStatus.ORDER_STATUS_PENDING_REFUND); | |||
| return new ResultData(); | |||
| } | |||
| @@ -84,35 +83,44 @@ public class WxOrdersController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), | |||
| @ApiImplicitParam(name = "cUserId", value = "用户ID", required = true, dataType = "Long") | |||
| }) | |||
| public ResultData expiredOrder(@RequestBody WxOrders wxOrders) { | |||
| public ResultData expiredOrder(@RequestBody WxOrder wxOrder) { | |||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxOrdersService.updateOrderStatus(wxOrders.getId(), EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS); | |||
| wxOrderService.updateOrderStatus(wxOrder.getId(), EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxOrder wxOrder) { | |||
| //Assert.notNull(wxOrder.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxOrderService.saveOrUpdate(wxOrder); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxOrders wxOrders) { | |||
| wxOrdersService.saveOrUpdate(wxOrders); | |||
| public ResultData update(@RequestBody WxOrder wxOrder) { | |||
| wxOrderService.saveOrUpdate(wxOrder); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxOrdersService.deleteById(id); | |||
| wxOrderService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxOrdersService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxOrderService.getById(id)); | |||
| } | |||
| } | |||
| @@ -9,45 +9,45 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxFlashSale; | |||
| import com.simple.service.WxFlashSaleService; | |||
| import com.simple.domain.po.WxPayOrder; | |||
| import com.simple.service.WxPayOrderService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxFlashSale") | |||
| public class WxFlashSaleController extends BaseController | |||
| @RequestMapping("wxPayOrder") | |||
| public class WxPayOrderController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxFlashSaleService wxFlashSaleService; | |||
| private WxPayOrderService wxPayOrderService; | |||
| private Logger logger = Logger.getLogger(WxFlashSaleController.class); | |||
| private Logger logger = Logger.getLogger(WxPayOrderController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxFlashSale wxFlashSale,Integer pageNum, Integer pageSize) { | |||
| if (null == wxFlashSale) wxFlashSale = new WxFlashSale(); | |||
| final PageInfo<WxFlashSale> page = wxFlashSaleService.listAsPage(wxFlashSale, pageNum, pageSize); | |||
| public ResultData list(@ModelAttribute WxPayOrder wxPayOrder,Integer pageNum, Integer pageSize) { | |||
| if (null == wxPayOrder) wxPayOrder = new WxPayOrder(); | |||
| final PageInfo<WxPayOrder> page = wxPayOrderService.listAsPage(wxPayOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxFlashSale wxFlashSale) { | |||
| //Assert.notNull(wxFlashSale.getName(), "角色名不能为空"); | |||
| public ResultData add(@RequestBody WxPayOrder wxPayOrder) { | |||
| //Assert.notNull(wxPayOrder.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxFlashSaleService.saveOrUpdate(wxFlashSale); | |||
| wxPayOrderService.saveOrUpdate(wxPayOrder); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxFlashSale wxFlashSale) { | |||
| wxFlashSaleService.saveOrUpdate(wxFlashSale); | |||
| public ResultData update(@RequestBody WxPayOrder wxPayOrder) { | |||
| wxPayOrderService.saveOrUpdate(wxPayOrder); | |||
| return new ResultData(); | |||
| } | |||
| @@ -55,7 +55,7 @@ public class WxFlashSaleController extends BaseController | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxFlashSaleService.deleteById(id); | |||
| wxPayOrderService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -63,7 +63,7 @@ public class WxFlashSaleController extends BaseController | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxFlashSaleService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxPayOrderService.getById(id)); | |||
| } | |||
| @@ -143,6 +143,7 @@ public class IdWorker { | |||
| for (int i = 0; i < 50000; i++) { | |||
| long id = idWorker.nextId(); | |||
| System.out.println(id); | |||
| System.out.println(String.valueOf(id)); | |||
| System.out.println(String.valueOf(id).length()); | |||
| } | |||
| System.out.println((System.nanoTime()-startTime)/1000000+"ms"); | |||
| @@ -8,8 +8,8 @@ import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_coupon_target") | |||
| public class WxCouponTarget implements Serializable { | |||
| @Table(name = "wx_coupon_channel") | |||
| public class WxCouponChannel implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @@ -144,7 +144,7 @@ public class WxCouponTarget implements Serializable { | |||
| } | |||
| } | |||
| public void setSortColumns(WxCouponTarget.Field... fields) | |||
| public void setSortColumns(WxCouponChannel.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| @@ -1,151 +0,0 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_flash_sale") | |||
| public class WxFlashSale implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*优惠券活动ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="优惠券活动ID",name="activityId") | |||
| private Long activityId; | |||
| /*状态 1启用 2停用**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态 1启用 2停用",name="isEnable") | |||
| private Integer isEnable; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /*上线时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="上线时间",name="upDate") | |||
| private Date upDate; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getActivityId() { | |||
| return activityId; | |||
| } | |||
| public void setActivityId(Long _activityId) { | |||
| activityId = _activityId; | |||
| } | |||
| public Integer getIsEnable() { | |||
| return isEnable; | |||
| } | |||
| public void setIsEnable(Integer _isEnable) { | |||
| isEnable = _isEnable; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date _createDate) { | |||
| createDate = _createDate; | |||
| } | |||
| public Date getUpDate() { | |||
| return upDate; | |||
| } | |||
| public void setUpDate(Date _upDate) { | |||
| upDate = _upDate; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,ActivityId_ASC("`activityId` ASC"),ActivityId_DESC("`activityId` DESC") | |||
| ,IsEnable_ASC("`isEnable` ASC"),IsEnable_DESC("`isEnable` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpDate_ASC("`upDate` ASC"),UpDate_DESC("`upDate` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxFlashSale.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -8,8 +8,8 @@ import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_orders") | |||
| public class WxOrders implements Serializable { | |||
| @Table(name = "wx_order") | |||
| public class WxOrder implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @@ -44,8 +44,8 @@ public class WxOrders implements Serializable { | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*卡券活动id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="卡券活动id",name="couponId") | |||
| /*卡券ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="卡券ID",name="couponId") | |||
| private Long couponId; | |||
| /*c端用户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | |||
| @@ -53,21 +53,21 @@ public class WxOrders implements Serializable { | |||
| /*支付金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付金额",name="payment") | |||
| private BigDecimal payment; | |||
| /*1.未使用2.已使用3.已过期4.已退款**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1.未使用2.已使用3.已过期4.已退款",name="couponStatus") | |||
| private Integer couponStatus; | |||
| /*状态(0.待付款 1.已支付 2.已退款 3.已核销 4.已取消 )**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(0.待付款 1.已支付 2.已退款 3.已核销 4.已取消 )",name="status") | |||
| /*支付时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | |||
| private Date paymentTime; | |||
| /*订单状态:-1全部;0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款);3-未退款/待退款;4-已退款;5-退款失败**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款);3-未退款/待退款;4-已退款;5-退款失败",name="status") | |||
| private Integer status; | |||
| /*过期时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="过期时间",name="validDate") | |||
| private Date validDate; | |||
| /*退款开始时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="退款开始时间",name="refundStartDate") | |||
| private Date refundStartDate; | |||
| /*退款完成时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="退款完成时间",name="refundEndDate") | |||
| private Date refundEndDate; | |||
| /*券状态(3:已领取/已购买/未核销/未使用,4:已核销/已使用,5:已过期,6:已退券 )**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券状态(3:已领取/已购买/未核销/未使用,4:已核销/已使用,5:已过期,6:已退券 )",name="couponStatus") | |||
| private Integer couponStatus; | |||
| /*有无退款(0: 无, 1:有)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有无退款(0: 无, 1:有)",name="refund") | |||
| private Integer refund; | |||
| /*退款时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="退款时间",name="refundTime") | |||
| private Date refundTime; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @@ -98,11 +98,11 @@ public class WxOrders implements Serializable { | |||
| public void setPayment(BigDecimal _payment) { | |||
| payment = _payment; | |||
| } | |||
| public Integer getCouponStatus() { | |||
| return couponStatus; | |||
| public Date getPaymentTime() { | |||
| return paymentTime; | |||
| } | |||
| public void setCouponStatus(Integer _couponStatus) { | |||
| couponStatus = _couponStatus; | |||
| public void setPaymentTime(Date _paymentTime) { | |||
| paymentTime = _paymentTime; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| @@ -110,23 +110,23 @@ public class WxOrders implements Serializable { | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public Date getValidDate() { | |||
| return validDate; | |||
| public Integer getCouponStatus() { | |||
| return couponStatus; | |||
| } | |||
| public void setValidDate(Date _validDate) { | |||
| validDate = _validDate; | |||
| public void setCouponStatus(Integer _couponStatus) { | |||
| couponStatus = _couponStatus; | |||
| } | |||
| public Date getRefundStartDate() { | |||
| return refundStartDate; | |||
| public Integer getRefund() { | |||
| return refund; | |||
| } | |||
| public void setRefundStartDate(Date _refundStartDate) { | |||
| refundStartDate = _refundStartDate; | |||
| public void setRefund(Integer _refund) { | |||
| refund = _refund; | |||
| } | |||
| public Date getRefundEndDate() { | |||
| return refundEndDate; | |||
| public Date getRefundTime() { | |||
| return refundTime; | |||
| } | |||
| public void setRefundEndDate(Date _refundEndDate) { | |||
| refundEndDate = _refundEndDate; | |||
| public void setRefundTime(Date _refundTime) { | |||
| refundTime = _refundTime; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| @@ -150,11 +150,11 @@ public class WxOrders implements Serializable { | |||
| ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") | |||
| ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | |||
| ,Payment_ASC("`payment` ASC"),Payment_DESC("`payment` DESC") | |||
| ,CouponStatus_ASC("`couponStatus` ASC"),CouponStatus_DESC("`couponStatus` DESC") | |||
| ,PaymentTime_ASC("`paymentTime` ASC"),PaymentTime_DESC("`paymentTime` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,ValidDate_ASC("`validDate` ASC"),ValidDate_DESC("`validDate` DESC") | |||
| ,RefundStartDate_ASC("`refundStartDate` ASC"),RefundStartDate_DESC("`refundStartDate` DESC") | |||
| ,RefundEndDate_ASC("`refundEndDate` ASC"),RefundEndDate_DESC("`refundEndDate` DESC") | |||
| ,CouponStatus_ASC("`couponStatus` ASC"),CouponStatus_DESC("`couponStatus` DESC") | |||
| ,Refund_ASC("`refund` ASC"),Refund_DESC("`refund` DESC") | |||
| ,RefundTime_ASC("`refundTime` ASC"),RefundTime_DESC("`refundTime` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ; | |||
| @@ -174,7 +174,7 @@ public class WxOrders implements Serializable { | |||
| } | |||
| } | |||
| public void setSortColumns(Field... fields) | |||
| public void setSortColumns(WxOrder.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| @@ -199,7 +199,7 @@ public class WxOrders implements Serializable { | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<Field> fList = new ArrayList(); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| @@ -0,0 +1,231 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_pay_order") | |||
| public class WxPayOrder implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="tenantId") | |||
| private Long tenantId; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | |||
| private Date createTime; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") | |||
| private Date updateTime; | |||
| /*订单ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | |||
| private Long orderId; | |||
| /*用户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId") | |||
| private Long cUserId; | |||
| /*支付金额(分)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分)",name="payAmount") | |||
| private Integer payAmount; | |||
| /*支付发起时间(秒)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付发起时间(秒)",name="payTimeStart") | |||
| private Integer payTimeStart; | |||
| /*支付结束时间(秒)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付结束时间(秒)",name="payTimeEnd") | |||
| private Integer payTimeEnd; | |||
| /*支付渠道: 0-微信小程序**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付渠道: 0-微信小程序",name="payChannel") | |||
| private Integer payChannel; | |||
| /*支付方式: 0-微信小程序支付**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付方式: 0-微信小程序支付",name="payWay") | |||
| private Integer payWay; | |||
| /*支付订单号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付订单号",name="payOrderNo") | |||
| private String payOrderNo; | |||
| /*支付状态: 0-支付中;1-支付成功;2-支付失败**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付状态: 0-支付中;1-支付成功;2-支付失败",name="status") | |||
| private Integer status; | |||
| /*支付失败原因**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付失败原因",name="failReason") | |||
| private String failReason; | |||
| public Long getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(Long _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Date getCreateTime() { | |||
| return createTime; | |||
| } | |||
| public void setCreateTime(Date _createTime) { | |||
| createTime = _createTime; | |||
| } | |||
| public Date getUpdateTime() { | |||
| return updateTime; | |||
| } | |||
| public void setUpdateTime(Date _updateTime) { | |||
| updateTime = _updateTime; | |||
| } | |||
| public Long getOrderId() { | |||
| return orderId; | |||
| } | |||
| public void setOrderId(Long _orderId) { | |||
| orderId = _orderId; | |||
| } | |||
| public Long getCUserId() { | |||
| return cUserId; | |||
| } | |||
| public void setCUserId(Long _cUserId) { | |||
| cUserId = _cUserId; | |||
| } | |||
| public Integer getPayAmount() { | |||
| return payAmount; | |||
| } | |||
| public void setPayAmount(Integer _payAmount) { | |||
| payAmount = _payAmount; | |||
| } | |||
| public Integer getPayTimeStart() { | |||
| return payTimeStart; | |||
| } | |||
| public void setPayTimeStart(Integer _payTimeStart) { | |||
| payTimeStart = _payTimeStart; | |||
| } | |||
| public Integer getPayTimeEnd() { | |||
| return payTimeEnd; | |||
| } | |||
| public void setPayTimeEnd(Integer _payTimeEnd) { | |||
| payTimeEnd = _payTimeEnd; | |||
| } | |||
| public Integer getPayChannel() { | |||
| return payChannel; | |||
| } | |||
| public void setPayChannel(Integer _payChannel) { | |||
| payChannel = _payChannel; | |||
| } | |||
| public Integer getPayWay() { | |||
| return payWay; | |||
| } | |||
| public void setPayWay(Integer _payWay) { | |||
| payWay = _payWay; | |||
| } | |||
| public String getPayOrderNo() { | |||
| return payOrderNo; | |||
| } | |||
| public void setPayOrderNo(String _payOrderNo) { | |||
| payOrderNo = _payOrderNo; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public String getFailReason() { | |||
| return failReason; | |||
| } | |||
| public void setFailReason(String _failReason) { | |||
| failReason = _failReason; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,CreateTime_ASC("`createTime` ASC"),CreateTime_DESC("`createTime` DESC") | |||
| ,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC") | |||
| ,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC") | |||
| ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | |||
| ,PayAmount_ASC("`payAmount` ASC"),PayAmount_DESC("`payAmount` DESC") | |||
| ,PayTimeStart_ASC("`payTimeStart` ASC"),PayTimeStart_DESC("`payTimeStart` DESC") | |||
| ,PayTimeEnd_ASC("`payTimeEnd` ASC"),PayTimeEnd_DESC("`payTimeEnd` DESC") | |||
| ,PayChannel_ASC("`payChannel` ASC"),PayChannel_DESC("`payChannel` DESC") | |||
| ,PayWay_ASC("`payWay` ASC"),PayWay_DESC("`payWay` DESC") | |||
| ,PayOrderNo_ASC("`payOrderNo` ASC"),PayOrderNo_DESC("`payOrderNo` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,FailReason_ASC("`failReason` ASC"),FailReason_DESC("`failReason` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxPayOrder.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,37 @@ | |||
| package com.simple.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumPayStatus { | |||
| PAY_WAY_UNKNOWN(-1, "未知"), | |||
| PAY_WAY_WAIT(0, "支付中"), | |||
| PAY_WAY_SUCCESS(1, "支付成功"), | |||
| PAY_WAY_FAIL(2, "支付失败"), | |||
| ; | |||
| public static EnumPayStatus getEnum(Integer code) { | |||
| for (EnumPayStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumPayStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.simple.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumPayWay { | |||
| PAY_WAY_WEAPP(0, "微信小程序"), | |||
| PAY_WAY_WECHAT(1, "微信支付"), | |||
| PAY_WAY_WECHAT_WAP(2, "微信h5"), | |||
| PAY_WAY_ALIPAY(3, "支付宝"), | |||
| PAY_WAY_ALIPAY_WAP(0, "支付宝h5"); | |||
| public static EnumPayWay getEnum(Integer code) { | |||
| for (EnumPayWay value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumPayWay(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,17 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxCouponChannel; | |||
| public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, String> { | |||
| List<WxCouponChannel> findList(WxCouponChannel wxCouponChannel); | |||
| } | |||
| @@ -1,17 +0,0 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxCouponTarget; | |||
| public interface WxCouponTargetMapper extends CommonMapper<WxCouponTarget, String> { | |||
| List<WxCouponTarget> findList(WxCouponTarget wxCouponTarget); | |||
| } | |||
| @@ -1,17 +0,0 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxFlashSale; | |||
| public interface WxFlashSaleMapper extends CommonMapper<WxFlashSale, String> { | |||
| List<WxFlashSale> findList(WxFlashSale wxFlashSale); | |||
| } | |||
| @@ -0,0 +1,17 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxOrder; | |||
| public interface WxOrderMapper extends CommonMapper<WxOrder, String> { | |||
| List<WxOrder> findList(WxOrder wxOrder); | |||
| } | |||
| @@ -1,17 +0,0 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxOrders; | |||
| public interface WxOrdersMapper extends CommonMapper<WxOrders, String> { | |||
| List<WxOrders> findList(WxOrders wxOrders); | |||
| } | |||
| @@ -0,0 +1,17 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxPayOrder; | |||
| public interface WxPayOrderMapper extends CommonMapper<WxPayOrder, String> { | |||
| List<WxPayOrder> findList(WxPayOrder wxPayOrder); | |||
| } | |||
| @@ -2,9 +2,9 @@ package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCouponTarget; | |||
| import com.simple.domain.po.WxCouponChannel; | |||
| public interface WxCouponTargetService { | |||
| public interface WxCouponChannelService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -14,7 +14,7 @@ public interface WxCouponTargetService { | |||
| * @param limit | |||
| * @return | |||
| */ | |||
| PageInfo<WxCouponTarget> listAsPage(WxCouponTarget record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxCouponChannel> listAsPage(WxCouponChannel record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -22,14 +22,14 @@ public interface WxCouponTargetService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxCouponTarget getById(Long id); | |||
| WxCouponChannel getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxCouponTarget record); | |||
| void saveOrUpdate(WxCouponChannel record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -2,10 +2,10 @@ package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxOrders; | |||
| import com.simple.domain.po.WxOrder; | |||
| import com.simple.enums.EnumOrderStatus; | |||
| public interface WxOrdersService { | |||
| public interface WxOrderService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -15,14 +15,14 @@ public interface WxOrdersService { | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxOrders> listAsPage(WxOrders record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 提交订单 | |||
| * @param record | |||
| * @return 订单id | |||
| */ | |||
| WxOrders saveOrder(WxOrders record); | |||
| WxOrder saveOrder(WxOrder record); | |||
| /** | |||
| * 更新订单状态 | |||
| @@ -37,14 +37,14 @@ public interface WxOrdersService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxOrders getById(Long id); | |||
| WxOrder getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxOrders record); | |||
| void saveOrUpdate(WxOrder record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -2,9 +2,9 @@ package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxFlashSale; | |||
| import com.simple.domain.po.WxPayOrder; | |||
| public interface WxFlashSaleService { | |||
| public interface WxPayOrderService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -14,7 +14,7 @@ public interface WxFlashSaleService { | |||
| * @param limit | |||
| * @return | |||
| */ | |||
| PageInfo<WxFlashSale> listAsPage(WxFlashSale record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxPayOrder> listAsPage(WxPayOrder record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -22,14 +22,14 @@ public interface WxFlashSaleService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxFlashSale getById(Long id); | |||
| WxPayOrder getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxFlashSale record); | |||
| void saveOrUpdate(WxPayOrder record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -0,0 +1,54 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCouponChannel; | |||
| import com.simple.mapper.WxCouponChannelMapper; | |||
| import com.simple.service.WxCouponChannelService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| @Autowired | |||
| WxCouponChannelMapper wxCouponChannelMapper; | |||
| @Override | |||
| public PageInfo<WxCouponChannel> listAsPage(WxCouponChannel record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponChannelMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxCouponChannel getById(Long id) { | |||
| return wxCouponChannelMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxCouponChannel record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| IdWorker idWorker = new IdWorker(0, 0); | |||
| record.setId(idWorker.nextId()); | |||
| wxCouponChannelMapper.insertSelective(record); | |||
| } else { | |||
| wxCouponChannelMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxCouponChannelMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -1,54 +0,0 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCouponTarget; | |||
| import com.simple.mapper.WxCouponTargetMapper; | |||
| import com.simple.service.WxCouponTargetService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxCouponTargetServiceImpl implements WxCouponTargetService { | |||
| @Autowired | |||
| WxCouponTargetMapper wxCouponTargetMapper; | |||
| @Override | |||
| public PageInfo<WxCouponTarget> listAsPage(WxCouponTarget record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponTargetMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxCouponTarget getById(Long id) { | |||
| return wxCouponTargetMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxCouponTarget record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxCouponTargetMapper.insertSelective(record); | |||
| } else { | |||
| wxCouponTargetMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxCouponTargetMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -1,54 +0,0 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxFlashSale; | |||
| import com.simple.mapper.WxFlashSaleMapper; | |||
| import com.simple.service.WxFlashSaleService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxFlashSaleServiceImpl implements WxFlashSaleService { | |||
| @Autowired | |||
| WxFlashSaleMapper wxFlashSaleMapper; | |||
| @Override | |||
| public PageInfo<WxFlashSale> listAsPage(WxFlashSale record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFlashSaleMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxFlashSale getById(Long id) { | |||
| return wxFlashSaleMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxFlashSale record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxFlashSaleMapper.insertSelective(record); | |||
| } else { | |||
| wxFlashSaleMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxFlashSaleMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -3,29 +3,28 @@ package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxOrders; | |||
| import com.simple.domain.po.WxOrder; | |||
| import com.simple.enums.EnumOrderStatus; | |||
| import com.simple.mapper.WxOrdersMapper; | |||
| import com.simple.service.WxOrdersService; | |||
| import com.simple.utils.Utility; | |||
| import com.simple.mapper.WxOrderMapper; | |||
| import com.simple.service.WxOrderService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxOrdersServiceImpl implements WxOrdersService { | |||
| public class WxOrderServiceImpl implements WxOrderService { | |||
| @Autowired | |||
| WxOrdersMapper wxOrdersMapper; | |||
| WxOrderMapper wxOrderMapper; | |||
| @Override | |||
| public PageInfo<WxOrders> listAsPage(WxOrders record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrdersMapper.findList(record)); | |||
| public PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxOrders saveOrder(WxOrders record) { | |||
| public WxOrder saveOrder(WxOrder record) { | |||
| // 检查 优惠券 库存 | |||
| // 保存订单 | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| @@ -34,38 +33,38 @@ public class WxOrdersServiceImpl implements WxOrdersService { | |||
| Date curr = new Date(); | |||
| record.setCreateDate(curr); | |||
| record.setUpdateDate(curr); | |||
| wxOrdersMapper.insertSelective(record); | |||
| wxOrderMapper.insertSelective(record); | |||
| return record; | |||
| } | |||
| @Override | |||
| public void updateOrderStatus(Long orderId,EnumOrderStatus enumOrderStatus) { | |||
| WxOrders record = wxOrdersMapper.selectByPrimaryKey(orderId); | |||
| WxOrder record = wxOrderMapper.selectByPrimaryKey(orderId); | |||
| record.setStatus(enumOrderStatus.getCode()); | |||
| record.setUpdateDate(new Date()); | |||
| wxOrdersMapper.updateByPrimaryKey(record); | |||
| wxOrderMapper.updateByPrimaryKey(record); | |||
| } | |||
| @Override | |||
| public WxOrders getById(Long id) { | |||
| return wxOrdersMapper.selectByPrimaryKey(id); | |||
| public WxOrder getById(Long id) { | |||
| return wxOrderMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxOrders record) { | |||
| public void saveOrUpdate(WxOrder record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| IdWorker idWorker = new IdWorker(0, 0); | |||
| record.setId(idWorker.nextId()); | |||
| wxOrdersMapper.insertSelective(record); | |||
| wxOrderMapper.insertSelective(record); | |||
| } else { | |||
| wxOrdersMapper.updateByPrimaryKeySelective(record); | |||
| wxOrderMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxOrdersMapper.deleteByPrimaryKey(id); | |||
| wxOrderMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @@ -0,0 +1,54 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxPayOrder; | |||
| import com.simple.mapper.WxPayOrderMapper; | |||
| import com.simple.service.WxPayOrderService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| @Autowired | |||
| WxPayOrderMapper wxPayOrderMapper; | |||
| @Override | |||
| public PageInfo<WxPayOrder> listAsPage(WxPayOrder record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPayOrderMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxPayOrder getById(Long id) { | |||
| return wxPayOrderMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxPayOrder record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| IdWorker idWorker = new IdWorker(0, 0); | |||
| record.setId(idWorker.nextId()); | |||
| wxPayOrderMapper.insertSelective(record); | |||
| } else { | |||
| wxPayOrderMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxPayOrderMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -1,7 +1,7 @@ | |||
| <?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="com.simple.mapper.WxCouponTargetMapper"> | |||
| <resultMap id="BaseResultMap" type="com.simple.domain.po.WxCouponTarget"> | |||
| <mapper namespace="com.simple.mapper.WxCouponChannelMapper"> | |||
| <resultMap id="BaseResultMap" type="com.simple.domain.po.WxCouponChannel"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||
| @@ -73,8 +73,8 @@ | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.simple.domain.po.WxCouponTarget" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_coupon_target | |||
| <select id="findList" parameterType="com.simple.domain.po.WxCouponChannel" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_coupon_channel | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| @@ -1,68 +0,0 @@ | |||
| <?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="com.simple.mapper.WxFlashSaleMapper"> | |||
| <resultMap id="BaseResultMap" type="com.simple.domain.po.WxFlashSale"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="activity_id" jdbcType="BIGINT" property="activityId" /> | |||
| <result column="is_enable" jdbcType="INTEGER" property="isEnable" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="up_date" jdbcType="TIMESTAMP" property="upDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`activity_id`,`is_enable`,`create_date`,`up_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||
| </if> | |||
| <if test=" null != activityId "> | |||
| and `activity_id` = #{activityId} | |||
| </if> | |||
| <if test=" null != isEnable "> | |||
| and `is_enable` = #{isEnable} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != upDate "> | |||
| and `up_date` = #{upDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.simple.domain.po.WxFlashSale" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_flash_sale | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,23 +1,23 @@ | |||
| <?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="com.simple.mapper.WxOrdersMapper"> | |||
| <resultMap id="BaseResultMap" type="com.simple.domain.po.WxOrders"> | |||
| <mapper namespace="com.simple.mapper.WxOrderMapper"> | |||
| <resultMap id="BaseResultMap" type="com.simple.domain.po.WxOrder"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | |||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | |||
| <result column="payment" jdbcType="DECIMAL" property="payment" /> | |||
| <result column="coupon_status" jdbcType="INTEGER" property="couponStatus" /> | |||
| <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="valid_date" jdbcType="TIMESTAMP" property="validDate" /> | |||
| <result column="refund_start_date" jdbcType="TIMESTAMP" property="refundStartDate" /> | |||
| <result column="refund_end_date" jdbcType="TIMESTAMP" property="refundEndDate" /> | |||
| <result column="coupon_status" jdbcType="INTEGER" property="couponStatus" /> | |||
| <result column="refund" jdbcType="INTEGER" property="refund" /> | |||
| <result column="refund_time" jdbcType="TIMESTAMP" property="refundTime" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`coupon_id`,`c_user_id`,`payment`,`coupon_status`,`status`,`valid_date`,`refund_start_date`,`refund_end_date`,`create_date`,`update_date` | |||
| `id`,`tenant_id`,`coupon_id`,`c_user_id`,`payment`,`payment_time`,`status`,`coupon_status`,`refund`,`refund_time`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -48,8 +48,8 @@ | |||
| </if> | |||
| <if test=" null != couponStatus "> | |||
| and `coupon_status` = #{couponStatus} | |||
| <if test=" null != paymentTime "> | |||
| and `payment_time` = #{paymentTime} | |||
| </if> | |||
| @@ -58,18 +58,18 @@ | |||
| </if> | |||
| <if test=" null != validDate "> | |||
| and `valid_date` = #{validDate} | |||
| <if test=" null != couponStatus "> | |||
| and `coupon_status` = #{couponStatus} | |||
| </if> | |||
| <if test=" null != refundStartDate "> | |||
| and `refund_start_date` = #{refundStartDate} | |||
| <if test=" null != refund "> | |||
| and `refund` = #{refund} | |||
| </if> | |||
| <if test=" null != refundEndDate "> | |||
| and `refund_end_date` = #{refundEndDate} | |||
| <if test=" null != refundTime "> | |||
| and `refund_time` = #{refundTime} | |||
| </if> | |||
| @@ -91,8 +91,8 @@ | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.simple.domain.po.WxOrders" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_orders | |||
| <select id="findList" parameterType="com.simple.domain.po.WxOrder" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_order | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| @@ -0,0 +1,116 @@ | |||
| <?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="com.simple.mapper.WxPayOrderMapper"> | |||
| <resultMap id="BaseResultMap" type="com.simple.domain.po.WxPayOrder"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="BIGINT" property="tenantId" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
| <result column="order_id" jdbcType="BIGINT" property="orderId" /> | |||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | |||
| <result column="pay_amount" jdbcType="INTEGER" property="payAmount" /> | |||
| <result column="pay_time_start" jdbcType="INTEGER" property="payTimeStart" /> | |||
| <result column="pay_time_end" jdbcType="INTEGER" property="payTimeEnd" /> | |||
| <result column="pay_channel" jdbcType="INTEGER" property="payChannel" /> | |||
| <result column="pay_way" jdbcType="INTEGER" property="payWay" /> | |||
| <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="fail_reason" jdbcType="VARCHAR" property="failReason" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`pay_amount`,`pay_time_start`,`pay_time_end`,`pay_channel`,`pay_way`,`pay_order_no`,`status`,`fail_reason` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != updateTime "> | |||
| and `update_time` = #{updateTime} | |||
| </if> | |||
| <if test=" null != orderId "> | |||
| and `order_id` = #{orderId} | |||
| </if> | |||
| <if test=" null != cUserId "> | |||
| and `c_user_id` = #{cUserId} | |||
| </if> | |||
| <if test=" null != payAmount "> | |||
| and `pay_amount` = #{payAmount} | |||
| </if> | |||
| <if test=" null != payTimeStart "> | |||
| and `pay_time_start` = #{payTimeStart} | |||
| </if> | |||
| <if test=" null != payTimeEnd "> | |||
| and `pay_time_end` = #{payTimeEnd} | |||
| </if> | |||
| <if test=" null != payChannel "> | |||
| and `pay_channel` = #{payChannel} | |||
| </if> | |||
| <if test=" null != payWay "> | |||
| and `pay_way` = #{payWay} | |||
| </if> | |||
| <if test=" null != payOrderNo "> | |||
| and `pay_order_no` like concat('%', #{payOrderNo},'%') | |||
| </if> | |||
| <if test=" null != status "> | |||
| and `status` = #{status} | |||
| </if> | |||
| <if test=" null != failReason "> | |||
| and `fail_reason` like concat('%', #{failReason},'%') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.simple.domain.po.WxPayOrder" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_pay_order | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||