| @@ -79,8 +79,7 @@ public class WxCampaignController extends BaseController { | |||||
| } | } | ||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | ||||
| wxCampaignService.saveOrUpdate(wxCampaign); | |||||
| return new ResultData(); | |||||
| return wxCampaignService.saveOrUpdate(wxCampaign); | |||||
| } | } | ||||
| @ApiOperation(value = "新增接口-小程序路径", notes = "produceType,produceId,pagePath,pageScene必填") | @ApiOperation(value = "新增接口-小程序路径", notes = "produceType,produceId,pagePath,pageScene必填") | ||||
| @@ -90,8 +89,17 @@ public class WxCampaignController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::addByPath"); | logger.debug("[" + getIpAddr() + "] WxCampaignController::addByPath"); | ||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | ||||
| wxCampaignService.addForPath(wxCampaign); | |||||
| return new ResultData(); | |||||
| return wxCampaignService.addForPath(wxCampaign); | |||||
| } | |||||
| @ApiOperation(value = "新增接口-小程序路径", notes = "produceType,produceId,pagePath,pageScene必填") | |||||
| @PostMapping("addByAPPPath") | |||||
| @SystemControllerLog(description = "宣传页-新增") | |||||
| public ResultData addByAPPPath(@RequestBody WxCampaign wxCampaign) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::addByAPPPath"); | |||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||||
| wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | |||||
| return wxCampaignService.addByAPPPath(wxCampaign); | |||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @@ -0,0 +1,2 @@ | |||||
| ALTER TABLE `wx_campaign` | |||||
| ADD COLUMN `go_appid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '小程序跳转路径,类型4适用' AFTER `page_scene`; | |||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.RedisCache; | |||||
| import com.iformall.annotation.TenantIgnore; | import com.iformall.annotation.TenantIgnore; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| @@ -32,6 +33,7 @@ public class WxMiniappThemeController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxMiniappThemeService wxMiniappThemeService; | WxMiniappThemeService wxMiniappThemeService; | ||||
| @RedisCache | |||||
| @ApiOperation("查询MiniappTheme列表") | @ApiOperation("查询MiniappTheme列表") | ||||
| @GetMapping(value = "/getOne") | @GetMapping(value = "/getOne") | ||||
| @TenantIgnore | @TenantIgnore | ||||
| @@ -73,6 +73,8 @@ public class WxCampaign extends TenantEntity { | |||||
| private String pagePath; | private String pagePath; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "小程序跳转二维码,类型3适用", name = "pageScene") | @io.swagger.annotations.ApiModelProperty(value = "小程序跳转二维码,类型3适用", name = "pageScene") | ||||
| private String pageScene; | private String pageScene; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "小程序跳转路径,类型4适用", name = "goAppid") | |||||
| private String goAppid; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="营销物料-小程序路径",name="weappPath") | @io.swagger.annotations.ApiModelProperty(value="营销物料-小程序路径",name="weappPath") | ||||
| @@ -8,6 +8,7 @@ public enum EnumCampaignType { | |||||
| STABLE(1, "固定格式"), | STABLE(1, "固定格式"), | ||||
| FREE(2, "自由图文"), | FREE(2, "自由图文"), | ||||
| PAGEPATH(3, "小程序路径"), | PAGEPATH(3, "小程序路径"), | ||||
| TAPPPATH(4, "第三方小程序路径"), | |||||
| ; | ; | ||||
| public static EnumCampaignType getEnum(Integer code) { | public static EnumCampaignType getEnum(Integer code) { | ||||
| @@ -17,7 +17,8 @@ public enum EnumScoreType { | |||||
| SPEND_CREDIT(10, "新增积分"), | SPEND_CREDIT(10, "新增积分"), | ||||
| CHANGE_CREDIT(11, "积分兑换"), | CHANGE_CREDIT(11, "积分兑换"), | ||||
| REDUCE_CREDIT(12, "消费积分"), | REDUCE_CREDIT(12, "消费积分"), | ||||
| ACTIVITY_JOIN(13, "活动报名"),; | |||||
| ACTIVITY_JOIN(13, "活动报名"), | |||||
| CLEAN_CREDIT(14, "积分清零计划"),; | |||||
| public static EnumScoreType getEnum(Integer code) { | public static EnumScoreType getEnum(Integer code) { | ||||
| for (EnumScoreType value : values()) { | for (EnumScoreType value : values()) { | ||||
| @@ -66,4 +66,5 @@ public interface WxCampaignService { | |||||
| void printHtmlById(Long id, HttpServletResponse response); | void printHtmlById(Long id, HttpServletResponse response); | ||||
| ResultData addByAPPPath(WxCampaign wxCampaign); | |||||
| } | } | ||||
| @@ -104,7 +104,28 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||||
| if (length >= 0xFFFFFF) { //Mysql MiddleText length limited | if (length >= 0xFFFFFF) { //Mysql MiddleText length limited | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "图文内容过大无法保存"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "图文内容过大无法保存"); | ||||
| } | } | ||||
| } else { | |||||
| } else if(wxCampaign.getType().equals(EnumCampaignType.PAGEPATH.getCode())) { | |||||
| if (StringUtils.isBlank(wxCampaign.getCoverImg())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "封面图不能为空"); | |||||
| } | |||||
| if (wxCampaign.getProduceType() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "produceType不能为空"); | |||||
| } | |||||
| if (wxCampaign.getProduceType().equals(EnumCampaignProductType.ACTIVITY_JOIN.getCode()) | |||||
| && wxCampaign.getProduceId() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "produceId不能为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(wxCampaign.getPagePath())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "pagePath不能为空"); | |||||
| } | |||||
| }else if(wxCampaign.getType().equals(EnumCampaignType.TAPPPATH.getCode())) { | |||||
| if (StringUtils.isBlank(wxCampaign.getCoverImg())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "封面图不能为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(wxCampaign.getGoAppid())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "小程序跳转路径不能为空"); | |||||
| } | |||||
| }else { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| @@ -328,5 +349,28 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public ResultData addByAPPPath(WxCampaign wxCampaign) { | |||||
| if(wxCampaign.getType().equals(EnumCampaignType.TAPPPATH.getCode())) { | |||||
| if (StringUtils.isBlank(wxCampaign.getCoverImg())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "封面图不能为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(wxCampaign.getGoAppid())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "小程序跳转路径不能为空"); | |||||
| } | |||||
| } else { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||||
| } | |||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||||
| if (wxCampaign.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| wxCampaign.setId(idWorker.nextId()); | |||||
| wxCampaignMapper.insert(wxCampaign); | |||||
| } else { | |||||
| wxCampaignMapper.updateById(wxCampaign); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS,"操作成功"); | |||||
| } | |||||
| } | } | ||||
| @@ -28,21 +28,23 @@ | |||||
| <result column="produce_id" jdbcType="BIGINT" property="produceId"/> | <result column="produce_id" jdbcType="BIGINT" property="produceId"/> | ||||
| <result column="page_path" jdbcType="BIGINT" property="pagePath"/> | <result column="page_path" jdbcType="BIGINT" property="pagePath"/> | ||||
| <result column="page_scene" jdbcType="BIGINT" property="pageScene"/> | <result column="page_scene" jdbcType="BIGINT" property="pageScene"/> | ||||
| <result column="go_appid" jdbcType="VARCHAR" property="goAppid"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`, | `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`, | ||||
| `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`html`, | `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`html`, | ||||
| `produce_type`,`produce_id`,`page_path`,`page_scene` | |||||
| `produce_type`,`produce_id`,`page_path`,`page_scene`,`go_appid` | |||||
| </sql> | </sql> | ||||
| <sql id="allCHeadColumns"> | <sql id="allCHeadColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`type`,`sort_num`,`page_path` | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`type`,`sort_num`,`page_path`,`go_appid` | |||||
| </sql> | </sql> | ||||
| <sql id="allAHeadColumns"> | <sql id="allAHeadColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`, | `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`, | ||||
| `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`page_path` | |||||
| `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`page_path`,`go_appid` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||