修订Oam缺陷

This commit is contained in:
DB 2023-12-26 18:27:03 +08:00
parent 74ae661c07
commit 5e0039ea95
21 changed files with 201 additions and 150 deletions

View File

@ -192,4 +192,5 @@ public interface RedisService {
* @Date: 2023/4/12 22:23
*/
Lock distributedLock(String key);
}

View File

@ -33,9 +33,9 @@ spring:
#
min-idle: 0
#
max-idle: 8
max-idle: 16
#
max-active: 8
max-active: 16
#
max-wait: -1ms
data:

View File

@ -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:

View File

@ -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:

View File

@ -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<String> staffIds;
/**
* 事务id
*/

View File

@ -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<Page<BusinessInfoPageVo>>
*/
@GetMapping("/getBusinessInfoPage")
@PostMapping("/getBusinessInfoPage")
@ApiOperation("获取个人事务分页列表/管理人员事务详情列表")
public R<Page<BusinessInfoPageVo>> getBusinessInfoPage(@ApiParam("请求参数") @Validated BusinessInfoPageBo bo) {
public R<Page<BusinessInfoPageVo>> getBusinessInfoPage(@ApiParam("请求参数") @RequestBody @Validated BusinessInfoPageBo bo) {
Page<BusinessInfoPageVo> page = businessService.getBusinessInfoPage(bo);
return R.ok(page);
}

View File

@ -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<Void> removeById(@PathVariable @ApiParam("数据导入主键") String id) {
dataImportService.removeById(id);
return R.ok();
}
/**

View File

@ -203,8 +203,8 @@ public class FinanceReimburseController {
@PutMapping("/reimburseReject")
public R<Void> 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();

View File

@ -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<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id")
String workOrderId) {
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id") String workOrderId) {
List<TaskWorkOrderRecordListVo> list = taskWorkOrderService.getWorkOrderRecordList(workOrderId);
return R.ok(list);
}
@ -80,8 +78,7 @@ public class TaskTechnologyController {
*/
@ApiOperation("技术模块-今日事务-新增工单记录")
@PostMapping("/insertWorkOrderRecord")
public R<Void> insertWorkOrderRecord(@RequestBody @Validated
TaskWorkOrderRecordBo bo) {
public R<Void> 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<Void> claimTask(@PathVariable @ApiParam("任务id")
String id) {
public R<Void> claimTask(@PathVariable @ApiParam("任务id") String id) {
taskService.claimTask(id);
return R.ok();
}

View File

@ -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);
}

View File

@ -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<BusinessMapper, Business> i
List<BusinessStaff> 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<BusinessDistributeDto>() {
@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<BusinessDistributeDto>() {
@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<Store> 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<BusinessDetail> businessDetails = BeanUtils.mapToList(storeList, BusinessDetail.class);
businessDetails.forEach(inner->{
inner.setBusinessId(businessId);
@ -236,18 +241,20 @@ public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, Business> 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<BusinessMapper, Business> 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<BusinessMapper, Business> 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<BusinessMapper, Business> 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);

View File

@ -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;
}

View File

@ -173,6 +173,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> 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<TaskMapper, Task> 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<TaskMapper, Task> 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<TaskMapper, Task> implements Ta
//逾期
case -1:
//判断当前任务状态
if (task.getTaskStatus() == 1) {
if (task.getTaskStatus() == 2) {
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
}

View File

@ -411,29 +411,27 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
taskWorkOrderRecord.setRecordStaffId(loginUserInfo.getString("id"));
// 插入记录
SpringUtils.getBean(TaskWorkOrderRecordService.class).save(taskWorkOrderRecord);
//没有负责人
if (StringUtils.isNotBlank(task.getResponsibleStaffId())) {
//判断插入记录用户类型
List<String> phoneList = new ArrayList<>();
StaffService staffService = SpringUtils.getBean(StaffService.class);
if (loginUserInfo.getInteger("staffType") == 1) {
// 负责人手机号
StaffInfoVo responsibleStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
List<String> 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<TaskWorkOrderMapper, T
}
TaskDemandBo taskDemandBo = new TaskDemandBo();
RedisService redisService = SpringUtils.getBean(RedisService.class);
String brandId = redisService.getCacheObject(OamConfigEnum.DEMAND_TO_TASK_BRAND.getKey());
String storeId = redisService.getCacheObject(OamConfigEnum.DEMAND_TO_TASK_STORE.getKey());
CommonService commonService = SpringUtils.getBean(CommonService.class);
String brandId = redisService.getCacheObject(commonService.getCacheKey(OamConfigEnum.DEMAND_TO_TASK_BRAND.getKey()));
String storeId = redisService.getCacheObject(commonService.getCacheKey(OamConfigEnum.DEMAND_TO_TASK_STORE.getKey()));
taskDemandBo.setAttachmentUrl(task.getAttachmentUrl())
.setBrandId(brandId)
.setStoreId(storeId)
@ -742,11 +741,8 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
//删除工单接收超时任务
startOrRemoveWorkOrderAcceptTask(taskWorkOrderId, false, now);
//生成工单处理超时任务
startOrUpdateWorkOrderOvertimeTask(taskWorkOrderId,false,now);
startOrUpdateWorkOrderOvertimeTask(taskWorkOrderId, false, now);
}
}
}
}

View File

@ -1,13 +1,12 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
/**
* @author DB
@ -33,6 +32,7 @@ public class BusinessInfoPageVo {
* 处理时间
*/
@ApiModelProperty(value = "处理时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private LocalDateTime detailRecordTime;
/**
* 事务详情状态(0进行中;1:完成2挂起)

View File

@ -1,33 +1,22 @@
package com.cpop.system.business.controller;
import com.cpop.core.annontation.OperationLog;
import com.cpop.core.base.R;
import com.cpop.core.base.enums.OperationLogEnum;
import com.cpop.system.business.bo.MenuListBo;
import com.cpop.system.business.bo.RoleBo;
import com.cpop.system.business.bo.RolePageBo;
import com.cpop.system.business.bo.RoleStatusBo;
import com.cpop.system.business.service.MenuService;
import com.cpop.system.business.service.RoleService;
import com.cpop.system.business.vo.MenuVo;
import com.cpop.system.business.vo.RolePageVo;
import com.mybatisflex.core.paginate.Page;
import org.springframework.security.access.prepost.PreAuthorize;
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.system.business.entity.Role;
import com.cpop.system.business.service.RoleService;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.io.Serializable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
@ -86,7 +75,9 @@ public class RoleController {
@ApiOperation("获取菜单树列表")
@GetMapping("/getSysMenuTreeList")
public R<List<MenuVo>> getSysMenuTreeList() {
List<MenuVo> list = menuService.getSysMenuTreeList(new MenuListBo());
MenuListBo menuListBo = new MenuListBo();
menuListBo.setStatus(true);
List<MenuVo> list = menuService.getSysMenuTreeList(menuListBo);
//过滤掉没有权限的数据
return R.ok(list);
}

View File

@ -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<MenuMapper, Menu> 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<MenuMapper, Menu> 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);
}
//设置组件

View File

@ -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<StoreSignMapper, StoreSign
return SpringUtils.getBean(StoreRenewService.class).getMapper().paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
queryWrapper
.select(BRAND.BRAND_NAME)
.select(STORE.CREATE_TIME, STORE.PERSON_CHARGE, STORE.PHONE, STORE.STORE_NAME)
.select(STORE.CREATE_TIME.as(StoreRenewPageVo::getCreateTime), STORE.PERSON_CHARGE, STORE.PHONE, STORE.STORE_NAME)
.select(STORE_SIGN.EXPIRE_DATE, STORE_SIGN.ID)
.select(STORE_LICENSE.LICENSE_ADDR, STORE_LICENSE.LICENSE_NAME, STORE_LICENSE.LICENSE_USER_NAME)
.select(STORE_RENEW.RENEW_DATE, STORE_RENEW.RENEW_AMOUNT)
@ -82,10 +80,10 @@ public class StoreSignServiceImpl extends ServiceImpl<StoreSignMapper, StoreSign
return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
queryWrapper
.select(BRAND.BRAND_NAME)
.select(STORE.CREATE_TIME, STORE.PERSON_CHARGE, STORE.PHONE, STORE.STORE_NAME)
.select(STORE_SIGN.EXPIRE_DATE, STORE_SIGN.ID)
.select(STORE.CREATE_TIME.as(StoreRenewPageVo::getCreateTime), STORE.PERSON_CHARGE, STORE.PHONE, STORE.STORE_NAME)
.select(STORE_SIGN.EXPIRE_DATE, STORE_SIGN.ID, STORE_SIGN.RUN_OFF_DATE, STORE_SIGN.RUN_OFF_REASON, STORE_SIGN.UPDATE_USER_ID.as(StoreRenewPageVo::getLastUpdateUserId))
.select(STORE_LICENSE.LICENSE_ADDR, STORE_LICENSE.LICENSE_NAME, STORE_LICENSE.LICENSE_USER_NAME)
.select(STORE_RENEW.RENEW_DATE,STORE_RENEW.RENEW_AMOUNT)
.select(STORE_RENEW.RENEW_DATE, STORE_RENEW.RENEW_AMOUNT)
.select("cos.name as renewStaffName")
.leftJoin(STORE).on(STORE.ID.eq(STORE_SIGN.STORE_ID))
.leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID))
@ -94,7 +92,13 @@ public class StoreSignServiceImpl extends ServiceImpl<StoreSignMapper, StoreSign
.leftJoin("cp_oam_staff").as("cos").on("`cos`.`id` = `cp_sys_store_renew`.`renew_staff_id`")
.and(BRAND.BRAND_NAME.like(bo.getBrandOrStore()).or(STORE.STORE_NAME.like(bo.getBrandOrStore())))
.and(STORE_LICENSE.LICENSE_ADDR.like(bo.getAddrOrName()).or(STORE_LICENSE.LICENSE_NAME.like(bo.getAddrOrName()))),
StoreRenewPageVo.class);
StoreRenewPageVo.class,
//子查询
item -> 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<StoreSignMapper, StoreSign
public void runOff(StoreRunOffBo bo) {
this.updateChain().set(STORE_SIGN.RUN_OFF_REASON, bo.getRunOffReason())
.set(STORE_SIGN.RUN_OFF_DATE, now())
.set(STORE_SIGN.IS_LOSS, true)
.where(STORE_SIGN.ID.eq(bo.getId())).update();
}

View File

@ -112,6 +112,7 @@ public class MenuRouteVo implements Serializable {
*/
@ApiModelProperty("是否忽略KeepAlive缓存")
private Boolean ignoreKeepAlive;
//private Boolean keepalive;
/**
* 内部定义类

View File

@ -114,4 +114,10 @@ public class MenuVo implements Serializable {
@ApiModelProperty(value = "隐藏菜单")
private Boolean hideMenu;
/**
* 是否忽略KeepAlive缓存
*/
@ApiModelProperty(value = "是否忽略KeepAlive缓存")
private Boolean ignoreKeepAlive;
}

View File

@ -1,6 +1,6 @@
package com.cpop.system.business.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -8,7 +8,7 @@ import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.LocalDateTime;
/**
* @author DB
@ -29,7 +29,8 @@ public class StoreRenewPageVo {
* 注册时间
*/
@ApiModelProperty(value = "注册时间")
private OffsetDateTime createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private LocalDateTime createTime;
/**
* 到期日期
*/
@ -74,7 +75,7 @@ public class StoreRenewPageVo {
* 续费时间
*/
@ApiModelProperty(value = "续费时间")
private String renewDate;
private LocalDate renewDate;
/**
* 续费金额
@ -86,4 +87,28 @@ public class StoreRenewPageVo {
*/
@ApiModelProperty(value = "续费人")
private String renewStaffName;
/**
* 流失日期
*/
@ApiModelProperty(value = "流失日期")
private LocalDate runOffDate;
/**
* 流失原因
*/
@ApiModelProperty(value = "流失原因")
private String runOffReason;
/**
* 最后操作员工Id
*/
@ApiModelProperty(value = "最后操作员工Id")
private String lastUpdateUserId;
/**
* 最后操作员工
*/
@ApiModelProperty(value = "最后操作员工")
private String lastUpdateStaffName;
}