diff --git a/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java b/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java index b5abafe..d6d48ce 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java +++ b/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java @@ -192,4 +192,5 @@ public interface RedisService { * @Date: 2023/4/12 22:23 */ Lock distributedLock(String key); + } diff --git a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml index cebb22a..0362549 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml +++ b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml @@ -33,9 +33,9 @@ spring: # min-idle: 0 # - max-idle: 8 + max-idle: 16 # - max-active: 8 + max-active: 16 # max-wait: -1ms data: diff --git a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-prod.yml b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-prod.yml index f0a0c48..4f8faa5 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-prod.yml +++ b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-prod.yml @@ -29,14 +29,14 @@ spring: password: Cpop2022@ #连接超时 timeout: 5000 - lettuce: + jedis: pool: # - min-idle: 0 + min-idle: 8 # - max-idle: 8 + max-idle: 16 # - max-active: 8 + max-active: 16 # max-wait: -1ms data: diff --git a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml index 3a15c64..a6e2660 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml +++ b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml @@ -33,14 +33,14 @@ spring: password: Cpop2022@ #连接超时 timeout: 5000 - lettuce: + jedis: pool: # - min-idle: 0 + min-idle: 8 # - max-idle: 8 + max-idle: 16 # - max-active: 8 + max-active: 16 # max-wait: -1ms data: diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/BusinessInfoPageBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/BusinessInfoPageBo.java index ce777e8..3782cff 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/BusinessInfoPageBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/BusinessInfoPageBo.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.experimental.Accessors; import javax.validation.constraints.NotBlank; +import java.util.List; /** * @author DB @@ -35,6 +36,12 @@ public class BusinessInfoPageBo { @ApiModelProperty(value = "事务详情状态(0:进行中;1:完成:2:挂起)") private Integer detailStatus; + /** + * 接收人 + */ + @ApiModelProperty(value = "接收人") + private List staffIds; + /** * 事务id */ diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BusinessController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BusinessController.java index 6e062db..8eb34d8 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BusinessController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BusinessController.java @@ -8,34 +8,21 @@ import com.cpop.oam.business.bo.BusinessDistributeBo; import com.cpop.oam.business.bo.BusinessInfoPageBo; import com.cpop.oam.business.bo.BusinessRemoveBo; import com.cpop.oam.business.dto.BusinessDistributeDto; -import com.cpop.oam.business.dto.DataImportDto; -import com.cpop.oam.business.entity.Staff; +import com.cpop.oam.business.service.BusinessService; import com.cpop.oam.business.service.StaffService; import com.cpop.oam.business.vo.BusinessInfoPageVo; import com.cpop.oam.business.vo.BusinessPageVo; -import com.cpop.oam.business.vo.StaffInfoVo; import com.cpop.oam.business.vo.StaffVo; import com.mybatisflex.core.paginate.Page; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.oam.business.entity.Business; -import com.cpop.oam.business.service.BusinessService; -import org.springframework.web.bind.annotation.RestController; 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.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -127,9 +114,9 @@ public class BusinessController { * @param bo 请求参数 * @return R> */ - @GetMapping("/getBusinessInfoPage") + @PostMapping("/getBusinessInfoPage") @ApiOperation("获取个人事务分页列表/管理人员事务详情列表") - public R> getBusinessInfoPage(@ApiParam("请求参数") @Validated BusinessInfoPageBo bo) { + public R> getBusinessInfoPage(@ApiParam("请求参数") @RequestBody @Validated BusinessInfoPageBo bo) { Page page = businessService.getBusinessInfoPage(bo); return R.ok(page); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/DataImportController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/DataImportController.java index 7f97dab..a250db9 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/DataImportController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/DataImportController.java @@ -2,12 +2,10 @@ package com.cpop.oam.business.controller.backstage; import com.alibaba.excel.EasyExcel; import com.cpop.core.base.R; -import com.cpop.core.utils.file.FileUploadUtils; -import com.cpop.core.utils.file.FileUtils; import com.cpop.oam.business.bo.DataImportBo; import com.cpop.oam.business.bo.DataImportPageBo; -import com.cpop.oam.business.bo.StaffBo; import com.cpop.oam.business.dto.DataImportDto; +import com.cpop.oam.business.service.DataImportService; import com.cpop.oam.business.vo.DataImportPageVo; import com.cpop.oam.business.vo.StoreListVo; import com.cpop.system.business.service.BrandService; @@ -15,20 +13,16 @@ import com.cpop.system.business.service.StoreService; import com.cpop.system.business.vo.BrandListVo; import com.cpop.system.business.vo.SysFileVo; import com.mybatisflex.core.paginate.Page; -import com.qcloud.cos.model.UploadResult; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.oam.business.entity.DataImport; -import com.cpop.oam.business.service.DataImportService; 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.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.io.Serializable; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -120,8 +114,9 @@ public class DataImportController { */ @DeleteMapping("/removeById/{id}") @ApiOperation("根据主键删除未导入数据记录") - public boolean removeById(@PathVariable @ApiParam("数据导入主键") String id) { - return dataImportService.removeById(id); + public R removeById(@PathVariable @ApiParam("数据导入主键") String id) { + dataImportService.removeById(id); + return R.ok(); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/FinanceReimburseController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/FinanceReimburseController.java index 3942373..71eab07 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/FinanceReimburseController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/FinanceReimburseController.java @@ -203,8 +203,8 @@ public class FinanceReimburseController { @PutMapping("/reimburseReject") public R reimburseReject(@RequestBody @Validated ReimburseRejectBo bo) { financeReimburseService.updateChain() - .set(FINANCE_REIMBURSE.STATUS,4) - .set(FINANCE_REIMBURSE.REJECT_REASON,bo.getRejectReason()) + .set(FINANCE_REIMBURSE.STATUS, -1) + .set(FINANCE_REIMBURSE.REJECT_REASON, bo.getRejectReason()) .where(FINANCE_REIMBURSE.ID.eq(bo.getId())) .update(); return R.ok(); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/TaskTechnologyController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/TaskTechnologyController.java index 70b27d5..0b16c8d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/TaskTechnologyController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/TaskTechnologyController.java @@ -1,12 +1,13 @@ package com.cpop.oam.business.controller.backstage; -import com.mybatisflex.core.paginate.Page; import com.cpop.core.base.R; import com.cpop.oam.business.bo.*; import com.cpop.oam.business.service.StaffService; import com.cpop.oam.business.service.TaskService; import com.cpop.oam.business.service.TaskStaffGroupService; +import com.cpop.oam.business.service.TaskWorkOrderService; import com.cpop.oam.business.vo.*; +import com.mybatisflex.core.paginate.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -17,8 +18,6 @@ import org.springframework.web.bind.annotation.*; import java.util.List; -import com.cpop.oam.business.service.TaskWorkOrderService; - /** * OAM-任务表 控制层。 * @@ -65,8 +64,7 @@ public class TaskTechnologyController { */ @ApiOperation("技术模块-今日事务-工单记录列表") @GetMapping("/getWorkOrderRecordList/{workOrderId}") - public R> getWorkOrderRecordList(@PathVariable @ApiParam("工单id") - String workOrderId) { + public R> getWorkOrderRecordList(@PathVariable @ApiParam("工单id") String workOrderId) { List list = taskWorkOrderService.getWorkOrderRecordList(workOrderId); return R.ok(list); } @@ -80,8 +78,7 @@ public class TaskTechnologyController { */ @ApiOperation("技术模块-今日事务-新增工单记录") @PostMapping("/insertWorkOrderRecord") - public R insertWorkOrderRecord(@RequestBody @Validated - TaskWorkOrderRecordBo bo) { + public R insertWorkOrderRecord(@RequestBody @Validated TaskWorkOrderRecordBo bo) { //是否是第一个 taskWorkOrderService.whetherReceive(bo.getTaskWorkOrderId()); taskWorkOrderService.insertWorkOrderRecord(bo); @@ -164,8 +161,7 @@ public class TaskTechnologyController { //@PreAuthorize("@aps.hasPermission('oamTask:iterateTask:update')") @ApiOperation("技术模块-任务领取-技术人员领取任务") @PutMapping("/claimTask/{id}") - public R claimTask(@PathVariable @ApiParam("任务id") - String id) { + public R claimTask(@PathVariable @ApiParam("任务id") String id) { taskService.claimTask(id); return R.ok(); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/CommonService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/CommonService.java index 1ef8fbc..84cb2ad 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/CommonService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/CommonService.java @@ -43,4 +43,13 @@ public interface CommonService { * @Date: 2023/5/11 15:48 **/ void setSysConfigInfo(SysConfigInfoBo bo); + + /** + * 获取缓存key + * @author DB + * @since 2023/12/26 + * @param key 枚举key + * @return String + */ + String getCacheKey(String key); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java index ce576e2..cfbdc9f 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java @@ -1,13 +1,12 @@ package com.cpop.oam.business.service.impl; -import cn.hutool.core.util.ByteUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cpop.common.utils.StringUtils; import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.LoginUser; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SecurityUtils; @@ -18,9 +17,12 @@ import com.cpop.oam.business.bo.BusinessDistributeBo; import com.cpop.oam.business.bo.BusinessInfoPageBo; import com.cpop.oam.business.bo.BusinessRemoveBo; import com.cpop.oam.business.dto.BusinessDistributeDto; +import com.cpop.oam.business.entity.Business; import com.cpop.oam.business.entity.BusinessDetail; import com.cpop.oam.business.entity.BusinessStaff; +import com.cpop.oam.business.mapper.BusinessMapper; import com.cpop.oam.business.service.BusinessDetailService; +import com.cpop.oam.business.service.BusinessService; import com.cpop.oam.business.service.BusinessStaffService; import com.cpop.oam.business.vo.BusinessInfoPageVo; import com.cpop.oam.business.vo.BusinessPageVo; @@ -29,15 +31,12 @@ import com.cpop.system.business.service.StoreService; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.oam.business.entity.Business; -import com.cpop.oam.business.mapper.BusinessMapper; -import com.cpop.oam.business.service.BusinessService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; +import javax.net.ssl.HttpsURLConnection; +import java.io.*; +import java.net.URL; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -161,30 +160,36 @@ public class BusinessServiceImpl extends ServiceImpl i List businessStaffList = new ArrayList<>(); bo.getButtJoint().forEach(item -> { //对接文件 - File buttJointFile = new File(item.getBusinessDocUrl()); - FileInputStream fileInputStream = null; + JSONObject jsonObject = JSONArray.parseArray(item.getBusinessDocUrl()).getJSONObject(0); + String url = jsonObject.getString("url"); + InputStream fileInputStream; try { - fileInputStream = new FileInputStream(buttJointFile); - } catch (FileNotFoundException e) { + HttpsURLConnection connection = (HttpsURLConnection) new URL(url).openConnection(); + fileInputStream = connection.getInputStream(); + EasyExcel.read(fileInputStream, BusinessDistributeDto.class, new ReadListener() { + + @Override + public void invoke(BusinessDistributeDto data, AnalysisContext context) { + businessDistributeDataList.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + + } + }).sheet().doRead(); + fileInputStream.close(); + } catch (IOException e) { throw new ServiceException("读取文件失败!"); } - EasyExcel.read(fileInputStream, BusinessDistributeDto.class,new ReadListener() { - - @Override - public void invoke(BusinessDistributeDto data, AnalysisContext context) { - businessDistributeDataList.add(data); - } - - @Override - public void doAfterAllAnalysed(AnalysisContext context) { - - } - }); if (businessDistributeDataList.isEmpty()) { throw new ServiceException("导入的excel存在空文件,请检查后重新操作"); } List storeList = SpringUtils.getBean(StoreService.class).queryChain() .where(STORE.ID.in(businessDistributeDataList.stream().map(BusinessDistributeDto::getStoreId).collect(Collectors.toSet()))).list(); + if (storeList.size() != businessDistributeDataList.size()) { + throw new ServiceException("校区查询匹配失败,请核实数据后重新提交"); + } List businessDetails = BeanUtils.mapToList(storeList, BusinessDetail.class); businessDetails.forEach(inner->{ inner.setBusinessId(businessId); @@ -236,18 +241,20 @@ public class BusinessServiceImpl extends ServiceImpl i //运营人员 if (loginUserInfo.getInteger("staffType") == 1) { //查询自己处理中的校区的记录 - queryWrapper.and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id"))) + queryWrapper.and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id")) //获取所有无人处理的校区 .or(STORE.ID.notIn(select(BUSINESS_DETAIL.STORE_ID) .from(BUSINESS_DETAIL) .leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.BUSINESS_ID.eq(BUSINESS_DETAIL.BUSINESS_ID)) .where(BUSINESS_STAFF.STAFF_ID.ne(loginUserInfo.getString("id"))) - )); + ))); + } else { + queryWrapper.and(BUSINESS_STAFF.STAFF_ID.in(bo.getStaffIds())); } PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); return SpringUtils.getBean(StoreService.class).getMapper().paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), queryWrapper - .select(BUSINESS_DETAIL.ID,BUSINESS_DETAIL.BUSINESS_ID, BUSINESS_DETAIL.DETAIL_STATUS, BUSINESS_DETAIL.DETAIL_DESC, BUSINESS_DETAIL.DETAIL_RECORD_TIME) + .select(BUSINESS_DETAIL.ID.as(BusinessInfoPageVo::getId),BUSINESS_DETAIL.BUSINESS_ID, BUSINESS_DETAIL.DETAIL_STATUS, BUSINESS_DETAIL.DETAIL_DESC, BUSINESS_DETAIL.DETAIL_RECORD_TIME) //品牌 .select(BRAND.BRAND_NAME) //校区 @@ -310,7 +317,8 @@ public class BusinessServiceImpl extends ServiceImpl i .and(BRAND.BRAND_NAME.like(bo.getBrandOrStore()).or(STORE.STORE_NAME.like(bo.getBrandOrStore()))) //校区地址或校区名模糊查询 .and(STORE_LICENSE.LICENSE_NAME.like(bo.getAddrOrName()).or(STORE_LICENSE.LICENSE_ADDR.like(bo.getAddrOrName()))) - .and(BUSINESS_DETAIL.DETAIL_STATUS.eq(bo.getDetailStatus())), + .and(BUSINESS_DETAIL.DETAIL_STATUS.eq(bo.getDetailStatus())) + .and(BUSINESS_STAFF.STAFF_ID.in(bo.getStaffIds())), BusinessInfoPageVo.class); } @@ -327,7 +335,7 @@ public class BusinessServiceImpl extends ServiceImpl i BusinessDetail businessDetail; //查询当前事务 if (StringUtils.isNotBlank(bo.getId())){ - businessDetail = businessDetailService.getById(bo.getId()); + businessDetail = businessDetailService.queryChain().where(BUSINESS_DETAIL.ID.eq(bo.getId())).one(); businessDetail.setDetailStatus(bo.getDetailStatus()).setDetailDesc(bo.getDetailDesc()).setDetailRecordTime(LocalDateTime.now()); //新增或修改 businessDetailService.updateById(businessDetail); @@ -342,9 +350,11 @@ public class BusinessServiceImpl extends ServiceImpl i } //完成的时候数量减少 if (bo.getDetailStatus() == 1) { - Business business = this.getById(businessDetail.getBusinessId()); + Business business = this.getById(bo.getBusinessId()); //所有任务都完成 - if (business.getAllSurplusQuantity() - 1 == 0) { + if (business.getAllSurplusQuantity() == 0) { + throw new ServiceException("当前事务已完成,请选择其他事务"); + } else if (business.getAllSurplusQuantity() - 1 == 0) { business.setStatus(1); } business.setAllSurplusQuantity(business.getAllSurplusQuantity() - 1); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java index 3156222..d7019b7 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java @@ -82,7 +82,8 @@ public class CommonServiceImpl implements CommonService { * @param configKey 参数键 * @return 缓存键key */ - private String getCacheKey(String configKey) { + @Override + public String getCacheKey(String configKey) { return OamConfigKey.OAM_CONFIG_KEY + configKey; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java index cdd26f2..9651b12 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java @@ -173,6 +173,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta .where(TASK.TASK_STATUS.eq(taskGetStatus)) .and(TASK.TASK_CONTENT.like(taskContent)) .and(TASK.SUBJECT.like(subject)) + .and(TASK.TASK_TYPE.in(0, 1)) .orderBy(TASK.IS_URGENT.desc(), TASK.CREATE_TIME.desc()), TaskToBeClaimedPageVo.class, // 对接人 @@ -337,9 +338,19 @@ public class TaskServiceImpl extends ServiceImpl implements Ta if (StringUtils.isBlank(testStaffPhones)) { throw new ServiceException("测试员工手机号未配置,请联系相关人员配置"); } + QueryWrapper queryWrapper = QueryWrapper.create(); + //对比当前员工是否是测试管理员 + if (!Arrays.asList(testStaffPhones.split(",")).contains(loginUserInfo.getString("phoneNumber"))) { + queryWrapper.and(TASK.TASK_STATUS.in(2, 3)) + .and(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id"))); + } else { + //测试人员 + queryWrapper.and(TASK.TASK_STATUS.eq(3)) + .groupBy(TASK.ID); + } return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(), - QueryWrapper.create() + queryWrapper .select(TASK.ID, TASK.TASK_STATUS, TASK.TASK_CONTENT, TASK.TASK_ITEM, TASK.TASK_RATING, TASK.TASK_RECEIPT_TIME, TASK.EXPECTED_COMPLETION_DATE, TASK.TASK_PROGRESS, TASK.SUBJECT) .select(STAFF.NAME.as(PersonTaskPageVo::getResponsibleStaffName)) //个人绩点 @@ -352,9 +363,6 @@ public class TaskServiceImpl extends ServiceImpl implements Ta .leftJoin(STAFF) .on(STAFF.ID.eq(TASK_STAFF_GROUP.STAFF_ID)) .where(TASK.TASK_TYPE.in(0, 1)) - //对比当前员工是否是测试管理员 - .and(TASK.TASK_STATUS.in(2, 3)) - .and(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id"))) .orderBy(TASK.EXPECTED_COMPLETION_DATE.asc()), PersonTaskPageVo.class); } @@ -377,7 +385,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta //逾期 case -1: //判断当前任务状态 - if (task.getTaskStatus() == 1) { + if (task.getTaskStatus() == 2) { if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) { throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!"); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java index 6020553..a8366c0 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java @@ -411,29 +411,27 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl phoneList = new ArrayList<>(); + StaffService staffService = SpringUtils.getBean(StaffService.class); + + if (loginUserInfo.getInteger("staffType") == 1) { // 负责人手机号 - StaffInfoVo responsibleStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId()); - List phoneList = new ArrayList<>(); + StaffInfoVo responsibleStaff = staffService.getStaffInfo(task.getResponsibleStaffId()); phoneList.add(responsibleStaff.getPhoneNumber()); - if (StringUtils.equals(loginUserInfo.getString("phoneNumber"), responsibleStaff.getPhoneNumber())) { - //读取记录人信息 - StaffInfoVo recordStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getRecordStaffId()); - phoneList.add(recordStaff.getPhoneNumber()); - } else { - phoneList.add(loginUserInfo.getString("phoneNumber")); - } - // 通知记录 - try { - SpringUtils.getBean(WebHookSendHandler.class) - .webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, - phoneList, - task.getTaskContent() + "\n工单有新回复:\n" + bo.getRecordText(), - false); - } catch (IOException e) { - throw new ServiceException("发送消息通知失败!"); - } + } else { + //读取记录人信息 + StaffInfoVo recordStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getRecordStaffId()); + phoneList.add(recordStaff.getPhoneNumber()); + } + phoneList.add(loginUserInfo.getString("phoneNumber")); + // 通知记录 + try { + SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, + task.getTaskContent() + "\n工单有新回复:\n" + bo.getRecordText(), + false); + } catch (IOException e) { + throw new ServiceException("发送消息通知失败!"); } } @@ -501,8 +499,9 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl> getSysMenuTreeList() { - List list = menuService.getSysMenuTreeList(new MenuListBo()); + MenuListBo menuListBo = new MenuListBo(); + menuListBo.setStatus(true); + List list = menuService.getSysMenuTreeList(menuListBo); //过滤掉没有权限的数据 return R.ok(list); } diff --git a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/MenuServiceImpl.java b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/MenuServiceImpl.java index 5eedc10..091cf00 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/MenuServiceImpl.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/MenuServiceImpl.java @@ -6,6 +6,7 @@ import com.cpop.common.utils.StringUtils; import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.LoginUser; import com.cpop.core.base.enums.InitRoleEnum; +import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SecurityUtils; import com.cpop.system.business.bo.MenuBo; import com.cpop.system.business.bo.MenuListBo; @@ -161,6 +162,12 @@ public class MenuServiceImpl extends ServiceImpl implements Me if (StringUtils.isNotBlank(bo.getPath())){ String[] split = bo.getPath().split("/"); String name = StringUtils.getMethodName(split[split.length - 1].replace("/", "")); + LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); + //名字不能重复 + long count = this.count(QueryWrapper.create().where(MENU.NAME.eq(name)).and(MENU.USER_TYPE.eq(loginUser.getUserType().toString()))); + if (count > 0) { + throw new ServiceException("命名失败,请调整路径"); + } entity.setName(name); } else { entity.setName(null); @@ -186,6 +193,12 @@ public class MenuServiceImpl extends ServiceImpl implements Me toUpperCaseString = split[split.length - 2]; } String name = StringUtils.getMethodName(toUpperCaseString.replace("/", "")); + LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); + //名字不能重复 + long count = this.count(QueryWrapper.create().where(MENU.NAME.eq(name)).and(MENU.USER_TYPE.eq(loginUser.getUserType().toString()))); + if (count > 1) { + throw new ServiceException("命名失败,请调整路径"); + } entity.setName(name); } //设置组件 diff --git a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java index e286781..36d35c8 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java @@ -7,16 +7,14 @@ import com.cpop.system.business.bo.StoreRenewPageBo; import com.cpop.system.business.bo.StoreRenewXmlBo; import com.cpop.system.business.bo.StoreRunOffBo; import com.cpop.system.business.dto.StoreRenewDto; +import com.cpop.system.business.entity.StoreSign; +import com.cpop.system.business.mapper.StoreSignMapper; import com.cpop.system.business.service.StoreRenewService; +import com.cpop.system.business.service.StoreSignService; import com.cpop.system.business.vo.StoreRenewPageVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.system.business.entity.StoreSign; -import com.cpop.system.business.mapper.StoreSignMapper; -import com.cpop.system.business.service.StoreSignService; -import org.apache.poi.ss.formula.functions.T; -import org.joda.time.LocalDate; import org.springframework.stereotype.Service; import java.util.List; @@ -61,7 +59,7 @@ public class StoreSignServiceImpl extends ServiceImpl item.field(StoreRenewPageVo::getLastUpdateUserId) + .queryWrapper(updateStaff -> queryChain() + .select("name") + .from("cp_oam_staff") + .where("cp_oam_staff.user_id = ?", updateStaff.getLastUpdateUserId()))); } /** @@ -107,6 +111,7 @@ public class StoreSignServiceImpl extends ServiceImpl