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

Commit 887443b2 authored by jiangxiulong's avatar jiangxiulong

appVersions

parent 26f0b7e5
package com.liquidnet.service.kylin.dto.param;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* <p>
* 正在现场app版本控制 需要的参数
* </p>
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
public class ZhengzaiAppVersionsParam implements Serializable {
// @ApiModelProperty(value = "Banner主键ID", example = "9822346783245")
private String zhengzaiAppVersionsId;
private String name;
private String filePath;
private String version;
private String minVersion;
private Integer type;
private Integer isProduction;
private Integer isForce;
private String content;
/**
* 创建时间
*/
private String createdAt;
/**
* 修改时间
*/
private String updatedAt;
private List<String> ids;
}
package com.liquidnet.service.kylin.dto.param.admin;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* <p>
* 正在现场app版本控制 需要的参数
* </p>
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
public class ZhengzaiAppVersionsSearchParam implements Serializable {
// @ApiModelProperty(value = "Banner主键ID", example = "9822346783245")
private Integer type;
@ApiModelProperty(value = "页数", example = "0")
@NotNull(message = "页数不能为空")
private Integer pageSize;
@ApiModelProperty(value = "数量", example = "20")
@NotNull(message = "数量不能为空")
private Integer pageNum;
}
package com.liquidnet.service.kylin.dto.vo.admin;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
* 正在现场app版本控制 返回给前端的数据字段
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
@ApiModel
public class ZhengzaiAppVersionsVo implements Serializable {
// @ApiModelProperty(value = "Banner主键ID")
private String zhengzaiAppVersionsId;
private String name;
private String filePath;
private String version;
private String minVersion;
private Integer type;
private Integer isProduction;
private Integer isForce;
private Integer isDeleted;
private String content;
/**
* 创建时间
*/
private String createdAt;
/**
* 修改时间
*/
private String updatedAt;
}
...@@ -43,6 +43,12 @@ INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, ur ...@@ -43,6 +43,12 @@ INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, ur
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2039, '路由信息主动查询', 2034, 5, '#', 'menuItem', 'F', '0', '1', 'kylin:performancesExpress:listOrderRoute', '#', 'admin', '2021-06-30 20:07:07', '', null, ''); INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2039, '路由信息主动查询', 2034, 5, '#', 'menuItem', 'F', '0', '1', 'kylin:performancesExpress:listOrderRoute', '#', 'admin', '2021-06-30 20:07:07', '', null, '');
# INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2040, '实际运费主动查询', 2034, 6, '#', 'menuItem', 'F', '0', '1', 'kylin:performancesExpress:getListFreight', '#', 'admin', '2021-06-30 20:07:07', '', null, ''); # INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2040, '实际运费主动查询', 2034, 6, '#', 'menuItem', 'F', '0', '1', 'kylin:performancesExpress:getListFreight', '#', 'admin', '2021-06-30 20:07:07', '', null, '');
INSERT INTO dev_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2041, '版本控制', 2000, 5, '#', 'menuItem', 'C', '0', '1', 'kylin:versionControl:view', '#', 'admin', '2021-06-30 20:01:36', '', null, '');
INSERT INTO dev_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2042, '正在现场App', 2041, 0, '/kylin/zhengzaiAppVersion', 'menuItem', 'C', '0', '1', 'kylin:zhengzaiAppVersion:list', '#', 'admin', '2021-06-30 20:03:59', '', null, '');
INSERT INTO dev_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2043, '添加', 2042, 1, '#', 'menuItem', 'F', '0', '1', 'kylin:zhengzaiAppVersion:create', '#', 'admin', '2021-06-30 20:05:58', '', null, '');
INSERT INTO dev_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2044, '编辑', 2042, 2, '#', 'menuItem', 'F', '0', '1', 'kylin:zhengzaiAppVersion:update', '#', 'admin', '2021-06-30 20:07:07', '', null, '');
INSERT INTO dev_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2045, '删除', 2042, 3, '#', 'menuItem', 'F', '0', '1', 'kylin:zhengzaiAppVersion:delete', '#', 'admin', '2021-06-30 20:07:07', '', null, '');
-- sys_role_menu -- sys_role_menu
INSERT INTO test_ln_scene.sys_role_menu (role_id, menu_id) VALUES (2, 2000); INSERT INTO test_ln_scene.sys_role_menu (role_id, menu_id) VALUES (2, 2000);
INSERT INTO test_ln_scene.sys_role_menu (role_id, menu_id) VALUES (2, 2001); INSERT INTO test_ln_scene.sys_role_menu (role_id, menu_id) VALUES (2, 2001);
......
package com.liquidnet.client.admin.web.controller.zhengzai.kylin;
import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinZhengzaiAppVersionsServiceImpl;
import com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao;
import com.liquidnet.service.kylin.dto.param.ZhengzaiAppVersionsParam;
import com.liquidnet.service.kylin.dto.param.admin.ZhengzaiAppVersionsSearchParam;
import com.liquidnet.service.kylin.dto.vo.admin.ZhengzaiAppVersionsVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 正在现场app版本控制
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Controller
@RequestMapping("/kylin/zhengzaiAppVersion")
public class ZhengzaiAppVersionController extends BaseController {
@Value("${liquidnet.client.admin.platformUrl}")
private String platformUrl;
private String prefix = "zhengzai/kylin/zhengzaiAppVersion";
@Autowired
private KylinZhengzaiAppVersionsServiceImpl kylinZhengzaiAppVersionsServiceImpl;
@GetMapping("/create")
public String create(ModelMap mmap) {
mmap.put("platformUrl", platformUrl);
return prefix + "/create";
}
@RequiresPermissions("kylin:zhengzaiAppVersion:create")
@PostMapping("create")
@ResponseBody
public AjaxResult createSave(ZhengzaiAppVersionsParam zhengzaiAppVersionsParam) {
Boolean res = kylinZhengzaiAppVersionsServiceImpl.create(zhengzaiAppVersionsParam);
if (res) {
return success();
} else {
return error("添加失败");
}
}
@GetMapping("/update/{zhengzaiAppVersionsId}")
public String update(@PathVariable("zhengzaiAppVersionsId") String zhengzaiAppVersionsId, ModelMap mmap) {
ZhengzaiAppVersionsVo result = null;
result = kylinZhengzaiAppVersionsServiceImpl.detail(zhengzaiAppVersionsId);
mmap.put("ZhengzaiAppVersionsVo", result);
mmap.put("platformUrl", platformUrl);
return prefix + "/update";
}
@RequiresPermissions("kylin:zhengzaiAppVersion:update")
@PostMapping("update")
@ResponseBody
public AjaxResult updateSave(ZhengzaiAppVersionsParam zhengzaiAppVersionsParam) {
boolean res = kylinZhengzaiAppVersionsServiceImpl.update(zhengzaiAppVersionsParam);
if (res) {
return success();
} else {
return error("修改失败");
}
}
@RequiresPermissions("kylin:zhengzaiAppVersion:view")
@GetMapping()
public String zhengzaiAppVersions() {
return prefix + "/zhengzaiAppVersion";
}
@RequiresPermissions("kylin:zhengzaiAppVersion:list")
@PostMapping("list")
@ResponseBody
public TableDataInfo allList(ZhengzaiAppVersionsSearchParam zhengzaiAppVersionsSearchParam) {
PageInfo<ZhengzaiAppVersionsListDao> result = kylinZhengzaiAppVersionsServiceImpl.listInfo(zhengzaiAppVersionsSearchParam);
return getDataTable(result.getList());
}
@RequiresPermissions("kylin:zhengzaiAppVersion:delete")
@PostMapping("delete")
@ResponseBody
public AjaxResult delete(ZhengzaiAppVersionsParam zhengzaiAppVersionsParam) {
List<String> bannersId = zhengzaiAppVersionsParam.getIds();
boolean result = kylinZhengzaiAppVersionsServiceImpl.delete(bannersId);
if (result) {
return success("删除成功");
} else {
return error("删除失败");
}
}
}
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('添加正在现场App版本')"/>
<th:block th:include="include :: select2-css"/>
<th:block th:include="include :: datetimepicker-css"/>
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<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 is-required">名称:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="name" id="name" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">版本号:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="version" id="version" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">最小版本号:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="minVersion" id="minVersion" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">类型</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="type" checked=""> IOS
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="type"> Android
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否生产环境</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="isProduction" checked="">
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="isProduction">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否强制升级</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="isForce">
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="isForce" checked="">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">升级描述:</label>
<div class="col-xs-10">
<textarea name="content" maxlength="500" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="form-group">
<label class="font-noraml">请上传封面图</label>
<div class="file-loading">
<input id="fileinput-demo-1" type="file" name="files" data-browse-on-zone-click="true"
data-msg-placeholder="Select {files} for upload...">
</div>
</div>
<input hidden id="filePath" name="filePath">
</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<th:block th:include="include :: bootstrap-suggest-js"/>
<script type="text/javascript">
var prefix = ctx + "kylin/zhengzaiAppVersion";
var platformUrl = "[[${platformUrl}]]";
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-post-add').serializeArray();
$.operate.save(prefix + "/create", data);
}
}
$(function () {
$("#fileinput-demo-1").fileinput({
'theme': 'explorer-fas',
'uploadUrl': "http://127.0.0.1:9003" + "/platform/basicServices/alOss/upload",
"uploadExtraData": {
"pathName" : "zhengzaiAppVersion"
},
autoReplace: true,
dropZoneTitle: "请上传文件",
maxFileCount: 1
});
$("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
$("#filePath").val(data.response.uploadpath)
});
})
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改banner')"/>
<th:block th:include="include :: select2-css"/>
<th:block th:include="include :: datetimepicker-css"/>
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<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 is-required">名称:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="name" id="name" required th:value="${ZhengzaiAppVersionsVo.name}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">版本号:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="version" id="version" required th:value="${ZhengzaiAppVersionsVo.version}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">最小版本号:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="minVersion" id="minVersion" required th:value="${ZhengzaiAppVersionsVo.minVersion}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">类型</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.type==1 ? true : false}" type="radio" value="1" name="type" checked=""> IOS
</label>
</div>
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.type==2 ? true : false}" type="radio" value="2" name="type"> Android
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否生产环境</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.isProduction==1 ? true : false}" type="radio" value="1" name="isProduction" checked="">
</label>
</div>
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.isProduction==2 ? true : false}" type="radio" value="2" name="isProduction">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否强制升级</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.isForce==1 ? true : false}" type="radio" value="1" name="isForce">
</label>
</div>
<div class="radio check-box">
<label>
<input th:checked="${ZhengzaiAppVersionsVo.isForce==2 ? true : false}" type="radio" value="2" name="isForce" checked="">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">升级描述:</label>
<div class="col-xs-10">
<textarea name="content" maxlength="500" class="form-control" rows="3" th:text="${ZhengzaiAppVersionsVo.content}"></textarea>
</div>
</div>
<div class="form-group">
<label class="font-noraml">请上传封面图</label>
<div class="file-loading">
<input id="fileinput-demo-1" type="file" name="files" th:value="${ZhengzaiAppVersionsVo.filePath}" data-browse-on-zone-click="true"
data-msg-placeholder="Select {files} for upload...">
</div>
</div>
<input hidden id="filePath" name="filePath" th:value="${ZhengzaiAppVersionsVo.filePath}">
</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<th:block th:include="include :: bootstrap-suggest-js"/>
<script type="text/javascript">
var prefix = ctx + "kylin/zhengzaiAppVersion";
var platformUrl = "[[${platformUrl}]]";
var filePath = "[[${ZhengzaiAppVersionsVo.filePath}]]";
var zhengzaiAppVersionsId = "[[${ZhengzaiAppVersionsVo.zhengzaiAppVersionsId}]]";
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-post-add').serializeArray();
data.push({"name": "zhengzaiAppVersionsId", "value": zhengzaiAppVersionsId});
$.operate.save(prefix + "/update", data);
}
}
$(function () {
$("#fileinput-demo-1").fileinput({
'theme': 'explorer-fas',
'uploadUrl': platformUrl + "/platform/basicServices/alOss/upload",
// 'uploadUrl': ctx + "system/user/profile/updateAvatar",
"uploadExtraData": {
"pathName" : "zhengzaiAppVersion"
},
overwriteInitial: false,
initialPreviewAsData: true,
dropZoneTitle: "请上传文件",
autoReplace: true,
maxFileCount: 1,
initialPreview: [
"https://app.zhengzai.tv/" + filePath
]
});
$("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
$("#filePath").val(data.response.uploadpath)
});
})
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('Banner列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>类型:</label>
<select name="type">
<option value="">全部</option>
<option value="1">IOS</option>
<option value="2">Android</option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="kylin:zhengzaiAppVersion:create">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="kylin:zhengzaiAppVersion:delete">
删除
</a>
</div>
<div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var updateFlag = [[${@permission.hasPermi('kylin:zhengzaiAppVersion:update')}]];
var removeFlag = [[${@permission.hasPermi('kylin:zhengzaiAppVersion:delete')}]];
var prefix = ctx + "kylin/zhengzaiAppVersion";
$(function () {
var options = {
url: prefix + "/list",
updateUrl: prefix + "/update/{id}",
createUrl: prefix + "/create",
removeUrl: prefix + "/delete",
modalName: "版本",
columns: [{
checkbox: true
},
{
field: 'zhengzaiAppVersionsId',
title: 'ID'
},
{
field: 'name',
title: '名称'
},
{
field: 'version',
title: '版本号'
},
{
field: 'minVersion',
title: '最小版本号'
},
{
field: '',
title: '类型',
formatter: function(value, row, index) {
if (row.type == 1) {
return "IOS";
} else {
return "Android";
}
}
},
{
field: '',
title: '是否生产环境',
formatter: function(value, row, index) {
if (row.isProduction == 1) {
return "是";
} else {
return "否";
}
}
},
{
field: '',
title: '是否强制升级',
formatter: function(value, row, index) {
if (row.isForce == 1) {
return "是";
} else {
return "否";
}
}
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + updateFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.zhengzaiAppVersionsId + '\')"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.zhengzaiAppVersionsId + '\')"></i>删除</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>
\ No newline at end of file
package com.liquidnet.client.admin.zhengzai.kylin.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao;
import com.liquidnet.service.kylin.dto.param.ZhengzaiAppVersionsParam;
import com.liquidnet.service.kylin.dto.param.admin.ZhengzaiAppVersionsSearchParam;
import com.liquidnet.service.kylin.dto.vo.admin.ZhengzaiAppVersionsVo;
import com.liquidnet.service.kylin.entity.KylinBanners;
import com.liquidnet.service.kylin.entity.KylinZhengzaiAppVersions;
import com.liquidnet.service.kylin.mapper.KylinBannersMapper;
import com.liquidnet.service.kylin.mapper.KylinZhengzaiAppVersionsMapper;
import com.liquidnet.service.kylin.service.admin.IKylinBannersService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.MongoConverter;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 正在现场app版本控制 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Service
public class KylinZhengzaiAppVersionsServiceImpl extends ServiceImpl<KylinBannersMapper, KylinBanners> implements IKylinBannersService {
@Value("${liquidnet.al-oss.imgUrl}")
private String imgUrl;
@Autowired
private KylinZhengzaiAppVersionsMapper kylinZhengzaiAppVersionsMapper;
@Autowired
MongoTemplate mongoTemplate;
@Autowired
private MongoConverter mongoConverter;
@Autowired
RedisUtil redisUtil;
public boolean create(ZhengzaiAppVersionsParam zhengzaiAppVersionsParam) {
try {
// 入数据库
String zhengzaiAppVersionsId = IDGenerator.nextSnowId();
zhengzaiAppVersionsParam.setZhengzaiAppVersionsId(zhengzaiAppVersionsId);
zhengzaiAppVersionsParam.setCreatedAt(DateUtil.getNowTime());
KylinZhengzaiAppVersions kylinZhengzaiAppVersions = new KylinZhengzaiAppVersions();
BeanUtils.copyProperties(zhengzaiAppVersionsParam, kylinZhengzaiAppVersions);
kylinZhengzaiAppVersionsMapper.insert(kylinZhengzaiAppVersions);
return true;
} catch (Exception e) {
return false;
}
}
public boolean update(ZhengzaiAppVersionsParam zhengzaiAppVersionsParam) {
try {
// 入数据库
String zhengzaiAppVersionsId = zhengzaiAppVersionsParam.getZhengzaiAppVersionsId();
zhengzaiAppVersionsParam.setUpdatedAt(DateUtil.getNowTime());
KylinZhengzaiAppVersions kylinZhengzaiAppVersions = new KylinZhengzaiAppVersions();
BeanUtils.copyProperties(zhengzaiAppVersionsParam, kylinZhengzaiAppVersions);
kylinZhengzaiAppVersionsMapper.update(kylinZhengzaiAppVersions, new UpdateWrapper<KylinZhengzaiAppVersions>().eq("zhengzai_app_versions_id", zhengzaiAppVersionsId));
return true;
} catch (Exception e) {
return false;
}
}
public ZhengzaiAppVersionsVo detail(String zhengzaiAppVersionsId) {
KylinZhengzaiAppVersions data = kylinZhengzaiAppVersionsMapper.selectOne(
new UpdateWrapper<KylinZhengzaiAppVersions>().eq("zhengzai_app_versions_id", zhengzaiAppVersionsId).eq("is_deleted", 1)
);
ZhengzaiAppVersionsVo zhengzaiAppVersionsVo = new ZhengzaiAppVersionsVo();
if (null != data) {
BeanUtils.copyProperties(data, zhengzaiAppVersionsVo);
} else {
return null;
}
return zhengzaiAppVersionsVo;
}
public PageInfo<ZhengzaiAppVersionsListDao> listInfo(ZhengzaiAppVersionsSearchParam zhengzaiAppVersionsSearchParam) {
try {
PageHelper.startPage(zhengzaiAppVersionsSearchParam.getPageNum(), zhengzaiAppVersionsSearchParam.getPageSize());
List<ZhengzaiAppVersionsListDao> voList = kylinZhengzaiAppVersionsMapper.searchList(BeanUtil.convertBeanToMap(zhengzaiAppVersionsSearchParam));
for (ZhengzaiAppVersionsListDao item : voList) {
// item.setCoverImg(imgUrl + item.getCoverImg());
}
return new PageInfo(voList);
} catch (Exception e) {
return new PageInfo(new ArrayList());
}
}
public Boolean delete(List<String> zhengzaiAppVersionsIds) {
try {
KylinZhengzaiAppVersions kylinZhengzaiAppVersions = new KylinZhengzaiAppVersions();
kylinZhengzaiAppVersions.setUpdatedAt(DateUtil.getNowTime());
kylinZhengzaiAppVersions.setIsDeleted(2);
kylinZhengzaiAppVersionsMapper.update(
kylinZhengzaiAppVersions
, new UpdateWrapper<KylinZhengzaiAppVersions>().in("zhengzai_app_versions_id", zhengzaiAppVersionsIds)
);
return true;
} catch (Exception e) {
return false;
}
}
}
package com.liquidnet.service.kylin.dao;
import lombok.Data;
import java.io.Serializable;
@Data
public class ZhengzaiAppVersionsListDao implements Serializable {
private String zhengzaiAppVersionsId;
private String name;
private String filePath;
private String version;
private String minVersion;
private Integer type;
private Integer isProduction;
private Integer isForce;
private Integer status;
private String content;
/**
* 创建时间
*/
private String createdAt;
/**
* 修改时间
*/
private String updatedAt;
}
package com.liquidnet.service.kylin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* <p>
* 正在现场app版本控制
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class KylinZhengzaiAppVersions implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Integer mid;
private String zhengzaiAppVersionsId;
private String name;
private String filePath;
private String version;
private String minVersion;
private Integer type;
private Integer isProduction;
private Integer isForce;
private Integer isDeleted;
private String content;
/**
* 创建时间
*/
private String createdAt;
/**
* 修改时间
*/
private String updatedAt;
}
package com.liquidnet.service.kylin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao;
import com.liquidnet.service.kylin.entity.KylinZhengzaiAppVersions;
import java.util.List;
import java.util.Map;
/**
* <p>
* 正在现场app版本控制 Mapper 接口 处理数据库
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
public interface KylinZhengzaiAppVersionsMapper extends BaseMapper<KylinZhengzaiAppVersions> {
List<ZhengzaiAppVersionsListDao> searchList(Map<String, Object> convertBeanToMap);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.kylin.mapper.KylinZhengzaiAppVersionsMapper">
<select id="searchList" parameterType="java.util.Map" resultType="com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao">
SELECT *
FROM kylin_zhengzai_app_versions
<where>
is_deleted = 1
<if test="type != ''">
AND type = ${type}
</if>
</where>
ORDER BY mid DESC
</select>
</mapper>
\ No newline at end of file
...@@ -938,3 +938,25 @@ CREATE TABLE `kylin_order_refund_pic` ...@@ -938,3 +938,25 @@ CREATE TABLE `kylin_order_refund_pic`
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET utf8mb4 DEFAULT CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci COMMENT '订单退款图片表'; COLLATE utf8mb4_unicode_ci COMMENT '订单退款图片表';
drop TABLE if exists `kylin_zhengzai_app_versions`;
CREATE TABLE `kylin_zhengzai_app_versions`
(
`mid` int(11) unsigned NOT NULL AUTO_INCREMENT,
`zhengzai_app_versions_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'zhengzai_app_versions_id',
`name` varchar(128) NOT NULL DEFAULT '' COMMENT '名称',
`file_path` varchar(255) NOT NULL DEFAULT '' COMMENT '文件路径',
`version` varchar(50) NOT NULL DEFAULT '' COMMENT '版本号',
`min_version` varchar(10) NOT NULL DEFAULT '' COMMENT '最近版本号',
`type` tinyint NOT NULL DEFAULT '0' COMMENT '上传类型 1-IOS 2-Android',
`is_production` tinyint NOT NULL DEFAULT '0' COMMENT '是否是生产环境,2否 1是',
`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已删除',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `kylin_zhengzai_app_versions_id_index` (`zhengzai_app_versions_id`),
PRIMARY KEY (`mid`)
) ENGINE = InnoDB
DEFAULT CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci COMMENT '正在现场app版本控制';
...@@ -80,7 +80,7 @@ public class WechatShareController { ...@@ -80,7 +80,7 @@ public class WechatShareController {
} }
public static Map<String, String> sign(String jsapi_ticket, String url) { public static Map<String, String> sign(String jsapi_ticket, String url) {
Map<String, String> ret = new HashMap<String, String>(); Map<String, String> ret = new HashMap();
String nonce_str = create_nonce_str(); String nonce_str = create_nonce_str();
String timestamp = create_timestamp(); String timestamp = create_timestamp();
String string1; String string1;
...@@ -91,7 +91,7 @@ public class WechatShareController { ...@@ -91,7 +91,7 @@ public class WechatShareController {
"&noncestr=" + nonce_str + "&noncestr=" + nonce_str +
"&timestamp=" + timestamp + "&timestamp=" + timestamp +
"&url=" + url; "&url=" + url;
System.out.println(string1); // System.out.println(string1);
try try
{ {
...@@ -110,7 +110,7 @@ public class WechatShareController { ...@@ -110,7 +110,7 @@ public class WechatShareController {
} }
ret.put("url", url); ret.put("url", url);
ret.put("jsapi_ticket", jsapi_ticket); // ret.put("jsapi_ticket", jsapi_ticket);
ret.put("nonceStr", nonce_str); ret.put("nonceStr", nonce_str);
ret.put("timestamp", timestamp); ret.put("timestamp", timestamp);
ret.put("signature", signature); ret.put("signature", signature);
......
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