增加 接口
parent
d4c71d06f2
commit
67f8d20a93
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>ruoyi</artifactId>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<version>4.8.0</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>ruoyi-pda</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 系统模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-framework</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-device</artifactId>
|
||||||
|
<version>4.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.ruoyi.pda.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import com.ruoyi.pda.domain.APKVersion;
|
||||||
|
import com.ruoyi.pda.service.LoginService;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by wangh on 2020/7/17-15:18。
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api")
|
||||||
|
public class LoginController {
|
||||||
|
@Autowired
|
||||||
|
LoginService service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/login/finduser")
|
||||||
|
public String finduser(String name,String pass){
|
||||||
|
System.out.println("登录名称= "+name+" pass= "+pass);
|
||||||
|
return service.login(name,pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getVersion")
|
||||||
|
public String getVersion(){
|
||||||
|
APKVersion apkVersion=service.getVersion();
|
||||||
|
apkVersion.setCode(0);
|
||||||
|
apkVersion.setMsg("");
|
||||||
|
if (apkVersion==null){
|
||||||
|
apkVersion=new APKVersion();
|
||||||
|
apkVersion.setUpdateStatus(0);
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
apkVersion.setUpdateStatus(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String s = JSONObject.toJSONString(apkVersion);
|
||||||
|
System.out.println("请求版本信息"+s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.ruoyi.pda.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.device.domain.BaseInfo;
|
||||||
|
import com.ruoyi.device.service.IBaseInfoService;
|
||||||
|
import com.ruoyi.pda.service.IPdaApiService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.core.domain.AjaxResult.error;
|
||||||
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api")
|
||||||
|
public class PdaApiController {
|
||||||
|
@Autowired
|
||||||
|
private IPdaApiService service;
|
||||||
|
@Autowired
|
||||||
|
private IBaseInfoService baseInfoService;
|
||||||
|
|
||||||
|
@PostMapping("/home/selectDeviceInfo")
|
||||||
|
public AjaxResult selectDeviceInfo(String code) {
|
||||||
|
BaseInfo baseInfo = baseInfoService.selectDeviceInfo(code);
|
||||||
|
if (baseInfo == null) return error("查询失败,条码扫描错误");
|
||||||
|
String deviceState = baseInfo.getDeviceState();
|
||||||
|
String deviceName = baseInfo.getDeviceName();
|
||||||
|
if (deviceState.equals("0")) return error(deviceName + "已停用,使用其他设备吧");
|
||||||
|
if (deviceState.equals("2")) return error(deviceName + "正在维修,使用其他设备吧");
|
||||||
|
if (baseInfo.getUseState().equals("1")) return error(deviceName + "在使用中,更换其他设备吧");
|
||||||
|
return success(baseInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AjaxResult open() throws IOException {
|
||||||
|
URL url = new URL("https://api.example.com/data");
|
||||||
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
|
conn.setRequestMethod("GET");
|
||||||
|
|
||||||
|
int responseCode = conn.getResponseCode();
|
||||||
|
if (responseCode == 200) {
|
||||||
|
// BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||||
|
// String inputLine;
|
||||||
|
// StringBuilder response = new StringBuilder();
|
||||||
|
// while ((inputLine = in.readLine()) != null) {
|
||||||
|
// response.append(inputLine);
|
||||||
|
// }
|
||||||
|
// in.close();
|
||||||
|
// System.out.println(response);
|
||||||
|
}
|
||||||
|
return success(conn.getInputStream());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,121 @@
|
|||||||
|
package com.ruoyi.pda.domain;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手持版本升级对象 pda_apk_version
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-04-06
|
||||||
|
*/
|
||||||
|
public class APKVersion {
|
||||||
|
@JSONField(name = "Code")
|
||||||
|
private int Code;
|
||||||
|
@JSONField(name = "Msg")
|
||||||
|
private String Msg;
|
||||||
|
@JSONField(name = "UpdateStatus")
|
||||||
|
private int UpdateStatus;
|
||||||
|
@JSONField(name = "VersionCode")
|
||||||
|
private Long VersionCode;
|
||||||
|
@JSONField(name = "VersionName")
|
||||||
|
private String VersionName;
|
||||||
|
@JSONField(name = "ModifyContent")
|
||||||
|
private String ModifyContent;
|
||||||
|
@JSONField(name = "DownloadUrl")
|
||||||
|
private String DownloadUrl;
|
||||||
|
@JSONField(name = "ApkSize")
|
||||||
|
private int ApkSize;
|
||||||
|
@JSONField(name = "ApkMd5")
|
||||||
|
private String ApkMd5;
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return Code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
Code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return Msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
Msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpdateStatus() {
|
||||||
|
return UpdateStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateStatus(int updateStatus) {
|
||||||
|
UpdateStatus = updateStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getVersionCode() {
|
||||||
|
return VersionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersionCode(Long versionCode) {
|
||||||
|
VersionCode = versionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersionName() {
|
||||||
|
return VersionName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersionName(String versionName) {
|
||||||
|
VersionName = versionName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModifyContent() {
|
||||||
|
return ModifyContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifyContent(String modifyContent) {
|
||||||
|
ModifyContent = modifyContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadUrl() {
|
||||||
|
return DownloadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDownloadUrl(String downloadUrl) {
|
||||||
|
DownloadUrl = downloadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getApkSize() {
|
||||||
|
return ApkSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApkSize(int apkSize) {
|
||||||
|
ApkSize = apkSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApkMd5() {
|
||||||
|
return ApkMd5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApkMd5(String apkMd5) {
|
||||||
|
ApkMd5 = apkMd5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "APKVersion{" +
|
||||||
|
"Code=" + Code +
|
||||||
|
", Msg='" + Msg + '\'' +
|
||||||
|
", UpdateStatus=" + UpdateStatus +
|
||||||
|
", VersionCode=" + VersionCode +
|
||||||
|
", VersionName='" + VersionName + '\'' +
|
||||||
|
", ModifyContent='" + ModifyContent + '\'' +
|
||||||
|
", DownloadUrl='" + DownloadUrl + '\'' +
|
||||||
|
", ApkSize=" + ApkSize +
|
||||||
|
", ApkMd5='" + ApkMd5 + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package com.ruoyi.pda.domain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wanghao
|
||||||
|
* @date 2023/8/23 10:25
|
||||||
|
*/
|
||||||
|
public class ApiUser {
|
||||||
|
private int id;
|
||||||
|
private String name;
|
||||||
|
private int status;
|
||||||
|
private String role_name;
|
||||||
|
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRole_name() {
|
||||||
|
return role_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole_name(String role_name) {
|
||||||
|
this.role_name = role_name;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,122 @@
|
|||||||
|
package com.ruoyi.pda.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手持版本升级对象 pda_apk_version
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-04-06
|
||||||
|
*/
|
||||||
|
public class PdaApkVersion extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键标识 */
|
||||||
|
private Long objid;
|
||||||
|
|
||||||
|
/** 版本号 */
|
||||||
|
@Excel(name = "版本号")
|
||||||
|
private Long versionCode;
|
||||||
|
|
||||||
|
/** 版本名 */
|
||||||
|
@Excel(name = "版本名")
|
||||||
|
private String versionName;
|
||||||
|
|
||||||
|
/** 信息 */
|
||||||
|
@Excel(name = "信息")
|
||||||
|
private String modifyContent;
|
||||||
|
|
||||||
|
/** 位置 */
|
||||||
|
@Excel(name = "位置")
|
||||||
|
private String downloadUrl;
|
||||||
|
|
||||||
|
/** 文件大小 */
|
||||||
|
@Excel(name = "文件大小")
|
||||||
|
private Long apkSize;
|
||||||
|
|
||||||
|
/** 文件标识 */
|
||||||
|
@Excel(name = "文件标识")
|
||||||
|
private String apkMd5;
|
||||||
|
|
||||||
|
public void setObjid(Long objid)
|
||||||
|
{
|
||||||
|
this.objid = objid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getObjid()
|
||||||
|
{
|
||||||
|
return objid;
|
||||||
|
}
|
||||||
|
public void setVersionCode(Long versionCode)
|
||||||
|
{
|
||||||
|
this.versionCode = versionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getVersionCode()
|
||||||
|
{
|
||||||
|
return versionCode;
|
||||||
|
}
|
||||||
|
public void setVersionName(String versionName)
|
||||||
|
{
|
||||||
|
this.versionName = versionName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersionName()
|
||||||
|
{
|
||||||
|
return versionName;
|
||||||
|
}
|
||||||
|
public void setModifyContent(String modifyContent)
|
||||||
|
{
|
||||||
|
this.modifyContent = modifyContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModifyContent()
|
||||||
|
{
|
||||||
|
return modifyContent;
|
||||||
|
}
|
||||||
|
public void setDownloadUrl(String downloadUrl)
|
||||||
|
{
|
||||||
|
this.downloadUrl = downloadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadUrl()
|
||||||
|
{
|
||||||
|
return downloadUrl;
|
||||||
|
}
|
||||||
|
public void setApkSize(Long apkSize)
|
||||||
|
{
|
||||||
|
this.apkSize = apkSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getApkSize()
|
||||||
|
{
|
||||||
|
return apkSize;
|
||||||
|
}
|
||||||
|
public void setApkMd5(String apkMd5)
|
||||||
|
{
|
||||||
|
this.apkMd5 = apkMd5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApkMd5()
|
||||||
|
{
|
||||||
|
return apkMd5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("objid", getObjid())
|
||||||
|
.append("versionCode", getVersionCode())
|
||||||
|
.append("versionName", getVersionName())
|
||||||
|
.append("modifyContent", getModifyContent())
|
||||||
|
.append("downloadUrl", getDownloadUrl())
|
||||||
|
.append("apkSize", getApkSize())
|
||||||
|
.append("apkMd5", getApkMd5())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.pda.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.pda.domain.APKVersion;
|
||||||
|
import com.ruoyi.pda.domain.ApiUser;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by wangh on 2021/4/26-9:32。
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface LoginMapper {
|
||||||
|
String login_findSalt(String name);
|
||||||
|
|
||||||
|
int login_getUser(@Param("name") String name, @Param("passw") String passw);
|
||||||
|
|
||||||
|
List<String> selectMenuNameByUserID(Integer userID);
|
||||||
|
|
||||||
|
APKVersion getVersion();
|
||||||
|
|
||||||
|
List<String> selectMenuName();
|
||||||
|
|
||||||
|
ApiUser apiLogin(@Param("name")String name,@Param("pass") String md5Str);
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package com.ruoyi.pda.mapper;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface PdaApiMapper {
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.pda.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.pda.domain.PdaApkVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手持版本升级Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-04-06
|
||||||
|
*/
|
||||||
|
public interface PdaApkVersionMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询手持版本升级
|
||||||
|
*
|
||||||
|
* @param objid 手持版本升级主键
|
||||||
|
* @return 手持版本升级
|
||||||
|
*/
|
||||||
|
public PdaApkVersion selectPdaApkVersionByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询手持版本升级列表
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 手持版本升级集合
|
||||||
|
*/
|
||||||
|
public List<PdaApkVersion> selectPdaApkVersionList(PdaApkVersion pdaApkVersion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增手持版本升级
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertPdaApkVersion(PdaApkVersion pdaApkVersion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改手持版本升级
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updatePdaApkVersion(PdaApkVersion pdaApkVersion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除手持版本升级
|
||||||
|
*
|
||||||
|
* @param objid 手持版本升级主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePdaApkVersionByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除手持版本升级
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePdaApkVersionByObjids(String[] objids);
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.ruoyi.pda.service;
|
||||||
|
|
||||||
|
public interface IPdaApiService {
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.pda.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.pda.domain.PdaApkVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手持版本升级Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-04-06
|
||||||
|
*/
|
||||||
|
public interface IPdaApkVersionService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询手持版本升级
|
||||||
|
*
|
||||||
|
* @param objid 手持版本升级主键
|
||||||
|
* @return 手持版本升级
|
||||||
|
*/
|
||||||
|
public PdaApkVersion selectPdaApkVersionByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询手持版本升级列表
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 手持版本升级集合
|
||||||
|
*/
|
||||||
|
public List<PdaApkVersion> selectPdaApkVersionList(PdaApkVersion pdaApkVersion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增手持版本升级
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertPdaApkVersion(PdaApkVersion pdaApkVersion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改手持版本升级
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updatePdaApkVersion(PdaApkVersion pdaApkVersion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除手持版本升级
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的手持版本升级主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePdaApkVersionByObjids(String objids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除手持版本升级信息
|
||||||
|
*
|
||||||
|
* @param objid 手持版本升级主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePdaApkVersionByObjid(Long objid);
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
package com.ruoyi.pda.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ruoyi.pda.domain.APKVersion;
|
||||||
|
import com.ruoyi.pda.domain.ApiUser;
|
||||||
|
import com.ruoyi.pda.mapper.LoginMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by wangh on 2021/4/26-9:27。
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LoginService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
LoginMapper mapper;
|
||||||
|
|
||||||
|
public String login(String name, String pass) {
|
||||||
|
try {
|
||||||
|
String salt = mapper.login_findSalt(name);
|
||||||
|
Integer userID = mapper.login_getUser(name, getMD5Str(name + pass + salt));
|
||||||
|
if (userID != null) {
|
||||||
|
// List<String> menuNameList=name.equals("admin")?
|
||||||
|
// mapper.selectMenuName():
|
||||||
|
// mapper.selectMenuNameByUserID(userID);
|
||||||
|
// if (menuNameList==null||menuNameList.isEmpty()){
|
||||||
|
// return "isEmpty";
|
||||||
|
// }
|
||||||
|
// return JSONObject.toJSONString(menuNameList);
|
||||||
|
return "ok";
|
||||||
|
} else {
|
||||||
|
return "Error";
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
return "Error";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getMD5Str(String str) {
|
||||||
|
MessageDigest messageDigest = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
messageDigest = MessageDigest.getInstance("MD5");
|
||||||
|
|
||||||
|
messageDigest.reset();
|
||||||
|
|
||||||
|
messageDigest.update(str.getBytes("UTF-8"));
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
System.out.println("NoSuchAlgorithmException caught!");
|
||||||
|
System.exit(-1);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] byteArray = messageDigest.digest();
|
||||||
|
|
||||||
|
StringBuffer md5StrBuff = new StringBuffer();
|
||||||
|
|
||||||
|
for (int i = 0; i < byteArray.length; i++) {
|
||||||
|
if (Integer.toHexString(0xFF & byteArray[i]).length() == 1) {
|
||||||
|
|
||||||
|
|
||||||
|
md5StrBuff.append("0").append(Integer.toHexString(0xFF & byteArray[i]));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return md5StrBuff.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public APKVersion getVersion() {
|
||||||
|
return mapper.getVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiUser apiLogin(String name, String pass) {
|
||||||
|
String salt = mapper.login_findSalt(name);
|
||||||
|
return mapper.apiLogin(name, getMD5Str(name + pass + salt));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.pda.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.pda.mapper.PdaApkVersionMapper;
|
||||||
|
import com.ruoyi.pda.domain.PdaApkVersion;
|
||||||
|
import com.ruoyi.pda.service.IPdaApkVersionService;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手持版本升级Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-04-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PdaApkVersionServiceImpl implements IPdaApkVersionService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private PdaApkVersionMapper pdaApkVersionMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询手持版本升级
|
||||||
|
*
|
||||||
|
* @param objid 手持版本升级主键
|
||||||
|
* @return 手持版本升级
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PdaApkVersion selectPdaApkVersionByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return pdaApkVersionMapper.selectPdaApkVersionByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询手持版本升级列表
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 手持版本升级
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PdaApkVersion> selectPdaApkVersionList(PdaApkVersion pdaApkVersion)
|
||||||
|
{
|
||||||
|
return pdaApkVersionMapper.selectPdaApkVersionList(pdaApkVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增手持版本升级
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertPdaApkVersion(PdaApkVersion pdaApkVersion)
|
||||||
|
{
|
||||||
|
pdaApkVersion.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return pdaApkVersionMapper.insertPdaApkVersion(pdaApkVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改手持版本升级
|
||||||
|
*
|
||||||
|
* @param pdaApkVersion 手持版本升级
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updatePdaApkVersion(PdaApkVersion pdaApkVersion)
|
||||||
|
{
|
||||||
|
return pdaApkVersionMapper.updatePdaApkVersion(pdaApkVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除手持版本升级
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的手持版本升级主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deletePdaApkVersionByObjids(String objids)
|
||||||
|
{
|
||||||
|
return pdaApkVersionMapper.deletePdaApkVersionByObjids(Convert.toStrArray(objids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除手持版本升级信息
|
||||||
|
*
|
||||||
|
* @param objid 手持版本升级主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deletePdaApkVersionByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return pdaApkVersionMapper.deletePdaApkVersionByObjid(objid);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.ruoyi.pda.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.pda.mapper.PdaApiMapper;
|
||||||
|
import com.ruoyi.pda.service.IPdaApiService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PdaServiceImpl implements IPdaApiService {
|
||||||
|
@Autowired
|
||||||
|
private PdaApiMapper mapper;
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
<?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.ruoyi.pda.mapper.LoginMapper">
|
||||||
|
|
||||||
|
<!--登陆-->
|
||||||
|
<select id="login_getUser" resultType="java.lang.Integer">
|
||||||
|
SELECT user_id FROM sys_user where login_name=#{name} and `password`=#{passw} limit 1;
|
||||||
|
</select>
|
||||||
|
<select id="login_findSalt" resultType="java.lang.String">
|
||||||
|
|
||||||
|
SELECT salt FROM `sys_user` where login_name=#{name}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMenuName" resultType="java.lang.String">
|
||||||
|
select menu_name
|
||||||
|
from sys_menu where parent_id=2185 order by order_num
|
||||||
|
</select>
|
||||||
|
<select id="selectMenuNameByUserID" resultType="java.lang.String">
|
||||||
|
select menu_name
|
||||||
|
from sys_role_menu r
|
||||||
|
left join sys_menu m on r.menu_id = m.menu_id
|
||||||
|
where r.role_id in (select role_id from sys_user_role where user_id=#{userID})
|
||||||
|
and parent_id=2185
|
||||||
|
group by menu_name,m.menu_id,m.order_num
|
||||||
|
order by m.order_num;
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.pda.domain.APKVersion" id="PdaApkVersionResult">
|
||||||
|
<result property="VersionCode" column="version_code" />
|
||||||
|
<result property="VersionName" column="version_name" />
|
||||||
|
<result property="ModifyContent" column="modify_content" />
|
||||||
|
<result property="DownloadUrl" column="download_url" />
|
||||||
|
<result property="ApkSize" column="apk_size" />
|
||||||
|
<result property="ApkMd5" column="apk_md5" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getVersion" resultMap="PdaApkVersionResult">
|
||||||
|
select version_code, version_name, modify_content, download_url, apk_size, apk_md5 from pda_apk_version order by create_time desc limit 1
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="apiLogin" resultType="com.ruoyi.pda.domain.ApiUser">
|
||||||
|
select u.user_id as id, user_name as name, u.status, sr.role_key as role_name
|
||||||
|
from sys_user u
|
||||||
|
left join sys_user_role ur on u.user_id = ur.user_id
|
||||||
|
left join sys_role sr on ur.role_id = sr.role_id and sr.role_name like '测方%'
|
||||||
|
where login_name = #{name}
|
||||||
|
and u.password = #{pass}
|
||||||
|
limit 1;
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?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.ruoyi.pda.mapper.PdaApiMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,81 @@
|
|||||||
|
<?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.ruoyi.pda.mapper.PdaApkVersionMapper">
|
||||||
|
|
||||||
|
<resultMap type="PdaApkVersion" id="PdaApkVersionResult">
|
||||||
|
<result property="objid" column="objid" />
|
||||||
|
<result property="versionCode" column="version_code" />
|
||||||
|
<result property="versionName" column="version_name" />
|
||||||
|
<result property="modifyContent" column="modify_content" />
|
||||||
|
<result property="downloadUrl" column="download_url" />
|
||||||
|
<result property="apkSize" column="apk_size" />
|
||||||
|
<result property="apkMd5" column="apk_md5" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectPdaApkVersionVo">
|
||||||
|
select objid, version_code, version_name, modify_content, download_url, apk_size, apk_md5, create_time from pda_apk_version
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectPdaApkVersionList" parameterType="PdaApkVersion" resultMap="PdaApkVersionResult">
|
||||||
|
<include refid="selectPdaApkVersionVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="versionCode != null "> and version_code = #{versionCode}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPdaApkVersionByObjid" parameterType="Long" resultMap="PdaApkVersionResult">
|
||||||
|
<include refid="selectPdaApkVersionVo"/>
|
||||||
|
where objid = #{objid}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPdaApkVersion" parameterType="PdaApkVersion" useGeneratedKeys="true" keyProperty="objid">
|
||||||
|
insert into pda_apk_version
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="versionCode != null">version_code,</if>
|
||||||
|
<if test="versionName != null">version_name,</if>
|
||||||
|
<if test="modifyContent != null">modify_content,</if>
|
||||||
|
<if test="downloadUrl != null">download_url,</if>
|
||||||
|
<if test="apkSize != null">apk_size,</if>
|
||||||
|
<if test="apkMd5 != null">apk_md5,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="versionCode != null">#{versionCode},</if>
|
||||||
|
<if test="versionName != null">#{versionName},</if>
|
||||||
|
<if test="modifyContent != null">#{modifyContent},</if>
|
||||||
|
<if test="downloadUrl != null">#{downloadUrl},</if>
|
||||||
|
<if test="apkSize != null">#{apkSize},</if>
|
||||||
|
<if test="apkMd5 != null">#{apkMd5},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatePdaApkVersion" parameterType="PdaApkVersion">
|
||||||
|
update pda_apk_version
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="versionCode != null">version_code = #{versionCode},</if>
|
||||||
|
<if test="versionName != null">version_name = #{versionName},</if>
|
||||||
|
<if test="modifyContent != null">modify_content = #{modifyContent},</if>
|
||||||
|
<if test="downloadUrl != null">download_url = #{downloadUrl},</if>
|
||||||
|
<if test="apkSize != null">apk_size = #{apkSize},</if>
|
||||||
|
<if test="apkMd5 != null">apk_md5 = #{apkMd5},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
where objid = #{objid}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deletePdaApkVersionByObjid" parameterType="Long">
|
||||||
|
delete from pda_apk_version where objid = #{objid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePdaApkVersionByObjids" parameterType="String">
|
||||||
|
delete from pda_apk_version where objid in
|
||||||
|
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,36 @@
|
|||||||
|
-- 菜单 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('手持版本升级', '3', '1', '/pda/pda_version', 'C', '0', 'pda:pda_version:view', '#', 'admin', sysdate(), '', null, '手持版本升级菜单');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
SELECT @parentId := LAST_INSERT_ID();
|
||||||
|
|
||||||
|
-- 按钮 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('手持版本升级查询', @parentId, '1', '#', 'F', '0', 'pda:pda_version:list', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('手持版本升级新增', @parentId, '2', '#', 'F', '0', 'pda:pda_version:add', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('手持版本升级修改', @parentId, '3', '#', 'F', '0', 'pda:pda_version:edit', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('手持版本升级删除', @parentId, '4', '#', 'F', '0', 'pda:pda_version:remove', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('手持版本升级导出', @parentId, '5', '#', 'F', '0', 'pda:pda_version:export', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
-- auto-generated definition
|
||||||
|
create table pda_apk_version
|
||||||
|
(
|
||||||
|
objid int auto_increment comment '主键标识'
|
||||||
|
primary key,
|
||||||
|
version_code int null comment '版本号',
|
||||||
|
version_name varchar(20) null comment '版本名',
|
||||||
|
modify_content varchar(100) null comment '信息',
|
||||||
|
download_url varchar(200) null comment '位置',
|
||||||
|
apk_size int null comment '文件大小',
|
||||||
|
apk_md5 varchar(200) null comment '文件标识',
|
||||||
|
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
|
||||||
|
)
|
||||||
|
comment '手持版本升级' charset = utf8mb3;
|
@ -0,0 +1,125 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增手持版本升级')" />
|
||||||
|
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-pda_version-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">版本号:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="versionCode" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">版本名:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="versionName" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">信息:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" class="form-control" name="modifyContent">
|
||||||
|
<div class="summernote" id="modifyContent"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">位置:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<!-- <input type="hidden" name="downloadUrl">-->
|
||||||
|
<!-- <div class="file-loading">-->
|
||||||
|
<!-- <input class="form-control file-upload" id="downloadUrl" name="file" type="file">-->
|
||||||
|
<input id="filePath" name="filePath" class="form-control" type="file">
|
||||||
|
<!-- </div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "pda/pda_version"
|
||||||
|
$("#form-pda_version-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
// if ($.validate.form()) {
|
||||||
|
// $.operate.save(prefix + "/add", $('#form-pda_version-add').serialize());
|
||||||
|
// }
|
||||||
|
var formData = new FormData();
|
||||||
|
if ($('#filePath')[0].files[0] == null) {
|
||||||
|
$.modal.alertWarning("请先选择文件路径");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
formData.append('versionCode', $("input[name='versionCode']").val());
|
||||||
|
formData.append('versionName', $("input[name='versionName']").val());
|
||||||
|
formData.append('modifyContent', $("input[name='modifyContent']").val());
|
||||||
|
formData.append('file', $('#filePath')[0].files[0]);
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/add",
|
||||||
|
type: 'post',
|
||||||
|
cache: false,
|
||||||
|
data: formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
dataType: "json",
|
||||||
|
success: function(result) {
|
||||||
|
$.operate.successCallback(result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// $(".file-upload").fileinput({
|
||||||
|
// uploadUrl: ctx + 'common/upload',
|
||||||
|
// maxFileCount: 1,
|
||||||
|
// autoReplace: true
|
||||||
|
// }).on('fileuploaded', function (event, data, previewId, index) {
|
||||||
|
// $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||||
|
// }).on('fileremoved', function (event, id, index) {
|
||||||
|
// $("input[name='" + event.currentTarget.id + "']").val('')
|
||||||
|
// })
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$('.summernote').summernote({
|
||||||
|
lang: 'zh-CN',
|
||||||
|
dialogsInBody: true,
|
||||||
|
callbacks: {
|
||||||
|
onChange: function(contents, $edittable) {
|
||||||
|
$("input[name='" + this.id + "']").val(contents);
|
||||||
|
},
|
||||||
|
onImageUpload: function(files) {
|
||||||
|
var obj = this;
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", files[0]);
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#' + obj.id).summernote('insertImage', result.url);
|
||||||
|
} else {
|
||||||
|
$.modal.alertError(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("图片上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,114 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('修改手持版本升级')" />
|
||||||
|
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-pda_version-edit" th:object="${pdaApkVersion}">
|
||||||
|
<input name="objid" th:field="*{objid}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">版本号:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="versionCode" th:field="*{versionCode}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">版本名:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="versionName" th:field="*{versionName}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">信息:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" class="form-control" th:field="*{modifyContent}">
|
||||||
|
<div class="summernote" id="modifyContent"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">位置:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" name="downloadUrl" th:field="*{downloadUrl}">
|
||||||
|
<div class="file-loading">
|
||||||
|
<input class="form-control file-upload" id="downloadUrl" name="file" type="file">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "pda/pda_version";
|
||||||
|
$("#form-pda_version-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-pda_version-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(".file-upload").each(function (i) {
|
||||||
|
var val = $("input[name='" + this.id + "']").val()
|
||||||
|
$(this).fileinput({
|
||||||
|
'uploadUrl': ctx + 'common/upload',
|
||||||
|
initialPreviewAsData: true,
|
||||||
|
initialPreview: [val],
|
||||||
|
maxFileCount: 1,
|
||||||
|
autoReplace: true
|
||||||
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||||
|
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||||
|
}).on('fileremoved', function (event, id, index) {
|
||||||
|
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||||
|
})
|
||||||
|
$(this).fileinput('_initFileActions');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$('.summernote').each(function(i) {
|
||||||
|
$('#' + this.id).summernote({
|
||||||
|
lang: 'zh-CN',
|
||||||
|
dialogsInBody: true,
|
||||||
|
callbacks: {
|
||||||
|
onChange: function(contents, $edittable) {
|
||||||
|
$("input[name='" + this.id + "']").val(contents);
|
||||||
|
},
|
||||||
|
onImageUpload: function(files) {
|
||||||
|
var obj = this;
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", files[0]);
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#' + obj.id).summernote('insertImage', result.url);
|
||||||
|
} else {
|
||||||
|
$.modal.alertError(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("图片上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var content = $("input[name='" + this.id + "']").val();
|
||||||
|
$('#' + this.id).summernote('code', content);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,112 @@
|
|||||||
|
<!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('手持版本升级列表')" />
|
||||||
|
</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>
|
||||||
|
<input type="text" name="versionCode"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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="pda:pda_version:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="pda:pda_version:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="pda:pda_version:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="pda:pda_version:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('pda:pda_version:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('pda:pda_version:remove')}]];
|
||||||
|
var prefix = ctx + "pda/pda_version";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
modalName: "手持版本升级",
|
||||||
|
sortName: "versionCode",
|
||||||
|
sortOrder: "desc",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'objid',
|
||||||
|
title: '主键标识',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'versionCode',
|
||||||
|
title: '版本号'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'versionName',
|
||||||
|
title: '版本名'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'modifyContent',
|
||||||
|
title: '信息'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'downloadUrl',
|
||||||
|
title: '位置'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'apkSize',
|
||||||
|
title: '文件大小'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'apkMd5',
|
||||||
|
title: '文件标识'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue