| @@ -57,6 +57,9 @@ public class WxCampaignController extends BaseController { | |||
| if (wxCampaign.getStatus() != null && wxCampaign.getStatus() == -1) { | |||
| wxCampaign.setStatus(null); | |||
| } | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.WX.getCode()); | |||
| } | |||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||
| wxCampaign.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | |||
| @@ -76,7 +79,10 @@ public class WxCampaignController extends BaseController { | |||
| } | |||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||
| return wxCampaignService.saveOrUpdate(wxCampaign, EnumProjectPlat.FM); | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.WX.getCode()); | |||
| } | |||
| return wxCampaignService.saveOrUpdate(wxCampaign); | |||
| } | |||
| @ApiOperation(value = "新增接口-小程序路径", notes = "produceType,produceId,pagePath,pageScene必填") | |||
| @@ -86,6 +92,9 @@ public class WxCampaignController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::addByPath"); | |||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.WX.getCode()); | |||
| } | |||
| return wxCampaignService.addForPath(wxCampaign); | |||
| } | |||
| @@ -96,6 +105,9 @@ public class WxCampaignController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::addByAPPPath"); | |||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.WX.getCode()); | |||
| } | |||
| return wxCampaignService.addByAPPPath(wxCampaign); | |||
| } | |||
| @@ -110,7 +122,10 @@ public class WxCampaignController extends BaseController { | |||
| } else { | |||
| wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | |||
| } | |||
| return wxCampaignService.saveOrUpdate(wxCampaign,EnumProjectPlat.FM); | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.WX.getCode()); | |||
| } | |||
| return wxCampaignService.saveOrUpdate(wxCampaign); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @@ -141,7 +156,8 @@ public class WxCampaignController extends BaseController { | |||
| } | |||
| } | |||
| } | |||
| return wxCampaignService.updateStatus(wxCampaign,EnumProjectPlat.FM); | |||
| wxCampaign.setPlat(campaign.getPlat()); | |||
| return wxCampaignService.updateStatus(wxCampaign); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @@ -189,8 +205,8 @@ public class WxCampaignController extends BaseController { | |||
| int temp = source.getSortNum(); | |||
| source.setSortNum(target.getSortNum()); | |||
| target.setSortNum(temp); | |||
| wxCampaignService.saveOrUpdate(source,EnumProjectPlat.FM); | |||
| wxCampaignService.saveOrUpdate(target,EnumProjectPlat.FM); | |||
| wxCampaignService.saveOrUpdate(source); | |||
| wxCampaignService.saveOrUpdate(target); | |||
| return new ResultData(Result.SUCCESS, "调整顺序成功", null); | |||
| } | |||
| @@ -0,0 +1,3 @@ | |||
| ALTER TABLE `mallink`.`wx_campaign` | |||
| ADD COLUMN `plat` smallint(2) DEFAULT 1 AFTER `go_appid`; | |||
| -----历史数据处理 | |||
| @@ -79,6 +79,8 @@ public class WxCampaign extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "小程序跳转路径,类型4适用", name = "goAppid") | |||
| private String goAppid; | |||
| private Integer plat; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="营销物料-小程序路径",name="weappPath") | |||
| protected String weappPath; | |||
| @@ -46,7 +46,7 @@ public interface WxCampaignService { | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(WxCampaign record, EnumProjectPlat projectPlat); | |||
| ResultData saveOrUpdate(WxCampaign record); | |||
| /** | |||
| * 基于小程序路径发布 | |||
| @@ -64,8 +64,7 @@ public interface WxCampaignService { | |||
| int getMaxSortNum(TenantEntity tenantEntity); | |||
| ResultData updateStatus(WxCampaign wxCampaign,EnumProjectPlat projectPlat); | |||
| ResultData updateStatus(WxCampaign wxCampaign); | |||
| void printHtmlById(Long id, HttpServletResponse response); | |||
| @@ -90,7 +90,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData saveOrUpdate(WxCampaign wxCampaign,EnumProjectPlat projectPlat) { | |||
| public ResultData saveOrUpdate(WxCampaign wxCampaign) { | |||
| if(wxCampaign.getType().equals(EnumCampaignType.STABLE.getCode())) { | |||
| if (StringUtils.isEmpty(wxCampaign.getCoverImg())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "封面图不能为空"); | |||
| @@ -140,7 +140,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||
| } else { | |||
| wxCampaignMapper.updateById(wxCampaign); | |||
| } | |||
| if(EnumProjectPlat.FM.equals(projectPlat)){ | |||
| if(EnumAppPlat.WX.getCode().equals(wxCampaign.getPlat())){ | |||
| //type 为固定格式才会有券的信息 才会有投放的问题 | |||
| couponInject(wxCampaign); | |||
| } | |||
| @@ -182,13 +182,13 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData updateStatus(WxCampaign wxCampaign,EnumProjectPlat projectPlat) { | |||
| public ResultData updateStatus(WxCampaign wxCampaign) { | |||
| wxCampaignMapper.updateById(wxCampaign); | |||
| if (wxCampaign.getType().equals(EnumCampaignType.PAGEPATH.getCode())) { | |||
| WxCampaign campaign = wxCampaignMapper.selectById(wxCampaign.getId()); | |||
| this.updateOtherStatus(campaign.getProduceId(),campaign.getStatus(),campaign.getProduceType()); | |||
| } | |||
| if(EnumProjectPlat.FM.equals(projectPlat)){ | |||
| if(EnumAppPlat.WX.getCode().equals(wxCampaign.getPlat())){ | |||
| //type 为固定格式才会有券的信息 才会有投放的问题 | |||
| couponInject(wxCampaign); | |||
| } | |||
| @@ -30,21 +30,22 @@ | |||
| <result column="page_scene" jdbcType="BIGINT" property="pageScene"/> | |||
| <result column="go_appid" jdbcType="VARCHAR" property="goAppid"/> | |||
| <result column="plat" jdbcType="INTEGER" property="plat"/> | |||
| </resultMap> | |||
| <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`, | |||
| `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`html`, | |||
| `produce_type`,`produce_id`,`page_path`,`page_scene`,`go_appid` | |||
| `produce_type`,`produce_id`,`page_path`,`page_scene`,`go_appid`,`plat` | |||
| </sql> | |||
| <sql id="allCHeadColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`type`,`sort_num`,`page_path`,`go_appid` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`type`,`sort_num`,`page_path`,`go_appid`,`plat` | |||
| </sql> | |||
| <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`, | |||
| `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`page_path`,`go_appid` | |||
| `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`page_path`,`go_appid`,`plat` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -100,6 +101,9 @@ | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != plat "> | |||
| and `plat` = #{plat} | |||
| </if> | |||
| <if test=" null != couponIds "> | |||
| and `coupon_ids` like concat('%', #{couponIds},'%') | |||
| @@ -64,6 +64,9 @@ public class WxCampaignController extends BaseController { | |||
| } | |||
| wxCampaign.updateTenantInfo(ifParentUpdateTenantInfo()); | |||
| wxCampaign.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.TOUTIAO.getCode()); | |||
| } | |||
| final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -81,7 +84,10 @@ public class WxCampaignController extends BaseController { | |||
| } | |||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||
| wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | |||
| return wxCampaignService.saveOrUpdate(wxCampaign, EnumProjectPlat.TT); | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.TOUTIAO.getCode()); | |||
| } | |||
| return wxCampaignService.saveOrUpdate(wxCampaign); | |||
| } | |||
| @ApiOperation(value = "新增接口-小程序路径", notes = "produceType,produceId,pagePath,pageScene必填") | |||
| @@ -116,7 +122,10 @@ public class WxCampaignController extends BaseController { | |||
| } else { | |||
| wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | |||
| } | |||
| return wxCampaignService.saveOrUpdate(wxCampaign, EnumProjectPlat.TT); | |||
| if(wxCampaign.getPlat() == null){ | |||
| wxCampaign.setPlat(EnumAppPlat.TOUTIAO.getCode()); | |||
| } | |||
| return wxCampaignService.saveOrUpdate(wxCampaign); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @@ -148,7 +157,8 @@ public class WxCampaignController extends BaseController { | |||
| // } | |||
| // } | |||
| // } | |||
| return wxCampaignService.updateStatus(wxCampaign,EnumProjectPlat.TT); | |||
| wxCampaign.setPlat(campaign.getPlat()); | |||
| return wxCampaignService.updateStatus(wxCampaign); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @@ -203,8 +213,8 @@ public class WxCampaignController extends BaseController { | |||
| int temp = source.getSortNum(); | |||
| source.setSortNum(target.getSortNum()); | |||
| target.setSortNum(temp); | |||
| wxCampaignService.saveOrUpdate(source, EnumProjectPlat.TT); | |||
| wxCampaignService.saveOrUpdate(target, EnumProjectPlat.TT); | |||
| wxCampaignService.saveOrUpdate(source); | |||
| wxCampaignService.saveOrUpdate(target); | |||
| return new ResultData(Result.SUCCESS, "调整顺序成功", null); | |||
| } | |||
| @@ -101,8 +101,8 @@ public class WxCampaignController extends BaseController { | |||
| int temp = source.getSortNum(); | |||
| source.setSortNum(target.getSortNum()); | |||
| target.setSortNum(temp); | |||
| wxCampaignService.saveOrUpdate(source, EnumProjectPlat.TT); | |||
| wxCampaignService.saveOrUpdate(target, EnumProjectPlat.TT); | |||
| wxCampaignService.saveOrUpdate(source); | |||
| wxCampaignService.saveOrUpdate(target); | |||
| return new ResultData(Result.SUCCESS, "调整顺序成功", null); | |||
| } | |||