| @@ -88,7 +88,7 @@ public class WxCouponOrderController extends BaseController | |||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | logger.error("couponOrderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | ||||
| } | } | ||||
| return wxCouponOrderService.verify(couponOrderId, getUser()); | |||||
| return wxCouponOrderService.verify(couponOrderId, getUser().getId()); | |||||
| } | } | ||||
| @ApiOperation(value = "退券接口", notes = "{\"couponOrderId\":\"string\"}") | @ApiOperation(value = "退券接口", notes = "{\"couponOrderId\":\"string\"}") | ||||
| @@ -108,6 +108,6 @@ public class WxCouponOrderController extends BaseController | |||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | logger.error("couponOrderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | ||||
| } | } | ||||
| return wxCouponOrderService.refund(couponOrderId, getUser()); | |||||
| return wxCouponOrderService.refund(couponOrderId, getUser().getId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -44,17 +44,17 @@ public interface WxCouponOrderService { | |||||
| * 根据主键couponOrderId(券码)核销 | * 根据主键couponOrderId(券码)核销 | ||||
| * | * | ||||
| * @param couponOrderId | * @param couponOrderId | ||||
| * @param bUser 核销人(登录用户) | |||||
| * @param bUserId 核销人(登录用户) | |||||
| */ | */ | ||||
| ResultData verify(Long couponOrderId, WxMerchantBUser bUser); | |||||
| ResultData verify(Long couponOrderId, Long bUserId); | |||||
| /** | /** | ||||
| * 根据主键couponOrderId(券码)退券(款) | * 根据主键couponOrderId(券码)退券(款) | ||||
| * | * | ||||
| * @param couponOrderId | * @param couponOrderId | ||||
| * @param bUser 退券(款)人(登录用户) | |||||
| * @param bUserId 退券(款)人(登录用户) | |||||
| */ | */ | ||||
| ResultData refund(Long couponOrderId, WxMerchantBUser bUser); | |||||
| ResultData refund(Long couponOrderId, Long bUserId); | |||||
| @@ -32,7 +32,8 @@ public class MallPermissionServiceImpl implements MallPermissionService { | |||||
| public void saveOrUpdate(MallPermission record) { | public void saveOrUpdate(MallPermission record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | ||||
| record.setId(new IdWorker(0, 0).nextId()); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| mallPermissionMapper.insertSelective(record); | mallPermissionMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| mallPermissionMapper.updateByPrimaryKeySelective(record); | mallPermissionMapper.updateByPrimaryKeySelective(record); | ||||
| @@ -31,7 +31,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| public void saveOrUpdate(WxCUserBasicInfo record) { | public void saveOrUpdate(WxCUserBasicInfo record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | ||||
| IdWorker idWorker = new IdWorker(0, 0); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| wxCUserBasicInfoMapper.insertSelective(record); | wxCUserBasicInfoMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| @@ -43,7 +43,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| public void saveOrUpdate(WxCouponOrder record) { | public void saveOrUpdate(WxCouponOrder record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | ||||
| IdWorker idWorker = new IdWorker(0, 0); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| wxCouponOrderMapper.insertSelective(record); | wxCouponOrderMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| @@ -60,7 +60,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public ResultData verify(Long couponOrderId, WxMerchantBUser bUser) { | |||||
| public ResultData verify(Long couponOrderId, Long bUserId) { | |||||
| WxCouponOrder wxCouponOrder = wxCouponOrderMapper.selectByPrimaryKey(couponOrderId); | WxCouponOrder wxCouponOrder = wxCouponOrderMapper.selectByPrimaryKey(couponOrderId); | ||||
| if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode()) { | if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode()) { | ||||
| logger.error("已过期: couponOrder-" + couponOrderId); | logger.error("已过期: couponOrder-" + couponOrderId); | ||||
| @@ -76,7 +76,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| } | } | ||||
| try { | try { | ||||
| wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); //1核销 | wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); //1核销 | ||||
| wxCouponOrder.setBUserId(bUser.getId()); | |||||
| wxCouponOrder.setBUserId(bUserId); | |||||
| wxCouponOrder.setUpdateDate(new Date()); | wxCouponOrder.setUpdateDate(new Date()); | ||||
| wxCouponOrderMapper.updateByPrimaryKeySelective(wxCouponOrder); | wxCouponOrderMapper.updateByPrimaryKeySelective(wxCouponOrder); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -90,7 +90,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public ResultData refund(Long couponOrderId, WxMerchantBUser bUser) { | |||||
| public ResultData refund(Long couponOrderId, Long bUserId) { | |||||
| WxCouponOrder wxCouponOrder = wxCouponOrderMapper.selectByPrimaryKey(couponOrderId); | WxCouponOrder wxCouponOrder = wxCouponOrderMapper.selectByPrimaryKey(couponOrderId); | ||||
| if (wxCouponOrder.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode())) { | if (wxCouponOrder.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode())) { | ||||
| @@ -107,7 +107,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| } | } | ||||
| try { | try { | ||||
| wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_INVALID.getCode()); //3退款,券作废 | wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_INVALID.getCode()); //3退款,券作废 | ||||
| wxCouponOrder.setBUserId(bUser.getId()); | |||||
| wxCouponOrder.setBUserId(bUserId); | |||||
| wxCouponOrder.setUpdateDate(new Date()); | wxCouponOrder.setUpdateDate(new Date()); | ||||
| wxCouponOrderMapper.updateByPrimaryKeySelective(wxCouponOrder); | wxCouponOrderMapper.updateByPrimaryKeySelective(wxCouponOrder); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -31,7 +31,7 @@ public class WxDateAmountRecordServiceImpl implements WxDateAmountRecordService | |||||
| public void saveOrUpdate(WxDateAmountRecord record) { | public void saveOrUpdate(WxDateAmountRecord record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | ||||
| IdWorker idWorker = new IdWorker(0, 0); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| wxDateAmountRecordMapper.insertSelective(record); | wxDateAmountRecordMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| @@ -174,6 +174,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| try { | try { | ||||
| WxCouponOrder couponOrder = new WxCouponOrder(); | WxCouponOrder couponOrder = new WxCouponOrder(); | ||||
| couponOrder.setId(idWorker.nextId()); | couponOrder.setId(idWorker.nextId()); | ||||
| couponOrder.setTenantId(user.getTenantId()); | |||||
| couponOrder.setCouponId(couponId); | couponOrder.setCouponId(couponId); | ||||
| couponOrder.setCUserId(user.getId()); | couponOrder.setCUserId(user.getId()); | ||||
| couponOrder.setOrderId(orderNumber); | couponOrder.setOrderId(orderNumber); | ||||
| @@ -401,7 +401,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| public void saveOrUpdate(WxPayOrder record) { | public void saveOrUpdate(WxPayOrder record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | ||||
| IdWorker idWorker = new IdWorker(0, 0); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| wxPayOrderMapper.insertSelective(record); | wxPayOrderMapper.insertSelective(record); | ||||
| } else { | } else { | ||||