| | |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.mapper.CodeClassifyMapper; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.TreeQueryObject; |
| | | import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.IResultCode; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import com.vci.ubcs.code.service.ICodeClassifyService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.FRAMEWORK_DATA_DISABLED; |
| | | import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.FRAMEWORK_DATA_ENABLED; |
| | | |
| | | /** |
| | | * 主题库定义表 控制器 |
| | |
| | | public R delCodeClassify(CodeClassify codeClassify) { |
| | | return codeClassifyService.deleteCodeClassify(codeClassify); |
| | | } |
| | | |
| | | /** |
| | | * 启用 |
| | | * @param codeClassify |
| | | * @return |
| | | */ |
| | | @PostMapping( "/enableData") |
| | | public R enable(CodeClassify codeClassify) { |
| | | return codeClassifyService.updateLcStatus(codeClassify.getOid(),FRAMEWORK_DATA_ENABLED); |
| | | } |
| | | |
| | | /** |
| | | * 停用 |
| | | * @param codeClassify |
| | | * @return |
| | | */ |
| | | @PostMapping( "/disableData") |
| | | public R disable(CodeClassify codeClassify) { |
| | | return codeClassifyService.updateLcStatus(codeClassify.getOid(),FRAMEWORK_DATA_DISABLED); |
| | | } |
| | | |
| | | /** |
| | | * 主键批量获取主题库分类 |
| | | * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 |
| | | * @return 主题库分类显示对象 |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public R listCodeClassifyByOids(String oids){ |
| | | Collection<CodeClassifyVO> voCollection = codeClassifyService.listCodeClassifyByOids(VciBaseUtil.str2List(oids)); |
| | | return R.data(voCollection); |
| | | } |
| | | |
| | | /** |
| | | * 参照树 主题库分类 |
| | | * @param treeQueryObject 树形查询对象 |
| | | * @return 主题库分类显示树 |
| | | */ |
| | | @GetMapping("/referTree") |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) { |
| | | return codeClassifyService.referTree(treeQueryObject); |
| | | } |
| | | |
| | | /** |
| | | * 导出分类 |
| | | * @param oid 分类主键 |
| | | */ |
| | | @GetMapping("/exportClassify") |
| | | public void exportClassify(String oid, HttpServletResponse response) throws IOException { |
| | | String excelName = codeClassifyService.exportClassify(oid); |
| | | // try { |
| | | // ControllerUtil.writeFileToResponse(response,excelName); |
| | | // } catch (Throwable e) { |
| | | // //如果出错,把错误信息写到text |
| | | // String msg = LangBaseUtil.getErrorMsg(e); |
| | | // String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "错误.txt"; |
| | | // LocalFileUtil.writeContentToFile(msg,errorFile); |
| | | // ControllerUtil.writeFileToResponse(response,errorFile); |
| | | // } |
| | | } |
| | | } |