记得上下班打卡 | git大法好,push需谨慎

Commit 4f463adc authored by jiangxiulong's avatar jiangxiulong

版本控制增加验票

parent 4d8e9cb6
......@@ -42,5 +42,7 @@ public class KylinRedisConst {
public static final String ZHENGZAI_APP_VERSIONS_ANDROID = "basicServices:zhengzaiAppVersionsAndroid";
public static final String ZHENGZAI_APP_VERSIONS_IOS = "basicServices:zhengzaiAppVersionsIos";
public static final String ZHENGZAI_APP_VERSIONS_CHECK_ANDROID = "basicServices:zhengzaiCheckAppVersionsAndroid";
public static final String ZHENGZAI_APP_VERSIONS_CHECK_IOS = "basicServices:zhengzaiCheckAppVersionsIos";
}
......@@ -28,6 +28,7 @@ public class ZhengzaiAppVersionsParam implements Serializable {
private Integer type;
private Integer isProduction;
private Integer isForce;
private Integer appType;
private String content;
......
......@@ -19,6 +19,7 @@ public class ZhengzaiAppVersionsSearchParam implements Serializable {
// @ApiModelProperty(value = "Banner主键ID", example = "9822346783245")
private Integer type;
private Integer appType;
@ApiModelProperty(value = "页数", example = "0")
@NotNull(message = "页数不能为空")
......
......@@ -33,6 +33,8 @@ public class ZhengzaiAppVersionsVo implements Serializable {
private String content;
private Integer appType;
/**
* 创建时间
*/
......
......@@ -9,6 +9,21 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add">
<div class="form-group">
<label class="col-sm-2 control-label">App类型</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="appType" checked=""> 正在现场
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="appType"> 验票
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">名称:</label>
<div class="col-sm-10">
......
......@@ -9,6 +9,21 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add">
<div class="form-group">
<label class="col-sm-2 control-label">App类型</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.appType==1 ? true : false}" type="radio" value="1" name="appType"> 正在现场
</label>
</div>
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.appType==2 ? true : false}" type="radio" value="2" name="appType"> 验票
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">名称:</label>
<div class="col-sm-10">
......
......@@ -10,6 +10,14 @@
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>App类型:</label>
<select name="appType">
<option value="">全部</option>
<option value="1">正在现场</option>
<option value="2">验票</option>
</select>
</li>
<li>
<label>类型:</label>
<select name="type">
......@@ -62,6 +70,17 @@
field: 'zhengzaiAppVersionsId',
title: 'ID'
},
{
field: 'appType',
title: 'App类型',
formatter: function(value, row, index) {
if (row.appType == 1) {
return "正在现场";
} else {
return "验票";
}
}
},
{
field: 'name',
title: '名称'
......
......@@ -56,6 +56,7 @@ public class KylinZhengzaiAppVersionsServiceImpl extends ServiceImpl<KylinBanner
BeanUtils.copyProperties(zhengzaiAppVersionsParam, kylinZhengzaiAppVersions);
kylinZhengzaiAppVersionsMapper.insert(kylinZhengzaiAppVersions);
getLastInfo();
getLastInfoCheck();
return true;
} catch (Exception e) {
return false;
......@@ -71,6 +72,7 @@ public class KylinZhengzaiAppVersionsServiceImpl extends ServiceImpl<KylinBanner
BeanUtils.copyProperties(zhengzaiAppVersionsParam, kylinZhengzaiAppVersions);
kylinZhengzaiAppVersionsMapper.update(kylinZhengzaiAppVersions, new UpdateWrapper<KylinZhengzaiAppVersions>().eq("zhengzai_app_versions_id", zhengzaiAppVersionsId));
getLastInfo();
getLastInfoCheck();
return true;
} catch (Exception e) {
return false;
......@@ -114,6 +116,7 @@ public class KylinZhengzaiAppVersionsServiceImpl extends ServiceImpl<KylinBanner
, new UpdateWrapper<KylinZhengzaiAppVersions>().in("zhengzai_app_versions_id", zhengzaiAppVersionsIds)
);
getLastInfo();
getLastInfoCheck();
return true;
} catch (Exception e) {
return false;
......@@ -140,4 +143,25 @@ public class KylinZhengzaiAppVersionsServiceImpl extends ServiceImpl<KylinBanner
return true;
}
public boolean getLastInfoCheck() { // 因为有可能之前是ios 改成 android 如果单独处理一个会有问题 所以每次处理
ZhengzaiAppVersionsListDao infoIos = kylinZhengzaiAppVersionsMapper.getLastInfoCheck(1);
ZhengzaiAppVersionsListDao infoAndroid = kylinZhengzaiAppVersionsMapper.getLastInfoCheck(2);
ZhengzaiAppVersionsVo zhengzaiAppVersionsVo = new ZhengzaiAppVersionsVo();
redisUtil.del(KylinRedisConst.ZHENGZAI_APP_VERSIONS_CHECK_IOS);
if (null != infoIos) {
BeanUtils.copyProperties(infoIos, zhengzaiAppVersionsVo);
redisUtil.set(KylinRedisConst.ZHENGZAI_APP_VERSIONS_CHECK_IOS, zhengzaiAppVersionsVo);
}
redisUtil.del(KylinRedisConst.ZHENGZAI_APP_VERSIONS_CHECK_ANDROID);
if (null != infoAndroid) {
String newPath = appUrl + infoAndroid.getFilePath();
infoAndroid.setFilePath(newPath);
BeanUtils.copyProperties(infoAndroid, zhengzaiAppVersionsVo);
redisUtil.set(KylinRedisConst.ZHENGZAI_APP_VERSIONS_CHECK_ANDROID, zhengzaiAppVersionsVo);
}
return true;
}
}
......@@ -24,6 +24,8 @@ public class ZhengzaiAppVersionsListDao implements Serializable {
private String content;
private Integer appType;
/**
* 创建时间
*/
......
......@@ -40,6 +40,8 @@ public class KylinZhengzaiAppVersions implements Serializable {
private String content;
private Integer appType;
/**
* 创建时间
*/
......
......@@ -20,4 +20,6 @@ public interface KylinZhengzaiAppVersionsMapper extends BaseMapper<KylinZhengzai
List<ZhengzaiAppVersionsListDao> searchList(Map<String, Object> convertBeanToMap);
ZhengzaiAppVersionsListDao getLastInfo(Integer type);
ZhengzaiAppVersionsListDao getLastInfoCheck(Integer type);
}
......@@ -9,6 +9,9 @@
<if test="type != ''">
AND type = ${type}
</if>
<if test="appType != ''">
AND app_type = ${appType}
</if>
</where>
ORDER BY mid DESC
</select>
......@@ -20,6 +23,20 @@
<if test="type != ''">
AND type = ${type}
</if>
AND app_type = 1
</where>
ORDER BY mid DESC
LIMIT 1
</select>
<select id="getLastInfoCheck" resultType="com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao">
SELECT *
FROM kylin_zhengzai_app_versions
<where>
is_deleted = 1
<if test="type != ''">
AND type = ${type}
</if>
AND app_type = 2
</where>
ORDER BY mid DESC
LIMIT 1
......
......@@ -954,6 +954,7 @@ CREATE TABLE `kylin_zhengzai_app_versions`
`is_force` tinyint NOT NULL DEFAULT '0' COMMENT '强制更新 2否 1是',
`content` varchar(255) NOT NULL DEFAULT '' COMMENT '升级描述',
`is_deleted` tinyint NOT NULL DEFAULT '1' COMMENT '1正常 2已删除',
`app_type` tinyint NOT NULL DEFAULT '0' COMMENT '1正在现场app 2验票app',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `kylin_zhengzai_app_versions_id_index` (`zhengzai_app_versions_id`),
......
......@@ -33,16 +33,26 @@ public class ZhengzaiAppVersionsController {
@ApiOperation("获取最新版本信息")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "上传类型 1-IOS 2-Android", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "appType", value = "App类型 1-正在 2-验票", required = true),
// @ApiImplicitParam(type = "query", dataType = "Integer", name = "isProduction", value = "是否是生产环境,1是 2否", required = true),
})
// public ZhengzaiAppVersionsVo lastInfo(@RequestParam Integer type, @RequestParam Integer isProduction) {
public ZhengzaiAppVersionsVo lastInfo(@RequestParam Integer type) {
public ZhengzaiAppVersionsVo lastInfo(@RequestParam Integer type, @RequestParam Integer appType) {
ZhengzaiAppVersionsVo info = null;
if (1 == type) {
info = (ZhengzaiAppVersionsVo) redisUtil.get(KylinRedisConst.ZHENGZAI_APP_VERSIONS_IOS);
} else if (2 == type) {
info = (ZhengzaiAppVersionsVo) redisUtil.get(KylinRedisConst.ZHENGZAI_APP_VERSIONS_ANDROID);
if (1 == appType) {
if (1 == type) {
info = (ZhengzaiAppVersionsVo) redisUtil.get(KylinRedisConst.ZHENGZAI_APP_VERSIONS_IOS);
} else if (2 == type) {
info = (ZhengzaiAppVersionsVo) redisUtil.get(KylinRedisConst.ZHENGZAI_APP_VERSIONS_ANDROID);
}
} else if (2 == appType) {
if (1 == type) {
info = (ZhengzaiAppVersionsVo) redisUtil.get(KylinRedisConst.ZHENGZAI_APP_VERSIONS_CHECK_IOS);
} else if (2 == type) {
info = (ZhengzaiAppVersionsVo) redisUtil.get(KylinRedisConst.ZHENGZAI_APP_VERSIONS_CHECK_ANDROID);
}
}
return info;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment