| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCouponOrder; | import com.simple.domain.po.WxCouponOrder; | ||||
| import com.simple.domain.vo.WxCouponOrderBVo; | |||||
| import com.simple.service.WxCouponOrderService; | import com.simple.service.WxCouponOrderService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -29,39 +30,10 @@ public class WxCouponOrderController extends BaseController | |||||
| @ApiImplicitParam(name="pageNum",value="页数",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)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCouponOrder) wxCouponOrder = new WxCouponOrder(); | |||||
| final PageInfo<WxCouponOrder> page = wxCouponOrderService.listAsPage(wxCouponOrder, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| if (wxCouponOrder == null) wxCouponOrder= new WxCouponOrder(); | |||||
| wxCouponOrder.setTenantId(getTenantId()); | |||||
| return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | |||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxCouponOrder wxCouponOrder) { | |||||
| //Assert.notNull(wxCouponOrder.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxCouponOrderService.saveOrUpdate(wxCouponOrder); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxCouponOrder wxCouponOrder) { | |||||
| wxCouponOrderService.saveOrUpdate(wxCouponOrder); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxCouponOrderService.deleteById(id); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @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,"查询成功",wxCouponOrderService.getById(id)); | |||||
| } | |||||
| } | } | ||||
| @@ -34,15 +34,15 @@ public class WxDateAmountRecordController extends BaseController | |||||
| private WxDateAmountRecordService wxDateAmountRecordService; | private WxDateAmountRecordService wxDateAmountRecordService; | ||||
| private Logger logger = Logger.getLogger(WxDateAmountRecordController.class); | private Logger logger = Logger.getLogger(WxDateAmountRecordController.class); | ||||
| @ApiOperation("首页查询交易金额记录接口") | |||||
| @ApiOperation("首页查询交易金额记录接口") | |||||
| @GetMapping("listOrder") | @GetMapping("listOrder") | ||||
| public ResultData listOrder() { | public ResultData listOrder() { | ||||
| return list(0); | return list(0); | ||||
| } | } | ||||
| @ApiOperation("首页查询交易金额记录接口") | |||||
| @ApiOperation("首页查询核销金额记录接口") | |||||
| @GetMapping("listVerified") | @GetMapping("listVerified") | ||||
| public ResultData listVerified() { | public ResultData listVerified() { | ||||
| return list(1); | return list(1); | ||||
| @@ -57,6 +57,7 @@ public class WxDateAmountRecordController extends BaseController | |||||
| temp.setTenantId(u.getTenantId()); | temp.setTenantId(u.getTenantId()); | ||||
| temp.setMerchantId(u.getMerchantId()); | temp.setMerchantId(u.getMerchantId()); | ||||
| temp.setType(verified); | temp.setType(verified); | ||||
| temp.setSortColumns(WxDateAmountRecord.Field.UpdateDate_ASC); | |||||
| SimpleDateFormat fmt = new SimpleDateFormat("MM/dd"); | SimpleDateFormat fmt = new SimpleDateFormat("MM/dd"); | ||||
| @@ -19,4 +19,6 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||||
| List<WxCouponOrderCVo> findListOfCUser(Map paramMap); | List<WxCouponOrderCVo> findListOfCUser(Map paramMap); | ||||
| WxCouponOrderCVo selectDetailOfCUser(Map paramMap); | WxCouponOrderCVo selectDetailOfCUser(Map paramMap); | ||||
| List<WxCouponOrderCVo> findListOfAdmin(WxCouponOrder wxCouponOrder); | |||||
| } | } | ||||
| @@ -95,4 +95,16 @@ public interface WxCouponOrderService { | |||||
| * @param bUserId B端用户 | * @param bUserId B端用户 | ||||
| */ | */ | ||||
| ResultData detailBUserVo(Long bUserId, String couponOrderId); | ResultData detailBUserVo(Long bUserId, String couponOrderId); | ||||
| /** | |||||
| * A端查询分页列表 | |||||
| * | |||||
| * @param wxCouponOrder | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| ResultData listAdminAsPage(WxCouponOrder wxCouponOrder, Integer pageIndex, Integer pageSize); | |||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.simple.common.IdWorker; | |||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.*; | import com.simple.domain.po.*; | ||||
| import com.simple.domain.vo.WxCouponOrderBVo; | |||||
| import com.simple.domain.vo.WxCouponOrderCVo; | import com.simple.domain.vo.WxCouponOrderCVo; | ||||
| import com.simple.enums.EnumCouponOrderStatus; | import com.simple.enums.EnumCouponOrderStatus; | ||||
| import com.simple.enums.EnumCouponStatus; | import com.simple.enums.EnumCouponStatus; | ||||
| @@ -47,6 +48,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findList(record)); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public WxCouponOrder getById(Long id) { | public WxCouponOrder getById(Long id) { | ||||
| return wxCouponOrderMapper.selectByPrimaryKey(id); | return wxCouponOrderMapper.selectByPrimaryKey(id); | ||||
| @@ -209,6 +212,11 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| return new ResultData(wxCouponOrderCVo); | return new ResultData(wxCouponOrderCVo); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData listAdminAsPage(WxCouponOrder wxCouponOrder, Integer pageIndex, Integer pageSize) { | |||||
| return new ResultData(PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfAdmin(wxCouponOrder))); | |||||
| } | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @@ -169,6 +169,74 @@ | |||||
| order by co.update_date desc | order by co.update_date desc | ||||
| </select> | </select> | ||||
| <select id="findListOfAdmin" parameterType="com.simple.domain.po.WxCouponOrder" resultMap="BVoResultMap"> | |||||
| select <include refid="allBUserVerifiedCouponOrderColumns" /> | |||||
| from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_merchant_b_user bu | |||||
| where o.id = co.order_id | |||||
| and co.coupon_id = c.id | |||||
| and cu.id = co.c_user_id | |||||
| and bu.id = co.b_user_id | |||||
| <if test=" null != id "> | |||||
| and co.id = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and co.tenant_id = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != couponId "> | |||||
| and co.coupon_id = #{couponId} | |||||
| </if> | |||||
| <if test=" null != cUserId "> | |||||
| and co.c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test=" null != bUserId "> | |||||
| and co.b_user_id = #{bUserId} | |||||
| </if> | |||||
| <if test=" null != orderId "> | |||||
| and co.order_id = #{orderId} | |||||
| </if> | |||||
| <if test=" null != expiredTime "> | |||||
| and co.expired_time = #{expiredTime} | |||||
| </if> | |||||
| <if test=" null != couponOrderStatus "> | |||||
| and co.coupon_order_status = #{couponOrderStatus} | |||||
| </if> | |||||
| <if test=" null != createDate "> | |||||
| and co.create_date = #{createDate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and co.update_date = #{updateDate} | |||||
| </if> | |||||
| <if test=" null != couponPrice "> | |||||
| and co.coupon_price = #{couponPrice} | |||||
| </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> | |||||
| </select> | |||||
| <select id="findListOfUnverifiedByDate" parameterType="map" resultMap="BaseResultMap"> | <select id="findListOfUnverifiedByDate" parameterType="map" resultMap="BaseResultMap"> | ||||
| select <include refid="allCouponOrderColumns" /> | select <include refid="allCouponOrderColumns" /> | ||||