|
@@ -7,8 +7,8 @@ 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.evaluation.service.EvaluationCycleService;
|
|
|
import com.huaxu.model.AjaxMessage;
|
|
|
import com.huaxu.model.LoginUser;
|
|
|
import com.huaxu.model.Pagination;
|
|
@@ -45,6 +45,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -84,6 +85,9 @@ public class WorkOrderManageController {
|
|
|
@Value("${UMIS.sys_video_path}")
|
|
|
private String videoDir;
|
|
|
|
|
|
+ @Value("{UMIS.sys_app_package_path}")
|
|
|
+ private String appPackageDir;
|
|
|
+
|
|
|
/**select
|
|
|
* 新增一条数据
|
|
|
*
|
|
@@ -355,6 +359,38 @@ public class WorkOrderManageController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK, avatar);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "上传APP安装包")
|
|
|
+ @RequestMapping(value = "addAppPackage", method = RequestMethod.POST)
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxMessage<String> addAppPackage(@ApiParam(value = "上传APP安装包", required = true) @RequestParam("avatarfile") MultipartFile file) {
|
|
|
+ String avatar = "";
|
|
|
+ if (!file.isEmpty()) {
|
|
|
+ try {
|
|
|
+ //上传简单文件名
|
|
|
+ String originalFilename = file.getOriginalFilename();
|
|
|
+ String suffixName = originalFilename.substring(originalFilename.lastIndexOf("."));
|
|
|
+ //存储路径
|
|
|
+ if(!suffixName.toLowerCase().equals("apk")||!suffixName.toLowerCase().equals("ipa")){
|
|
|
+ new AjaxMessage<>(ResultStatus.ERROR, "上传文件类型不正确");
|
|
|
+ }
|
|
|
+ long size = file.getSize();
|
|
|
+ if (size > 1024 * 1024 * 200) {
|
|
|
+ throw new RxcException("10004", "文件不能超过200M");
|
|
|
+ }
|
|
|
+ avatar = new StringBuffer(appPackageDir).append(originalFilename).toString();
|
|
|
+ File dest = new File(avatar);
|
|
|
+ if(!dest.getParentFile().exists()){
|
|
|
+ dest.getParentFile().mkdirs();
|
|
|
+ }
|
|
|
+ file.transferTo(new File(avatar));
|
|
|
+ } catch (IOException e) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.ERROR, e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, avatar);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@GetMapping("/event/select")
|
|
|
@ApiOperation(value = "查询事件隐患/所有工单")
|
|
|
public AjaxMessage<Pagination<WorkOrderManageDto>> selectEvent(
|