|
|
@@ -1,17 +1,10 @@
|
|
|
package org.jeecg.modules.platmanager.controller;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
-import java.net.URLDecoder;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.PermissionData;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
@@ -23,275 +16,295 @@ import org.jeecg.common.utils.OauthApi;
|
|
|
import org.jeecg.common.utils.OauthTokenUtils;
|
|
|
import org.jeecg.modules.platmanager.entity.HwPlatform;
|
|
|
import org.jeecg.modules.platmanager.service.IHwPlatformService;
|
|
|
-
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-
|
|
|
+import org.jeecg.modules.subcontratormanager.entity.HwSubcontractor;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
-
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
- /**
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
* @Description: 平台信息
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2019-09-17
|
|
|
+ * @Date: 2019-09-17
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/platmanager/hwPlatform")
|
|
|
@Slf4j
|
|
|
public class HwPlatformController {
|
|
|
- @Autowired
|
|
|
- private IHwPlatformService hwPlatformService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 分页列表查询
|
|
|
- * @param hwPlatform
|
|
|
- * @param pageNo
|
|
|
- * @param pageSize
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping(value = "/list")
|
|
|
- @PermissionData(pageComponent = "platmanager/HwPlatformList")
|
|
|
- public Result<IPage<HwPlatform>> queryPageList(HwPlatform hwPlatform,
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
- Result<IPage<HwPlatform>> result = new Result<IPage<HwPlatform>>();
|
|
|
- QueryWrapper<HwPlatform> queryWrapper = QueryGenerator.initQueryWrapperForRule(hwPlatform, req.getParameterMap());
|
|
|
- Page<HwPlatform> page = new Page<HwPlatform>(pageNo, pageSize);
|
|
|
- Page<HwPlatform> pageList = hwPlatformService.pageList(page, hwPlatform,queryWrapper);
|
|
|
- result.setSuccess(true);
|
|
|
- result.setResult(pageList);
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加
|
|
|
- * @param hwPlatform
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping(value = "/add")
|
|
|
- public Result<HwPlatform> add(@RequestBody HwPlatform hwPlatform) {
|
|
|
- Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
- try {
|
|
|
- hwPlatformService.saveHwPlatform(hwPlatform);
|
|
|
- result.success("添加成功!");
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage(),e);
|
|
|
- result.error500("操作失败");
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- * @param hwPlatform
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PutMapping(value = "/edit")
|
|
|
- public Result<HwPlatform> edit(@RequestBody HwPlatform hwPlatform) {
|
|
|
- Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
- HwPlatform hwPlatformEntity = hwPlatformService.getById(hwPlatform.getId());
|
|
|
- if(hwPlatformEntity==null) {
|
|
|
- result.error500("未找到对应实体");
|
|
|
- }else {
|
|
|
- boolean ok = hwPlatformService.updatePlatform(hwPlatform);
|
|
|
- //TODO 返回false说明什么?
|
|
|
- if(ok) {
|
|
|
- result.success("修改成功!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return result;
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private IHwPlatformService hwPlatformService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param hwPlatform
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ @PermissionData(pageComponent = "platmanager/HwPlatformList")
|
|
|
+ public Result<IPage<HwPlatform>> queryPageList(HwPlatform hwPlatform,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<IPage<HwPlatform>> result = new Result<IPage<HwPlatform>>();
|
|
|
+ QueryWrapper<HwPlatform> queryWrapper = QueryGenerator.initQueryWrapperForRule(hwPlatform, req.getParameterMap());
|
|
|
+ Page<HwPlatform> page = new Page<HwPlatform>(pageNo, pageSize);
|
|
|
+ Page<HwPlatform> pageList = hwPlatformService.pageList(page, hwPlatform, queryWrapper);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(pageList);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param hwPlatform
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public Result<HwPlatform> add(@RequestBody HwPlatform hwPlatform) {
|
|
|
+ Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
+ try {
|
|
|
+ hwPlatformService.saveHwPlatform(hwPlatform);
|
|
|
+ result.success("添加成功!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ result.error500("操作失败");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ *
|
|
|
+ * @param hwPlatform
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PutMapping(value = "/edit")
|
|
|
+ public Result<HwPlatform> edit(@RequestBody HwPlatform hwPlatform) {
|
|
|
+ Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
+ HwPlatform hwPlatformEntity = hwPlatformService.getById(hwPlatform.getId());
|
|
|
+ if (hwPlatformEntity == null) {
|
|
|
+ result.error500("未找到对应实体");
|
|
|
+ } else {
|
|
|
+ boolean ok = hwPlatformService.updatePlatform(hwPlatform);
|
|
|
+ //TODO 返回false说明什么?
|
|
|
+ if (ok) {
|
|
|
+ result.success("修改成功!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 锁定解锁
|
|
|
+ *
|
|
|
+ * @param hwPlatform
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PutMapping(value = "/locking")
|
|
|
+ public Result<HwPlatform> locking(@RequestBody HwPlatform hwPlatform) {
|
|
|
+ Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
+ HwPlatform hwPlatformEntity = hwPlatformService.getById(hwPlatform.getId());
|
|
|
+ if (hwPlatformEntity == null) {
|
|
|
+ result.error500("未找到对应实体");
|
|
|
+ } else {
|
|
|
+ boolean ok = hwPlatformService.updateByHwPlatform(hwPlatform);
|
|
|
+ //TODO 返回false说明什么?
|
|
|
+ if (ok) {
|
|
|
+ if (hwPlatform.getStatus() == 1) {
|
|
|
+ result.success("锁定成功!");
|
|
|
+ } else {
|
|
|
+ result.success("解锁成功!");
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 锁定解锁
|
|
|
- * @param hwPlatform
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PutMapping(value = "/locking")
|
|
|
- public Result<HwPlatform> locking(@RequestBody HwPlatform hwPlatform) {
|
|
|
- Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
- HwPlatform hwPlatformEntity = hwPlatformService.getById(hwPlatform.getId());
|
|
|
- if(hwPlatformEntity==null) {
|
|
|
- result.error500("未找到对应实体");
|
|
|
- }else {
|
|
|
- boolean ok = hwPlatformService.updateByHwPlatform(hwPlatform);
|
|
|
- //TODO 返回false说明什么?
|
|
|
- if(ok) {
|
|
|
- if(hwPlatform.getStatus()==1){
|
|
|
- result.success("锁定成功!");
|
|
|
- }else {
|
|
|
- result.success("解锁成功!");
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 通过id删除
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ try {
|
|
|
+ hwPlatformService.removeById(id);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("删除失败", e.getMessage());
|
|
|
+ return Result.error("删除失败!");
|
|
|
+ }
|
|
|
+ return Result.ok("删除成功!");
|
|
|
+ }
|
|
|
|
|
|
- return result;
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
+ public Result<HwPlatform> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
+ Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
+ if (ids == null || "".equals(ids.trim())) {
|
|
|
+ result.error500("参数不识别!");
|
|
|
+ } else {
|
|
|
+ this.hwPlatformService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ result.success("删除成功!");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id删除
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @DeleteMapping(value = "/delete")
|
|
|
- public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
- try {
|
|
|
- hwPlatformService.removeById(id);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("删除失败",e.getMessage());
|
|
|
- return Result.error("删除失败!");
|
|
|
- }
|
|
|
- return Result.ok("删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量删除
|
|
|
- * @param ids
|
|
|
- * @return
|
|
|
- */
|
|
|
- @DeleteMapping(value = "/deleteBatch")
|
|
|
- public Result<HwPlatform> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
- Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
- if(ids==null || "".equals(ids.trim())) {
|
|
|
- result.error500("参数不识别!");
|
|
|
- }else {
|
|
|
- this.hwPlatformService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
- result.success("删除成功!");
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id查询
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping(value = "/queryById")
|
|
|
- public Result<HwPlatform> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
- Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
- HwPlatform hwPlatform = hwPlatformService.getById(id);
|
|
|
- if(hwPlatform==null) {
|
|
|
- result.error500("未找到对应实体");
|
|
|
- }else {
|
|
|
- result.setResult(hwPlatform);
|
|
|
- result.setSuccess(true);
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 通过id查询
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
+ public Result<HwPlatform> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ Result<HwPlatform> result = new Result<HwPlatform>();
|
|
|
+ HwPlatform hwPlatform = hwPlatformService.getById(id);
|
|
|
+ if (hwPlatform == null) {
|
|
|
+ result.error500("未找到对应实体");
|
|
|
+ } else {
|
|
|
+ result.setResult(hwPlatform);
|
|
|
+ result.setSuccess(true);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 导出excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param
|
|
|
- */
|
|
|
- @RequestMapping(value = "/exportXls")
|
|
|
- public ModelAndView exportXls(HttpServletRequest request, HwPlatform hwPlatform) {
|
|
|
- // Step.1 组装查询条件查询数据
|
|
|
- QueryWrapper<HwPlatform> queryWrapper = QueryGenerator.initQueryWrapper(hwPlatform, request.getParameterMap());
|
|
|
- List<HwPlatform> pageList = hwPlatformService.list(queryWrapper);
|
|
|
- // Step.2 AutoPoi 导出Excel
|
|
|
- ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
- // 过滤选中数据
|
|
|
- String selections = request.getParameter("selections");
|
|
|
- if(oConvertUtils.isEmpty(selections)) {
|
|
|
- mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
|
|
- }else {
|
|
|
- List<String> selectionList = Arrays.asList(selections.split(","));
|
|
|
- List<HwPlatform> exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
|
|
|
- mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
|
|
- }
|
|
|
- //导出文件名称
|
|
|
- mv.addObject(NormalExcelConstants.FILE_NAME, "平台信息列表");
|
|
|
- mv.addObject(NormalExcelConstants.CLASS, HwPlatform.class);
|
|
|
- mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("平台信息列表数据", "导出人:Jeecg", "导出信息"));
|
|
|
- return mv;
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 导出excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/exportXls")
|
|
|
+ public ModelAndView exportXls(HttpServletRequest request, HwPlatform hwPlatform) {
|
|
|
+ // Step.1 组装查询条件查询数据
|
|
|
+ QueryWrapper<HwPlatform> queryWrapper = QueryGenerator.initQueryWrapper(hwPlatform, request.getParameterMap());
|
|
|
+ List<HwPlatform> pageList = hwPlatformService.list(queryWrapper);
|
|
|
+ // Step.2 AutoPoi 导出Excel
|
|
|
+ ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
+ // 过滤选中数据
|
|
|
+ String selections = request.getParameter("selections");
|
|
|
+ if (oConvertUtils.isEmpty(selections)) {
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
|
|
+ } else {
|
|
|
+ List<String> selectionList = Arrays.asList(selections.split(","));
|
|
|
+ List<HwPlatform> exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
|
|
+ }
|
|
|
+ //导出文件名称
|
|
|
+ mv.addObject(NormalExcelConstants.FILE_NAME, "平台信息列表");
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, HwPlatform.class);
|
|
|
+ mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("平台信息列表数据", "导出人:Jeecg", "导出信息"));
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 通过excel导入数据
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @return
|
|
|
- */
|
|
|
- @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
- public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
- MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
|
|
- Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
|
|
- for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
|
|
- MultipartFile file = entity.getValue();// 获取上传文件对象
|
|
|
- ImportParams params = new ImportParams();
|
|
|
- params.setTitleRows(2);
|
|
|
- params.setHeadRows(1);
|
|
|
- params.setNeedSave(true);
|
|
|
- try {
|
|
|
- List<HwPlatform> listHwPlatforms = ExcelImportUtil.importExcel(file.getInputStream(), HwPlatform.class, params);
|
|
|
- hwPlatformService.saveBatch(listHwPlatforms);
|
|
|
- return Result.ok("文件导入成功!数据行数:" + listHwPlatforms.size());
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage(),e);
|
|
|
- return Result.error("文件导入失败:"+e.getMessage());
|
|
|
- } finally {
|
|
|
- try {
|
|
|
- file.getInputStream().close();
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return Result.ok("文件导入失败!");
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 通过excel导入数据
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
+ public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
|
|
+ Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
|
|
+ for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
|
|
+ MultipartFile file = entity.getValue();// 获取上传文件对象
|
|
|
+ ImportParams params = new ImportParams();
|
|
|
+ params.setTitleRows(2);
|
|
|
+ params.setHeadRows(1);
|
|
|
+ params.setNeedSave(true);
|
|
|
+ try {
|
|
|
+ List<HwPlatform> listHwPlatforms = ExcelImportUtil.importExcel(file.getInputStream(), HwPlatform.class, params);
|
|
|
+ hwPlatformService.saveBatch(listHwPlatforms);
|
|
|
+ return Result.ok("文件导入成功!数据行数:" + listHwPlatforms.size());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ return Result.error("文件导入失败:" + e.getMessage());
|
|
|
+ } finally {
|
|
|
+ try {
|
|
|
+ file.getInputStream().close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Result.ok("文件导入失败!");
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 服务商配置选择列表
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PutMapping(value = "/applicationSubList")
|
|
|
- public Result<Object> applicationSubcontractorList() {
|
|
|
- String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
- String requestUrl = OauthApi.applicationSubcontractorList;
|
|
|
- Map<String, Object> parameters = new HashMap<>();
|
|
|
- parameters.put("pageNo", 1);
|
|
|
- parameters.put("pageSize", -1);
|
|
|
- String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
|
|
|
- JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
|
|
|
- log.info("jsonObject===={}", jsonObject);
|
|
|
- if (jsonObject != null) {
|
|
|
- if (jsonObject.getBoolean("success")) {
|
|
|
- log.info("配置选择列表===={}", jsonObject);
|
|
|
- List<Object> list = (List<Object>) jsonObject.get("result");
|
|
|
- return Result.ok(list);
|
|
|
- } else {
|
|
|
- //抛出异常
|
|
|
- throw new JeecgBootException("查询失败");
|
|
|
- }
|
|
|
- } else {
|
|
|
- throw new JeecgBootException("查询失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 服务商配置选择列表
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PutMapping(value = "/applicationSubList")
|
|
|
+ public Result<Object> applicationSubcontractorList() {
|
|
|
+ String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
+ String requestUrl = OauthApi.applicationSubcontractorList;
|
|
|
+ Map<String, Object> parameters = new HashMap<>();
|
|
|
+ parameters.put("pageNo", 1);
|
|
|
+ parameters.put("pageSize", -1);
|
|
|
+ String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
|
|
|
+ JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
|
|
|
+ log.info("jsonObject===={}", jsonObject);
|
|
|
+ if (jsonObject != null) {
|
|
|
+ if (jsonObject.getBoolean("success")) {
|
|
|
+ log.info("配置选择列表===={}", jsonObject);
|
|
|
+ List<Object> list = (List<Object>) jsonObject.get("result");
|
|
|
+ return Result.ok(list);
|
|
|
+ } else {
|
|
|
+ //抛出异常
|
|
|
+ throw new JeecgBootException("查询失败");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("查询失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成电签控制台链接
|
|
|
+ *
|
|
|
+ * @param hwmSubcontractor
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PutMapping(value = "/createConsoleLoginUrl")
|
|
|
+ public Result<?> createConsoleLoginUrl(@RequestBody HwSubcontractor hwmSubcontractor) {
|
|
|
+ Result<?> result = hwPlatformService.createConsoleLoginUrl(hwmSubcontractor);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
}
|