Ver Fonte

Merge remote-tracking branch 'origin/20210223' into 20210223

hym há 3 anos atrás
pai
commit
95335a25b9

+ 3 - 6
operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderManageController.java

@@ -7,7 +7,6 @@ import com.huaxu.client.UserCenterClient;
 import com.huaxu.common.ConvertXY;
 import com.huaxu.common.FileUploadUtil;
 import com.huaxu.common.MyPoint;
-import com.huaxu.common.RxcException;
 import com.huaxu.entity.Message;
 import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.LoginUser;
@@ -90,7 +89,6 @@ public class WorkOrderManageController {
 
     /**select
      * 新增一条数据
-     *
      * @param workOrderManage 实体类
      * @return Response对象
      */
@@ -370,12 +368,12 @@ public class WorkOrderManageController {
                 String originalFilename = file.getOriginalFilename();
                 String suffixName = originalFilename.substring(originalFilename.lastIndexOf("."));
                 //存储路径
-                if(!suffixName.toLowerCase().equals("apk")||!suffixName.toLowerCase().equals("ipa")){
-                    new AjaxMessage<>(ResultStatus.ERROR, "上传文件类型不正确");
+                if(!suffixName.toLowerCase().equals(".apk")&&!suffixName.toLowerCase().equals(".ipa")){
+                    return new AjaxMessage<>(ResultStatus.ERROR, "上传文件类型不正确");
                 }
                 long size = file.getSize();
                 if (size >  1024 * 1024 * 200) {
-                    throw new RxcException("10004", "文件不能超过200M");
+                    return   new AjaxMessage<>(ResultStatus.ERROR, "文件不能超过200M");
                 }
                 avatar = new StringBuffer(appPackageDir).append(originalFilename).toString();
                 File dest = new File(avatar);
@@ -390,7 +388,6 @@ public class WorkOrderManageController {
         return new AjaxMessage<>(ResultStatus.OK, avatar);
     }
 
-
     @GetMapping("/event/select")
     @ApiOperation(value = "查询事件隐患/所有工单")
     public AjaxMessage<Pagination<WorkOrderManageDto>> selectEvent(

+ 21 - 14
user_center/src/main/java/com/huaxu/controller/VerManageController.java

@@ -18,10 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -46,16 +43,6 @@ public class VerManageController {
     @Autowired
     private DictService dictService;
 
-    /**
-     * 查询app版本信息
-     * @return 单条数据
-     */
-    @RequestMapping(value = "selectVer", method = RequestMethod.GET)
-    @ApiOperation(value = "查询app版本信息")
-    public AjaxMessage<VerManageEntity> selectVer() {
-        return new AjaxMessage<>(ResultStatus.OK, verManageService.selectVer());
-    }
-
     /**
      * 查询app版本信息
      * @return 单条数据
@@ -109,6 +96,26 @@ public class VerManageController {
     }
 
 
+    /**
+     * 删除APP版本信息
+     */
+    @PostMapping(value = "deleteVerManage")
+    @ApiOperation(value = "删除版本管理")
+    public AjaxMessage<Object> deleteVerManage(
+            @ApiParam(value = "要删除的版本ID,多个ID之间用逗号隔开", required = true) @RequestBody String ids){
+        String [] idArray = ids.split(",");
+        if(idArray.length==0){
+            return new AjaxMessage<>(ResultStatus.ERROR,"参数异常");
+        }
+        List<String> idList = Arrays.asList(idArray);
+        int result = verManageService.deleteSelective(idList);
+        if(result>0){
+            return new AjaxMessage<>(ResultStatus.OK);
+        }
+        return new AjaxMessage<>(ResultStatus.ERROR);
+    }
+
+
     /**
      * 获取并设置用户、任务工单类型名称
      * @param result

+ 4 - 0
user_center/src/main/java/com/huaxu/dao/VerManageMapper.java

@@ -7,6 +7,8 @@ import com.huaxu.entity.VerManageEntity;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  *
  * VerManageMapper
@@ -21,4 +23,6 @@ public interface VerManageMapper extends BaseMapper<VerManageEntity> {
     int insertSelective(VerManageEntity verManageEntity);
 
     int updateByPrimaryKeySelective(VerManageEntity verManageEntity);
+
+    int deleteSelective(@Param("ids") List<String> ids);
 }

+ 4 - 0
user_center/src/main/java/com/huaxu/entity/VerManageEntity.java

@@ -87,6 +87,10 @@ public class VerManageEntity implements Serializable {
     /** 强制升级版本 */
     @ApiModelProperty(value = "强制升级版本")
     private String forcedUpgradeVer;
+    
+    /** 下载地址 */
+    @ApiModelProperty(value = "下载地址")
+    private String download;
 
     /** 是否最新版本 */
     @ApiModelProperty(value = "是否最新版本")

+ 5 - 0
user_center/src/main/java/com/huaxu/service/VerManageService.java

@@ -7,6 +7,7 @@ import com.huaxu.dao.VerManageMapper;
 
 import com.huaxu.entity.*;
 
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import org.springframework.stereotype.Service;
@@ -45,4 +46,8 @@ public class VerManageService extends ServiceImpl<VerManageMapper, VerManageEnti
 	public int updateByPrimaryKeySelective(VerManageEntity verManageEntity){
 		return verManageMapper.updateByPrimaryKeySelective(verManageEntity);
 	}
+
+	public int deleteSelective(List<String> ids){
+		return verManageMapper.deleteSelective(ids);
+	}
 }

+ 22 - 1
user_center/src/main/resources/mapper/VerManageMapper.xml

@@ -18,6 +18,7 @@
         <result property="productType"    column="product_type"    />
         <result property="forcedUpgradeVer"    column="forced_upgrade_ver"    />
         <result property="isNewestVer"    column="is_newest_ver"    />
+        <result property="download"    column="download"    />
     </resultMap>
 
     <!--  实体  -->
@@ -35,7 +36,8 @@
          a.cur_app_ver as "curAppVer" ,
          a.product_type as "productType" ,
          a.forced_upgrade_ver as "forcedUpgradeVer" ,
-         a.is_newest_ver as "isNewestVer"
+         a.is_newest_ver as "isNewestVer" ,
+         a.download as "download"
      </sql>
 
     <!--  根据主键获取实体   -->
@@ -61,6 +63,9 @@
             <if test="verUrl != null" >
                 ver_url,
             </if>
+            <if test="download != null" >
+                download,
+            </if>
             <if test="isForcedUpgrade != null" >
                 is_forced_upgrade,
             </if>
@@ -103,6 +108,9 @@
             <if test="verUrl != null" >
                 #{verUrl,jdbcType=VARCHAR},
             </if>
+            <if test="download != null" >
+                #{download,jdbcType=VARCHAR},
+            </if>
             <if test="isForcedUpgrade != null" >
                 #{isForcedUpgrade,jdbcType=INTEGER},
             </if>
@@ -149,6 +157,9 @@
             <if test="verUrl != null" >
                 ver_url = #{verUrl,jdbcType=VARCHAR},
             </if>
+            <if test="download != null" >
+                download = #{download,jdbcType=VARCHAR},
+            </if>
             <if test="isForcedUpgrade != null" >
                 is_forced_upgrade = #{isForcedUpgrade,jdbcType=INTEGER},
             </if>
@@ -182,4 +193,14 @@
         </set>
         where id = #{id,jdbcType=INTEGER}
     </update>
+
+    <delete id="deleteSelective" parameterType="map">
+        update uims_ver_manage
+        set status = 0
+        where id in
+        <foreach collection="ids" item="item" open="(" close=")" separator=",">
+            #{item,jdbcType=INTEGER}
+        </foreach>
+    </delete>
+
 </mapper>