| | |
| | |
|
| | | @Resource
|
| | | private SpecialService specialService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SpecialCardService specialCardService;
|
| | | |
| | |
|
| | | /**
|
| | | * 保存信息
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, SpecialCard specialCard, HttpServletRequest request,PrintWriter out) {
|
| | | public void save(String callback, SpecialCard specialCard, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型 |
| | | // 1. 先判断httpRequest 是否含有文件类型
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | specialCardService.saveObject(fileRequest.getFile("file"), specialCard);
|
| | | }else{
|
| | | specialCardService.saveObject(null, specialCard);
|
| | | }
|
| | | |
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | specialCardService.saveObject(fileRequest.getFile("file"), specialCard);
|
| | | } else {
|
| | | specialCardService.saveObject(null, specialCard);
|
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (FloatADException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 查询
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key 模糊查询:说明、标识
|
| | | * @param key
|
| | | * 模糊查询:说明、标识
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key,
|
| | | Integer sort, PrintWriter out) {
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer sort, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | List<SpecialCard> list = specialCardService.listQuery((pageIndex - 1) * pageSize, |
| | | pageSize, key, sort);
|
| | | List<SpecialCard> list = specialCardService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sort);
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | long count = specialCardService.countlistQuery(key);
|
| | | |
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); |
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | |
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | * |
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | |
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
|
| | | }.getType());
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | int count = specialCardService.deleteBatchByPrimaryKey(list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除[" + count + "]条数据"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 保存信息
|
| | | *
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveSpecial")
|
| | | public void saveSpecial(String callback, Special record, String jumpType, HttpServletRequest request,PrintWriter out) {
|
| | | public void saveSpecial(String callback, Special record, String jumpType, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型 |
| | | // 1. 先判断httpRequest 是否含有文件类型
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | specialService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"), fileRequest.getFile("file3"), record, jumpType);
|
| | | }else{
|
| | | specialService.saveObject(null, null, null, record, jumpType);
|
| | | }
|
| | | |
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | specialService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"),
|
| | | fileRequest.getFile("file3"), record, jumpType);
|
| | | } else {
|
| | | specialService.saveObject(null, null, null, record, jumpType);
|
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (SpecialException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 删除专题
|
| | | * |
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | |
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
|
| | | }.getType());
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | int count = specialService.deleteBatchByPrimaryKey(list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除[" + count + "]条数据"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 修改排序
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 查询专题
|
| | | * 查询专题
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param bannerId |
| | | * @param bannerId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "querySpecial")
|
| | | public void querySpecial(String callback, Integer pageIndex, Integer pageSize, String key,
|
| | | Long cardId, Integer sex, PrintWriter out) {
|
| | | public void querySpecial(String callback, Integer pageIndex, Integer pageSize, String key, Long cardId, Integer sex,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | |
| | | out.print(JsonUtil.loadFalseResult("唯一标识ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | |
| | |
|
| | | List<Special> list = specialService.listQueryByCard((pageIndex - 1) * pageSize, pageSize, cardId, key, sex);
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | long count = specialService.countlistQueryByCard(cardId, key, sex);
|
| | | |
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); |
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | |
| | | public final static int SEX_DEFAULT = 0; // 通用
|
| | | public final static int SEX_WOMAN = 1; // 女
|
| | | public final static int SEX_MAN = 2; // 男
|
| | | public final static int SEX_DEFAULT_WOMAN = 10; // 女+ 通用
|
| | | public final static int SEX_DEFAULT_MAN = 20; // 男+ 通用
|
| | | public final static int SEX_MAN_WOMAN = 12; // 男+ 女
|
| | | |
| | | public final static int SEX_ALL = 120; // 男+女+通用
|
| | | |
| | | public final static int SEX_DEFAULT = 0; // 通用
|
| | | public final static int SEX_WOMAN = 1; // 女
|
| | | public final static int SEX_MAN = 2; // 男
|
| | | public final static int SEX_DEFAULT_WOMAN = 10; // 女+ 通用
|
| | | public final static int SEX_DEFAULT_MAN = 20; // 男+ 通用
|
| | | public final static int SEX_MAN_WOMAN = 12; // 男+ 女
|
| | |
|
| | | public final static int SEX_ALL = 120; // 男+女+通用
|
| | |
|
| | | @Expose
|
| | | @Column(name = "b_id")
|
| | | private Long id;
|
| | |
| | | @Expose
|
| | | @Column(name = "b_card_id")
|
| | | private Long cardId;
|
| | | |
| | |
|
| | | // 主图
|
| | | @Expose
|
| | | @Column(name = "b_main_picture")
|
| | | private String picture;
|
| | | |
| | |
|
| | | // 装饰图
|
| | | @Expose
|
| | | @Column(name = "b_icon")
|
| | | private String icon;
|
| | | |
| | |
|
| | | // 附图
|
| | | @Expose
|
| | | @Column(name = "b_sub_picture")
|
| | |
| | | // 跳转是否需要登录
|
| | | @Column(name = "b_jump_login")
|
| | | private boolean jumpLogin;
|
| | | |
| | |
|
| | | // 排序
|
| | | @Column(name = "b_orderby")
|
| | | private Integer orderby;
|
| | | |
| | |
|
| | | // 排序
|
| | | @Column(name = "b_order_man")
|
| | | private Integer orderMan;
|
| | | |
| | |
|
| | | // 排序
|
| | | @Column(name = "b_order_woman")
|
| | | private Integer orderWoman;
|
| | | |
| | |
|
| | | // 状态
|
| | | @Column(name = "b_state")
|
| | | private Long state;
|
| | | |
| | |
|
| | | // 性别区分
|
| | | @Column(name = "b_sex")
|
| | | private Integer sex;
|
| | | |
| | |
|
| | | // 显示类型:圆形图 、大图
|
| | | @Expose
|
| | | @Column(name = "b_show_type")
|
| | | private String showType;
|
| | | |
| | |
|
| | | // 备注
|
| | | @Column(name = "b_remark")
|
| | | private String remark;
|
| | | |
| | | // 平台:1-android 2-IOS
|
| | | @Column(name = "b_platform")
|
| | | private Integer platform;
|
| | | |
| | | // 版本号
|
| | | @Column(name = "b_version_code")
|
| | | private Integer versionCode;
|
| | |
|
| | | // android最小版本
|
| | | @Column(name = "b_min_android_version_code")
|
| | | private Integer minAndroidVersionCode;
|
| | |
|
| | | // ios最小版本
|
| | | @Column(name = "b_min_ios_version_code")
|
| | | private Integer minIOSVersionCode;
|
| | |
|
| | | // 创建时间
|
| | | @Column(name = "b_createtime")
|
| | |
| | | // 更新时间
|
| | | @Column(name = "b_updatetime")
|
| | | private Date updatetime;
|
| | | |
| | | |
| | |
|
| | | // 是否弹框
|
| | | @Expose
|
| | | private boolean elastic;
|
| | | |
| | | |
| | |
|
| | | // 背景图片
|
| | | private String bottomPicture; |
| | | private String bottomPicture;
|
| | | // 是否删除图片
|
| | | private Boolean delIcon;
|
| | | private Boolean delPicture;
|
| | | private Boolean delSubPicture;
|
| | | |
| | |
|
| | | // 限制最低版本
|
| | | private String version; |
| | | |
| | | private String version;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | public void setCard(String card) {
|
| | | this.card = card;
|
| | | }
|
| | |
|
| | |
|
| | | public String getPicture() {
|
| | | return picture;
|
| | |
| | | }
|
| | |
|
| | | public Long getState() {
|
| | |
|
| | | return state;
|
| | | }
|
| | |
|
| | |
| | | this.orderWoman = orderWoman;
|
| | | }
|
| | |
|
| | | public Integer getPlatform() {
|
| | | return platform;
|
| | | }
|
| | |
|
| | | public void setPlatform(Integer platform) {
|
| | | this.platform = platform;
|
| | | }
|
| | |
|
| | | public Integer getVersionCode() {
|
| | | return versionCode;
|
| | | }
|
| | |
|
| | | public void setVersionCode(Integer versionCode) {
|
| | | this.versionCode = versionCode;
|
| | | }
|
| | |
|
| | | public String getVersion() {
|
| | | return version;
|
| | | }
|
| | |
| | | public void setVersion(String version) {
|
| | | this.version = version;
|
| | | }
|
| | |
|
| | | public Integer getMinAndroidVersionCode() {
|
| | | return minAndroidVersionCode;
|
| | | }
|
| | |
|
| | | public void setMinAndroidVersionCode(Integer minAndroidVersionCode) {
|
| | | this.minAndroidVersionCode = minAndroidVersionCode;
|
| | | }
|
| | |
|
| | | public Integer getMinIOSVersionCode() {
|
| | | return minIOSVersionCode;
|
| | | }
|
| | |
|
| | | public void setMinIOSVersionCode(Integer minIOSVersionCode) {
|
| | | this.minIOSVersionCode = minIOSVersionCode;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | <result column="b_sex" property="sex" jdbcType="INTEGER" />
|
| | | <result column="b_show_type" property="showType" jdbcType="VARCHAR" />
|
| | | <result column="b_remark" property="remark" jdbcType="VARCHAR" />
|
| | | <result column="b_platform" property="platform" jdbcType="INTEGER"/>
|
| | | <result column="b_version_code" property="versionCode" jdbcType="INTEGER"/>
|
| | | <result column="b_min_android_version_code" property="minAndroidVersionCode" jdbcType="INTEGER"/>
|
| | | <result column="b_min_ios_version_code" property="minIOSVersionCode" jdbcType="INTEGER"/>
|
| | | <result column="b_createtime" property="createtime" jdbcType="TIMESTAMP" />
|
| | | <result column="b_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
| | |
|
| | |
| | | </association>
|
| | |
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_platform,b_version_code,b_createtime,b_updatetime</sql>
|
| | | <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_min_android_version_code,b_min_ios_version_code,b_createtime,b_updatetime</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | |
| | | yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special
|
| | | (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_platform,b_version_code,b_createtime,b_updatetime)
|
| | | (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_min_android_version_code,b_min_ios_version_code,b_createtime,b_updatetime)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{platform,jdbcType=INTEGER},#{versionCode,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
|
| | | (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{minAndroidVersionCode,jdbcType=INTEGER},#{minIOSVersionCode,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_special
|
| | |
| | | <if test="sex != null">b_sex,</if>
|
| | | <if test="showType != null">b_show_type,</if>
|
| | | <if test="remark != null">b_remark,</if>
|
| | | <if test="platform != null">b_platform,</if>
|
| | | <if test="versionCode != null">b_version_code,</if>
|
| | | <if test="minAndroidVersionCode != null">b_min_android_version_code,</if>
|
| | | <if test="minIOSVersionCode != null">b_min_ios_version_code,</if>
|
| | | <if test="createtime != null">b_createtime,</if>
|
| | | <if test="updatetime != null">b_updatetime,</if>
|
| | | </trim>
|
| | |
| | | <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="showType != null">#{showType,jdbcType=VARCHAR},</if>
|
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
|
| | | <if test="platform != null">#{platform,jdbcType=INTEGER},</if>
|
| | | <if test="versionCode != null">#{versionCode,jdbcType=INTEGER},</if>
|
| | | <if test="minAndroidVersionCode != null">#{minAndroidVersionCode,jdbcType=INTEGER},</if>
|
| | | <if test="minIOSVersionCode != null">#{minIOSVersionCode,jdbcType=INTEGER},</if>
|
| | | <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | |
| | | #{orderWoman,jdbcType=INTEGER},b_state =
|
| | | #{state,jdbcType=BIGINT},b_show_type =
|
| | | #{showType,jdbcType=VARCHAR},b_remark =
|
| | | #{remark,jdbcType=VARCHAR},b_platform = #{platform,jdbcType=INTEGER},b_version_code = #{versionCode,jdbcType=INTEGER},
|
| | | #{remark,jdbcType=VARCHAR},b_min_android_version_code = #{minAndroidVersionCode,jdbcType=INTEGER},b_min_ios_version_code = #{minIOSVersionCode,jdbcType=INTEGER},
|
| | | b_createtime =
|
| | | #{createtime,jdbcType=TIMESTAMP},b_updatetime =
|
| | | #{updatetime,jdbcType=TIMESTAMP},b_sex=#{sex,jdbcType=INTEGER} where
|
| | |
| | | <if test="sex != null">b_sex=#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="showType != null">b_show_type=#{showType,jdbcType=VARCHAR},</if>
|
| | | <if test="remark != null">b_remark=#{remark,jdbcType=VARCHAR},</if>
|
| | | <if test="platform != null">b_platform=#{platform,jdbcType=INTEGER},</if>
|
| | | <if test="versionCode != null">b_version_code=#{versionCode,jdbcType=INTEGER},</if>
|
| | | <if test="minAndroidVersionCode != null">b_min_android_version_code=#{minAndroidVersionCode,jdbcType=INTEGER},</if>
|
| | | <if test="minIOSVersionCode != null">b_min_ios_version_code=#{minIOSVersionCode,jdbcType=INTEGER},</if>
|
| | | <if test="createtime != null">b_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updatetime != null">b_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
|
| | | </set>
|
| | |
| | | SELECT p.* FROM`yeshi_ec_special` p
|
| | | LEFT JOIN `yeshi_ec_special_card` c ON p.`b_card_id` = c.`cd_id`
|
| | | WHERE p.`b_state` = 0 AND c.`cd_state` = 0 AND c.`cd_card` = #{card}
|
| | | AND IF(p.`b_platform` IS NOT NULL, IF(#{versionCode} <![CDATA[>=]]> p.`b_version_code` AND p.`b_platform`=#{platform}, TRUE,FALSE), TRUE)
|
| | | AND IF(p.`b_min_android_version_code` IS NOT NULL, IF(#{minIOSVersionCode} <![CDATA[>=]]> p.`b_min_ios_version_code` AND p.`b_min_android_version_code`=#{minAndroidVersionCode}, TRUE,FALSE), TRUE)
|
| | | ORDER BY p.`b_orderby`
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private AppVersionService appVersionService;
|
| | | |
| | |
|
| | | @Override
|
| | | public Special selectByPrimaryKey(Long id) {
|
| | |
| | | Integer sex = record.getSex();
|
| | | if (sex == null) {
|
| | | throw new SpecialException(1, "性别不能为空");
|
| | | }
|
| | |
|
| | | String version = record.getVersion();
|
| | | Integer platformCode = record.getPlatform();
|
| | | if (!StringUtil.isNullOrEmpty(version) && platformCode != null) {
|
| | | String platform = "android";
|
| | | if (platformCode == 2)
|
| | | platform = "ios";
|
| | | AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, version);
|
| | | if (versionInfo == null)
|
| | | throw new SpecialException(1, "版本号信息缺失");
|
| | | |
| | | record.setVersionCode(versionInfo.getVersionCode());
|
| | | record.setPlatform(platformCode);
|
| | | } else {
|
| | | if (!StringUtil.isNullOrEmpty(version))
|
| | | throw new SpecialException(1, "平台类型不能为空");
|
| | | |
| | | if (platformCode != null) |
| | | throw new SpecialException(1, "版本号不能为空");
|
| | | }
|
| | |
|
| | | String params = record.getParams();
|
| | |
| | | public List<Special> listByVersion(long start, int count, String card, Integer platform, Integer versionCode) {
|
| | | return specialMapper.listByVersion(start, count, card, platform, versionCode);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listCacheSpecialToIndex'+#acceptData.platform+'-'+#acceptData.version+'-'+#sex")
|
| | | public JSONObject listCacheSpecialToIndex(AcceptData acceptData, Integer sex) throws Exception {
|