编号:ZSSAC-585 描述:安装包页面修改
This commit is contained in:
parent
83f3b02382
commit
bd3a791ab0
@ -22,6 +22,10 @@
|
|||||||
<groupId>com.smarterFramework</groupId>
|
<groupId>com.smarterFramework</groupId>
|
||||||
<artifactId>sf-common</artifactId>
|
<artifactId>sf-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.smarterFramework</groupId>
|
||||||
|
<artifactId>sf-file</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -3,10 +3,12 @@ package com.sf.system.deployment.controller;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.sf.common.utils.DateUtils;
|
||||||
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
||||||
import com.sf.system.deployment.service.IDeploymentServicePublishService;
|
import com.sf.system.deployment.service.IDeploymentServicePublishService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.unit.DataUnit;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
@ -102,4 +104,30 @@ public class DeploymentServicePublishController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(deploymentServicePublishService.deleteDeploymentServicePublishByIds(ids));
|
return toAjax(deploymentServicePublishService.deleteDeploymentServicePublishByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布功能
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('deployment:publish:publish')")
|
||||||
|
@GetMapping(value = "/publish/{id}")
|
||||||
|
public AjaxResult publish(@PathVariable("id") Long id) throws Exception {
|
||||||
|
DeploymentServicePublish deploymentServicePublish = deploymentServicePublishService.selectDeploymentServicePublishById(id);
|
||||||
|
// deploymentServicePublish.setUpdateBy(getUsername());
|
||||||
|
deploymentServicePublish.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return success(deploymentServicePublishService.publish(deploymentServicePublish));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发布列表详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('deployment:publish:sold:out')")
|
||||||
|
@GetMapping(value = "/sold/out/{id}")
|
||||||
|
public AjaxResult soldOut(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
DeploymentServicePublish deploymentServicePublish = deploymentServicePublishService.selectDeploymentServicePublishById(id);
|
||||||
|
// deploymentServicePublish.setUpdateBy(getUsername());
|
||||||
|
deploymentServicePublish.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return success(deploymentServicePublishService.soldOut(deploymentServicePublish));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,19 @@
|
|||||||
package com.sf.deploy.controller;
|
package com.sf.system.deployment.controller;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.sf.common.annotation.Log;
|
import com.sf.common.annotation.Log;
|
||||||
import com.sf.common.core.controller.BaseController;
|
import com.sf.common.core.controller.BaseController;
|
||||||
import com.sf.common.core.domain.AjaxResult;
|
import com.sf.common.core.domain.AjaxResult;
|
||||||
import com.sf.common.enums.BusinessType;
|
|
||||||
import com.sf.deploy.domain.SysApkInfo;
|
|
||||||
import com.sf.deploy.service.ISysApkInfoService;
|
|
||||||
import com.sf.common.utils.poi.ExcelUtil;
|
|
||||||
import com.sf.common.core.page.TableDataInfo;
|
import com.sf.common.core.page.TableDataInfo;
|
||||||
|
import com.sf.common.enums.BusinessType;
|
||||||
|
import com.sf.common.utils.poi.ExcelUtil;
|
||||||
|
import com.sf.system.deployment.domain.SysApkInfo;
|
||||||
|
import com.sf.system.deployment.service.ISysApkInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安装包管理(新)Controller
|
* 安装包管理(新)Controller
|
@ -34,7 +34,7 @@ public class DeploymentServicePublish extends BaseEntity
|
|||||||
|
|
||||||
/** 安装包编号 */
|
/** 安装包编号 */
|
||||||
@Excel(name = "安装包编号")
|
@Excel(name = "安装包编号")
|
||||||
private String apkId;
|
private Long apkId;
|
||||||
|
|
||||||
/** app store地址 */
|
/** app store地址 */
|
||||||
@Excel(name = "app store地址")
|
@Excel(name = "app store地址")
|
||||||
@ -99,6 +99,30 @@ public class DeploymentServicePublish extends BaseEntity
|
|||||||
/** 更新人 */
|
/** 更新人 */
|
||||||
private String modified;
|
private String modified;
|
||||||
|
|
||||||
|
/** 系统编码 */
|
||||||
|
private String appCode;
|
||||||
|
|
||||||
|
|
||||||
|
/** 二维码 */
|
||||||
|
private String quickMark;
|
||||||
|
|
||||||
|
|
||||||
|
public String getQuickMark() {
|
||||||
|
return quickMark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuickMark(String quickMark) {
|
||||||
|
this.quickMark = quickMark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppCode() {
|
||||||
|
return appCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppCode(String appCode) {
|
||||||
|
this.appCode = appCode;
|
||||||
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -135,12 +159,12 @@ public class DeploymentServicePublish extends BaseEntity
|
|||||||
{
|
{
|
||||||
return systemType;
|
return systemType;
|
||||||
}
|
}
|
||||||
public void setApkId(String apkId)
|
public void setApkId(Long apkId)
|
||||||
{
|
{
|
||||||
this.apkId = apkId;
|
this.apkId = apkId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getApkId()
|
public Long getApkId()
|
||||||
{
|
{
|
||||||
return apkId;
|
return apkId;
|
||||||
}
|
}
|
||||||
@ -315,7 +339,8 @@ public class DeploymentServicePublish extends BaseEntity
|
|||||||
.append("created", getCreated())
|
.append("created", getCreated())
|
||||||
.append("modified", getModified())
|
.append("modified", getModified())
|
||||||
.append("createTime", getCreateTime())
|
.append("createTime", getCreateTime())
|
||||||
.append("updateTime", getUpdateTime())
|
.append("appCode", getAppCode())
|
||||||
|
.append("quickMark", getQuickMark())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package com.sf.deploy.domain;
|
package com.sf.system.deployment.domain;
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.sf.common.annotation.Excel;
|
import com.sf.common.annotation.Excel;
|
||||||
import com.sf.common.core.domain.BaseEntity;
|
import com.sf.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安装包管理(新)对象 SYS_APK_INFO
|
* 安装包管理(新)对象 SYS_APK_INFO
|
@ -1,7 +1,9 @@
|
|||||||
package com.sf.deploy.mapper;
|
package com.sf.system.deployment.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.sf.system.deployment.domain.SysApkInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.sf.deploy.domain.SysApkInfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安装包管理(新)Mapper接口
|
* 安装包管理(新)Mapper接口
|
@ -2,6 +2,7 @@ package com.sf.system.deployment.service;
|
|||||||
|
|
||||||
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,4 +60,8 @@ public interface IDeploymentServicePublishService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeploymentServicePublishById(Long id);
|
public int deleteDeploymentServicePublishById(Long id);
|
||||||
|
|
||||||
|
public int publish(DeploymentServicePublish deploymentServicePublish) throws Exception;
|
||||||
|
|
||||||
|
public int soldOut(DeploymentServicePublish deploymentServicePublish);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package com.sf.deploy.service;
|
package com.sf.system.deployment.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.sf.system.deployment.domain.SysApkInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.sf.deploy.domain.SysApkInfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安装包管理(新)Service接口
|
* 安装包管理(新)Service接口
|
@ -1,12 +1,21 @@
|
|||||||
package com.sf.system.deployment.service.impl;
|
package com.sf.system.deployment.service.impl;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.sf.common.utils.DateUtils;
|
import com.sf.common.utils.DateUtils;
|
||||||
|
import com.sf.common.utils.file.QRCodeUtils;
|
||||||
|
import com.sf.file.domain.SysOss;
|
||||||
|
import com.sf.file.service.ISysOssService;
|
||||||
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
||||||
|
import com.sf.system.deployment.domain.SysApkInfo;
|
||||||
import com.sf.system.deployment.mapper.DeploymentServicePublishMapper;
|
import com.sf.system.deployment.mapper.DeploymentServicePublishMapper;
|
||||||
import com.sf.system.deployment.service.IDeploymentServicePublishService;
|
import com.sf.system.deployment.service.IDeploymentServicePublishService;
|
||||||
|
import com.sf.system.deployment.service.ISysApkInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布列表Service业务层处理
|
* 发布列表Service业务层处理
|
||||||
@ -17,6 +26,10 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class DeploymentServicePublishServiceImpl implements IDeploymentServicePublishService
|
public class DeploymentServicePublishServiceImpl implements IDeploymentServicePublishService
|
||||||
{
|
{
|
||||||
|
@Resource
|
||||||
|
private ISysApkInfoService iSysApkInfoService;
|
||||||
|
@Resource
|
||||||
|
private ISysOssService iSysOssService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeploymentServicePublishMapper deploymentServicePublishMapper;
|
private DeploymentServicePublishMapper deploymentServicePublishMapper;
|
||||||
|
|
||||||
@ -93,4 +106,26 @@ public class DeploymentServicePublishServiceImpl implements IDeploymentServicePu
|
|||||||
{
|
{
|
||||||
return deploymentServicePublishMapper.deleteDeploymentServicePublishById(id);
|
return deploymentServicePublishMapper.deleteDeploymentServicePublishById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int publish(DeploymentServicePublish deploymentServicePublish) throws Exception {
|
||||||
|
if(1 == deploymentServicePublish.getStatus()){
|
||||||
|
return 0;//不允许重复发布
|
||||||
|
}
|
||||||
|
deploymentServicePublish.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
SysApkInfo sysApkInfo = iSysApkInfoService.selectSysApkInfoById(deploymentServicePublish.getApkId());
|
||||||
|
SysOss oss = iSysOssService.upload(QRCodeUtils.generateQRCode(sysApkInfo.getSysApk()));
|
||||||
|
deploymentServicePublish.setStatus(1L);
|
||||||
|
deploymentServicePublish.setQuickMark(oss.getUrl());
|
||||||
|
return deploymentServicePublishMapper.updateDeploymentServicePublish(deploymentServicePublish);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int soldOut(DeploymentServicePublish deploymentServicePublish) {
|
||||||
|
if(2 == deploymentServicePublish.getStatus()){
|
||||||
|
return 0;//不允许重复下架
|
||||||
|
}
|
||||||
|
deploymentServicePublish.setStatus(3L);
|
||||||
|
return deploymentServicePublishMapper.updateDeploymentServicePublish(deploymentServicePublish);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package com.sf.deploy.service.impl;
|
package com.sf.system.deployment.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.sf.common.utils.DateUtils;
|
import com.sf.common.utils.DateUtils;
|
||||||
|
import com.sf.system.deployment.domain.SysApkInfo;
|
||||||
|
import com.sf.system.deployment.mapper.SysApkInfoMapper;
|
||||||
|
import com.sf.system.deployment.service.ISysApkInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.sf.deploy.mapper.SysApkInfoMapper;
|
|
||||||
import com.sf.deploy.domain.SysApkInfo;
|
import java.util.List;
|
||||||
import com.sf.deploy.service.ISysApkInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安装包管理(新)Service业务层处理
|
* 安装包管理(新)Service业务层处理
|
@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="applyId" column="apply_id" />
|
<result property="applyId" column="apply_id" />
|
||||||
<result property="appName" column="app_name" />
|
<result property="appName" column="app_name" />
|
||||||
|
<result property="appCode" column="app_code" />
|
||||||
|
<result property="quickMark" column="quick_mark" />
|
||||||
<result property="systemType" column="system_type" />
|
<result property="systemType" column="system_type" />
|
||||||
<result property="apkId" column="apk_id" />
|
<result property="apkId" column="apk_id" />
|
||||||
<result property="appStoreAddress" column="app_store_address" />
|
<result property="appStoreAddress" column="app_store_address" />
|
||||||
@ -32,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectDeploymentServicePublishVo">
|
<sql id="selectDeploymentServicePublishVo">
|
||||||
select id, apply_id, app_name, system_type, apk_id, app_store_address, version, version_desc, publish_environment, publish_strategy, result_notify, public_version, force_update, download_verification, update_object, validity_start_time, validity_end_time, remark, status, is_delete, created, modified, create_time, update_time from DEPLOYMENT_SERVICE_PUBLISH
|
select id, apply_id, app_name, app_code, quick_mark, system_type, apk_id, app_store_address, version, version_desc, publish_environment, publish_strategy, result_notify, public_version, force_update, download_verification, update_object, validity_start_time, validity_end_time, remark, status, is_delete, created, modified, create_time, update_time from DEPLOYMENT_SERVICE_PUBLISH
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDeploymentServicePublishList" parameterType="DeploymentServicePublish" resultMap="DeploymentServicePublishResult">
|
<select id="selectDeploymentServicePublishList" parameterType="DeploymentServicePublish" resultMap="DeploymentServicePublishResult">
|
||||||
@ -109,6 +111,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="applyId != null">apply_id = #{applyId},</if>
|
<if test="applyId != null">apply_id = #{applyId},</if>
|
||||||
<if test="appName != null and appName != ''">app_name = #{appName},</if>
|
<if test="appName != null and appName != ''">app_name = #{appName},</if>
|
||||||
|
<if test="appCode != null and appCode != ''">app_code = #{appCode},</if>
|
||||||
|
<if test="quickMark != null and quickMark != ''">quick_mark = #{quickMark},</if>
|
||||||
<if test="systemType != null and systemType != ''">system_type = #{systemType},</if>
|
<if test="systemType != null and systemType != ''">system_type = #{systemType},</if>
|
||||||
<if test="apkId != null and apkId != ''">apk_id = #{apkId},</if>
|
<if test="apkId != null and apkId != ''">apk_id = #{apkId},</if>
|
||||||
<if test="appStoreAddress != null">app_store_address = #{appStoreAddress},</if>
|
<if test="appStoreAddress != null">app_store_address = #{appStoreAddress},</if>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.sf.deploy.mapper.SysApkInfoMapper">
|
<mapper namespace="com.sf.system.deployment.mapper.SysApkInfoMapper">
|
||||||
|
|
||||||
<resultMap type="SysApkInfo" id="SysApkInfoResult">
|
<resultMap type="SysApkInfo" id="SysApkInfoResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
@ -42,3 +42,17 @@ export function delPublish(id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 发布
|
||||||
|
export function publish(id) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/publish/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 下架
|
||||||
|
export function delPublish(id) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/sold/out/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user