| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.product.core.config.CoreConst; |
| | | import com.product.core.controller.support.AbstractBaseController; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.entity.RequestParameterEntity; |
| | |
| | | import com.product.file.util.ResultInfo; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.util.BaseUtil; |
| | | import com.product.util.support.AbstractBaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.swing.text.Document; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | public class DocumentController extends AbstractBaseController { |
| | | @Autowired |
| | | public DocumentService documentService; |
| | | |
| | | @PostMapping("/permission/{version}") |
| | | @ApiVersion(1) |
| | | public String permission(HttpServletRequest request) { |
| | | try { |
| | | FieldSetEntity fieldSetEntity = BaseUtil.getFieldSetEntity(request); |
| | | String documentUuid = fieldSetEntity.getString("document_uuid"); |
| | | return BaseUtil.success(documentService.isPermission(documentUuid)); |
| | | } catch (BaseException e) { |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | return this.error(DocumentCode.GET_DOCUMENT_PERMISSIONS_FAIL, e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增文件数据(上传)3 |
| | |
| | | FieldSetEntity applayInfo = documentService.getApplyInfo(fse); |
| | | return OK_List(applayInfo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getFileItemize/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getFileItemize(HttpServletRequest request) { |
| | | //获取参数 |
| | | FieldSetEntity fse = null; |
| | | Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if (bean != null) { |
| | | RequestParameterEntity reqp = (RequestParameterEntity) bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder |
| | | .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | return OK_List(documentService.getFileItemize(fse)); |
| | | } |
| | | } |
| | | |
| | | |