- * 课程评论回复表 前端控制器 - *
- * - * @author chen - * @since 2023-05-25 - */ -@Api(value = "C-课程评论回复管理", tags = "C-课程评论回复管理") -@RestController -@RequestMapping("/comment") -public class CommentController { - - @Autowired - private CommentService commentService; - - @Autowired - private NotifyService notifyService; - -// @Autowired -// private WebsocketService webSocketService; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "课程评论树列表", response = CommentRes.class) - @GetMapping("/commentTreeList") - public R commentTreeList( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - return commentService.commentTreeList(mallId,schoolId,accountId); - } - - @ApiOperation(value = "添加课程评论") - @PostMapping("/addComment") - public R addComment( - @ApiParam(name = "comment", value = "评论内容", required = true) - @RequestBody Comment comment, HttpServletRequest request) throws IOException { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - comment.setSchoolId(schoolId); - comment.setCreateAccountId(Integer.valueOf(accountId)); - SensitiveFilter filter = SensitiveFilter.getInstance(); - //需要过滤则用“”替换,如果需要屏蔽,则用“*”替换 - String content = filter.replaceSensitiveWord(comment.getContent(), 2, "*"); - comment.setContent(content); - boolean save = commentService.save(comment); - - if (save && comment.getReplyAccountId()!=null && !comment.getReplyAccountId().equals(Integer.valueOf(accountId))){ - //添加回复通知 - if (comment.getStatus()==2){ - //同一条评论消息未读,再次评论不通知 - QueryWrapper- * 课程评论点赞表 前端控制器 - *
- * - * @author chen - * @since 2023-05-25 - */ -@Api(value = "C-课程评论点赞管理", tags = "C-课程评论点赞管理") -@RestController -@RequestMapping("/commentLike") -public class CommentLikeController { - - @Autowired - private CommentLikeService commentLikeService; - - @Autowired - private CommentService commentService; - - @Autowired - private NotifyService notifyService; - - @ApiOperation(value = "评论点赞") - @PostMapping("/commentAndLike") - public R commentAndLike( - @ApiParam(name = "commentId", value = "评论id", required = true) - @RequestParam Integer commentId, HttpServletRequest request) { - CommentLike commentLike = new CommentLike(); - commentLike.setCommentId(commentId); - String accountId = TokenUtils.getIdByJwtToken(request); - commentLike.setAccountId(Integer.valueOf(accountId)); - boolean save = commentLikeService.save(commentLike); - - if (save){ - Comment comment = commentService.getById(commentId); - //添加点赞通知 - Notify notify = new Notify(); - notify.setType(1); - notify.setAccountId(comment.getCreateAccountId()); - notify.setCommentId(comment.getCommentId()); - notify.setCommentAccountId(Integer.valueOf(accountId)); - notifyService.save(notify); - - } - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "取消点赞") - @PostMapping("/unlike") - public R unlike( - @ApiParam(name = "commentId", value = "评论id", required = true) - @RequestParam Integer commentId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - boolean remove = commentLikeService.remove(new QueryWrapper- * 企业课程章节表 前端控制器 - *
- * - * @author lr - * @since 2021-09-26 - */ -@Api(description = "课程章节管理", tags = "课程章节管理") -@RestController -@RequestMapping("/nakadai/curriculum/chapter") -public class CurriculumChapterController { - @Autowired - private CurriculumChapterService curriculumChapterService; - - @ApiOperation(value = "根据课程id查询章节小节,树状结构") - @GetMapping("/queryChaptersAndSubsections/{courseId}") - public R queryChaptersAndSubsections( - @ApiParam(name = "courseId", value = "课程ID", required = true) - @PathVariable String courseId) { - List- * 课程笔记表 前端控制器 - *
- * - * @author chen - * @since 2023-05-04 - */ -@Api(value = "课程笔记管理", tags = "课程笔记管理") -@RestController -@RequestMapping("/curriculumNotes") -public class CurriculumNotesController { - - @Autowired - private CurriculumNotesService curriculumNotesService; - - @ApiOperation(value = "添加笔记") - @PostMapping("/addNote") - public R addNote( - @ApiParam(name = "notes", value = "笔记内容", required = true) - @RequestBody CurriculumNotes notes, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - //名称判重 - QueryWrapper- * 企业课程小节表 前端控制器 - *
- * - * @author lr - * @since 2021-09-26 - */ -@RestController -@Api(description = "课程小节管理", tags = "课程小节管理") -@RequestMapping("/nakadai/curriculum/subsection") -public class CurriculumSubsectionController { - @Autowired - private CurriculumSubsectionService curriculumSubsectionService; - - @ApiOperation(value = "添加小节") - @PostMapping("/addSubsection") - public R addSubsection( - @ApiParam(name = "courseSubsection", value = "小节对象", required = true) - @RequestBody CurriculumSubsection curriculumSubsection) { - //判重 - boolean isRepeat = curriculumSubsectionService.repeat(curriculumSubsection); - if (isRepeat) { - return R.error("小节已存在"); - } - boolean save = curriculumSubsectionService.saveSubsection(curriculumSubsection); - return save ? R.ok() : R.error(); - } - - @ApiOperation(value = "修改小节") - @PutMapping("/editSubsection") - public R editSubsection( - @ApiParam(name = "courseSubsection", value = "小节对象", required = true) - @RequestBody CurriculumSubsection courseSubsection) { - boolean update = curriculumSubsectionService.updateById(courseSubsection); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据id删除小节") - @DeleteMapping("/deleteSubsection/{subsectionId}") - public R deleteSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @PathVariable String subsectionId) throws ClientException { - boolean remove = curriculumSubsectionService.removeSubsection(subsectionId); - return remove ? R.ok() : R.error(); - } - - @ApiOperation(value = "根据小节id获取预览文件地址") - @GetMapping("/getSubsection/{subsectionId}") - public R getSubsection( - @ApiParam(name = "subsectionId", value = "小节ID", required = true) - @PathVariable String subsectionId) { - String officeUrl = "https://view.officeapps.live.com/op/view.aspx?src="; - // String xDocUrl = "http://view.xdocin.com/xdoc?_xdoc="; - CurriculumSubsection courseSubsection = curriculumSubsectionService.getById(subsectionId); - if (courseSubsection != null) { - String fileUrl = courseSubsection.getFileUrl(); - String previewUrl = officeUrl + fileUrl; - return R.ok().put("previewUrl", previewUrl); - } else { - return R.error(); - } - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/CustomerController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/CustomerController.java deleted file mode 100644 index ac1a907..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/CustomerController.java +++ /dev/null @@ -1,358 +0,0 @@ -package com.huoran.nakadai.controller; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.NakadaiClient; -import com.huoran.api.UserClient; -import com.huoran.common.constant.DelConstant; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.PageUtils; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.*; -import com.huoran.nakadai.entity.req.CustomerListReq; -import com.huoran.nakadai.entity.req.CustomerReq; -import com.huoran.nakadai.entity.req.GetTheSystemUnderTheProductReq; -import com.huoran.nakadai.entity.req.ListOfClientCommercialManagersReq; -import com.huoran.nakadai.entity.res.BusinessManagerOrderResp; -import com.huoran.nakadai.entity.res.CustomerDetailRes; -import com.huoran.nakadai.entity.res.CustomerListRes; -import com.huoran.nakadai.entity.res.ListOfClientCommercialManagersResp; -import com.huoran.nakadai.mapper.CustomerMapper; -import com.huoran.nakadai.mapper.HrStaffMapper; -import com.huoran.nakadai.service.ICustomerService; -import com.huoran.nakadai.service.IOrderService; -import com.huoran.nakadai.utils.ExcelStyleUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.ibatis.annotations.Param; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.net.URLEncoder; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadPoolExecutor; - -/** - *- * 客户表 前端控制器 - *
- * - * @author huoran - * @since 2021-06-28 - */ -@Api(value = "客户管理", tags = "客户管理") -@RestController -@RequestMapping("/nakadai/customer") -public class CustomerController { - - @Autowired - private ICustomerService iCustomerService; - - @Autowired - private CustomerMapper mapper; - - @Autowired - private HrStaffMapper staffMapper; - - @Autowired - private IOrderService orderService; - - @Autowired - private UserClient userClient; - - - @Autowired - private NakadaiClient nakadaiClient; - - /** - * 客户登录次数补充 - */ - @ApiOperation(value = "客户登录次数补充", notes = "客户登录次数补充") - @PostMapping("/supplementaryCustomerLogins") - public R supplementaryCustomerLogins() { - List- * 数据平台产品表 前端控制器 - *
- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/dataProduct") -@Api(value = "产品", tags = "产品") -public class DataProductController { - - - @Autowired - private IDataProductService dataProductService; - - @PostMapping("/AppletsDataProductList") - @ApiOperation(value = "小程序数据产品列表", response = AppletsDataProductResp.class) - public R AppletsDataProductList(@RequestBody MiniProgramProductsReq req) { - return dataProductService.AppletsDataProductList(req); - } -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineController.java deleted file mode 100644 index 7a38ec2..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/DisciplineController.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.huoran.nakadai.controller; - - -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.Discipline; -import com.huoran.nakadai.entity.Professional; -import com.huoran.nakadai.entity.ProfessionalClass; -import com.huoran.nakadai.service.IDisciplineService; -import com.huoran.nakadai.service.IProfessionalClassService; -import com.huoran.nakadai.service.IProfessionalService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * @Description: java方法作用描述 - * @auther: Rong - * @date: 2021/9/17 15:44 - */ -@RestController -@RequestMapping("/nakadai/subject") -@Api(value = "API - 课程管理三级联查", tags = "课程管理三级联查") -public class DisciplineController { - @Autowired - public IDisciplineService service; - - @Autowired - public IProfessionalClassService classService; - - @Autowired - public IProfessionalService professionalService; - - @GetMapping("/subjectCategoryCited") - @ApiOperation(value = "教师端展示引用的学科类别(三级数据)", response = Discipline.class) - public R subjectCategoryCited() { - List- * 学科层次 前端控制器 - *
- * - * @author huoran - * @since 2021-07-09 - */ -@RestController -@RequestMapping("/nakadai/disciplineLevel") -public class DisciplineLevelController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/EduCurriculumChapterController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/EduCurriculumChapterController.java deleted file mode 100644 index ab36809..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/EduCurriculumChapterController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 课程章节 前端控制器 - *
- * - * @author lr - * @since 2021-09-26 - */ -@RestController -@RequestMapping("/nakadai/edu-curriculum-chapter") -public class EduCurriculumChapterController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java index d7d59d2..b44ae94 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java @@ -45,12 +45,6 @@ public class EnterpriseCertificationController { @Autowired public EnterpriseCertificationService service; - /* @Autowired - public IHrUserAccountService userAccountService; - - @Autowired - public IHrUserInfoService userInfoService;*/ - /** * 由前台申请认证后才有后台认证记录,认证状态有 待审核、已通过、未驳回三种状态,没有未提交这种状态 @@ -106,8 +100,6 @@ public class EnterpriseCertificationController { @PostMapping("/update") @ApiOperation(value = "修改", response = EnterpriseCertification.class) public R update(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) { - /* String accountId = TokenUtils.getIdByJwtToken(request); - enterpriseCertification.setAccountId(Integer.valueOf(accountId));*/ boolean updateState = service.updateById(enterpriseCertification); return updateState ? R.ok() : R.error("编辑失败"); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrContractInformationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrContractInformationController.java deleted file mode 100644 index 05e70b6..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrContractInformationController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 合同信息表 前端控制器 - *
- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/contractInformation") -public class HrContractInformationController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrCoursePermissionsController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrCoursePermissionsController.java deleted file mode 100644 index 0a5bfd0..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrCoursePermissionsController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 课程权限表 前端控制器 - *
- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/coursePermissions") -public class HrCoursePermissionsController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrDataPermissionsController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrDataPermissionsController.java deleted file mode 100644 index 7a8fd7d..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrDataPermissionsController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 数据平台权限表 前端控制器 - *
- * - * @author huoran - * @since 2021-06-28 - */ -@RestController -@RequestMapping("/nakadai/dataPermissions") -public class HrDataPermissionsController { - -} diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/HrLogController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/HrLogController.java deleted file mode 100644 index e0da36c..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/HrLogController.java +++ /dev/null @@ -1,276 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.HrLog; -import com.huoran.nakadai.entity.LogContent; -import com.huoran.nakadai.entity.vo.LogManagementListVo; -import com.huoran.nakadai.entity.vo.OrderVo; -import com.huoran.nakadai.service.HrLogService; -import com.huoran.nakadai.service.LogContentService; -import com.huoran.nakadai.utils.CollectionUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; - -/** - *- * 前端控制器 - *
- * - * @author chen - * @since 2022-03-04 - */ -@Api(tags = "日志管理") -@RestController -@RequestMapping("/nakadai/log") -public class HrLogController { - - @Autowired - private HrLogService logService; - - @Autowired - private LogContentService logContentService; - - @Autowired - private RedisTemplate- * 中台账号组织架构 前端控制器 - *
- * - * @author chen - * @since 2022-03-22 - */ -@Api(tags = "中台账号组织架构") -@RestController -@RequestMapping("/nakadai/staffAccountArchitecture") -public class HrStaffAccountArchitectureController { - - @Autowired - public HrStaffAccountArchitectureService architectureService; - - /** - * 新增中台组织架构 - */ - @PostMapping("/save") - @ApiOperation(value = "新增中台组织架构") - public R save(@RequestBody @Valid ArchitectureAddReq architectureAddReq) { - - if (architectureAddReq.getLevel() > 6) { - return R.error("暂不支持" + architectureAddReq.getLevel() + "层级"); - } - HrStaffAccountArchitecture architecture = new HrStaffAccountArchitecture(); - BeanUtils.copyProperties(architectureAddReq, architecture); - - boolean ok = architectureService.checkRepeat(architecture); - if (ok) { - return R.error("同级下已存在相同的名称:" + architectureAddReq.getOrganizationName()); - } - boolean save = architectureService.save(architecture); - return save ? R.ok().put("id", architecture.getId()) : R.error(); - - } - - /** - * 编辑中台组织架构 - */ - @PostMapping("/update") - @ApiOperation(value = "编辑中台组织架构") - public R update(@RequestBody @Valid HrStaffAccountArchitecture architecture) { - boolean ok = architectureService.checkRepeat(architecture); - if (ok) { - return R.error("同级下已存在相同的名称:" + architecture.getOrganizationName()); - } else { - boolean update = architectureService.updateById(architecture); - return update ? R.ok() : R.error(); - } - } - - /** - * 删除组织架构 - */ - @PostMapping("/delete") - @ApiOperation(value = "删除中台组织架构") - public R delete(@ApiParam(name = "id", value = "架构id", required = true) @RequestParam Integer id) { - //级联删除子部门 - boolean remove = architectureService.removeOrganization(id); - return remove ? R.ok() : R.error(); - } - - /** - * 中台组织架构树形列表 - */ - @PostMapping("/treeList") - @ApiOperation(value = "中台组织架构树形列表", response = HrStaffAccountArchitecture.class) - public R treeList() { - List- * 中台后台员工账号表 前端控制器 - *
- * - * @author chen - * @since 2022-03-22 - */ -@Api(tags = "中台后台员工账号") -@RestController -@RequestMapping("/nakadai/backstageStaff") -public class HrStaffController { - - @Autowired - public HrStaffService staffService; - - /** - * 新增员工 - */ - @PostMapping("/saveStaff") - @ApiOperation(value = "新增员工") - public R saveStaff(@RequestBody @Valid StaffAddReq staffReq) throws Exception { - return staffService.saveStaff(staffReq); - } - - /** - * 员工列表 - */ - @PostMapping("/staffList") - @ApiOperation(value = "员工列表", response = StaffResp.class) - public R staffList(@RequestBody @Valid StaffListReq req) { - return staffService.pageStaffList(req); - } - - /** - * 员工详情 - */ - @GetMapping("/staffDetail") - @ApiOperation(value = "员工详情", response = StaffResp.class) - public R staffDetail(@ApiParam(name = "accountId", value = "员工账号id") @RequestParam Integer accountId) { - return staffService.staffDetail(accountId); - } - - /** - * 编辑员工 - */ - @PostMapping("/modifyStaff") - @ApiOperation(value = "编辑员工") - public R modifyStaff(@RequestBody @Valid StaffUpdateReq updateReq) { - return staffService.modifyStaff(updateReq); - } - - /** - * 删除员工 - */ - @PostMapping("/delStaff") - @ApiOperation(value = "删除员工") - public R delStaff(@ApiParam(name = "accountIds", value = "要删除的账号id") @RequestParam List- * 前端控制器 - *
- * - * @author chen - * @since 2022-03-23 - */ -@Api(tags = "员工部门") -@RestController -@RequestMapping("/nakadai/staffDepartment") -public class HrStaffDepartmentController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/LogContentController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/LogContentController.java deleted file mode 100644 index bc0d0a0..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/LogContentController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 前端控制器 - *
- * - * @author chen - * @since 2022-03-08 - */ -@RestController -@RequestMapping("/nakadai/log-content") -public class LogContentController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallAnnexController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallAnnexController.java deleted file mode 100644 index 0965ce5..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallAnnexController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 商品附件表 前端控制器 - *
- * - * @author chen - * @since 2023-05-06 - */ -@RestController -@RequestMapping("/mall-annex") -public class MallAnnexController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallClassificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallClassificationController.java deleted file mode 100644 index fd94ede..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallClassificationController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 商品分类关联表 前端控制器 - *
- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallClassification") -public class MallClassificationController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallController.java deleted file mode 100644 index 5207e63..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallController.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.api.UserClient; -import com.huoran.common.exception.CustomException; -import com.huoran.common.exception.ExceptionEnum; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.*; -import com.huoran.nakadai.entity.req.GoodsListReq; -import com.huoran.nakadai.entity.res.GoodsRes; -import com.huoran.nakadai.entity.vo.GoodsVo; -import com.huoran.nakadai.mapper.CurriculumMapper; -import com.huoran.nakadai.mapper.DataProductMapper; -import com.huoran.nakadai.service.MallClassificationService; -import com.huoran.nakadai.service.MallService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.Date; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.stream.Collectors; - -/** - *- * 商城管理表 前端控制器 - *
- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商城商品管理", tags = "M-商城商品管理") -@RestController -@RequestMapping("/mall") -public class MallController { - - @Autowired - private MallService mallService; - - @Autowired - private MallClassificationService mallClassificationService; - - @Autowired - private CurriculumMapper curriculumMapper; - - @Autowired - private DataProductMapper dataProductMapper; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "添加商品") - @PostMapping("/addGoods") - public R addGoods( - @ApiParam(name = "goodsVo", value = "商品数据", required = true) - @RequestBody @Valid GoodsVo goodsVo, HttpServletRequest request) throws ExecutionException, InterruptedException { - String accountId = TokenUtils.getIdByJwtToken(request); - goodsVo.getMall().setAccountId(accountId); - //保存上架时间 - if (goodsVo.getMall().getState()==0){ - goodsVo.getMall().setShelfTime(new Date()); - } - return mallService.addGoods(goodsVo); - } - - @ApiOperation(value = "商品列表", response = GoodsRes.class) - @PostMapping("/listOfGoods") - public R listOfGoods( - @ApiParam(name = "orderListReq", value = "查询条件", required = true) - @RequestBody GoodsListReq goodsListReq,HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - goodsListReq.setSchoolId(schoolId); - return mallService.listOfGoods(goodsListReq); - } - - @ApiOperation(value = "职站商城", response = GoodsRes.class) - @PostMapping("/stationShoppingMall") - public R stationShoppingMall( - @ApiParam(name = "orderListReq", value = "查询条件", required = true) - @RequestBody GoodsListReq goodsListReq) { - return mallService.stationShoppingMall(goodsListReq); - } - - @GetMapping("/schoolGoods") - @ApiOperation(value = "获取学校购买订单后的商品id") - public List- * 商品课程学习记录 前端控制器 - *
- * - * @author chen - * @since 2023-04-26 - */ -@Api(value = "M-商品课程学习记录", tags = "M-商品课程学习记录") -@RestController -@RequestMapping("/mallCourseLearningRecord") -public class MallCourseLearningRecordController { - - @Autowired - private MallCourseLearningRecordService recordService; - - @Autowired - private UserClient userClient; - - @ApiOperation(value = "添加学习记录(进入实验调用)") - @PostMapping("/addLearningRecord") - public R addLearningRecord( - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = userClient.getSchoolIdByAccountId(accountId); - //查询记录,进入过实验,下次进入不再记录数据 - MallCourseLearningRecord one = recordService.getOne(new QueryWrapper- * 商品学科类别关联表 前端控制器 - *
- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商城商品学科类别管理", tags = "M-商城商品学科类别管理") -@RestController -@RequestMapping("/mallDiscipline") -public class MallDisciplineController { - - @Autowired - private MallDisciplineService mallDisciplineService; - - /** - * 批量导入学科类别 - */ - @PostMapping("/importSubjectCategoriesInBatches") - @ApiOperation("批量导入学科类别") - public R importSubjectCategoriesInBatches(@RequestParam(name = "file") MultipartFile file) { - return mallDisciplineService.importSubjectCategoriesInBatches(file); - } - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallNonAssociatedLinksController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallNonAssociatedLinksController.java deleted file mode 100644 index d1963e7..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallNonAssociatedLinksController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 非关联产品链接 前端控制器 - *
- * - * @author chen - * @since 2023-05-15 - */ -@RestController -@RequestMapping("/mall-non-associated-links") -public class MallNonAssociatedLinksController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallPriceController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallPriceController.java deleted file mode 100644 index 36b2b20..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallPriceController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.huoran.nakadai.controller; - - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.huoran.common.response.R; -import com.huoran.nakadai.entity.MallPrice; -import com.huoran.nakadai.service.MallPriceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -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.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 商品价格表 前端控制器 - *
- * - * @author chen - * @since 2023-04-25 - */ -@Api(value = "M-商城商品价格管理", tags = "M-商城商品价格管理") -@RestController -@RequestMapping("/mallPrice") -public class MallPriceController { - - @Autowired - private MallPriceService mallPriceService; - - @ApiOperation(value = "查询商品所在省份城市结算价",response = MallPrice.class) - @PostMapping("/queryCitySettlementPrice") - public R queryCitySettlementPrice( - @ApiParam(name = "provinceId", value = "省份id", required = true) - @RequestParam Integer provinceId, - @ApiParam(name = "cityId", value = "城市id", required = true) - @RequestParam Integer cityId, - @ApiParam(name = "mallId", value = "商品id", required = true) - @RequestParam Integer mallId) { - QueryWrapper- * 商品供应商关联表 前端控制器 - *
- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallSupplier") -public class MallSupplierController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTagsController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallTagsController.java deleted file mode 100644 index 7b80e13..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTagsController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 商品分类标签关联表 前端控制器 - *
- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallTags") -public class MallTagsController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTypeController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MallTypeController.java deleted file mode 100644 index 02b5393..0000000 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MallTypeController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.huoran.nakadai.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 商品类型关联表 前端控制器 - *
- * - * @author chen - * @since 2023-04-25 - */ -@RestController -@RequestMapping("/mallType") -public class MallTypeController { - -} - diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java index 8d5bf34..be78c31 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java @@ -1,96 +1,104 @@ +/* + * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. + * + * https://www.mall4j.com/ + * + * 未经允许,不可做商业用途! + * + * 版权所有,侵权必究! + */ + package com.huoran.nakadai.controller; -import com.huoran.common.response.R; -import com.huoran.common.utils.TokenUtils; +import cn.hutool.core.util.StrUtil; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.response.ServerResponseEntity; +import com.huoran.nakadai.entity.model.Message; import com.huoran.nakadai.service.MessageService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.apache.commons.lang3.StringUtils; -import org.springframework.amqp.core.AmqpAdmin; -import org.springframework.amqp.core.DirectExchange; +import com.huoran.nakadai.utils.PageParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + -@Api(value = "或然中台消息管理", tags = "或然中台消息管理") @RestController -@RequestMapping("/message") +@RequestMapping("/admin/message") public class MessageController { - @Autowired - private AmqpAdmin amqpAdmin; - @Autowired private MessageService messageService; -// @Autowired -// private WebsocketService webSocketService; - -// @ApiOperation(value = "所有在线用户接收消息通知",response = SendMsgVO.class) -// @PostMapping("/refreshPageNotification") -// public void refreshPageNotification( -// @ApiParam(name = "username", value = "发送者名称", required = false) -// @RequestParam(required = false) String username, -// @ApiParam(name = "to", value = "发给谁(默认发送给所有在线用户)", required = false) -// @RequestParam(required = false) String to, -// @ApiParam(name = "content", value = "消息通知", required = false) -// @RequestParam(required = false) String content) { -// WebsocketMsgDTO websocketMsgDTO = new WebsocketMsgDTO(); -// websocketMsgDTO.setForm("系统消息"); -// if (StringUtils.isEmpty(username)){ -// websocketMsgDTO.setUsername("系统通知机器人"); -// }else { -// websocketMsgDTO.setUsername(username); -// } -// if (StringUtils.isEmpty(to)){ -// websocketMsgDTO.setTo("all"); -// }else { -// websocketMsgDTO.setTo(to); -// } -// if (StringUtils.isEmpty(content)){ -// websocketMsgDTO.setContent("refresh"); -// }else { -// websocketMsgDTO.setContent(content); -// } -// websocketMsgDTO.setExtras(null); -// webSocketService.send(websocketMsgDTO); -// } - /** - * 发送指定的用户队列 + * 分页获取 */ - @ApiOperation(value = "发送消息给指定的用户") - @GetMapping("/sendMessageToUser") - public void sendMessageToUser(String message, String accountId) { - messageService.sendMessageToUser(message,accountId); + @GetMapping("/page") + public ServerResponseEntity- * 此表是在教师端系统管理,可对于系统内置模型统一管理 前端控制器 - *
- * - * @author chen - * @since 2023-06-03 - */ -@RestController -@RequestMapping("/model/demo/hidden") - -@Api(value = "API - 中台:教师端可对于系统内置模型统一管理", tags = "中台:教师端可对于系统内置模型统一管理") -public class ModelDemoHiddenController { - @Autowired - private UserClient userClient; - @Autowired - public ModelDemoHiddenService service; - - @PostMapping("/batchShutdown") - @ApiOperation(value = "批量关闭(用于教师端读取系统内置模型—关闭模型) 集合传的是模型id") - public R delete(@RequestBody List- * 引用模型-分类表 前端控制器 - *
- * - * @author chen - * @since 2022-03-04 - */ -@RestController -@RequestMapping("/nakadai/model/reference") -@Api(value = "API - 中台:ModelReferenceCategoryController", tags = "中台:模型分类") -public class ModelReferenceCategoryController { - @Autowired - private UserClient userClient; - @Autowired - public ModelReferenceCategoryService service; - - @PostMapping("/saveReferenceCategory") - @ApiOperation(value = "新增模型分类") - public R saveReferenceCategory(@RequestBody @Validated ModelReferenceCategory modelSysCategory, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - modelSysCategory.setAccountId(Integer.valueOf(accountId)); - if (modelSysCategory.getFounder() == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - modelSysCategory.setSchoolId(userClient.getSchoolIdByAccountId(accountId)); - } else { - - } - boolean checkRepeat = service.checkRepeat(modelSysCategory, 0); - if (checkRepeat) { - return R.error("该层级下已有重复的分类名称了!"); - } - boolean ret = service.save(modelSysCategory); - return ret ? R.ok().put("referenceCategoryId", modelSysCategory.getId()) : R.error(); - } - - @PostMapping("/modelClassList") - @ApiOperation(value = "模型分类列表(中台、职站教师端通用)") - public R modelClassList(@RequestParam("systemId") @ApiParam(value = "系统id") Integer systemId - , @RequestParam("founder") @ApiParam(value = "创建人来源(0、系统 1、院校)") Integer founder, HttpServletRequest request) { - String accountId = TokenUtils.getIdByJwtToken(request); - Integer schoolId = null; - if (founder == ModellConstant.SOURCE_INSTITUTION) { - //创建来源为院校时候赋值学校id - schoolId = userClient.getSchoolIdByAccountId(accountId); - } - - List- * 引用模型代码记录表 前端控制器 - *
- * - * @author chen - * @since 2022-03-04 - */ -@RestController -@RequestMapping("/nakadai/model/reference/demo") -@Api(value = "API - 中台:ModelReferenceDemoController", tags = "中台:模型代码记录") -public class ModelReferenceDemoController { - - @Autowired - private UserClient userClient; - @Autowired - public ModelReferenceDemoService service; - - - @Autowired - public ModelSysCategoryService sysCategoryService; - @Autowired - public ModelSysDemoService sysDemoService; - - @PostMapping("/saveReferenceDemo") - @ApiOperation(value = "导入模型") - public R saveReferenceDemo(@RequestBody @Validated List- * 订单表 前端控制器 - *
- * - * @author huoran - * @since 2021-06-28 + * @author lgh on 2018/09/15. */ -@Api(tags = "订单管理") +@Slf4j @RestController -@RequestMapping("/nakadai/order") +@RequestMapping("/order/order") public class OrderController { @Autowired - private IOrderService orderService; + private OrderService orderService; @Autowired - private OrderOtherService orderOtherService; + private OrderItemService orderItemService; @Autowired - private MallService mallService; + private ProductService productService; @Autowired - private PartnerTeamService partnerTeamService; - - @ApiOperation(value = "添加订单") - @PostMapping("/add") - public R add( - @ApiParam(name = "orderVo", value = "订单数据", required = true) - @RequestBody @Valid OrderVo orderVo) throws ExecutionException, InterruptedException { - return orderService.addOrder(orderVo); - } + private SkuService skuService; - @ApiOperation(value = "订单列表", response = IPage.class) - @PostMapping("/list") - public R list(@ApiParam(name = "orderListReq", value = "查询条件", required = true) @RequestBody OrderListReq orderListReq) { - HashMap- * 订单其他信息(包含课程权限、数据平台权限、合同信息等) 前端控制器 - *
- * - * @author cheney - * @since 2021-07-01 - */ -@Api(tags = "订单内容管理") -@RestController -@RequestMapping("/nakadai/orderOther") -public class OrderOtherController { - - @Autowired - private OrderOtherService orderOtherService; - - @ApiOperation(value = "订单发货") - @PostMapping("/ship") - public R ship(@RequestBody OrderOther orderOther) { - boolean update = orderOtherService.ship(orderOther); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "批量发货") - @PostMapping("/bulkShipping") - public R bulkShipping(@RequestBody BulkShipOrdersReq bulkShipOrdersReq) { - boolean update = orderOtherService.bulkShipping(bulkShipOrdersReq); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "是否启用订单") - @PostMapping("/enable") - public R enable( - @ApiParam(name = "id", value = "货品id", required = true) - @RequestParam @Valid @NotNull(message = "货品id不能为空") Integer id, - @ApiParam(name = "flag", value = "标识", required = true) - @RequestParam @Valid @Size(max = 1) Integer flag) { - boolean update = orderOtherService.enable(id, flag); - return update ? R.ok() : R.error(); - } - - @ApiOperation(value = "续费查询之前产品信息") - @PostMapping("/renew") - public R renew(@RequestBody @Valid OrderRenewVo orderRenewVo) { - ArrayList- * 合伙人账号表 前端控制器 - *
- * - * @author chen - * @since 2022-05-18 - */ -@Api(tags = "合伙人账号管理") -@RestController -@RequestMapping("/nakadai/partnerAccount") -public class PartnerAccountController { - - @Autowired - public PartnerAccountService partnerAccountService; - - @Autowired - public PartnerTeamService partnerTeamService; - - @Autowired - public PartnerClassificationService partnerClassificationService; - - @Autowired - private RedisTemplate- * 合伙人分类表 前端控制器 - *
- * - * @author chen - * @since 2022-05-18 - */ -@Api(tags = "合伙人分类管理") -@RestController -@RequestMapping("/nakadai/partnerClassification") -public class PartnerClassificationController { - - @Autowired - public PartnerClassificationService partnerClassificationService; - - /** - * 新增合伙人分类 - */ - @PostMapping("/save") - @ApiOperation(value = "新增合伙人分类") - public R save(@RequestBody @Valid PartnerClassificationAddReq PartnerClassificationAddReq) { - - //暂时无限制 -/* if (PartnerClassificationAddReq.getLevel() > 6) { - return R.error("暂不支持" + PartnerClassificationAddReq.getLevel() + "层级"); - }*/ - - PartnerClassification partnerClassification = new PartnerClassification(); - BeanUtils.copyProperties(PartnerClassificationAddReq, partnerClassification); - - boolean ok = partnerClassificationService.checkRepeat(partnerClassification); - if (ok) { - return R.error("同级下已存在相同的名称:" + PartnerClassificationAddReq.getPartnerClassificationName()); - } - boolean save = partnerClassificationService.save(partnerClassification); - return save ? R.ok().put("id", partnerClassification.getId()) : R.error(); - - } - - /** - * 编辑合伙人分类 - */ - @PostMapping("/update") - @ApiOperation(value = "编辑合伙人分类") - public R update(@RequestBody @Valid PartnerClassification partnerClassification) { - boolean ok = false; - PartnerClassification byId = partnerClassificationService.getById(partnerClassification.getId()); - //名字未修改,不用进行判重 - if (!byId.getPartnerClassificationName().equals(partnerClassification.getPartnerClassificationName())){ - //全部分类进行判重 - ok = partnerClassificationService.checkRepeatAll(partnerClassification); - } - if (ok) { - return R.error("已存在相同的名称:" + partnerClassification.getPartnerClassificationName()); - } else { - boolean update = partnerClassificationService.updateById(partnerClassification); - if (partnerClassification.getIsTeam()==1){ - //更新团员所属团队名称 - List- * 合伙人——方案管理——产品配置表 前端控制器 - *
- * - * @author chen - * @since 2023-06-28 - */ - -/** - * @描述:合伙人——方案管理——产品配置表控制类 - * @作者: Rong - * @日期: 2023-06-28 - */ -@RestController -@RequestMapping("/partnerSchemeManagementProductConfig") -@Api(value = "合伙人——方案管理——产品配置表:PartnerSchemeManagementProductConfigController", tags = "R-合伙人——方案管理——产品配置表") -public class PartnerSchemeManagementProductConfigController { - - @Autowired - public PartnerSchemeManagementProductConfigService service; - - @Autowired - private UserClient userClient; - - - @PostMapping("/batchDeletion") - @ApiOperation(value = "批量删除", response = PartnerSchemeManagementProductConfig.class) - public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestBody List- * 合伙人团队表(合伙人账号与分类中间表) 前端控制器 - *
- * - * @author chen - * @since 2022-05-18 - */ -@Api(tags = "团队管理") -@RestController -@RequestMapping("/nakadai/partner-team") -public class PartnerTeamController { - - @Autowired - public PartnerTeamService partnerTeamService; - - @Autowired - public PartnerAccountService accountService; - - @Autowired - public PartnerAccountServiceImpl accountServiceImpl; - - @Autowired - public PartnerClassificationService classificationService; - - @Autowired - private UserClient userClient; - - /*@ApiOperation(value = "团队成员列表") - @GetMapping(value = "/teamList") - public R teamList( - @ApiParam(name = "id", value = "团队id", required = true) - @RequestParam String id, - @ApiParam(name = "current", value = "当前页码", required = true) - @RequestParam int current, - @ApiParam(name = "pageSize", value = "每页记录数", required = true) - @RequestParam int pageSize, - @ApiParam(name = "name", value = "成员名称", required = false) - @RequestParam(value = "name") String name){ - List