| @@ -250,12 +250,23 @@ public class WxCouponController extends BaseController { | |||||
| return result; | return result; | ||||
| } | } | ||||
| @TenantIgnore | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findDraftCoupon") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "券投放-查询") | |||||
| public ResultData findDraftCoupon(@RequestParam Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::findDraftCoupon"); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| return new ResultData(wxCouponService.getDraftCoupon(id,tenantEntity.getTenantId(),tenantEntity)); | |||||
| } | |||||
| @TenantIgnore | @TenantIgnore | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("updateOnlie") | |||||
| @PostMapping("updateByOnlie") | |||||
| @SystemControllerLog(description = "券投放-更新") | @SystemControllerLog(description = "券投放-更新") | ||||
| public ResultData updateOnlie(@RequestBody WxCoupon wxCoupon) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::update"); | |||||
| public ResultData updateByOnlie(@RequestBody WxCoupon wxCoupon) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::updateByOnlie"); | |||||
| if (wxCoupon.getId() == null) { | if (wxCoupon.getId() == null) { | ||||
| return new ResultData(ResultData.ERROR, "缺少id"); | return new ResultData(ResultData.ERROR, "缺少id"); | ||||
| } | } | ||||
| @@ -129,4 +129,6 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| WxCoupon selectDraftCoupon(@Param("couponId")Long id,@Param("tenantId")String tenantId); | WxCoupon selectDraftCoupon(@Param("couponId")Long id,@Param("tenantId")String tenantId); | ||||
| WxCoupon selectOnlineCoupon(@Param("id")Long id, @Param("tenantId")String tenantId); | WxCoupon selectOnlineCoupon(@Param("id")Long id, @Param("tenantId")String tenantId); | ||||
| Long selectDraftId(@Param("couponId")Long id,@Param("tenantId")String tenantId); | |||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| @@ -314,4 +315,6 @@ public interface WxCouponService { | |||||
| void handleDraftCoupon(WxCoupon wxCoupon); | void handleDraftCoupon(WxCoupon wxCoupon); | ||||
| WxCouponCVo getDraftCoupon(Long couponId, String tenantId, TenantEntity mallTenantEntity); | |||||
| } | } | ||||
| @@ -2208,5 +2208,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| @Override | |||||
| public WxCouponCVo getDraftCoupon(Long couponId, String tenantId, TenantEntity mallTenantEntity) { | |||||
| Long id = wxCouponMapper.selectDraftId(couponId,tenantId); | |||||
| if(id != null){ | |||||
| return getVoById(id,tenantId,mallTenantEntity); | |||||
| }else{ | |||||
| return getVoById(couponId,tenantId,mallTenantEntity); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -1614,4 +1614,11 @@ | |||||
| where id = #{id} and tenant_id = #{tenantId} | where id = #{id} and tenant_id = #{tenantId} | ||||
| </select> | </select> | ||||
| <select id="selectDraftId" parameterType="java.util.HashMap" resultType="Long"> | |||||
| select c.id | |||||
| from wx_coupon c | |||||
| where c.`version` = 1 and coupon_id = #{couponId} and tenant_id = #{tenantId} | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||