From 7a0108640def8f7d7bc0b51e46db4e1b881d5b9b Mon Sep 17 00:00:00 2001 From: Administrator Date: Tue, 22 Feb 2022 20:22:34 +0800 Subject: [PATCH] 临时上个版本 联调中 --- src/main/java/com/subsidy/dto/administer/OperatorsDTO.java | 2 +- src/main/java/com/subsidy/mapper/CompanyDictMapper.java | 2 +- src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 6 +++++- src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java | 32 +++++++++++++++++--------------- src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java | 13 ++++++++++++- src/main/resources/code.properties | 1 + src/main/resources/mapper/CompanyDictMapper.xml | 3 +++ 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java index f4f033e..7bae5bb 100644 --- a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java +++ b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java @@ -17,6 +17,6 @@ public class OperatorsDTO { private String userName; - private Integer id; + private Long id; } diff --git a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java index fe81fc9..7239059 100644 --- a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java @@ -24,7 +24,7 @@ public interface CompanyDictMapper extends BaseMapper { * 企业管理--查找所有主账号 * @return */ - IPage operators(IPage page, String companyName,Long fieldId,Integer role); + IPage operators(IPage page, String companyName,Long fieldId,Long id); /** * 查找所有的公司名称 diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index f00f885..01d190c 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -213,6 +213,10 @@ public class AdministerServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),0); + IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),null); List operatorsVOS = operatorsVOIPage.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java index c0b9405..c99d1af 100644 --- a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -2,6 +2,7 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.common.constant.CourseNotification; import com.subsidy.common.exception.HttpException; import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO; @@ -71,17 +72,17 @@ public class ClassDictServiceImpl extends ServiceImpl getAllClasses(ClassDictDO classDictDO) throws Exception{ + public List getAllClasses(ClassDictDO classDictDO) throws Exception { DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); List getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO); - for (GetAllClassesVO getAllClassesVO : getAllClassesVOS){ + for (GetAllClassesVO getAllClassesVO : getAllClassesVOS) { - if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))){ + if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))) { getAllClassesVO.setOpenStatus("1"); //待开始 - }else if (new Date().after(fmt.parse(getAllClassesVO.getEndDate()))){ + } else if (new Date().after(fmt.parse(getAllClassesVO.getEndDate()))) { getAllClassesVO.setOpenStatus("2"); - }else { + } else { getAllClassesVO.setOpenStatus("0"); } } @@ -98,6 +99,7 @@ public class ClassDictServiceImpl extends ServiceImpl classNoticeDOS = addClassDTO.getClassNoticeDOS(); for (ClassNoticeDO classNoticeDO : classNoticeDOS) { - if(DateFormatUtil.parse(classNoticeDO.getNoticeTime(),"yyyy-MM-dd").before(new Date())) { + if (DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd").before(new Date())) { throw new HttpException(70001); } classNoticeDO.setClassId(classDictDO.getId()); + classNoticeDO.setStatus(CourseNotification.UNSENT); classNoticeMapper.insert(classNoticeDO); Map params = new HashMap<>(); - //params.put("classId", classNoticeDO.getClassId()); + params.put("classId", classNoticeDO.getClassId()); params.put("id", classNoticeDO.getId()); - String name = classDictDO.getClassName()+"-"+classNoticeDO.getNoticeType()+"-"+classNoticeDO.getNoticeTime(); - quartzUtil.addSimpleJob(CourseNotificationJob.class, DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd") , params, name, "CourseNotificationJob"); + String name = classDictDO.getClassName() + "-" + classNoticeDO.getNoticeType() + "-" + classNoticeDO.getNoticeTime(); + quartzUtil.addSimpleJob(CourseNotificationJob.class, DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd"), params, name, "CourseNotificationJob"); } - } - return classDictDO.getId(); } @@ -155,9 +157,9 @@ public class ClassDictServiceImpl extends ServiceImpl() - .lambda() - .eq(AnsweringQuestionDO::getAskId,classMemberMappingDO.getMemberId()) - .eq(AnsweringQuestionDO::getClassId,classMemberMappingDO.getClassId())); + .lambda() + .eq(AnsweringQuestionDO::getAskId, classMemberMappingDO.getMemberId()) + .eq(AnsweringQuestionDO::getClassId, classMemberMappingDO.getClassId())); return ConstantUtils.DELETE_SUCCESS; } diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index ae1585c..a8aa3fc 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -76,7 +76,18 @@ public class CompanyDictServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),1); + + //判断该用户的角色 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + // + //if (count > 0){ + // operatorsDTO.setId(null); + //} + + IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),operatorsDTO.getId()); List operatorsVOS = page.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { //查看公司所在行业 diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties index abbb579..478c33e 100644 --- a/src/main/resources/code.properties +++ b/src/main/resources/code.properties @@ -6,6 +6,7 @@ meishu.code-message[10003]=验证码错误 meishu.code-message[10004]=账号或密码错误 meishu.code-message[10010]=学生信息不存在 meishu.code-message[10011]=成员信息不存在 +meishu.code-message[10012]=该账号不存在 meishu.code-message[10013]=账户已冻结,请联系账户管理员 meishu.code-message[10014]=该成员已存在,请勿重复添加 meishu.code-message[10015]=首次登录请使用验证码登录 diff --git a/src/main/resources/mapper/CompanyDictMapper.xml b/src/main/resources/mapper/CompanyDictMapper.xml index 0983030..6fef702 100644 --- a/src/main/resources/mapper/CompanyDictMapper.xml +++ b/src/main/resources/mapper/CompanyDictMapper.xml @@ -41,6 +41,9 @@ and t2.delete_date is null and t3.delete_date is null and role = #{role} + + and t2.id = #{id} + and t2.company_name like concat('%',#{companyName} ,'%') -- libgit2 0.25.0