23 changed files with 0 additions and 2235 deletions
@ -1,135 +0,0 @@ |
|||
package com.zdxt.app.controller; |
|||
|
|||
import com.zdxt.app.domain.AppUpload; |
|||
import com.zdxt.app.service.AppUploadService; |
|||
import com.zdxt.auth.framework.web.domain.AjaxResult; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import com.zdxt.log.aspectj.lang.annotation.Log; |
|||
import com.zdxt.log.aspectj.lang.enums.BusinessType; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
import java.io.*; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author hangjialin |
|||
* @Date 2019/12/23 15:08 |
|||
* @Version 1.0 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/project/appUpload") |
|||
public class AppUploadController extends BaseController { |
|||
private String prefix = "project/appUpload"; |
|||
|
|||
@Autowired |
|||
private AppUploadService appUploadService; |
|||
|
|||
@RequiresPermissions("project:appUpload:view") |
|||
@GetMapping("/view") |
|||
public String user() |
|||
{ |
|||
return prefix + "/appUpload"; |
|||
} |
|||
|
|||
@RequiresPermissions("project:appUpload:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(AppUpload appUpload) |
|||
{ |
|||
startPage(); |
|||
List<AppUpload> list = appUploadService.getAppUploadList(appUpload); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add(ModelMap mmap) |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
/** |
|||
* 新增APP上传 |
|||
*/ |
|||
@RequiresPermissions("project:appUpload:add") |
|||
@Log(title = "新增APP上传", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(@Validated AppUpload appUpload, @RequestParam("file")MultipartFile file) throws IOException { |
|||
return AjaxResult.success("操作成功", appUploadService.insertAppUpload(appUpload,file)); |
|||
} |
|||
|
|||
/** |
|||
* 修改APP上传 |
|||
*/ |
|||
@GetMapping("/edit/{appId}") |
|||
public String edit(@PathVariable("appId") String appId, ModelMap mmap) |
|||
{ |
|||
mmap.put("app", appUploadService.selectByAppId(appId)); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改APP上传 |
|||
*/ |
|||
@RequiresPermissions("project:appUpload:edit") |
|||
@Log(title = " 修改APP上传", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(@Validated AppUpload appUpload, @RequestParam("file")MultipartFile file) throws IOException { |
|||
return AjaxResult.success("操作成功",appUploadService.updateAppUpload(appUpload,file)); |
|||
} |
|||
|
|||
/** |
|||
* 修改状态 |
|||
*/ |
|||
@Log(title = "修改状态", businessType = BusinessType.UPDATE) |
|||
@RequiresPermissions("project:appUpload:edit") |
|||
@PostMapping("/editStatus") |
|||
@ResponseBody |
|||
public AjaxResult editStatus(String appStatus,String appId) |
|||
{ |
|||
return AjaxResult.success("操作成功",appUploadService.updateAppUploadState(appStatus,appId)); |
|||
} |
|||
|
|||
/** |
|||
* 删除APP上传 |
|||
*//*
|
|||
@RequiresPermissions("project:appUpload:remove") |
|||
@Log(title = "删除APP上传", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return AjaxResult("操作成功",appUploadService.deleteAppUploads(ids)); |
|||
}*/ |
|||
/** |
|||
* 删除APP上传 |
|||
*/ |
|||
@RequiresPermissions("project:appUpload:remove") |
|||
@Log(title = "删除APP上传", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return AjaxResult.success(appUploadService.deleteAppUploads(ids)); |
|||
} |
|||
/** |
|||
* 查询APP转态为有效的数据 |
|||
* @return |
|||
*/ |
|||
@GetMapping( "/getValidStatus") |
|||
@ResponseBody |
|||
public TableDataInfo getValidStatus() { |
|||
List<AppUpload> list= this.appUploadService.getValidStatus("0"); |
|||
return getDataTable(list); |
|||
} |
|||
} |
|||
@ -1,78 +0,0 @@ |
|||
package com.zdxt.app.domain; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Author hangjialin |
|||
* @Date 2019/12/23 11:15 |
|||
* @Version 1.0 |
|||
* APP上传 |
|||
*/ |
|||
public class AppUpload { |
|||
|
|||
private static final long serialVersionUID = -1769115449597745872L; |
|||
|
|||
/** APP上传ID */ |
|||
private String appId; |
|||
|
|||
/** APP上传版本号 */ |
|||
private String appVersion; |
|||
|
|||
/** APP上传描述 */ |
|||
private String appDescribe; |
|||
|
|||
/** APP上传状态(0有效 1无效) */ |
|||
private String appStatus; |
|||
|
|||
/** APP上传时间 */ |
|||
private Date uploadTime;//APP上传时间
|
|||
|
|||
/** APP上传人 */ |
|||
private String uploadBy; |
|||
|
|||
/** APP上传路径 */ |
|||
private String uploadPath; |
|||
|
|||
public static long getSerialVersionUID() { return serialVersionUID; } |
|||
|
|||
public String getAppId() { return appId; } |
|||
|
|||
public void setAppId(String appId) { this.appId = appId; } |
|||
|
|||
public String getAppVersion() { return appVersion; } |
|||
|
|||
public void setAppVersion(String appVersion) { this.appVersion = appVersion; } |
|||
|
|||
public String getAppDescribe() { return appDescribe; } |
|||
|
|||
public void setAppDescribe(String appDescribe) { this.appDescribe = appDescribe; } |
|||
|
|||
public String getAppStatus() { return appStatus; } |
|||
|
|||
public void setAppStatus(String appStatus) { this.appStatus = appStatus; } |
|||
|
|||
public Date getUploadTime() { return uploadTime; } |
|||
|
|||
public void setUploadTime(Date uploadTime) { this.uploadTime = uploadTime; } |
|||
|
|||
public String getUploadBy() { return uploadBy; } |
|||
|
|||
public void setUploadBy(String uploadBy) { this.uploadBy = uploadBy; } |
|||
|
|||
public String getUploadPath() { return uploadPath; } |
|||
|
|||
public void setUploadPath(String uploadPath) { this.uploadPath = uploadPath; } |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "AppUpload{" + |
|||
"appId=" + appId + |
|||
", appVersion='" + appVersion + '\'' + |
|||
", appDescribe='" + appDescribe + '\'' + |
|||
", appStatus='" + appStatus + '\'' + |
|||
", uploadTime=" + uploadTime + |
|||
", uploadBy='" + uploadBy + '\'' + |
|||
", uploadPath='" + uploadPath + '\'' + |
|||
'}'; |
|||
} |
|||
} |
|||
@ -1,74 +0,0 @@ |
|||
package com.zdxt.app.mapper; |
|||
|
|||
import com.zdxt.app.domain.AppUpload; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author hangjialin |
|||
* @Date 2019/12/23 11:58 |
|||
* @Version 1.0 |
|||
* APP上传 |
|||
*/ |
|||
public interface AppUploadMapper { |
|||
/** |
|||
* 查询APP上传列表 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
public List<AppUpload> getAppUploadList(AppUpload appUpload); |
|||
|
|||
/** |
|||
* 根据id查询查询列表 |
|||
* @return |
|||
*/ |
|||
public AppUpload selectByAppId(String appId); |
|||
|
|||
/** |
|||
* 新增APP上传 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
public int insertAppUpload(AppUpload appUpload); |
|||
|
|||
/** |
|||
* 修改APP上传 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
public int updateAppUpload(AppUpload appUpload); |
|||
|
|||
/** |
|||
* 修改当前选中的状态开启(0.正常) |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
public int updateAppUploadState(@Param("appStatus") String appStatus, @Param("appId") String appId); |
|||
|
|||
/** |
|||
* 列表所有的状态修改为(1.失效) |
|||
* @return |
|||
*/ |
|||
public int updateAppUploadStatus(); |
|||
|
|||
/** |
|||
* 删除APP上传 |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
public int deleteAppUpload(String appId); |
|||
|
|||
/** |
|||
* 批量删除APP上传 |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
public int deleteAppUploads(String[] appId); |
|||
|
|||
/** |
|||
* 查询APP转态为有效的数据 |
|||
* @return |
|||
*/ |
|||
public List<AppUpload> getValidStatus(String appStatus); |
|||
} |
|||
@ -1,70 +0,0 @@ |
|||
package com.zdxt.app.service; |
|||
|
|||
import com.zdxt.app.domain.AppUpload; |
|||
import com.zdxt.common.ZDResponse; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author hangjialin |
|||
* @Date 2019/12/23 14:49 |
|||
* @Version 1.0 |
|||
* APP上传 |
|||
*/ |
|||
public interface AppUploadService { |
|||
/** |
|||
* 查询APP上传列表 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
public List<AppUpload> getAppUploadList(AppUpload appUpload); |
|||
|
|||
/** |
|||
* 根据id查询查询列表 |
|||
* @return |
|||
*/ |
|||
public AppUpload selectByAppId(String appId); |
|||
|
|||
/** |
|||
* 新增APP上传 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
public int insertAppUpload(AppUpload appUpload, MultipartFile file) throws IOException; |
|||
|
|||
/** |
|||
* 修改APP上传 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
public int updateAppUpload(AppUpload appUpload, MultipartFile file) throws IOException; |
|||
|
|||
/** |
|||
* 修改当前选中的状态开启(0.正常,1.失效) |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
public int updateAppUploadState(String appStatus, String appId); |
|||
|
|||
/** |
|||
* 删除APP上传 |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
public int deleteAppUpload(String appId); |
|||
|
|||
/** |
|||
* 批量删除APP上传 |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
int deleteAppUploads(String ids); |
|||
|
|||
/** |
|||
* 查询APP转态为有效的数据 |
|||
* @return |
|||
*/ |
|||
public List<AppUpload> getValidStatus(String appStatus); |
|||
} |
|||
@ -1,168 +0,0 @@ |
|||
package com.zdxt.app.service.impl; |
|||
|
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.zdxt.app.domain.ApkInfo; |
|||
import com.zdxt.app.domain.AppUpload; |
|||
import com.zdxt.app.mapper.AppUploadMapper; |
|||
import com.zdxt.app.service.AppUploadService; |
|||
import com.zdxt.auth.common.utils.file.FileUploadUtils; |
|||
import com.zdxt.auth.common.utils.security.ShiroUtils; |
|||
import com.zdxt.auth.feign.FileUploadApi; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.util.Convert; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.*; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @Author hangjialin |
|||
* @Date 2019/12/23 14:51 |
|||
* @Version 1.0 |
|||
* APP上传文件 |
|||
*/ |
|||
@Service |
|||
public class AppUploadServiceImpl implements AppUploadService { |
|||
@Autowired |
|||
private AppUploadMapper appUploadMapper; |
|||
|
|||
@Autowired |
|||
private FileUploadApi fileUploadApi; |
|||
|
|||
@Value("${ruoyi.profile}") |
|||
private String urlProfile; |
|||
|
|||
public static final String PACKAGE = "package"; |
|||
|
|||
private static final String SPLIT_REGEX = "(: )|(=')|(' )|'"; |
|||
|
|||
/** |
|||
* 查询APP上传列表 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<AppUpload> getAppUploadList(AppUpload appUpload) { |
|||
return this.appUploadMapper.getAppUploadList(appUpload); |
|||
} |
|||
|
|||
/** |
|||
* 根据id查询查询列表 |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public AppUpload selectByAppId(String appId) { |
|||
return this.appUploadMapper.selectByAppId(appId); |
|||
} |
|||
|
|||
/** |
|||
* 新增APP上传 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public int insertAppUpload(AppUpload appUpload, MultipartFile file) throws IOException { |
|||
getAppUpload(appUpload,file); |
|||
Date date = new Date(); |
|||
String guid = UUID.randomUUID().toString(); |
|||
appUpload.setAppId(guid); |
|||
appUpload.setUploadTime(date); |
|||
appUpload.setAppStatus("1"); |
|||
appUpload.setUploadBy(ShiroUtils.getSysUser().getUserName()); |
|||
return this.appUploadMapper.insertAppUpload(appUpload); |
|||
} |
|||
|
|||
/** |
|||
* 修改APP上传 |
|||
* @param appUpload |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public int updateAppUpload(AppUpload appUpload, MultipartFile file) throws IOException { |
|||
getAppUpload(appUpload,file); |
|||
return this.appUploadMapper.updateAppUpload(appUpload); |
|||
} |
|||
|
|||
/** |
|||
* 修改当前选中的状态开启(0.正常1.失效) |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public int updateAppUploadState(String appStatus,String appId) { |
|||
this.appUploadMapper.updateAppUploadStatus(); |
|||
return this.appUploadMapper.updateAppUploadState(appStatus,appId); |
|||
} |
|||
|
|||
/** |
|||
* 删除APP上传 |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public int deleteAppUpload(String appId) { |
|||
return this.appUploadMapper.deleteAppUpload(appId); |
|||
} |
|||
|
|||
@Override |
|||
public int deleteAppUploads(String ids) { |
|||
return this.appUploadMapper.deleteAppUploads(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 查询APP转态为有效的数据 |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<AppUpload> getValidStatus(String appStatus) { |
|||
return this.appUploadMapper.getValidStatus(appStatus); |
|||
} |
|||
|
|||
/** |
|||
* 给版本号赋值 |
|||
* @param apkInfo |
|||
* @param source |
|||
*/ |
|||
private void setApkInfoProperty(ApkInfo apkInfo, String source) { |
|||
if (source.startsWith(PACKAGE)) { |
|||
String[] packageInfo = source.split(SPLIT_REGEX); |
|||
apkInfo.setPackageName(packageInfo[2]); |
|||
apkInfo.setVersionCode(packageInfo[4]); |
|||
apkInfo.setVersionName(packageInfo[6]); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 上传文件 |
|||
*/ |
|||
public void getAppUpload(AppUpload appUpload, MultipartFile file)throws IOException { |
|||
ApkInfo apkInfo = new ApkInfo(); |
|||
String aaptTool = urlProfile + "/aapt.exe"; |
|||
// 上传文件路径
|
|||
String filePath = FileUploadUtils.getDefaultBaseDir(); |
|||
// 上传并返回新文件名称
|
|||
String fileName = fileUploadApi.upload(file); |
|||
String fileNames = fileName.replaceAll("/profile/", filePath); |
|||
ProcessBuilder pb = new ProcessBuilder(aaptTool, "d", "badging", fileNames); |
|||
Process p = pb.start(); |
|||
InputStream is = p.getInputStream(); |
|||
BufferedReader reader = new BufferedReader(new InputStreamReader(is), 8192); |
|||
apkInfo.setSize(new File(fileName).length()); |
|||
String temp = null; |
|||
while ((temp = reader.readLine()) != null) { |
|||
setApkInfoProperty(apkInfo, temp); |
|||
} |
|||
is.close(); |
|||
appUpload.setUploadPath(fileName); |
|||
appUpload.setAppVersion(apkInfo.getVersionName()); |
|||
System.err.println(apkInfo.getVersionName()); |
|||
} |
|||
|
|||
} |
|||
@ -1,107 +0,0 @@ |
|||
<?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.zdxt.app.mapper.AppUploadMapper"> |
|||
<resultMap id="AppUploadResult" type="com.zdxt.app.domain.AppUpload"> |
|||
<result property="appId" column="app_id" /> |
|||
<result property="appVersion" column="app_version"/> |
|||
<result property="appDescribe" column="app_describe"/> |
|||
<result property="appStatus" column="app_status"/> |
|||
<result property="uploadTime" column="uploadTime"/> |
|||
<result property="uploadBy" column="upload_by"/> |
|||
<result property="uploadPath" column="upload_path"/> |
|||
</resultMap> |
|||
<sql id="AppUploadResultVo"> |
|||
app_id, app_version, app_describe, app_status, uploadTime, upload_by, upload_path |
|||
</sql> |
|||
<!--<select id="getAppUploadList" parameterType="AppUpload" resultMap="AppUploadResult" > |
|||
select |
|||
<include refid="AppUploadResultVo"/> |
|||
from app_upload |
|||
where 1=1 |
|||
<if test="appVersion != null and appVersion != ''"> |
|||
and app_version like concat('%', #{appVersion,jdbcType=VARCHAR}, '%') |
|||
</if> |
|||
<if test="appStatus != null and appStatus != ''"> |
|||
and app_status = #{appStatus,jdbcType=VARCHAR} |
|||
</if> order by uploadTime asc |
|||
</select>--> |
|||
<select id="getAppUploadList" parameterType="com.zdxt.app.domain.AppUpload" resultMap="AppUploadResult"> |
|||
<!--@mbg.generated--> |
|||
select |
|||
<include refid="AppUploadResultVo" /> |
|||
from app_upload |
|||
<where> |
|||
<if test="appVersion != null and appVersion != ''"> |
|||
and app_version like concat('%', #{appVersion,jdbcType=VARCHAR}, '%') |
|||
</if> |
|||
<if test="appStatus != null and appStatus != ''"> |
|||
and app_status = #{appStatus,jdbcType=VARCHAR} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="selectByAppId" parameterType="AppUpload" resultMap="AppUploadResult"> |
|||
select |
|||
<include refid="AppUploadResultVo"/> |
|||
from app_upload |
|||
where app_id=#{appId} |
|||
</select> |
|||
<insert id="insertAppUpload" parameterType="AppUpload"> |
|||
insert into app_upload |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="appId != null and appId != ''">app_id,</if> |
|||
<if test="appVersion != null and appVersion != ''">app_version,</if> |
|||
<if test="appDescribe != null and appDescribe != ''">app_describe,</if> |
|||
<if test="appStatus != null and appStatus != ''">app_status,</if> |
|||
<if test="uploadTime != null ">uploadTime,</if> |
|||
<if test="uploadBy != null and uploadBy != ''">upload_by,</if> |
|||
<if test="uploadPath != null and uploadPath != ''">upload_path,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="appId != null and appId != ''">#{appId},</if> |
|||
<if test="appVersion != null and appVersion != ''">#{appVersion},</if> |
|||
<if test="appDescribe != null and appDescribe != ''">#{appDescribe},</if> |
|||
<if test="appStatus != null and appStatus != ''">#{appStatus},</if> |
|||
<if test="uploadTime != null ">#{uploadTime},</if> |
|||
<if test="uploadBy != null and uploadBy != ''">#{uploadBy},</if> |
|||
<if test="uploadPath != null and uploadPath != ''">#{uploadPath},</if> |
|||
</trim> |
|||
</insert> |
|||
<update id="updateAppUpload" parameterType="AppUpload"> |
|||
update app_upload |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="appVersion != null and appVersion != ''">app_version=#{appVersion},</if> |
|||
<if test="appDescribe != null and appDescribe != ''">app_describe=#{appDescribe},</if> |
|||
<if test="appStatus != null and appStatus != ''">app_status=#{appStatus},</if> |
|||
<if test="uploadPath != null and uploadPath != ''">upload_path=#{uploadPath},</if> |
|||
</trim> |
|||
where app_id = #{appId} |
|||
</update> |
|||
<update id="updateAppUploadState" parameterType="AppUpload"> |
|||
update app_upload |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
app_status = #{appStatus} |
|||
</trim> |
|||
where app_id = #{appId} |
|||
</update> |
|||
<update id="updateAppUploadStatus" parameterType="Integer"> |
|||
update app_upload |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
app_status = 1 |
|||
</trim> |
|||
</update> |
|||
<delete id="deleteAppUpload" parameterType="String"> |
|||
delete from app_upload where app_id = #{appId} |
|||
</delete> |
|||
<delete id="deleteAppUploads" parameterType="String"> |
|||
delete from app_upload where app_id in |
|||
<foreach item="appId" collection="array" open="(" separator="," close=")"> |
|||
#{appId} |
|||
</foreach> |
|||
</delete> |
|||
<select id="getValidStatus" parameterType="AppUpload" resultMap="AppUploadResult" > |
|||
select |
|||
<include refid="AppUploadResultVo"/> |
|||
from app_upload |
|||
where app_status = #{appStatus} |
|||
</select> |
|||
</mapper> |
|||
@ -1,107 +0,0 @@ |
|||
<?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.zdxt.app.mapper.AppUploadMapper"> |
|||
<resultMap id="AppUploadResult" type="com.zdxt.app.domain.AppUpload"> |
|||
<result property="appId" column="app_id" /> |
|||
<result property="appVersion" column="app_version"/> |
|||
<result property="appDescribe" column="app_describe"/> |
|||
<result property="appStatus" column="app_status"/> |
|||
<result property="uploadTime" column="uploadTime"/> |
|||
<result property="uploadBy" column="upload_by"/> |
|||
<result property="uploadPath" column="upload_path"/> |
|||
</resultMap> |
|||
<sql id="AppUploadResultVo"> |
|||
app_id, app_version, app_describe, app_status, uploadTime, upload_by, upload_path |
|||
</sql> |
|||
<!--<select id="getAppUploadList" parameterType="AppUpload" resultMap="AppUploadResult" > |
|||
select |
|||
<include refid="AppUploadResultVo"/> |
|||
from app_upload |
|||
where 1=1 |
|||
<if test="appVersion != null and appVersion != ''"> |
|||
and app_version like concat('%', #{appVersion,jdbcType=VARCHAR}, '%') |
|||
</if> |
|||
<if test="appStatus != null and appStatus != ''"> |
|||
and app_status = #{appStatus,jdbcType=VARCHAR} |
|||
</if> order by uploadTime asc |
|||
</select>--> |
|||
<select id="getAppUploadList" parameterType="com.zdxt.app.domain.AppUpload" resultMap="AppUploadResult"> |
|||
<!--@mbg.generated--> |
|||
select |
|||
<include refid="AppUploadResultVo" /> |
|||
from app_upload |
|||
<where> |
|||
<if test="appVersion != null and appVersion != ''"> |
|||
and app_version like concat(concat('%', #{appVersion,jdbcType=VARCHAR}), '%') |
|||
</if> |
|||
<if test="appStatus != null and appStatus != ''"> |
|||
and app_status = #{appStatus,jdbcType=VARCHAR} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="selectByAppId" parameterType="AppUpload" resultMap="AppUploadResult"> |
|||
select |
|||
<include refid="AppUploadResultVo"/> |
|||
from app_upload |
|||
where app_id=#{appId} |
|||
</select> |
|||
<insert id="insertAppUpload" parameterType="AppUpload"> |
|||
insert into app_upload |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="appId != null and appId != ''">app_id,</if> |
|||
<if test="appVersion != null and appVersion != ''">app_version,</if> |
|||
<if test="appDescribe != null and appDescribe != ''">app_describe,</if> |
|||
<if test="appStatus != null and appStatus != ''">app_status,</if> |
|||
<if test="uploadTime != null ">uploadTime,</if> |
|||
<if test="uploadBy != null and uploadBy != ''">upload_by,</if> |
|||
<if test="uploadPath != null and uploadPath != ''">upload_path,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="appId != null and appId != ''">#{appId},</if> |
|||
<if test="appVersion != null and appVersion != ''">#{appVersion},</if> |
|||
<if test="appDescribe != null and appDescribe != ''">#{appDescribe},</if> |
|||
<if test="appStatus != null and appStatus != ''">#{appStatus},</if> |
|||
<if test="uploadTime != null ">#{uploadTime},</if> |
|||
<if test="uploadBy != null and uploadBy != ''">#{uploadBy},</if> |
|||
<if test="uploadPath != null and uploadPath != ''">#{uploadPath},</if> |
|||
</trim> |
|||
</insert> |
|||
<update id="updateAppUpload" parameterType="AppUpload"> |
|||
update app_upload |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="appVersion != null and appVersion != ''">app_version=#{appVersion},</if> |
|||
<if test="appDescribe != null and appDescribe != ''">app_describe=#{appDescribe},</if> |
|||
<if test="appStatus != null and appStatus != ''">app_status=#{appStatus},</if> |
|||
<if test="uploadPath != null and uploadPath != ''">upload_path=#{uploadPath},</if> |
|||
</trim> |
|||
where app_id = #{appId} |
|||
</update> |
|||
<update id="updateAppUploadState" parameterType="AppUpload"> |
|||
update app_upload |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
app_status = #{appStatus} |
|||
</trim> |
|||
where app_id = #{appId} |
|||
</update> |
|||
<update id="updateAppUploadStatus" parameterType="Integer"> |
|||
update app_upload |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
app_status = 1 |
|||
</trim> |
|||
</update> |
|||
<delete id="deleteAppUpload" parameterType="String"> |
|||
delete from app_upload where app_id = #{appId} |
|||
</delete> |
|||
<delete id="deleteAppUploads" parameterType="String"> |
|||
delete from app_upload where app_id in |
|||
<foreach item="appId" collection="array" open="(" separator="," close=")"> |
|||
#{appId} |
|||
</foreach> |
|||
</delete> |
|||
<select id="getValidStatus" parameterType="AppUpload" resultMap="AppUploadResult" > |
|||
select |
|||
<include refid="AppUploadResultVo"/> |
|||
from app_upload |
|||
where app_status = #{appStatus} |
|||
</select> |
|||
</mapper> |
|||
@ -1,109 +0,0 @@ |
|||
package com.zdxt.auth.feign; |
|||
|
|||
import com.zdxt.auth.dto.DistrictBean; |
|||
import com.zdxt.auth.project.system.district.damain.District; |
|||
import com.zdxt.auth.project.system.district.mapper.DistrictMapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @program: EmergencyBaseLib |
|||
* @description: 行政区域Api实现 |
|||
* @author: chenkun |
|||
* @create: 2020-03-23 19:29 |
|||
**/ |
|||
@Service |
|||
public class DistrictApiImpl implements DistrictApi{ |
|||
|
|||
@Autowired |
|||
DistrictMapper districtMapper; |
|||
|
|||
@Override |
|||
public List<DistrictBean> getAllProvince() { |
|||
ArrayList<DistrictBean> resultList = new ArrayList<>(); |
|||
String districtCode = new String("0000"); |
|||
List<District> list = districtMapper.getAllProvince(districtCode); |
|||
if(list.size()>0){ |
|||
for(District district:list){ |
|||
DistrictBean districtBean = transformDate(district); |
|||
resultList.add(districtBean); |
|||
} |
|||
} |
|||
return resultList; |
|||
} |
|||
|
|||
@Override |
|||
public List<DistrictBean> selectCitiesByProvinceCode(String provinceCode) { |
|||
ArrayList<DistrictBean> resultList = new ArrayList<>(); |
|||
if(!provinceCode.equals("")){ |
|||
String code = provinceCode.substring(0, 2); |
|||
District district = new District(); |
|||
district.setDistrictCode(code); |
|||
List<District> districtList = districtMapper.selectDistrictList(district); |
|||
if(districtList.size()>0){ |
|||
for(District district1:districtList){ |
|||
String districtCode = district1.getDistrictCode(); |
|||
if(!districtCode.substring(2,4).equals("00") && districtCode.substring(4,6).equals("00")){ |
|||
DistrictBean districtBean = transformDate(district1); |
|||
resultList.add(districtBean); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return resultList; |
|||
} |
|||
|
|||
@Override |
|||
public List<DistrictBean> selectCountiesByCityCode(String cityCode) { |
|||
ArrayList<DistrictBean> resultList = new ArrayList<>(); |
|||
if(!cityCode.equals("")){ |
|||
String code = cityCode.substring(0, 4); |
|||
District district = new District(); |
|||
district.setDistrictCode(code); |
|||
List<District> districtList = districtMapper.selectDistrictList(district); |
|||
if(districtList.size()>0){ |
|||
for(District district1:districtList){ |
|||
if(!district1.getDistrictCode().substring(4,6).equals("00")){ |
|||
DistrictBean districtBean = transformDate(district1); |
|||
resultList.add(districtBean); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return resultList; |
|||
} |
|||
|
|||
@Override |
|||
public String[] getDistrictByCode(String districtCode) { |
|||
String[] strings1 = new String[3]; |
|||
String[] strings2 = new String[3]; |
|||
strings2[0] = districtCode.substring(0, 2)+"0000"; |
|||
strings2[1] = districtCode.substring(0, 4) + "00"; |
|||
strings2[2] = districtCode; |
|||
for(int i=0;i<strings2.length;i++){ |
|||
District district = new District(); |
|||
district.setDistrictCode(strings2[i]); |
|||
List<District> districtList = districtMapper.selectDistrictList(district); |
|||
if(districtList.size()==1){ |
|||
strings1[i] = districtList.get(0).getDistictName(); |
|||
} |
|||
} |
|||
return strings1; |
|||
} |
|||
|
|||
/** |
|||
* 实体类与javaBean转换 |
|||
* @param district |
|||
* @return |
|||
*/ |
|||
private DistrictBean transformDate(District district){ |
|||
DistrictBean districtBean = new DistrictBean(); |
|||
districtBean.setDistrictId(district.getDistrictId()); |
|||
districtBean.setDistrictCode(district.getDistrictCode()); |
|||
districtBean.setDistictName(district.getDistictName()); |
|||
return districtBean; |
|||
} |
|||
} |
|||
@ -1,125 +0,0 @@ |
|||
package com.zdxt.auth.project.system.district.controller; |
|||
|
|||
import com.zdxt.auth.common.utils.poi.ExcelUtil; |
|||
import com.zdxt.auth.framework.web.controller.BaseController; |
|||
import com.zdxt.auth.framework.web.domain.AjaxResult; |
|||
import com.zdxt.auth.framework.web.page.TableDataInfo; |
|||
import com.zdxt.auth.project.system.district.damain.District; |
|||
import com.zdxt.auth.project.system.district.service.DistrictService; |
|||
import com.zdxt.log.aspectj.lang.annotation.Log; |
|||
import com.zdxt.log.aspectj.lang.enums.BusinessType; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @program: EmergencyBaseLib |
|||
* @description: 行政区划Controller |
|||
* @author: chenkun |
|||
* @create: 2020-03-23 11:47:34 |
|||
**/ |
|||
@Controller |
|||
@RequestMapping("system/district") |
|||
public class DistrictController extends BaseController { |
|||
|
|||
@Autowired |
|||
DistrictService districtService; |
|||
|
|||
private String prefix = "system/district"; |
|||
|
|||
@RequiresPermissions("system:district:view") |
|||
@GetMapping("/view") |
|||
public String distict() |
|||
{ |
|||
return prefix + "/district"; |
|||
} |
|||
|
|||
/** |
|||
* 查询行政区划列表 |
|||
*/ |
|||
@RequiresPermissions("system:district:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(District district) |
|||
{ |
|||
startPage(); |
|||
List<District> list = new ArrayList<>(); |
|||
list = districtService.selectDistrict(district); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 新增行政区划页面 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存危险源数据 |
|||
*/ |
|||
@RequiresPermissions("system:district:add") |
|||
@Log(title = "行政区划", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(District district) |
|||
{ |
|||
return toAjax(districtService.insertDistrict(district)); |
|||
} |
|||
|
|||
/** |
|||
* 修改行政区划数据 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") String id, ModelMap mmap) |
|||
{ |
|||
District district = districtService.selectDistrictById(id); |
|||
mmap.put("District", district); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 查看详情 |
|||
*/ |
|||
@RequiresPermissions("system:district:detail") |
|||
@GetMapping("/detail/{id}") |
|||
public String detail(@PathVariable("id") String id, ModelMap mmap) |
|||
{ |
|||
District district = districtService.selectDistrictById(id); |
|||
mmap.put("District", district); |
|||
return prefix + "/detail"; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 修改保存区划数据 |
|||
*/ |
|||
@RequiresPermissions("system:district:edit") |
|||
@Log(title = "重大危险源", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(District district) |
|||
{ |
|||
return toAjax(districtService.updateDistrict(district)); |
|||
} |
|||
|
|||
/** |
|||
* 删除行政区划数据 |
|||
*/ |
|||
@RequiresPermissions("system:district:remove") |
|||
@Log(title = "行政区划", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove( String ids) |
|||
{ |
|||
return toAjax(districtService.deleteDistrictById(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -1,104 +0,0 @@ |
|||
package com.zdxt.auth.project.system.district.damain; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @program: EmergencyBaseLib |
|||
* @description: 行政区划实体类 |
|||
* @author: chenkun |
|||
* @create: 2020-03-23 09:35 |
|||
**/ |
|||
public class District { |
|||
|
|||
//行政区划ID
|
|||
private String districtId; |
|||
//行政区划编码
|
|||
private String districtCode; |
|||
//行政区划名称
|
|||
private String distictName; |
|||
//启用日期
|
|||
private Date startDate; |
|||
//停用日期
|
|||
private Date disableDate; |
|||
//数据来源单位
|
|||
private String sourceUnit; |
|||
//该数据的最近更新时间
|
|||
private Date updateTime; |
|||
//备注
|
|||
private String remark; |
|||
//数据状态
|
|||
private Integer status; |
|||
|
|||
public String getDistrictId() { |
|||
return districtId; |
|||
} |
|||
|
|||
public void setDistrictId(String districtId) { |
|||
this.districtId = districtId; |
|||
} |
|||
|
|||
public String getDistrictCode() { |
|||
return districtCode; |
|||
} |
|||
|
|||
public void setDistrictCode(String districtCode) { |
|||
this.districtCode = districtCode; |
|||
} |
|||
|
|||
public String getDistictName() { |
|||
return distictName; |
|||
} |
|||
|
|||
public void setDistictName(String distictName) { |
|||
this.distictName = distictName; |
|||
} |
|||
|
|||
public Date getStartDate() { |
|||
return startDate; |
|||
} |
|||
|
|||
public void setStartDate(Date startDate) { |
|||
this.startDate = startDate; |
|||
} |
|||
|
|||
public Date getDisableDate() { |
|||
return disableDate; |
|||
} |
|||
|
|||
public void setDisableDate(Date disableDate) { |
|||
this.disableDate = disableDate; |
|||
} |
|||
|
|||
public String getSourceUnit() { |
|||
return sourceUnit; |
|||
} |
|||
|
|||
public void setSourceUnit(String sourceUnit) { |
|||
this.sourceUnit = sourceUnit; |
|||
} |
|||
|
|||
public Date getUpdateTime() { |
|||
return updateTime; |
|||
} |
|||
|
|||
public void setUpdateTime(Date updateTime) { |
|||
this.updateTime = updateTime; |
|||
} |
|||
|
|||
public String getRemark() { |
|||
return remark; |
|||
} |
|||
|
|||
public void setRemark(String remark) { |
|||
this.remark = remark; |
|||
} |
|||
|
|||
public Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
} |
|||
@ -1,59 +0,0 @@ |
|||
package com.zdxt.auth.project.system.district.mapper; |
|||
|
|||
import com.zdxt.auth.project.system.district.damain.District; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @program: EmergencyBaseLib |
|||
* @description: 行政区划Mapper |
|||
* @author: chenkun |
|||
* @create: 2020-03-23 09:43 |
|||
**/ |
|||
@Repository |
|||
public interface DistrictMapper { |
|||
|
|||
/** |
|||
* 综合查询行政区划列表 |
|||
* @param district |
|||
* @return |
|||
*/ |
|||
List<District> selectDistrictList(District district); |
|||
|
|||
/** |
|||
* 根据行政区划ID获取实体信息 |
|||
* @param districId |
|||
* @return |
|||
*/ |
|||
District selectDistrictListById(String districId); |
|||
|
|||
/** |
|||
* 新增行政区划数据 |
|||
* @param district |
|||
* @return |
|||
*/ |
|||
int insertDistrict(District district); |
|||
|
|||
/** |
|||
* 更新行政区划数据 |
|||
* @param district |
|||
* @return |
|||
*/ |
|||
int updateDistrict(District district); |
|||
|
|||
/** |
|||
* 根据ID删除行政区划数据 |
|||
* @param districtId |
|||
* @return |
|||
*/ |
|||
int deleteDistrict(String districtId); |
|||
|
|||
/** |
|||
* 根据标识符查询所有省份信息 |
|||
* @param districtCode |
|||
* @return |
|||
*/ |
|||
List<District> getAllProvince(String districtCode); |
|||
|
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
package com.zdxt.auth.project.system.district.service; |
|||
|
|||
import com.zdxt.auth.project.system.district.damain.District; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @program: EmergencyBaseLib |
|||
* @description: 行政区划Service |
|||
* @author: chenkun |
|||
* @create: 2020-03-23 09:44 |
|||
**/ |
|||
public interface DistrictService { |
|||
|
|||
List<District> selectDistrict(District district); |
|||
|
|||
District selectDistrictById(String districtId); |
|||
|
|||
int updateDistrict(District district); |
|||
|
|||
int insertDistrict(District district); |
|||
|
|||
int deleteDistrictById(String districtId); |
|||
|
|||
/** |
|||
* 根据完整行政代码获取省市区县名称 |
|||
* @param districtCode |
|||
* @return |
|||
*/ |
|||
String[] getDistrictByCode(String districtCode); |
|||
} |
|||
@ -1,85 +0,0 @@ |
|||
package com.zdxt.auth.project.system.district.service.impl; |
|||
|
|||
import com.zdxt.auth.common.utils.DateUtils; |
|||
import com.zdxt.auth.project.system.district.damain.District; |
|||
import com.zdxt.auth.project.system.district.mapper.DistrictMapper; |
|||
import com.zdxt.auth.project.system.district.service.DistrictService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @program: EmergencyBaseLib |
|||
* @description: 行政区划ServiceImpl |
|||
* @author: chenkun |
|||
* @create: 2020-03-23 09:44 |
|||
**/ |
|||
@Service |
|||
public class DistrictServiceImpl implements DistrictService { |
|||
|
|||
@Autowired |
|||
DistrictMapper districtMapper; |
|||
|
|||
@Override |
|||
public List<District> selectDistrict(District district) { |
|||
return districtMapper.selectDistrictList(district); |
|||
} |
|||
|
|||
@Override |
|||
public District selectDistrictById(String districtId) { |
|||
return districtMapper.selectDistrictListById(districtId); |
|||
} |
|||
|
|||
@Override |
|||
public int updateDistrict(District district) { |
|||
if(district.getStatus() == 1){ |
|||
district.setDisableDate(DateUtils.dateTime("yyyy-MM-dd","2099-01-01")); |
|||
district.setStartDate(DateUtils.getNowDate()); |
|||
}else{ |
|||
district.setStartDate(DateUtils.dateTime("yyyy-MM-dd","2099-01-01")); |
|||
district.setDisableDate(DateUtils.getNowDate()); |
|||
} |
|||
district.setUpdateTime(DateUtils.getNowDate()); |
|||
return districtMapper.updateDistrict(district); |
|||
} |
|||
|
|||
@Override |
|||
public int insertDistrict(District district) { |
|||
district.setDistrictId(UUID.randomUUID().toString()); |
|||
if(district.getStatus() == 1){ |
|||
district.setDisableDate(DateUtils.dateTime("yyyy-MM-dd","2099-01-01")); |
|||
district.setStartDate(DateUtils.getNowDate()); |
|||
}else{ |
|||
district.setStartDate(DateUtils.dateTime("yyyy-MM-dd","2099-01-01")); |
|||
district.setDisableDate(DateUtils.getNowDate()); |
|||
} |
|||
return districtMapper.insertDistrict(district); |
|||
} |
|||
|
|||
@Override |
|||
public int deleteDistrictById(String districtId) { |
|||
return districtMapper.deleteDistrict(districtId); |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public String[] getDistrictByCode(String districtCode) { |
|||
String[] strings1 = new String[3]; |
|||
String[] strings2 = new String[3]; |
|||
strings2[0] = districtCode.substring(0, 2)+"0000"; |
|||
strings2[1] = districtCode.substring(0, 4) + "00"; |
|||
strings2[2] = districtCode; |
|||
for(int i=0;i<strings2.length;i++){ |
|||
District district = new District(); |
|||
district.setDistrictCode(strings2[i]); |
|||
List<District> districtList = districtMapper.selectDistrictList(district); |
|||
if(districtList.size()==1){ |
|||
strings1[i] = districtList.get(0).getDistictName(); |
|||
} |
|||
} |
|||
return strings1; |
|||
} |
|||
} |
|||
@ -1,106 +0,0 @@ |
|||
<?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.zdxt.auth.project.system.district.mapper.DistrictMapper"> |
|||
|
|||
<resultMap type="com.zdxt.auth.project.system.district.damain.District" id="DistrictResult"> |
|||
<id property="districtId" column="DistrictId" /> |
|||
<result property="districtCode" column="DistrictCode" /> |
|||
<result property="distictName" column="DistrictName" /> |
|||
<result property="startDate" column="StartDate" /> |
|||
<result property="disableDate" column="DisableDate" /> |
|||
<result property="sourceUnit" column="SourceUnit" /> |
|||
<result property="updateTime" column="UpdateTime" /> |
|||
<result property="remark" column="Remarks" /> |
|||
<result property="status" column="Status" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDistrictVo"> |
|||
select DistrictId, DistrictCode, DistrictName, StartDate, DisableDate, SourceUnit, UpdateTime, Remarks, Status |
|||
from bas_district |
|||
</sql> |
|||
|
|||
<select id="selectDistrictList" parameterType="com.zdxt.auth.project.system.district.damain.District" resultMap="DistrictResult"> |
|||
<include refid="selectDistrictVo"/> |
|||
<where> |
|||
<if test="districtCode != null and districtCode != ''"> |
|||
AND DistrictCode like concat( #{districtCode}, '%') |
|||
</if> |
|||
<if test="distictName != null and distictName != ''"> |
|||
AND DistrictName like concat('%', #{distictName}, '%') |
|||
</if> |
|||
<if test="startDate != null"> |
|||
AND StartDate = #{startDate} |
|||
</if> |
|||
<if test="disableDate != null"> |
|||
AND DisableDate = #{disableDate} |
|||
</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''"> |
|||
AND SourceUnit = #{sourceUnit} |
|||
</if> |
|||
<if test="updateTime != null"> |
|||
AND UpdateTime = #{updateTime} |
|||
</if> |
|||
<if test="remark != null and remark != ''"> |
|||
AND Remarks = #{remark} |
|||
</if> |
|||
<if test="status != null"> |
|||
AND Status = #{status} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectDistrictListById" parameterType="java.lang.String" resultMap="DistrictResult"> |
|||
<include refid="selectDistrictVo"/> |
|||
where DistrictId = #{districtId} |
|||
</select> |
|||
|
|||
<delete id="deleteDistrict" parameterType="java.lang.String"> |
|||
delete from bas_district where DistrictId = #{districtId} |
|||
</delete> |
|||
|
|||
<update id="updateDistrict" parameterType="com.zdxt.auth.project.system.district.damain.District"> |
|||
update bas_district |
|||
<set> |
|||
<if test="districtCode != null and districtCode != ''">DistrictCode = #{districtCode},</if> |
|||
<if test="distictName != null and distictName != ''">DistrictName = #{distictName},</if> |
|||
<if test="startDate != null">StartDate = #{startDate},</if> |
|||
<if test="disableDate != null">DisableDate = #{disableDate},</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">SourceUnit = #{sourceUnit},</if> |
|||
<if test="updateTime != null">UpdateTime = #{updateTime},</if> |
|||
<if test="remark != null and remark != ''">Remarks = #{remark},</if> |
|||
<if test="status != null">Status = #{status},</if> |
|||
</set> |
|||
where DistrictId = #{districtId} |
|||
</update> |
|||
|
|||
<insert id="insertDistrict" parameterType="com.zdxt.auth.project.system.district.damain.District"> |
|||
insert into bas_district( |
|||
<if test="districtId != null and districtId != ''">DistrictId ,</if> |
|||
<if test="districtCode != null and districtCode != ''">DistrictCode,</if> |
|||
<if test="distictName != null and distictName != ''">DistrictName,</if> |
|||
<if test="startDate != null">StartDate,</if> |
|||
<if test="disableDate != null">DisableDate,</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">SourceUnit,</if> |
|||
<if test="updateTime != null">UpdateTime,</if> |
|||
<if test="remark != null and remark != ''">Remarks,</if> |
|||
<if test="status != null">Status</if> |
|||
)values( |
|||
<if test="districtId != null and districtId != ''">#{districtId},</if> |
|||
<if test="districtCode != null and districtCode != ''">#{districtCode},</if> |
|||
<if test="distictName != null and distictName != ''">#{distictName},</if> |
|||
<if test="startDate != null">#{startDate},</if> |
|||
<if test="disableDate != null">#{disableDate},</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">#{sourceUnit},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
<if test="remark != null and remark != ''">#{remark},</if> |
|||
<if test="status != null">#{status}</if> |
|||
) |
|||
</insert> |
|||
<select id="getAllProvince" parameterType="java.lang.String" resultMap="DistrictResult"> |
|||
<include refid="selectDistrictVo"/> |
|||
where DistrictCode like concat( '%',#{districtCode}) |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -1,106 +0,0 @@ |
|||
<?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.zdxt.auth.project.system.district.mapper.DistrictMapper"> |
|||
|
|||
<resultMap type="com.zdxt.auth.project.system.district.damain.District" id="DistrictResult"> |
|||
<id property="districtId" column="DistrictId" /> |
|||
<result property="districtCode" column="DistrictCode" /> |
|||
<result property="distictName" column="DistrictName" /> |
|||
<result property="startDate" column="StartDate" /> |
|||
<result property="disableDate" column="DisableDate" /> |
|||
<result property="sourceUnit" column="SourceUnit" /> |
|||
<result property="updateTime" column="UpdateTime" /> |
|||
<result property="remark" column="Remarks" /> |
|||
<result property="status" column="Status" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDistrictVo"> |
|||
select DistrictId, DistrictCode, DistrictName, StartDate, DisableDate, SourceUnit, UpdateTime, Remarks, Status |
|||
from bas_district |
|||
</sql> |
|||
|
|||
<select id="selectDistrictList" parameterType="com.zdxt.auth.project.system.district.damain.District" resultMap="DistrictResult"> |
|||
<include refid="selectDistrictVo"/> |
|||
<where> |
|||
<if test="districtCode != null and districtCode != ''"> |
|||
AND DistrictCode like concat( #{districtCode}, '%') |
|||
</if> |
|||
<if test="distictName != null and distictName != ''"> |
|||
AND DistrictName like concat(concat('%', #{distictName}), '%') |
|||
</if> |
|||
<if test="startDate != null"> |
|||
AND StartDate = #{startDate} |
|||
</if> |
|||
<if test="disableDate != null"> |
|||
AND DisableDate = #{disableDate} |
|||
</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''"> |
|||
AND SourceUnit = #{sourceUnit} |
|||
</if> |
|||
<if test="updateTime != null"> |
|||
AND UpdateTime = #{updateTime} |
|||
</if> |
|||
<if test="remark != null and remark != ''"> |
|||
AND Remarks = #{remark} |
|||
</if> |
|||
<if test="status != null"> |
|||
AND Status = #{status} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectDistrictListById" parameterType="java.lang.String" resultMap="DistrictResult"> |
|||
<include refid="selectDistrictVo"/> |
|||
where DistrictId = #{districtId} |
|||
</select> |
|||
|
|||
<delete id="deleteDistrict" parameterType="java.lang.String"> |
|||
delete from bas_district where DistrictId = #{districtId} |
|||
</delete> |
|||
|
|||
<update id="updateDistrict" parameterType="com.zdxt.auth.project.system.district.damain.District"> |
|||
update bas_district |
|||
<set> |
|||
<if test="districtCode != null and districtCode != ''">DistrictCode = #{districtCode},</if> |
|||
<if test="distictName != null and distictName != ''">DistrictName = #{distictName},</if> |
|||
<if test="startDate != null">StartDate = #{startDate},</if> |
|||
<if test="disableDate != null">DisableDate = #{disableDate},</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">SourceUnit = #{sourceUnit},</if> |
|||
<if test="updateTime != null">UpdateTime = #{updateTime},</if> |
|||
<if test="remark != null and remark != ''">Remarks = #{remark},</if> |
|||
<if test="status != null">Status = #{status},</if> |
|||
</set> |
|||
where DistrictId = #{districtId} |
|||
</update> |
|||
|
|||
<insert id="insertDistrict" parameterType="com.zdxt.auth.project.system.district.damain.District"> |
|||
insert into bas_district( |
|||
<if test="districtId != null and districtId != ''">DistrictId ,</if> |
|||
<if test="districtCode != null and districtCode != ''">DistrictCode,</if> |
|||
<if test="distictName != null and distictName != ''">DistrictName,</if> |
|||
<if test="startDate != null">StartDate,</if> |
|||
<if test="disableDate != null">DisableDate,</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">SourceUnit,</if> |
|||
<if test="updateTime != null">UpdateTime,</if> |
|||
<if test="remark != null and remark != ''">Remarks,</if> |
|||
<if test="status != null">Status</if> |
|||
)values( |
|||
<if test="districtId != null and districtId != ''">#{districtId},</if> |
|||
<if test="districtCode != null and districtCode != ''">#{districtCode},</if> |
|||
<if test="distictName != null and distictName != ''">#{distictName},</if> |
|||
<if test="startDate != null">#{startDate},</if> |
|||
<if test="disableDate != null">#{disableDate},</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">#{sourceUnit},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
<if test="remark != null and remark != ''">#{remark},</if> |
|||
<if test="status != null">#{status}</if> |
|||
) |
|||
</insert> |
|||
<select id="getAllProvince" parameterType="java.lang.String" resultMap="DistrictResult"> |
|||
<include refid="selectDistrictVo"/> |
|||
where DistrictCode like concat( '%',#{districtCode}) |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -1,93 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="zdxtInclude :: 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> |
|||
<input type="text" name="userId" th:value="${userId}" hidden/> |
|||
</li> |
|||
<li> |
|||
<p>详细地址:</p> |
|||
<input type="text" name="address"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-reset 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"> |
|||
|
|||
</div> |
|||
<div class="col-sm-12 select-table table-bordered"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="zdxtInclude :: footer"/> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('project:address:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('project:address:remove')}]]; |
|||
var detailFlag = [[${@permission.hasPermi('project:address:detail')}]]; |
|||
var prefix = ctx + "small/project/address"; |
|||
|
|||
$(function () { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add/{}", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
detailUrl: prefix + "/detail/{guid}", |
|||
modalName: "主页", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'name', |
|||
title: '收货人' |
|||
}, |
|||
{ |
|||
field: 'mobile', |
|||
title: '电话' |
|||
}, |
|||
{ |
|||
field: 'address', |
|||
title: '详细地址' |
|||
}, |
|||
{ |
|||
field: 'creator', |
|||
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.guid + '\')"><i class="fa fa-edit"></i> 编辑</a> '); |
|||
// return actions.join(''); |
|||
// } |
|||
// } |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -1,89 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="zdxtInclude :: header('新增APP上传')" /> |
|||
<th:block th:include="zdxtInclude :: jasny-bootstrap-css" /> |
|||
<th:block th:include="zdxtInclude :: bootstrap-fileinput-css"/> |
|||
<th:block th:include="zdxtInclude :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-appUpload-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">描述:</label> |
|||
<div class="col-sm-10"> |
|||
<textarea class="form-control" rows="5" name="appDescribe" id="appDescribe" required></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">路径:</label> |
|||
<div class="col-sm-10"> |
|||
<input name="file" type="file" id="uploadFile" class="file-loading" required/> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="zdxtInclude :: footer" /> |
|||
<th:block th:include="zdxtInclude :: datetimepicker-js" /> |
|||
<th:block th:include="zdxtInclude :: jasny-bootstrap-js" /> |
|||
<th:block th:include="zdxtInclude :: bootstrap-fileinput-js"/> |
|||
<script> |
|||
var prefix = ctx + "project/appUpload"; |
|||
$(function() { |
|||
//初始化fileinput |
|||
var fileInput = new FileInput(); |
|||
fileInput.Init("uploadFile", prefix+'/add'); |
|||
}); |
|||
var msg; |
|||
//初始化fileinput |
|||
var FileInput = function() { |
|||
var oFile = new Object(); |
|||
//初始化fileinput控件(第一次初始化) |
|||
oFile.Init = function(ctrlName, uploadUrl) { |
|||
var control = $('#' + ctrlName); |
|||
//初始化上传控件的样式 |
|||
control.fileinput({ |
|||
language: 'zh', //设置语言 |
|||
uploadUrl: prefix+'/add', //上传的地址 |
|||
allowedFileExtensions: ['apk'], //接收的文件后缀 |
|||
uploadAsync: true, //默认异步上传 |
|||
showUpload: false, //是否显示上传按钮 |
|||
showRemove: true, //显示移除按钮 |
|||
showCaption: true, //是否显示标题 |
|||
dropZoneEnabled: true, //是否显示拖拽区域 |
|||
maxFileCount: 1, //表示允许同时上传的最大文件个数 |
|||
maxFileSize: 51200,//50MB |
|||
enctype: 'multipart/form-data', |
|||
dropZoneTitleClass: 'file-drop-zone-title', |
|||
layoutTemplates:{ |
|||
actionUpload:'' |
|||
}, |
|||
uploadExtraData: function () { |
|||
return { |
|||
appDescribe:$("#appDescribe").val(), |
|||
}; |
|||
} |
|||
}); |
|||
$(".file-drop-zone-title").text("拖拽文件到这里 …") |
|||
//文件上传完成之后发生的事件 |
|||
$("#uploadFile").on("fileuploaded", function(event, data, previewId, index) { |
|||
if (data.response.code == 0) { |
|||
parent.AppUploadRefresh(); |
|||
//关闭窗口 |
|||
parent.layer.closeAll(); |
|||
} |
|||
}); |
|||
} |
|||
return oFile; //这里必须返回oFile对象,否则FileInput组件初始化不成功 |
|||
}; |
|||
$("#form-appUpload-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$("#uploadFile").fileinput("upload"); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -1,157 +0,0 @@ |
|||
<!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('APP上传')" /> |
|||
<th:block th:include="include :: layout-latest-css" /> |
|||
<th:block th:include="include :: ztree-css" /> |
|||
<style> |
|||
.page-list{display: inline-block !important;} |
|||
.pull-right{display: inline-block !important;} |
|||
</style> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="ui-layout-center"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="user-form"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
版本号:<input type="text" name="appVersion"/> |
|||
</li> |
|||
<li> |
|||
状态:<select name="appStatus" th:with="type=${@dict.getType('app_status')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-reset 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="project:appUpload:add"> |
|||
<i class="fa fa-plus"></i> 新增 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="project:appUpload:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="project:appUpload:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
</div> |
|||
|
|||
<div class="col-sm-12 select-table table-bordered"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: layout-latest-js" /> |
|||
<th:block th:include="include :: ztree-js" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('project:appUpload:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('project:appUpload:remove')}]]; |
|||
var prefix = ctx + "project/appUpload"; |
|||
|
|||
$(function() { |
|||
var panehHidden = false; |
|||
if ($(this).width() < 769) { |
|||
panehHidden = true; |
|||
} |
|||
$('body').layout({ initClosed: panehHidden, west__size: 285,west_resizable:false }); |
|||
getAppUploadList(); |
|||
}); |
|||
|
|||
function getAppUploadList() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
sortName: "uploadTime", |
|||
sortOrder: "desc", |
|||
modalName: "APP上传", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'appId', |
|||
title: 'ID', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'appVersion', |
|||
title: '版本号', |
|||
sortable: true, |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
field: 'appDescribe', |
|||
title: '描述', |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
visible: editFlag == 'hidden' ? false : true, |
|||
title: '状态', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
return statusTools(row); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'uploadTime', |
|||
title: '上传时间', |
|||
sortable: true, |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
field: 'uploadBy', |
|||
title: '上传人', |
|||
sortable: true, |
|||
align: 'center', |
|||
}, |
|||
/*{ |
|||
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.appId + '\')"><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.appId + '\')"><i class="fa fa-remove"></i> 删除</a> '); |
|||
return actions.join(''); |
|||
} |
|||
}*/] |
|||
}; |
|||
$.table.init(options); |
|||
} |
|||
function AppUploadRefresh(){ |
|||
$.table.refresh(); |
|||
} |
|||
/* app状态显示 */ |
|||
function statusTools(row) { |
|||
if (row.appStatus == 1) { |
|||
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.appId + '\')"></i> '; |
|||
} else { |
|||
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.appId + '\')"></i> '; |
|||
} |
|||
} |
|||
function enable(appId) { |
|||
$.modal.confirm("确认要启动该版本吗?", function() { |
|||
$.operate.post(prefix + "/editStatus", {"appStatus":0, "appId": appId}); |
|||
}) |
|||
} |
|||
function disable(appId) { |
|||
$.modal.confirm("确认要停用该版本吗?", function() { |
|||
$.operate.post(prefix + "/editStatus", { "appStatus":1,"appId": appId}); |
|||
}) |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -1,91 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增APP上传')" /> |
|||
<th:block th:include="include :: jasny-bootstrap-css" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-css"/> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-appUpload-edit" th:object="${app}"> |
|||
<input type="hidden" id="appId" th:field="*{appId}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">描述:</label> |
|||
<div class="col-sm-10"> |
|||
<textarea class="form-control" rows="5" name="appDescribe" id="appDescribe" th:field="*{appDescribe}" required></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">路径:</label> |
|||
<div class="col-sm-10"> |
|||
<input name="file" type="file" id="uploadFile" class="file-loading" required/> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: jasny-bootstrap-js" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-js"/> |
|||
<script> |
|||
var prefix = ctx + "project/appUpload"; |
|||
$(function() { |
|||
//初始化fileinput |
|||
var fileInput = new FileInput(); |
|||
fileInput.Init("uploadFile", prefix+'/edit'); |
|||
}); |
|||
//初始化fileinput |
|||
var FileInput = function() { |
|||
var oFile = new Object(); |
|||
//初始化fileinput控件(第一次初始化) |
|||
oFile.Init = function(ctrlName, uploadUrl) { |
|||
var control = $('#' + ctrlName); |
|||
//初始化上传控件的样式 |
|||
control.fileinput({ |
|||
language: 'zh', //设置语言 |
|||
uploadUrl: prefix+'/edit', //上传的地址 |
|||
allowedFileExtensions: ['apk'], //接收的文件后缀 |
|||
uploadAsync: true, //默认异步上传 |
|||
showUpload: false, //是否显示上传按钮 |
|||
showRemove: true, //显示移除按钮 |
|||
showCaption: true, //是否显示标题 |
|||
dropZoneEnabled: true, //是否显示拖拽区域 |
|||
maxFileCount: 1, //表示允许同时上传的最大文件个数 |
|||
enctype: 'multipart/form-data', |
|||
maxFileSize: 51200,//50MB |
|||
dropZoneTitleClass: 'file-drop-zone-title', |
|||
autoReplace:true, |
|||
layoutTemplates:{ |
|||
actionUpload:'' |
|||
}, |
|||
uploadExtraData: function () { |
|||
return { |
|||
appId:$("#appId").val(), |
|||
appDescribe:$("#appDescribe").val(), |
|||
}; |
|||
} |
|||
}); |
|||
$(".file-drop-zone-title").text("拖拽文件到这里 …") |
|||
//文件上传完成之后发生的事件 |
|||
$("#uploadFile").on("fileuploaded", function(event, data, previewId, index) { |
|||
if (data.response.code == 0) { |
|||
parent.AppUploadRefresh(); |
|||
//关闭窗口 |
|||
parent.layer.closeAll(); |
|||
} |
|||
}); |
|||
} |
|||
return oFile; //这里必须返回oFile对象,否则FileInput组件初始化不成功 |
|||
}; |
|||
$("#form-appUpload-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$("#uploadFile").fileinput("upload"); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -1,78 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增电话举报')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-district-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">区域名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="distictName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">区域代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="districtCode" class="form-control" type="text" maxlength="6"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">数据来源单位:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="sourceUnit" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">是否启用:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="status" class="form-control"> |
|||
<option selected="selected" value="">请选择</option> |
|||
<option value="1">启用</option> |
|||
<option value="0">停用</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remark" class="form-control"></textarea> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "system/district" |
|||
$("#form-district-add").validate({ |
|||
rules:{ |
|||
distictName: { |
|||
required: true |
|||
}, |
|||
|
|||
districtCode:{ |
|||
required: true |
|||
} |
|||
}, |
|||
messages: { |
|||
distictName: { |
|||
required: "请输入区域名称", |
|||
}, |
|||
departTel: { |
|||
required: "请输入编码", |
|||
} |
|||
}, |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-district-add').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -1,130 +0,0 @@ |
|||
<!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="col-sm-12 search-collapse"> |
|||
<form id="formId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<p>区域名称:</p> |
|||
<input type="text" name="distictName"/> |
|||
</li> |
|||
<li> |
|||
<p>区域代码:</p> |
|||
<input type="text" name="districtCode"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-reset 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="system:district:add"> |
|||
<i class="fa fa-plus"></i> 新增 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="edit()" shiro:hasPermission="system:district:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</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 addFlag = [[${@permission.hasPermi('system:district:add')}]]; |
|||
var editFlag = [[${@permission.hasPermi('system:district:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('system:district:remove')}]]; |
|||
var prefix = ctx + "system/district" |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
modalName: "行政区划", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'districtId', |
|||
title: '行政区划ID', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'distictName', |
|||
title: '行政区划名称', |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
field: 'districtCode', |
|||
title: '行政区划代码', |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
field: 'sourceUnit', |
|||
title: '数据来源单位', |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
field: 'startDate', |
|||
title: '启用时间', |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
field: 'disableDate', |
|||
title: '停用时间', |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
field: 'status', |
|||
title: '状态', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
if (value == '1') { |
|||
return "启用" |
|||
} else { |
|||
return "停用" |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
if (row.parentId != 0) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.districtId + '\')"><i class="fa fa-eye"></i> 查看</a> '); |
|||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.districtId + '\')"><i class="fa fa-remove"></i> 删除</a>'); |
|||
return actions.join(''); |
|||
} else { |
|||
return ""; |
|||
} |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
function edit(){ |
|||
var row = $("#bootstrap-table").bootstrapTable('getSelections')[0]; |
|||
if ($.common.isEmpty(row)) { |
|||
$.modal.alertWarning("请至少选择一条记录"); |
|||
return; |
|||
} |
|||
$.operate.edit(row.districtId,null,null); |
|||
} |
|||
</script> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -1,77 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改电话举报')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-district-edit" th:object="${District}"> |
|||
<input name="id" th:field="*{districtId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">区域名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="distictName" th:field="*{distictName}" class="form-control" type="text" autocomplete="off"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">区域编码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="districtCode" th:field="*{districtCode}" class="form-control" type="text" autocomplete="off"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">数据来源单位:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="sourceUnit" th:field="*{sourceUnit}" class="form-control" type="text" autocomplete="off"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required"> 状态:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="status" class="form-control m-b" th:with="type=${@dict.getType('system_district_status')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option> |
|||
</select> |
|||
</div> |
|||
|
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label" >备注:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="informContent" class="form-control" >[[*{remark}]]</textarea> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "system/district"; |
|||
$("#form-district-edit").validate({ |
|||
rules:{ |
|||
distictName: { |
|||
required: true |
|||
}, |
|||
districtCode:{ |
|||
required: true |
|||
} |
|||
}, |
|||
messages: { |
|||
distictName: { |
|||
required: "请输入区域名称", |
|||
}, |
|||
districtCode: { |
|||
required: "请输入区域编码", |
|||
} |
|||
}, |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-district-edit').serialize()); |
|||
} |
|||
}; |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -1,56 +0,0 @@ |
|||
package com.zdxt.auth.feign; |
|||
|
|||
import com.zdxt.auth.dto.DistrictBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiImplicitParam; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 文件上传API |
|||
* |
|||
* @author chenkun |
|||
* @date 2020/3/23 16:44 |
|||
*/ |
|||
@Api(tags="行政区划API") |
|||
@RestController |
|||
@RequestMapping("/api/district") |
|||
public interface DistrictApi { |
|||
|
|||
/** |
|||
* 获取所有省份信息 |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "获取所有省份信息") |
|||
@GetMapping("/getAllProvincies") |
|||
public List<DistrictBean> getAllProvince(); |
|||
|
|||
/** |
|||
* 根据省区域代码获取市信息 |
|||
* @param provinceCode |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "根据省区域代码获取市信息") |
|||
@ApiImplicitParam(name = "provinceCode",value = "省区域编号",required = true, dataType = "String",paramType = "path") |
|||
@GetMapping("/getCities/{provinceCode}") |
|||
public List<DistrictBean> selectCitiesByProvinceCode(@PathVariable(name = "provinceCode") String provinceCode); |
|||
|
|||
/** |
|||
* 根据市区域代码获取区县信息 |
|||
* @param cityCode |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "根据市区域代码获取区县信息") |
|||
@ApiImplicitParam(name = "cityCode",value = "市区域编号",required = true, dataType = "String",paramType = "path") |
|||
@GetMapping("/getCounties/{cityCode}") |
|||
public List<DistrictBean> selectCountiesByCityCode(@PathVariable(name = "cityCode") String cityCode); |
|||
|
|||
/** |
|||
* 根据行政区域编号获取省、市、区县数组 |
|||
* @param districtCode |
|||
* @return |
|||
*/ |
|||
String[] getDistrictByCode(String districtCode); |
|||
} |
|||
Loading…
Reference in new issue