| @@ -10,7 +10,6 @@ import com.iformall.enums.EnumCampaignStatus; | |||||
| import com.iformall.enums.EnumCouponChannelType; | import com.iformall.enums.EnumCouponChannelType; | ||||
| import com.iformall.service.WxCampaignService; | import com.iformall.service.WxCampaignService; | ||||
| import com.iformall.service.WxCouponChannelService; | import com.iformall.service.WxCouponChannelService; | ||||
| import com.iformall.service.WxCouponService; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -38,8 +37,6 @@ public class WxCampaignController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCampaignService wxCampaignService; | private WxCampaignService wxCampaignService; | ||||
| @Autowired | @Autowired | ||||
| private WxCouponService wxCouponService; | |||||
| @Autowired | |||||
| private WxCouponChannelService wxCouponChannelService; | private WxCouponChannelService wxCouponChannelService; | ||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @@ -53,7 +50,7 @@ public class WxCampaignController extends BaseController { | |||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCampaign.setTenantId(getTenantId()); | wxCampaign.setTenantId(getTenantId()); | ||||
| wxCampaign.setSortColumns(SortNum_ASC, CreateTime_ASC); | wxCampaign.setSortColumns(SortNum_ASC, CreateTime_ASC); | ||||
| final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | |||||
| final PageInfo<WxCampaign> page = wxCampaignService.clistAsPage(wxCampaign, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.utils.HashUtil; | import com.iformall.utils.HashUtil; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -34,9 +35,13 @@ public class WxMerchantController extends BaseController { | |||||
| if(merchantCode == null) { | if(merchantCode == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| String codeMD5 = HashUtil.DecodeByMD5(merchantCode); | |||||
| if(StringUtils.isBlank(codeMD5)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| HashMap<String, String> params = new HashMap<String, String>(); | HashMap<String, String> params = new HashMap<String, String>(); | ||||
| params.put("tenantId", getTenantId()); | params.put("tenantId", getTenantId()); | ||||
| params.put("merchantCode", HashUtil.DecodeByMD5(merchantCode)); | |||||
| params.put("merchantCode", codeMD5); | |||||
| WxMerchantVo wxMerchant = wxMerchantService.getMerchantInfo(params); | WxMerchantVo wxMerchant = wxMerchantService.getMerchantInfo(params); | ||||
| return new ResultData(wxMerchant); | return new ResultData(wxMerchant); | ||||
| } | } | ||||
| @@ -9,6 +9,8 @@ public interface WxCampaignMapper extends CommonMapper<WxCampaign, Long> { | |||||
| List<WxCampaign> findList(WxCampaign wxCampaign); | List<WxCampaign> findList(WxCampaign wxCampaign); | ||||
| List<WxCampaign> findCList(WxCampaign wxCampaign); | |||||
| int getMaxSortNum(String tenantId); | int getMaxSortNum(String tenantId); | ||||
| @@ -8,15 +8,23 @@ import javax.servlet.http.HttpServletResponse; | |||||
| public interface WxCampaignService { | public interface WxCampaignService { | ||||
| /** | |||||
| /** | |||||
| * 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
| * | |||||
| * @param record | * @param record | ||||
| * @param offset | |||||
| * @param limit | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCampaign> listAsPage(WxCampaign record, Integer pageIndex, Integer pageSize); | PageInfo<WxCampaign> listAsPage(WxCampaign record, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxCampaign> clistAsPage(WxCampaign record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -56,6 +56,11 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCampaignMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCampaignMapper.findList(record)); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxCampaign> clistAsPage(WxCampaign record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCampaignMapper.findCList(record)); | |||||
| } | |||||
| @Override | @Override | ||||
| public WxCampaign getById(Long id) { | public WxCampaign getById(Long id) { | ||||
| WxCampaign wxCampaign = wxCampaignMapper.selectByPrimaryKey(id); | WxCampaign wxCampaign = wxCampaignMapper.selectByPrimaryKey(id); | ||||
| @@ -26,7 +26,11 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`cover_img`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`, | `id`,`tenant_id`,`cover_img`,`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` | |||||
| </sql> | |||||
| <sql id="allCHeadColumns"> | |||||
| `id`,`tenant_id`,`cover_img`,`title`,`sort_num` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -135,6 +139,11 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="findCList" parameterType="com.iformall.domain.po.WxCampaign" resultMap="BaseResultMap"> | |||||
| select <include refid="allCHeadColumns" /> from wx_campaign | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| <select id="getMaxSortNum" parameterType="java.lang.String" resultType="java.lang.Integer"> | <select id="getMaxSortNum" parameterType="java.lang.String" resultType="java.lang.Integer"> | ||||
| select max(sort_num) from wx_campaign where `tenant_id` = #{tenantId} | select max(sort_num) from wx_campaign where `tenant_id` = #{tenantId} | ||||
| </select> | </select> | ||||