已修改35个文件
已重命名1个文件
已删除1个文件
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ProjectNumVo; |
| | | import com.yuanchu.limslaboratory.service.WorkService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | @ApiImplicitParam(name = "type", value = "æ£éªç±»å(0:åææ;1:æå;2:å§æå)", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/dutyMater") |
| | | @AuthHandler |
| | | public Result dutyMater(String startTime,String endTime,Integer type) { |
| | | return Result.success(workService.dutyMater(startTime,endTime,type)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "type", value = "æ£éªç±»å(0:åææ;1:æå;2:å§æå)", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/executeMater") |
| | | @AuthHandler |
| | | public Result executeMater(String startTime,String endTime,Integer type) { |
| | | return Result.success(workService.executeMater(startTime,endTime,type)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "type", value = "æ£éªç±»å(0:åææ;1:æå;2:å§æå)", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/dutytimely") |
| | | @AuthHandler |
| | | public Result dutytimely(String startTime,String endTime,Integer type) { |
| | | return Result.success(workService.dutytimely(startTime,endTime,type)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "type", value = "æ£éªç±»å(0:åææ;1:æå;2:å§æå)", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/executetimely") |
| | | @AuthHandler |
| | | public Result executetimely(String startTime,String endTime,Integer type) { |
| | | return Result.success(workService.executetimely(startTime,endTime,type)); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.CnasAnnualPlan; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasAnnualPlanVo; |
| | | import com.yuanchu.limslaboratory.service.CnasAnnualPlanService; |
| | |
| | | @ApiImplicitParam(name = "planTime", value = "æ£éªå¼å§æ¶é´", dataTypeClass = Date.class), |
| | | }) |
| | | @GetMapping("/selectAllList") |
| | | @AuthHandler |
| | | public Result selectAllList(Integer page, Integer pageSize, @DateTimeFormat(pattern = "yyyy-MM") Date planTime) { |
| | | IPage<CnasAnnualPlanVo> reportPage = cnasAnnualPlanService.selectAllList(new Page(page, pageSize), planTime); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "CnasAnnualPlan", value = "审æ¥å¯¹è±¡", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @AuthHandler |
| | | public Result addCnasAnnualPlan(@RequestHeader("X-Token") String token, @RequestBody CnasAnnualPlan cnasAnnualPlan) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | @ApiImplicitParam(name = "auditTime", value = "å®¡æ ¸æ¥æ", dataTypeClass = Date.class, required = true), |
| | | @ApiImplicitParam(name = "file", value = "éä»¶æä»¶", dataTypeClass = MultipartFile.class, required = true) |
| | | }) |
| | | @AuthHandler |
| | | public Result addAccessory(@RequestHeader("X-Token") String token, Date auditTime, MultipartFile file) throws Exception { |
| | | //è§£æå½åç»å½ç¨æ· |
| | | Object object = RedisUtil.get(token); |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "planId", value = "å®¡æ ¸æ¥æ", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @AuthHandler |
| | | public Result deleteCnasAnnualPlan(Integer planId) { |
| | | Integer isDeleteSuccess = cnasAnnualPlanService.deleteCnasAnnualPlan(planId); |
| | | if (isDeleteSuccess == 1){ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.CnasSatisfactionSurvey; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.CnasSatisfactionSurveyPageDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasSatisfactionSurveyVo; |
| | |
| | | */ |
| | | @ApiOperation(value = "è·å满æåº¦è°æ¥") |
| | | @GetMapping("/getCnasSatisfactionSurvey") |
| | | @AuthHandler |
| | | public Result<CnasSatisfactionSurveyVo>getCnasSatisfactionSurvey(CnasSatisfactionSurveyPageDto cnasSatisfactionSurveyPageDto){ |
| | | return Result.success(service.getCnasSatisfactionSurvey(cnasSatisfactionSurveyPageDto)); |
| | | } |
| | | |
| | | @GetMapping("/getFillNameAndId") |
| | | @ApiOperation(value = "è·åå½åå½å人") |
| | | @AuthHandler |
| | | public Result<Map>getFillNameAndId(@RequestHeader("X-Token")String token){ |
| | | return Result.success(service.getFillNameAndTd(token)); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "éä»¶ä¸ä¼ ") |
| | | @PostMapping(value = "/uploadFile",consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = {MediaType.APPLICATION_JSON_VALUE}) |
| | | @AuthHandler |
| | | public Result<Map>wordParse(MultipartFile file){ |
| | | return Result.success(service.wordParse(file)); |
| | | } |
| | | |
| | | @ApiOperation(value = "满æåº¦è°æ¥æ°å¢") |
| | | @PostMapping("/addSurvey") |
| | | @AuthHandler |
| | | public Result<Boolean>addSurvey(@RequestBody CnasSatisfactionSurvey cnasSatisfactionSurvey){ |
| | | System.out.println(cnasSatisfactionSurvey+"============="); |
| | | return Result.success(service.addSurvey(cnasSatisfactionSurvey)); |
| | | } |
| | | |
ÎļþÃû´Ó framework/src/main/java/com/yuanchu/limslaboratory/annotation/RequestInfo.java ÐÞ¸Ä |
| | |
| | | */ |
| | | @Target({ElementType.METHOD, ElementType.TYPE}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface RequestInfo { |
| | | public @interface AuthHandler { |
| | | |
| | | String type(); |
| | | /** |
| | | * æ¥å£ç±»å |
| | | * @return |
| | | */ |
| | | int type() default 0; |
| | | |
| | | String name() ; |
| | | |
| | | /** |
| | | * æ¥å£å |
| | | * @return |
| | | */ |
| | | String name() default ""; |
| | | |
| | | } |
| | |
| | | |
| | | public AuthException() { |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | } |
| | |
| | | |
| | | @ExceptionHandler({AuthException.class}) |
| | | public Result<?> noAuth(AuthException e){ |
| | | e.printStackTrace(); |
| | | return Result.fail(400,"æ æé"); |
| | | return Result.fail(Integer.valueOf(e.getCode()),e.getMsg()); |
| | | } |
| | | } |
| | |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.mapper.UserMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | |
| | | @ApiImplicitParam(name = "message", value = "ç³è¯·åå·/åææåç§°", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectInspectsList") |
| | | @AuthHandler |
| | | public Result selectInspectsList(int pageSize, int countSize, String message) { |
| | | IPage<Map<String, Object>> inspectionPage = inspectionService.selectInspectsList(new Page<Object>(pageSize, countSize), message); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectAll") |
| | | @AuthHandler |
| | | public Result selectAll(Integer type) { |
| | | switch (type) { |
| | | case 0: |
| | |
| | | @ApiImplicitParam(name = "specifications", value = "è§æ ¼åå·", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseVer") |
| | | @AuthHandler |
| | | public Result chooseVer(String name, String mcode, String specifications) { |
| | | return Result.success(inspectionService.chooseVer(name, mcode, specifications)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "experiment", value = "è¯éªé¡¹ç®(å§æä¸å±)", dataTypeClass = String.class ) |
| | | }) |
| | | @GetMapping("/lookProByVer") |
| | | @AuthHandler |
| | | public Result lookProByVer(String name, String mcode, String specifications,Integer version,String experiment) { |
| | | return Result.success(inspectionService.lookProByVer(name, mcode, specifications,version,experiment)); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | |
| | | |
| | | @ApiOperation("龿¥-->è·å龿¥") |
| | | @GetMapping("/link") |
| | | @AuthHandler |
| | | public Result<?> getLink() { |
| | | Object link1 = null; |
| | | try { |
| | |
| | | @ApiImplicitParam(name = "inspectionStatus", value = "æ£éªç¶æ", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/page") |
| | | @AuthHandler |
| | | public Result<?> getLinkBasicPage(Integer pageNo, Integer pageSize, String entrustCoding, String sampleName, String entrusted, Integer inspectionStatus) { |
| | | IPage<Map<String, Object>> linkBasicPage = linkBasicInformationService.getLinkBasicPage(new Page<Object>(pageNo, pageSize), entrustCoding, sampleName, entrusted, inspectionStatus); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.pojo.LinkDetection; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | |
| | | |
| | | @ApiOperation("龿¥-->è·åæ ·ååç§°") |
| | | @GetMapping("/material") |
| | | @AuthHandler |
| | | public Result<?> getMaterialIdAndName(@RequestHeader("link") String link) { |
| | | String redisLink = RedisUtil.get("viewId").toString(); |
| | | if (linkBasicInformationService.isIfViewUUID(redisLink)){ |
| | |
| | | |
| | | @ApiOperation("龿¥-->è·åè§æ ¼åå·") |
| | | @GetMapping("/specification") |
| | | @AuthHandler |
| | | public Result<?> getSpecificationIdAndName(@RequestHeader("link") String link, String materialId) { |
| | | String redisLink = RedisUtil.get("viewId").toString(); |
| | | if (linkBasicInformationService.isIfViewUUID(redisLink)){ |
| | |
| | | @ApiImplicitParam(name = "modelId", value = "åå·id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseProject") |
| | | @AuthHandler |
| | | public Result<?> chooseProject(@RequestHeader("link") String link, Integer modelId) { |
| | | String redisLink = RedisUtil.get("viewId").toString(); |
| | | if (linkBasicInformationService.isIfViewUUID(redisLink)){ |
| | |
| | | |
| | | @ApiOperation("龿¥-->æ·»å å§ææ¥æ£ç³è¯·å") |
| | | @PostMapping("/addInspection") |
| | | @AuthHandler |
| | | public Result<?> addLinkBasicInformation(@RequestHeader("link") String link, @RequestBody LinkBasicInformation linkBasicInformation) { |
| | | String redisLink = RedisUtil.get("viewId").toString(); |
| | | if (linkBasicInformationService.isIfViewUUID(redisLink)){ |
| | |
| | | |
| | | @ApiOperation(value = "çæäºç»´ç æéçå¯ä¸ç ") |
| | | @GetMapping("/getViewUUID") |
| | | @AuthHandler |
| | | public Result<?> getViewUUID(int day){ |
| | | return Result.success("çææå",linkBasicInformationService.getViewUUID(day)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢äºç»´ç æéçå¯ä¸ç ") |
| | | @GetMapping("/selectViewUUID") |
| | | @AuthHandler |
| | | public Result<?> selectViewUUID(){ |
| | | return Result.success("æ¥è¯¢æå",linkBasicInformationService.selectViewUUID()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ£éªå¯ä¸ç æ¯å¦ææ") |
| | | @GetMapping("/isIfViewUUID") |
| | | @AuthHandler |
| | | public Result<?> isIfViewUUID(String viewId){ |
| | | return Result.success("æ¥è¯¢æå",linkBasicInformationService.isIfViewUUID(viewId)); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformanceReview; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformanceReviewVo; |
| | |
| | | |
| | | @GetMapping("/getNonConformanceReview") |
| | | @ApiOperation("ä¸åæ ¼ååé¦-->è·åä¸åæ ¼åè¯å®¡ä¿¡æ¯") |
| | | @AuthHandler |
| | | public Result<NonConformanceReviewVo> getNonConformanceReview(NonConformingFeedbackDto nonConformingFeedbackDto){ |
| | | |
| | | return Result.success(service.getNonConformanceReviewVo(nonConformingFeedbackDto)); |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformingFeedback; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformingFeedbackVo; |
| | |
| | | |
| | | @GetMapping("/getNonConformingFeedback") |
| | | @ApiOperation("ä¸åæ ¼ååé¦-->è·åä¸åæ ¼åä¿¡æ¯") |
| | | @AuthHandler |
| | | public Result<NonConformingFeedbackVo> getNonConformingFeedback(NonConformingFeedbackDto nonConformingFeedbackDto){ |
| | | return Result.success(service.getNonConformingFeedback(nonConformingFeedbackDto)); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | @ApiImplicitParam(name = "status", value = "æ£éªç»æ", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectAllPlan") |
| | | @AuthHandler |
| | | public Result selectAllPlan(String code, String beginTime, String endTime, Integer status) { |
| | | System.out.println(planService.selectAllPlan(code, beginTime, endTime, status).toString()); |
| | | return Result.success(planService.selectAllPlan(code, beginTime, endTime, status)); |
| | |
| | | |
| | | @ApiOperation("åé
-->éæ©æ£éªäºº") |
| | | @GetMapping("/choosecheck") |
| | | @AuthHandler |
| | | public Result choosecheck() { |
| | | return Result.success(planService.choosecheck()); |
| | | } |
| | | |
| | | @ApiOperation("åé
--éæ©è®¾å¤") |
| | | @GetMapping("/chooseinstum") |
| | | @AuthHandler |
| | | public Result chooseinstum() { |
| | | return Result.success(planService.chooseinstum()); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "instrumentId", value = "设å¤id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/distribution") |
| | | @AuthHandler |
| | | public Result distribution(Integer id, Integer userId, Integer instrumentId) { |
| | | return Result.success(planService.distribution(id, userId, instrumentId)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "value", value = "æ£éªå¼", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/check") |
| | | @AuthHandler |
| | | public Result check(Integer id, String value) { |
| | | return Result.success(planService.check(id, value)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/reported") |
| | | @AuthHandler |
| | | public Result reported(Integer id) { |
| | | return Result.success(planService.reported(id)); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.SelectQualificationRateDto; |
| | | import com.yuanchu.limslaboratory.service.QualificationRateStatisticsService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | |
| | | @ApiOperation("æ¥è¯¢ç³è¯·ç©æåä¾åºåå表") |
| | | @GetMapping("/getSupplierList") |
| | | @AuthHandler |
| | | public Result<?> getSupplierList() { |
| | | return Result.success(service.getSupplierList()); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªæ ·ååæ ¼çç»è®¡") |
| | | @GetMapping("/getTestSampleStatistics") |
| | | @AuthHandler |
| | | public Result<?> getTestSampleStatistics(SelectQualificationRateDto dto){ |
| | | System.out.println("getTestSampleStatistics______________>"+dto); |
| | | return Result.success(service.getTestSampleStatistics(dto)); |
| | |
| | | |
| | | @ApiOperation("æ¥è¯¢ä¾åºåä¸åæ ¼ç»è®¡æ¬¡æ°") |
| | | @GetMapping("/getSupplierNoPassStatistics") |
| | | @AuthHandler |
| | | public Result<?> getSupplierNoPassStatistics(SelectQualificationRateDto dto){ |
| | | System.out.println("getSupplierNoPassStatistics++++++++++++++++>"+dto); |
| | | return Result.success(service.getSupplierNoPassStatistics(dto)); |
| | |
| | | |
| | | @ApiOperation("æ¥è¯¢ä¸åæ ¼é¡¹ç®ç»è®¡") |
| | | @GetMapping("/getNoPassProjectStatistics") |
| | | @AuthHandler |
| | | public Result<?> getNoPassProjectStatistics(SelectQualificationRateDto dto){ |
| | | System.out.println("getNoPassProjectStatistics===============>"+dto); |
| | | return Result.success(service.getNoPassProjectStatistics(dto)); |
| | |
| | | |
| | | @ApiOperation("è·åæ ·ååç§°") |
| | | @GetMapping("/getSampleOptions") |
| | | @AuthHandler |
| | | public Result<?> getSampleOptions(){ |
| | | return Result.success(service.getSampleOptions()); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | @ApiImplicitParam(name = "createTime", value = "æ¥ææ¥æ", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAll") |
| | | @AuthHandler |
| | | public Result<?> selectRawMaterial(Integer pageSize, Integer pageNo, String materialCoding, String materialName, Integer type, String createTime) { |
| | | IPage<RawMaterial> iPage = rawMaterialService.selectRawMaterial(materialCoding, materialName, type, createTime, new Page<Objects>(pageNo, pageSize)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | import com.yuanchu.limslaboratory.service.ReportService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | |
| | | @ApiImplicitParam(name = "name", value = "æç´¢ä¿¡æ¯", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllReport") |
| | | @AuthHandler |
| | | public Result selectAllReport(Integer page, Integer pageSize, Integer status, String name) { |
| | | IPage<ReportVo> reportPage = reportService.selectAllReport(new Page<Object>(page, pageSize), status, name); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @ApiImplicitParam(name = "id", value = "æ£éªæ¥åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/submit") |
| | | @AuthHandler |
| | | public Result submit(Integer id) { |
| | | return Result.success(reportService.submit(id)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "result", value = "å®¡æ ¸ç»è®º", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/check") |
| | | @AuthHandler |
| | | public Result check(@RequestHeader("X-Token") String token, Integer id, String result) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | @ApiImplicitParam(name = "id", value = "æ£éªæ¥åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delreport") |
| | | @AuthHandler |
| | | public Result delreport(Integer id) { |
| | | return Result.success(reportService.delreport(id)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "code", value = "æ¥ååå·", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/getReportContext") |
| | | @AuthHandler |
| | | public Result getReportContext(String code) { |
| | | return Result.success(reportService.getReportContext(code)); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Classify; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateClassifyDto; |
| | | import com.yuanchu.limslaboratory.service.ClassifyService; |
| | |
| | | |
| | | @ApiOperation("æ·»å åç±»") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addClassifyInformation(@RequestBody Classify classify) { |
| | | Integer isAddClassifySuccess = classifyService.addClassifyInformation(classify); |
| | | if (isAddClassifySuccess == 1) { |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "åç±»åç§°", name = "classifyName", dataTypeClass = String.class) |
| | | }) |
| | | @AuthHandler |
| | | public Result<?> getListClassifyInformation(String classifyName) { |
| | | return Result.success(classifyService.getListClassifyInformation(classifyName)); |
| | | } |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "åç±»Id", name = "classifyId", dataTypeClass = String.class) |
| | | }) |
| | | @AuthHandler |
| | | public Result<?> deleteClassifyInformation(String classifyId) { |
| | | Boolean isDeleteSuccess = classifyService.deleteClassifyInformation(classifyId); |
| | | if (isDeleteSuccess){ |
| | |
| | | |
| | | @ApiOperation("æ´æ°åç±»") |
| | | @PutMapping("/update") |
| | | @AuthHandler |
| | | public Result<?> updateClassifyInformation(@RequestBody UpdateClassifyDto updateClassifyDto) throws Exception { |
| | | Classify classify = JackSonUtil.unmarshal(JackSonUtil.marshal(updateClassifyDto), Classify.class); |
| | | Boolean isUpdateClassifySuccess = classifyService.updateClassifyInformation(classify); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.EquipmentPoint; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateEquipmentPointDto; |
| | | import com.yuanchu.limslaboratory.service.EquipmentPointService; |
| | |
| | | |
| | | @ApiOperation("æ·»å 设å¤ç ç¹") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addEquipmentPointInformation(@RequestHeader("X-Token") String token, @RequestBody EquipmentPoint equipmentPoint) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | @ApiImplicitParam(name = "InstrumentId", value = "ä»ªå¨æ¨¡åId", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/list") |
| | | @AuthHandler |
| | | public Result<?> getListEquipmentPointInformation(String InstrumentId) { |
| | | List<Map<String, Object>> list = equipmentPointService.getListEquipmentPointInformation(InstrumentId); |
| | | return Result.success(list); |
| | |
| | | @ApiImplicitParam(name = "equipmentPointId", value = "设å¤ç ç¹Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @DeleteMapping("/delete") |
| | | @AuthHandler |
| | | public Result<?> deleteEquipmentPointInformation(Integer equipmentPointId) { |
| | | Integer isDeleteSuccess = equipmentPointService.deleteEquipmentPointInformation(equipmentPointId); |
| | | if (isDeleteSuccess == 1){ |
| | |
| | | |
| | | @ApiOperation("æ ¹æ®ç ç¹Idæ´æ°æ°æ®") |
| | | @PutMapping("/update") |
| | | @AuthHandler |
| | | public Result<?> updateEquipmentPointInformation(@RequestHeader("X-Token") String token, @RequestBody UpdateEquipmentPointDto updateEquipmentPointDto) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateInstrumentDto; |
| | | import com.yuanchu.limslaboratory.service.InstrumentService; |
| | |
| | | |
| | | @ApiOperation("æ·»å 仪å¨è®¾å¤") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addInstrumentInformation(@RequestHeader("X-Token") String token, @RequestBody Instrument instrument) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | @ApiImplicitParam(name = "whetherWhether", value = "æ¯å¦å·²è¿æ", dataTypeClass = Boolean.class), |
| | | @ApiImplicitParam(name = "numberOrNameOrSpecifications", value = "ç¼å·/设å¤åç§°/è§æ ¼åå·", dataTypeClass = String.class) |
| | | }) |
| | | @AuthHandler |
| | | public Result<?> getListInstrumentInformation(Integer pageNo, |
| | | Integer pageSize, |
| | | Integer conditions, |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "instrumentId", value = "仪å¨Id", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @AuthHandler |
| | | public Result<?> deleteInstrumentInformation(String instrumentId) { |
| | | Boolean isDeleteSuccess = instrumentService.deleteInstrumentInformation(instrumentId); |
| | | if (isDeleteSuccess){ |
| | |
| | | |
| | | @ApiOperation("æ·»å ä»ªå¨æ¶ä¿ç®¡äººä¸ææ¡æ°æ®") |
| | | @GetMapping("/get_user") |
| | | @AuthHandler |
| | | public Result<?> getMapUserInformation() { |
| | | return Result.success(userService.getUserNameAndId()); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "InstrumentId", value = "åç±»Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/get_instrument") |
| | | @AuthHandler |
| | | public Result<?> getIdInstrumentInformation(Integer InstrumentId) { |
| | | Instrument idInstrumentInformation = instrumentService.getIdInstrumentInformation(InstrumentId); |
| | | return Result.success(idInstrumentInformation); |
| | |
| | | |
| | | @ApiOperation("æ ¹æ®ä»ªå¨Idæ´æ°æ°æ®") |
| | | @PutMapping("/update") |
| | | @AuthHandler |
| | | public Result<?> updateEquipmentPointInformation(@RequestBody UpdateInstrumentDto updateInstrumentDto) throws Exception { |
| | | Instrument instrument = JackSonUtil.unmarshal(JackSonUtil.marshal(updateInstrumentDto), Instrument.class); |
| | | Integer isUpdateSuccess = instrumentService.updateEquipmentPointInformation(instrument); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddPlanDto; |
| | |
| | | |
| | | @ApiOperation("æ·»å 计é计å") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addMeteringPlanInformation(@RequestBody MeteringPlan meteringPlan) { |
| | | Integer isInsertSuccess = meteringPlanService.addMeteringPlanInformation(meteringPlan); |
| | | if (isInsertSuccess == 1){ |
| | |
| | | |
| | | @ApiOperation("计é计åå页æ¥è¯¢") |
| | | @GetMapping("/plan_page_list") |
| | | @AuthHandler |
| | | public Result<?> pagingQueryOfMeteringPlan(SelectMeteringPlanDto dto) { |
| | | return Result.success(meteringPlanService.pagingQueryOfMeteringPlan(dto)); |
| | | } |
| | | |
| | | @ApiOperation("计éå°è´¦å页æ¥è¯¢") |
| | | @GetMapping("/standing_page_list") |
| | | @AuthHandler |
| | | public Result<?> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto selectMeasurementLedgerDto) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeasurementLedger(selectMeasurementLedgerDto); |
| | | return Result.success(page); |
| | |
| | | |
| | | @ApiOperation("å询计åä¿¡æ¯") |
| | | @GetMapping("/getPlanMeasureInstrument") |
| | | @AuthHandler |
| | | public Result<?> getPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto){ |
| | | return Result.success(meteringPlanService.getPlanMeasureInstrument(dto)); |
| | | } |
| | | |
| | | @ApiOperation("计åä¿¡æ¯ä¹ä¸å页") |
| | | @GetMapping("/limitGetPlanMeasureInstrument") |
| | | @AuthHandler |
| | | public Result<?> limitGetPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto){ |
| | | return Result.success(meteringPlanService.limitGetPlanMeasureInstrument(dto)); |
| | | } |
| | | |
| | | @ApiOperation("è·åuserå表å仪å¨å表") |
| | | @GetMapping("/getListUserAndListIns") |
| | | @AuthHandler |
| | | public Result<?>getListUserAndListIns(){ |
| | | return Result.success(meteringPlanService.getListUserAndListIns(userService.getUserNameAndId())); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å 计åå计éä¿¡æ¯") |
| | | @PostMapping("/addPlanAndMeasure") |
| | | @AuthHandler |
| | | public Result<?>addPlanAndMeasure(@RequestBody AddPlanDto addPlanDto){ |
| | | return Result.success(meteringPlanService.addPlanAndMeasure(userService.getUserInfo(ServletUtils.getRequest().getHeader("X-Token")),addPlanDto)); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.MetricalInformation; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateMetricalInformationDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdatedMetricalInformationDto; |
| | |
| | | |
| | | @ApiOperation("æ·»å 计éä¿¡æ¯") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addMetricalInformation(MetricalInformation metricalInformation, |
| | | @RequestPart(value = "file", required = false) MultipartFile file) { |
| | | Integer isInsertSuccess = metricalInformationService.addEquipmentPointInformation(metricalInformation, file); |
| | |
| | | @ApiImplicitParam(name = "InstrumentId", value = "ä»ªå¨æ¨¡åId", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/list") |
| | | @AuthHandler |
| | | public Result<?> getListMetricalInformation(String InstrumentId) { |
| | | List<Map<String, Object>> list = metricalInformationService.getListEquipmentPointInformation(InstrumentId); |
| | | return Result.success(list); |
| | |
| | | @ApiImplicitParam(name = "metricalInformationId", value = "计éä¿¡æ¯Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @DeleteMapping("/delete") |
| | | @AuthHandler |
| | | public Result<?> deleteMetricalInformation(Integer metricalInformationId) { |
| | | Integer isDeleteSuccess = metricalInformationService.deleteMetricalInformation(metricalInformationId); |
| | | if (isDeleteSuccess == 1){ |
| | |
| | | |
| | | @ApiOperation("æ ¹æ®è®¡éä¿¡æ¯Idæ´æ°æ°æ®") |
| | | @PutMapping("/update") |
| | | @AuthHandler |
| | | public Result<?> updateMetricalInformation(UpdateMetricalInformationDto updateMetricalInformationDto, |
| | | @RequestPart(value = "file", required = false) MultipartFile file) throws Exception { |
| | | MetricalInformation metricalInformation = JackSonUtil.unmarshal(JackSonUtil.marshal(updateMetricalInformationDto), MetricalInformation.class); |
| | |
| | | |
| | | @ApiOperation("æ·»å 计éä¿¡æ¯æ¶è´è´£äººä¸ææ¡æ°æ®") |
| | | @GetMapping("/get_user") |
| | | @AuthHandler |
| | | public Result<?> getMapUserInformation() { |
| | | return Result.success(userService.getUserNameAndId()); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°è®¡éç»æ") |
| | | @PostMapping("/updateMetricalInformationInfo") |
| | | @AuthHandler |
| | | public Result<?> updateMetricalInformationInfo(@RequestBody UpdatedMetricalInformationDto dto){ |
| | | return Result.success(metricalInformationService.updateMetricalInformationInfo(dto)); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddMaterialDto; |
| | | import com.yuanchu.limslaboratory.service.MaterialService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | |
| | | @ApiOperation(value = "æ·»å ææ -->éæ©æ ·ååç§°") |
| | | @GetMapping("/selectmater") |
| | | @AuthHandler |
| | | public Result selectmater() { |
| | | return Result.success(materialService.selectmater()); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å ææ ") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addMaterialInformation(@Validated @RequestBody AddMaterialDto addMaterialDto) { |
| | | Integer isMaterialSuccess = materialService.addMaterialInformation(addMaterialDto); |
| | | if (isMaterialSuccess == 1) { |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "ç©æID", name = "materialId", dataTypeClass = Integer.class) |
| | | }) |
| | | @AuthHandler |
| | | public Result<?> deleteMaterialInformation(Integer materialId) { |
| | | Integer isDeleteMaterialSuccess = materialService.deleteMaterialInformation(materialId); |
| | | if (isDeleteMaterialSuccess == 1) { |
| | |
| | | |
| | | @ApiOperation(value = "æ ååº-->ç©æ-->ä¾§è¾¹æ å级å±å¼") |
| | | @GetMapping("/list") |
| | | @AuthHandler |
| | | public Result<?> getFourLevelInformation() { |
| | | List<Map<String, Object>> fourLevelInformation = materialService.getFourLevelInformation(); |
| | | return Result.success(fourLevelInformation); |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Organizational; |
| | | import com.yuanchu.limslaboratory.service.OrganizationalService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | |
| | | |
| | | @ApiOperation(value = "ä¾§è¾¹æ æ å±å¼") |
| | | @GetMapping("/list") |
| | | @AuthHandler |
| | | public Result<?> getFourLevelInformation() { |
| | | List<Map<String, Object>> organizationalTree = organizationalService.OrganizationalTree(); |
| | | return Result.success(organizationalTree); |
| | |
| | | @ApiImplicitParam(value = "é¨é¨ID", name = "departmentId", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/table") |
| | | @AuthHandler |
| | | public Result<?> getDepartmentListTable(Integer departmentId) { |
| | | List<Map<String, Object>> departmentListTable = organizationalService.getDepartmentListTable(departmentId); |
| | | return Result.success(departmentListTable); |
| | |
| | | |
| | | @ApiOperation(value = "æ·»å é¨é¨") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addDepartment(@RequestBody @Validated Organizational organizational) { |
| | | Integer addDepartment = organizationalService.addDepartment(organizational); |
| | | if (addDepartment >= 1){ |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹é¨é¨") |
| | | @PutMapping("/add") |
| | | @PutMapping("/update") |
| | | @AuthHandler |
| | | public Result<?> updateDepartment(Integer id, @RequestBody @Validated Organizational organizational) { |
| | | Integer addDepartment = organizationalService.updateDepartment(id, organizational); |
| | | if (addDepartment >= 1){ |
| | |
| | | |
| | | @ApiOperation(value = "å é¤é¨é¨") |
| | | @DeleteMapping("/delete") |
| | | @AuthHandler |
| | | public Result<?> deleteDepartment(String ids) { |
| | | organizationalService.deleteDepartment(ids); |
| | | return Result.success("å 餿åï¼"); |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.service.ProductService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·ID", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseVersion") |
| | | @AuthHandler |
| | | public Result<?> chooseVersion(Integer specificationsId) { |
| | | return Result.success(productService.chooseVersion(specificationsId)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "version", value = "çæ¬(é»è®¤ææ°çæ¬)", dataTypeClass = Integer.class,required = true ) |
| | | }) |
| | | @GetMapping("/page") |
| | | @AuthHandler |
| | | public Result<?> pageProductInformation(Integer specificationsId,Integer version) { |
| | | return Result.success(productService.pageProductInformation(specificationsId,version)); |
| | | } |
| | |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | @AuthHandler |
| | | public Result<?> write(Integer id, String required, String internal) { |
| | | Integer write = productService.write(id, required, internal); |
| | | if (write >= 1){ |
| | |
| | | @ApiImplicitParam(name = "ids", value = "æ å项ç®ID", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @DeleteMapping("/deleteList") |
| | | @AuthHandler |
| | | public Result<?> deleteList(String ids) { |
| | | MyUtil.PrintLog(ids); |
| | | productService.deleteList(ids); |
| | |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addVersion") |
| | | @AuthHandler |
| | | public Result<?> addVersion(Integer specificationsId ) { |
| | | Integer version = productService.addVersion(specificationsId); |
| | | return Result.success("æ·»å çæ¬"+version+"æå"); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddMaterialDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.ProductModelDto; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | |
| | | |
| | | @ApiOperation(value = "éæ©æ ·ååç§°") |
| | | @GetMapping("/selectmater") |
| | | @AuthHandler |
| | | public Result selectmater() { |
| | | return Result.success(productModelService.selectmater()); |
| | | } |
| | |
| | | |
| | | @ApiOperation("æ·»å æ å") |
| | | @PostMapping("/addproductModel") |
| | | @AuthHandler |
| | | public Result<?> addproductModel(@Validated @RequestBody ProductModelDto productModelDto) { |
| | | productModelService.addproductModel(productModelDto); |
| | | return Result.success("æ·»å æ å项ç®ã" + productModelDto.getName() + "ãæåï¼"); |
| | |
| | | @ApiImplicitParam(name = "material", value = "æ ·ååç§°", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/selectproductModel") |
| | | @AuthHandler |
| | | public Result selectproductModel(String name, String father, String material) { |
| | | return Result.success(productModelService.selectproductModel(name, father, material)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "id", value = "æ 忍¡çid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectproductModelById") |
| | | @AuthHandler |
| | | public Result selectproductModelById(Integer id) { |
| | | return Result.success(productModelService.selectproductModelById(id)); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "id", value = "æ 忍¡çid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/writeproductModel") |
| | | @AuthHandler |
| | | public Result<?> writeproductModel(Integer id, @Validated @RequestBody ProductModelDto productModelDto) { |
| | | productModelService.writeproductModel(id,productModelDto); |
| | | return Result.success("ä¿®æ¹æ å项ç®ã" + productModelDto.getName() + "ãæåï¼"); |
| | |
| | | @ApiImplicitParam(name = "id", value = "æ 忍¡çid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delproductModel") |
| | | @AuthHandler |
| | | public Result<?> delproductModel(Integer id) { |
| | | productModelService.delproductModel(id); |
| | | return Result.success("å 餿 åé¡¹ç®æåï¼"); |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddSpecifications; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto; |
| | | import com.yuanchu.limslaboratory.service.SpecificationsService; |
| | |
| | | |
| | | @ApiOperation("æ·»å ç©æ") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addSpecificationsInformation(@Validated @RequestBody AddSpecifications addSpecifications) { |
| | | Integer isMaterialSuccess = specificationsService.addSpecificationsInformation(addSpecifications); |
| | | if (isMaterialSuccess == 1) { |
| | |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @DeleteMapping("/delete") |
| | | @AuthHandler |
| | | public Result<?> deleteSpecificationsInformation(Integer specificationsId) { |
| | | Integer isStandardsSuccess = specificationsService.deleteSpecifications(specificationsId); |
| | | if (isStandardsSuccess == 1) { |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto; |
| | | import com.yuanchu.limslaboratory.service.StandardService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | |
| | | @ApiOperation("æ·»å ç©æ") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addStandardInformation(@Validated @RequestBody AddStandardDto addStandardDto) { |
| | | Integer isMaterialSuccess = standardService.addStandardInformation(addStandardDto); |
| | | if (isMaterialSuccess == 1) { |
| | |
| | | |
| | | @ApiOperation("æ ¹æ®IDå è§æ ¼") |
| | | @DeleteMapping("/delete") |
| | | @AuthHandler |
| | | public Result<?> deleteStandardsInformation(Integer standardsId) { |
| | | Integer isDeleteMaterialSuccess = standardService.deleteStandardInformation(standardsId); |
| | | if (isDeleteMaterialSuccess == 1) { |
| | |
| | | package com.yuanchu.limslaboratory.aop; |
| | | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.yuanchu.limslaboratory.annotation.RequestInfo; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.exception.AuthException; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.service.RoleManagerService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.ServletUtils; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.lang.annotation.Annotation; |
| | | import java.lang.reflect.Method; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | |
| | | @Aspect |
| | | public class AuthRequestAspect { |
| | | |
| | | @Pointcut("@annotation(com.yuanchu.limslaboratory.annotation.RequestInfo)") |
| | | @Pointcut("@annotation(com.yuanchu.limslaboratory.annotation.AuthHandler)") |
| | | public void pointCut() { |
| | | } |
| | | |
| | | //private ThreadLocal<ConcurrentHashMap<String, Map>> threadLocal; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | |
| | | @Resource |
| | | private RoleManagerService roleService; |
| | | |
| | | @SneakyThrows |
| | | @Before("pointCut()") |
| | | public void before(JoinPoint joinPoint) { |
| | | HttpServletRequest request = ServletUtils.getRequest(); |
| | | log.info("æ¦æª=====ã"+request.getServletPath()); |
| | | Class<?> clazz = joinPoint.getTarget().getClass(); |
| | | String clazzName = joinPoint.getTarget().getClass().getName(); |
| | | // è·å访é®çæ¹æ³å |
| | |
| | | Class[] argClz = ((MethodSignature) joinPoint.getSignature()).getParameterTypes(); |
| | | // è·å访é®çæ¹æ³å¯¹è±¡ |
| | | Method method = clazz.getDeclaredMethod(methodName, argClz); |
| | | // 夿å½å访é®çæ¹æ³æ¯å¦å卿宿³¨è§£ |
| | | if (method.isAnnotationPresent(RequestInfo.class)) { |
| | | RequestInfo annotation = method.getAnnotation(RequestInfo.class); |
| | | System.out.println(annotation.name()); |
| | | System.out.println(annotation.type()); |
| | | //è·åç±»ä¸è¯·æ±å°å |
| | | RequestMapping annotation = clazz.getAnnotation(RequestMapping.class); |
| | | StringBuilder builder = new StringBuilder(); |
| | | String apiInfo=null; |
| | | builder.append(annotation.value()[0]); |
| | | //è·åæ¹æ³ä¸æ³¨è§£ |
| | | if (method.isAnnotationPresent(PostMapping.class)) { |
| | | PostMapping post = method.getAnnotation(PostMapping.class); |
| | | builder.append(post.value()[0]); |
| | | } |
| | | //throw new AuthException("400","æ æé"); |
| | | if (method.isAnnotationPresent(GetMapping.class)) { |
| | | GetMapping get = method.getAnnotation(GetMapping.class); |
| | | builder.append(get.value()[0]); |
| | | } |
| | | if (method.isAnnotationPresent(DeleteMapping.class)) { |
| | | DeleteMapping delete = method.getAnnotation(DeleteMapping.class); |
| | | builder.append(delete.value()[0]); |
| | | } |
| | | if (method.isAnnotationPresent(PutMapping.class)) { |
| | | PutMapping put = method.getAnnotation(PutMapping.class); |
| | | builder.append(put.value()[0]); |
| | | } |
| | | if (method.isAnnotationPresent(ApiOperation.class)) { |
| | | ApiOperation api = method.getAnnotation(ApiOperation.class); |
| | | apiInfo=api.value(); |
| | | } |
| | | HttpServletRequest request = ServletUtils.getRequest(); |
| | | Map<String, Object> userInfo = userService.getUserInfo(request.getHeader("X-Token")); |
| | | if(Objects.nonNull(userInfo)){ |
| | | String roleId = String.valueOf(userInfo.get("roleId")); |
| | | Map<String, Object> urlType = roleService.getUrlType(builder.toString()); |
| | | log.info("æ¦æªè¯·æ±----------------ã"+builder); |
| | | boolean b = roleService.hasUrl(String.valueOf(urlType.get("type")), String.valueOf(urlType.get("menuId")), roleId); |
| | | if(!b){ |
| | | log.warn("ç¨æ·/idï¼"+userInfo.get("name")+"/"+userInfo.get("id")+"---------æéä¸è¶³ï¼å·²æ¦æªï¼"); |
| | | //throw new AuthException("400","æ æé"); |
| | | } |
| | | }else { |
| | | throw new AuthException("401","ç»éè¿æ"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.RequestInfo; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.dto.GetAllRoleAndMenuByConditionPageDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.RoleInfoDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateRoleMenuDto; |
| | |
| | | |
| | | @ApiOperation("è·åèååè½æ ") |
| | | @GetMapping("/getMenusTree") |
| | | @RequestInfo(type = "add",name="ccc") |
| | | @AuthHandler |
| | | public Result<?>getMenusTree() { |
| | | return Result.success(roleManagerService.getMenusTree()); |
| | | }; |
| | | |
| | | @ApiOperation("æ°å¢è§è²") |
| | | @PostMapping("/addRoleInfo") |
| | | @AuthHandler |
| | | public Result<?>addRoleInfo(@RequestBody RoleInfoDto dto){ |
| | | return Result.success(roleManagerService.addRoleInfo(dto)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢è§è²åéå¤") |
| | | @GetMapping("/assertRepeat") |
| | | @AuthHandler |
| | | public Result<?> assertRepeat(String roleName){ |
| | | return Result.success(roleManagerService.assertRepeat(roleName)); |
| | | } |
| | | |
| | | @ApiOperation("è·åè§è²ä¿¡æ¯") |
| | | @GetMapping("/getAllRoleAndMenuInfo") |
| | | @AuthHandler |
| | | public Result<?> getAllRoleAndMenuInfo(GetAllRoleAndMenuByConditionPageDto dto){ |
| | | return Result.success(roleManagerService.getAllRoleAndMenuInfo(dto)); |
| | | } |
| | | |
| | | @ApiOperation("é»è¾å é¤è§è²") |
| | | @GetMapping("/deleteRole") |
| | | @AuthHandler |
| | | public Result<?> deleteRole(Long id){ |
| | | return Result.success(roleManagerService.deleteRole(id)); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹æé") |
| | | @PostMapping("/updateRoleMenu") |
| | | @AuthHandler |
| | | public Result<?> updateRoleMenu(@RequestBody UpdateRoleMenuDto dto){ |
| | | return Result.success(roleManagerService.updateRoleMenu(dto)); |
| | | } |
| | | |
| | | @ApiOperation("/æ ¹æ®è§è²è·åRole") |
| | | @ApiOperation("æ ¹æ®è§è²Idè·åRole") |
| | | @GetMapping("/getRoleAndMenuByRole") |
| | | @AuthHandler |
| | | public Result<?> getRoleAndMenuByRole(Long roleId){ |
| | | return Result.success(roleManagerService.getRoleAndMenuByRole(roleId)); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.clients.UserLoginUtils; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.service.RoleManagerService; |
| | |
| | | |
| | | @ApiOperation("æ°å¢ç¨æ·è·åè§è²æéä¿¡æ¯") |
| | | @GetMapping("/list") |
| | | @AuthHandler |
| | | public Result<?> getUserListRole(){ |
| | | List<Map<String,Object>> data = roleManagerService.getUserListRole(); |
| | | return Result.success(data); |
| | |
| | | return Result.fail(202,"ç¨æ·ç»å½ä¿¡æ¯æ æï¼è¯·éæ°ç»å½"); |
| | | } |
| | | |
| | | @ApiOperation("ç»å½-->è·åè§è²ä¿¡æ¯") |
| | | @GetMapping("/roleInfo") |
| | | public Result<?> getUserRoleInfo(@RequestHeader("X-Token") String token){ |
| | | return Result.success(userService.getUserRoleInfo(token)); |
| | | } |
| | | |
| | | @PostMapping("/getUserById") |
| | | @ApiOperation("è·åæå®ç¨æ·idçç¨æ·ä¿¡æ¯åä¼ä¸ä¿¡æ¯") |
| | | @AuthHandler |
| | | public Result<?> getUserById(@RequestHeader("X-Token") String token) throws Exception { |
| | | Object o = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = null; |
| | |
| | | |
| | | @PostMapping("/add_new_personnel") |
| | | @ApiOperation("å®éªå®¤ç®¡ç-->人å管ç-->æ°å¢äººå") |
| | | @AuthHandler |
| | | public Result<?> addNewPersonnel(@RequestHeader("X-Token") String token, @RequestBody NewPersonnelVo newPersonnelVo) throws Exception { |
| | | Object redisUserMessage = RedisUtil.get(token); |
| | | Map<String, Object> user = null; |
| | |
| | | |
| | | @PutMapping("/update_new_personnel") |
| | | @ApiOperation("å®éªå®¤ç®¡ç-->人å管ç-->ç¼è¾æä½") |
| | | @AuthHandler |
| | | public Result<?> updateNewPersonnel(@RequestBody UpdatePersonnelVo updatePersonnelVo) { |
| | | Integer isUpdateSuccess = userService.updateNewPersonnel(updatePersonnelVo); |
| | | if (isUpdateSuccess == 1){ |
| | |
| | | @ApiImplicitParam(name = "name", value = "人ååç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "status", value = "å¨èç¶æ", dataTypeClass = Integer.class) |
| | | }) |
| | | @AuthHandler |
| | | public Result<Map<String, Object>> getNewPersonnelPage(Integer pageNo, Integer pageSize, String name, Integer status) { |
| | | IPage<Map<String, Object>> PageList = userService.getNewPersonnelPage(name, new Page<Objects>(pageNo, pageSize), status); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | @ApiImplicitParam(name = "type", value = "ç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectWaitInforList") |
| | | @AuthHandler |
| | | public Result selectWaitInforList(@RequestHeader("token") String token,int pageSize, int countSize, String title, String text, Integer type) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | @ApiImplicitParam(name = "ids", value = "å¾
åid", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @GetMapping("/delAllWaitInfor") |
| | | @AuthHandler |
| | | public Result delAllWaitInfor(@RequestHeader("token") String token,String ids) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | @ApiImplicitParam(name = "ids", value = "å¾
åid", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @GetMapping("/writeAllWaitInfor") |
| | | @AuthHandler |
| | | public Result writeAllWaitInfor(@RequestHeader("token") String token,String ids) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | |
| | | RoleAndMenuDto selectAllRoleAndMenuByRoleId(Long roleId); |
| | | |
| | | List<Map<String, Object>> getUserListRole(); |
| | | |
| | | Map<String, Object>selctInterFaceType(String url); |
| | | |
| | | Map<String, Long> hasUrl(String type, String menuId, String roleId); |
| | | } |
| | |
| | | RoleAndMenuDto getRoleAndMenuByRole(Long roleId); |
| | | |
| | | List<Map<String, Object>> getUserListRole(); |
| | | |
| | | Map<String, Object> getUrlType(String url); |
| | | |
| | | boolean hasUrl(String type,String menuId,String roleId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.RoleAndMenuDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NewPersonnelVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.UpdatePersonnelVo; |
| | | |
| | |
| | | * è·åææç¨æ·çåç§°ä¸Id |
| | | */ |
| | | List<Map<String, Object>> getUserNameAndId(); |
| | | |
| | | RoleAndMenuDto getUserRoleInfo(String token); |
| | | } |
| | |
| | | .collect(Collectors.toList()); |
| | | r.setRoleMenuList(collect); |
| | | }); |
| | | roleAndMenuDtos.forEach(r->{ |
| | | r.getRoleMenuList().forEach(System.out::println); |
| | | }); |
| | | //roleAndMenuDtos.forEach(r->{ |
| | | // r.getRoleMenuList().forEach(System.out::println); |
| | | //}); |
| | | Map<String, Object>result=new HashMap<>(3); |
| | | result.put("list",roleAndMenuDtos); |
| | | int size = roleManageMapper.getRoleInfoByName(dto.getName()).size(); |
| | |
| | | return roleManageMapper.getUserListRole(); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getUrlType(String url) { |
| | | String type=null; |
| | | Map<String, Object> stringIntegerMap = roleManageMapper.selctInterFaceType(url); |
| | | String of = String.valueOf(stringIntegerMap.get("type")); |
| | | switch (of) { |
| | | case "0": |
| | | type="selected"; |
| | | break; |
| | | case "1": |
| | | type="added"; |
| | | break; |
| | | case "2": |
| | | type="updated"; |
| | | break; |
| | | case "3": |
| | | type="deleted"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | stringIntegerMap.put("type",type); |
| | | System.out.println(type); |
| | | return stringIntegerMap; |
| | | } |
| | | |
| | | @Override |
| | | public boolean hasUrl(String type, String menuId, String roleId) { |
| | | return roleManageMapper.hasUrl( type, menuId, roleId).get("num")>0L; |
| | | } |
| | | |
| | | |
| | | private List<Menu> getEnumChildren(Menu root, List<Menu> all) { |
| | | return all.stream() |
| | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name",loginUser.get("name")); |
| | | data.put("id",loginUser.get("id")); |
| | | data.put("roleId",loginUser.get("roleId")); |
| | | data.put("remind", remind); |
| | | RoleAndMenuDto role = getRoleInfo(Long.valueOf(String.valueOf(loginUser.get("roleId")))); |
| | | System.out.println("+++++++++++++++++++++++++++++++++++++++++++++"); |
| | | System.out.println(role); |
| | | System.out.println("++++++++++++++++++++++++++++++++++++++++++++++"); |
| | | data.put("role",role); |
| | | return data; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public RoleAndMenuDto getUserRoleInfo(String token) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, String> selectUserByUserId(int userId) { |
| | | return userMapper.selectUserByUserId(userId); |
| | | } |
| | |
| | | ) |
| | | </insert> |
| | | <update id="updateRoleState"> |
| | | UPDATE role SET state = 0 WHERE (id = #{id}) |
| | | UPDATE role |
| | | SET state = 0 |
| | | WHERE (id = #{id}) |
| | | </update> |
| | | <delete id="deleteRoleMenuByRoleId"> |
| | | delete from role_menu where role_id =#{id} |
| | | delete |
| | | from role_menu |
| | | where role_id = #{id} |
| | | </delete> |
| | | <select id="getAssertName" resultType="com.yuanchu.limslaboratory.pojo.RoleInfo"> |
| | | select id |
| | | from role |
| | | where name = #{roleName} |
| | | and state=1 |
| | | and state = 1 |
| | | </select> |
| | | <select id="selectAllRoleAndMenu" resultMap="roleAndMenu"> |
| | | SELECT r.id roleId, |
| | |
| | | select id |
| | | from role |
| | | where 1=1 |
| | | and state=1 |
| | | and state=1 |
| | | <if test="roleName!=null and roleName!=''"> |
| | | and name like CONCAT('%',#{roleName},'%') |
| | | </if> |
| | | </select> |
| | | <select id="selectAllRoleAndMenuByRoleId" resultMap="roleAndMenuById"> |
| | | SELECT |
| | | r.`name` roleName, |
| | | menu_id menuId, |
| | | parent_id parentId, |
| | | m.`name` menuName, |
| | | m.url menuUrl, |
| | | SELECT r.`name` roleName, |
| | | menu_id menuId, |
| | | parent_id parentId, |
| | | m.`name` menuName, |
| | | m.url menuUrl, |
| | | -- m.redirect redirect, |
| | | -- m.icon icon, |
| | | rm.selected, |
| | | rm.added, |
| | | rm.updated, |
| | | rm.deleted |
| | | FROM |
| | | role_menu rm, |
| | | role r, |
| | | menu m |
| | | WHERE |
| | | rm.role_id = r.id |
| | | rm.selected, |
| | | rm.added, |
| | | rm.updated, |
| | | rm.deleted |
| | | FROM role_menu rm, |
| | | role r, |
| | | menu m |
| | | WHERE rm.role_id = r.id |
| | | AND rm.menu_id = m.id |
| | | AND r.state = 1 |
| | | AND rm.state = 1 |
| | | AND m.state = 1 |
| | | and r.id=#{roleId} |
| | | and r.id = #{roleId} |
| | | </select> |
| | | |
| | | <select id="getUserListRole" resultType="map"> |
| | | SELECT CONCAT(r.`id`, '') id, r.`name` |
| | | FROM role r |
| | | </select> |
| | | <select id="selctInterFaceType" resultType="java.util.Map"> |
| | | select type, menu_id menuId |
| | | from interface_info |
| | | WHERE url = #{url} |
| | | </select> |
| | | <select id="hasUrl" resultType="java.util.Map"> |
| | | SELECT COUNT(id) num |
| | | from role_menu |
| | | WHERE role_id = #{roleId} |
| | | and menu_id = #{menuId} |
| | | and ${type} = 1 |
| | | </select> |
| | | <resultMap id="roleAndMenuById" type="com.yuanchu.limslaboratory.pojo.dto.RoleAndMenuDto"> |
| | | <result property="roleName" column="roleName"/> |
| | | <result property="createTime" column="createTime"/> |