Selaa lähdekoodia

1、设置图片原图字段;2、修改机场平台tenantCode字段;

tags/v1.0.0^2
wanjing 1 vuosi sitten
vanhempi
commit
a7cb6dce95
7 muutettua tiedostoa jossa 254 lisäystä ja 201 poistoa
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/execute/ExecuteInspectionService.java
  2. +1
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFileDistributionListService.java
  3. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/AirportTask.java
  4. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileDistributionListVo.java
  5. +93
    -76
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java
  6. +137
    -122
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java
  7. +11
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/WorkOrderHandleVo.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/execute/ExecuteInspectionService.java Näytä tiedosto

@@ -120,7 +120,7 @@ public class ExecuteInspectionService {
jsonObject.put("taskId", inspection.getInspectionLine());
jsonObject.put("requestId", inspection.getId());
jsonObject.put("code", "gs"); // 与机场平台约定好的
jsonObject.put("tenantName", tenant.getName());
jsonObject.put("tenantCode", tenant.getCode());

log.info("进入调用机场平台方法: url:{}", url);
log.info("进入调用机场平台方法: jsonObject:{}", jsonObject);

+ 1
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFileDistributionListService.java Näytä tiedosto

@@ -126,6 +126,7 @@ public class QueryInspectionFileDistributionListService {
inspectionFileDistributionListVo.setQuestionName(questionType.getContent());
}
inspectionFileDistributionListVo.setFileThumbnail(CommonConfig.imageURL + inspectionFileDistributionListVo.getFileThumbnail());
inspectionFileDistributionListVo.setFileOriginal(CommonConfig.imageURL + inspectionFileDistributionListVo.getFileOriginal());
}
return inspectionFileDistributionListVoList;
}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/AirportTask.java Näytä tiedosto

@@ -94,7 +94,7 @@ public class AirportTask {
jsonObject.put("taskId", inspection.getInspectionLine());
jsonObject.put("requestId", String.valueOf(inspection.getId()));
jsonObject.put("code", "gs"); // 与机场平台约定好的
jsonObject.put("tenantName", tenant.getName());
jsonObject.put("tenantCode", tenant.getCode());

String airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST");
if (StringUtils.isEmpty(airPortStr)) {

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileDistributionListVo.java Näytä tiedosto

@@ -30,11 +30,21 @@ public class InspectionFileDistributionListVo {
*/
private String questionName;

/**
* 文件名称
*/
private String fileName;

/**
* 缩略图
*/
private String fileThumbnail;

/**
* 原图
*/
private String fileOriginal;

/**
* 经度
*/

+ 93
- 76
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java Näytä tiedosto

@@ -61,19 +61,20 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
private QuestionTypeMapper questionTypeMapper;

/**
*待确认问题 status状态为5
* 待确认问题 status状态为5
*
* @param query
* @return
*/
@Override
public JsonResult unconfirmedQuestion(InspectionFileQuery query) {
if(null == query.getLimit() && null == query.getPage()){
if (null == query.getLimit() && null == query.getPage()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//登录用户信息
String tenantId = CurrentUserUtil.getTenantId();
query.setTenantId(tenantId);
if(StringUtils.isEmpty(query.getInspectionId())){
query.setTenantId(tenantId);
if (StringUtils.isEmpty(query.getInspectionId())) {
return JsonResult.error("任务id为空");
}
//获取当前登录人
@@ -85,11 +86,11 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery()
.eq(Inspection::getId, query.getInspectionId())
.eq(Inspection::getMark, 1));
if(ObjectUtil.isNull(inspection)){
if (ObjectUtil.isNull(inspection)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//设置分页
IPage<InspectionFile> page = new Page<>(query.getPage(),query.getLimit());
IPage<InspectionFile> page = new Page<>(query.getPage(), query.getLimit());
//获取分页数据
IPage<InspectionFile> result = inspectionFileMapper.selectPage(page, Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getInspectionId, query.getInspectionId())
@@ -102,18 +103,19 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 已确认问题 status状态为15
*
* @param query
* @return
*/
@Override
public JsonResult confirmedQuestion(InspectionFileQuery query) {
if(null==query.getLimit() && null == query.getPage()){
if (null == query.getLimit() && null == query.getPage()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//登录用户信息
String tenantId = CurrentUserUtil.getTenantId();
query.setTenantId(tenantId);
if(StringUtils.isEmpty(query.getInspectionId())){
if (StringUtils.isEmpty(query.getInspectionId())) {
return JsonResult.error("任务id为空");
}
//获取当前登录人
@@ -125,11 +127,11 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery()
.eq(Inspection::getId, query.getInspectionId())
.eq(Inspection::getMark, 1));
if(ObjectUtil.isNull(inspection)){
if (ObjectUtil.isNull(inspection)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//设置分页
IPage<InspectionFile> page = new Page<>(query.getPage(),query.getLimit());
IPage<InspectionFile> page = new Page<>(query.getPage(), query.getLimit());
//获取分页数据
IPage<InspectionFile> result = inspectionFileMapper.selectPage(page, Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getInspectionId, query.getInspectionId())
@@ -143,18 +145,19 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 已忽略问题 status状态为10
*
* @param query
* @return
*/
@Override
public JsonResult ignoredQuestion(InspectionFileQuery query) {
if(null==query.getLimit() && null == query.getPage()){
if (null == query.getLimit() && null == query.getPage()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//登录用户信息
String tenantId = CurrentUserUtil.getTenantId();
query.setTenantId(tenantId);
if(StringUtils.isEmpty(query.getInspectionId())){
if (StringUtils.isEmpty(query.getInspectionId())) {
return JsonResult.error("任务id为空");
}
//获取当前登录人
@@ -166,11 +169,11 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery()
.eq(Inspection::getId, query.getInspectionId())
.eq(Inspection::getMark, 1));
if(ObjectUtil.isNull(inspection)){
if (ObjectUtil.isNull(inspection)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//设置分页
IPage<InspectionFile> page = new Page<>(query.getPage(),query.getLimit());
IPage<InspectionFile> page = new Page<>(query.getPage(), query.getLimit());
//获取分页数据
IPage<InspectionFile> result = inspectionFileMapper.selectPage(page, Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getInspectionId, query.getInspectionId())
@@ -184,12 +187,13 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 问题标识
*
* @param dto
* @return
*/
@Override
public JsonResult questionIdentification(QuestionIdentificationDto dto) {
if(StringUtils.isEmpty(dto.getId())) return JsonResult.error("问题id不存在");
if (StringUtils.isEmpty(dto.getId())) return JsonResult.error("问题id不存在");
//查询任务此问题
InspectionFile inspectionFile = inspectionFileMapper.selectOne(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getId, dto.getId())
@@ -198,18 +202,18 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
//修改对应的问题类型
inspectionFile.setQuestionId(dto.getQuestionId());
int count = inspectionFileMapper.updateById(inspectionFile);
if(count<=0){
if (count <= 0) {
return JsonResult.error();
}
//设置图片添加域名
if(StringUtils.isNotEmpty(inspectionFile.getFileThumbnail())){
inspectionFile.setFileThumbnail(CommonConfig.imageURL+inspectionFile.getFileThumbnail());
if (StringUtils.isNotEmpty(inspectionFile.getFileThumbnail())) {
inspectionFile.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail());
}
if(StringUtils.isNotEmpty(inspectionFile.getFileOriginal())){
inspectionFile.setFileOriginal(CommonConfig.imageURL+inspectionFile.getFileOriginal());
if (StringUtils.isNotEmpty(inspectionFile.getFileOriginal())) {
inspectionFile.setFileOriginal(CommonConfig.imageURL + inspectionFile.getFileOriginal());
}
if(StringUtils.isNotEmpty(inspectionFile.getFileImage())){
inspectionFile.setFileImage(CommonConfig.imageURL+inspectionFile.getFileImage());
if (StringUtils.isNotEmpty(inspectionFile.getFileImage())) {
inspectionFile.setFileImage(CommonConfig.imageURL + inspectionFile.getFileImage());
}


@@ -218,21 +222,22 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 确认问题
*
* @param entity
* @return
*/
@Override
public JsonResult confirm(InspectionFile entity) {
if(StringUtils.isEmpty(entity.getId())) {
if (StringUtils.isEmpty(entity.getId())) {
return JsonResult.error("问题id为空");
}
//查询当前问题
LambdaUpdateWrapper<InspectionFile> qw = new LambdaUpdateWrapper<>();
qw.eq(InspectionFile::getId,entity.getId());
qw.eq(InspectionFile::getMark,1);
qw.set(InspectionFile::getStatus,15);
qw.eq(InspectionFile::getId, entity.getId());
qw.eq(InspectionFile::getMark, 1);
qw.set(InspectionFile::getStatus, 15);
int count = inspectionFileMapper.update(entity, qw);
if(count<=0){
if (count <= 0) {
return JsonResult.error();
}
return JsonResult.success("确认问题成功");
@@ -240,21 +245,22 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 忽略问题
*
* @param entity
* @return
*/
@Override
public JsonResult ignore(InspectionFile entity) {
if(null == entity.getId()) {
if (null == entity.getId()) {
return JsonResult.error("问题id为空");
}
//查询当前问题
LambdaUpdateWrapper<InspectionFile> qw = new LambdaUpdateWrapper<>();
qw.eq(InspectionFile::getId,entity.getId());
qw.eq(InspectionFile::getMark,1);
qw.set(InspectionFile::getStatus,10);
qw.eq(InspectionFile::getId, entity.getId());
qw.eq(InspectionFile::getMark, 1);
qw.set(InspectionFile::getStatus, 10);
int count = inspectionFileMapper.update(entity, qw);
if(count<=0){
if (count <= 0) {
return JsonResult.error();
}
return JsonResult.success("忽略问题成功");
@@ -262,31 +268,35 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 查看
*
* @param id
* @return
*/
@Override
public JsonResult seeQuestion(String id) {
//校验
if(StringUtils.isEmpty(id)){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
if (StringUtils.isEmpty(id)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
SeeQuestionVo vo = inspectionFileMapper.selectByInspectionId(id);
if(ObjectUtil.isNull(vo)){
if (ObjectUtil.isNull(vo)) {
return JsonResult.error("未查询出对应的问题及处理结果");
}
//对属性处理
if(StringUtils.isNotEmpty(vo.getFileOriginal())){
vo.setFileOriginal(CommonConfig.imageURL+vo.getFileOriginal());
if (StringUtils.isNotEmpty(vo.getFileOriginal())) {
vo.setFileOriginal(CommonConfig.imageURL + vo.getFileOriginal());
}
if(StringUtils.isNotEmpty(vo.getFileImage())){
vo.setFileImage(CommonConfig.imageURL+vo.getFileImage());
if (StringUtils.isNotEmpty(vo.getFileImage())) {
vo.setFileImage(CommonConfig.imageURL + vo.getFileImage());
}
if(StringUtils.isNotEmpty(vo.getFileThumbnail())){
vo.setFileThumbnail(CommonConfig.imageURL+vo.getFileThumbnail());
if (StringUtils.isNotEmpty(vo.getFileThumbnail())) {
vo.setFileThumbnail(CommonConfig.imageURL + vo.getFileThumbnail());
}
if (StringUtils.isNotEmpty(vo.getFileOriginal())) {
vo.setFileOriginal(CommonConfig.imageURL + vo.getFileOriginal());
}
//对多张处理结果图进行处理用,隔开
if(StringUtils.isNotEmpty(vo.getHandlerImage())){
if (StringUtils.isNotEmpty(vo.getHandlerImage())) {
String getHandlerImage = getMultipleUrl(vo.getHandlerImage());
vo.setHandlerImage(getHandlerImage);
}
@@ -297,12 +307,13 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 导航
*
* @param id
* @return
*/
@Override
public JsonResult navigation(String id) {
if(StringUtils.isEmpty(id)){
if (StringUtils.isEmpty(id)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
InspectionFile inspectionFile = inspectionFileMapper.selectOne(Wrappers.<InspectionFile>lambdaQuery()
@@ -313,6 +324,7 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 问题处理统计
*
* @return
*/
@Override
@@ -320,19 +332,19 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
//登录用户信息
User userInfo = CurrentUserUtil.getUserInfo();
String username = userInfo.getUsername();
if(StringUtils.isEmpty(username)){
return JsonResult.error(InspectionFileEnum.USER_NAME_IS_NULL.getCode(),InspectionFileEnum.USER_NAME_IS_NULL.getMsg());
if (StringUtils.isEmpty(username)) {
return JsonResult.error(InspectionFileEnum.USER_NAME_IS_NULL.getCode(), InspectionFileEnum.USER_NAME_IS_NULL.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1)
.eq(User::getUsername, username));
if(ObjectUtil.isNull(user)){
return JsonResult.error(InspectionFileEnum.USER_IS_NOT_EXIST.getCode(),InspectionFileEnum.USER_IS_NOT_EXIST.getMsg());
if (ObjectUtil.isNull(user)) {
return JsonResult.error(InspectionFileEnum.USER_IS_NOT_EXIST.getCode(), InspectionFileEnum.USER_IS_NOT_EXIST.getMsg());
}
if(StringUtils.isEmpty(user.getId())){
return JsonResult.error(InspectionFileEnum.USER_ID_IS_NULL.getCode(),InspectionFileEnum.USER_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(user.getId())) {
return JsonResult.error(InspectionFileEnum.USER_ID_IS_NULL.getCode(), InspectionFileEnum.USER_ID_IS_NULL.getMsg());
}
if(null == user.getRoleId()){
if (null == user.getRoleId()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//今日
@@ -341,15 +353,15 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
DateTime startTime = DateUtil.offset(DateUtil.beginOfDay(DateUtil.date()), DateField.DAY_OF_WEEK, -4);
List<InspectionFileCountVo> result = new ArrayList<>();
//判断角色 1超级管理员 2部门管理员 3普通用户
if(RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()){
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
try {
List<String> list = findDates(startTime, endTime);
for (String s : list) {
InspectionFileCountVo vo = new InspectionFileCountVo();
vo.setCheckTime(s);
//查询当日登录用户的已处理问题总数,创建时间
Integer num = inspectionFileMapper.getInspectionFileHandleCount(s,user.getId());
if(null != num){
Integer num = inspectionFileMapper.getInspectionFileHandleCount(s, user.getId());
if (null != num) {
vo.setInspectionHandleSum(num);
}
result.add(vo);
@@ -358,15 +370,15 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
e.printStackTrace();
}
}
if(RoleEnum.ADMIN.getCode() == user.getRoleId() || RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()){
if (RoleEnum.ADMIN.getCode() == user.getRoleId() || RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
try {
List<String> list = findDates(startTime, endTime);
for (String s : list) {
InspectionFileCountVo vo = new InspectionFileCountVo();
vo.setCheckTime(s);
//查询当日登录用户的已处理问题总数,创建时间
Integer num = inspectionFileMapper.getInspectionFileCount(s,user.getId());
if(null != num){
Integer num = inspectionFileMapper.getInspectionFileCount(s, user.getId());
if (null != num) {
vo.setInspectionHandleSum(num);
}
result.add(vo);
@@ -382,24 +394,25 @@ public class InspectionFileServiceImpl implements IInspectionFileService {

/**
* 观看回放
*
* @param id
* @return
*/
@Override
public JsonResult playback(String id) {
//校验
if(StringUtils.isEmpty(id)){
if (StringUtils.isEmpty(id)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//根据问题id查询对应的任务
InspectionFile inspectionFile = inspectionFileMapper.selectById(id);
if(ObjectUtil.isNull(inspectionFile)){
return JsonResult.error(InspectionFileEnum.DATA_IS_NULL.getCode(),InspectionFileEnum.DATA_IS_NULL.getMsg());
if (ObjectUtil.isNull(inspectionFile)) {
return JsonResult.error(InspectionFileEnum.DATA_IS_NULL.getCode(), InspectionFileEnum.DATA_IS_NULL.getMsg());
}
//获取对应的任务id
String inspectionId = inspectionFile.getInspectionId();
if(StringUtils.isEmpty(inspectionId)){
return JsonResult.error(InspectionFileEnum.INSPECTION_ID_NULL.getCode(),InspectionFileEnum.INSPECTION_ID_NULL.getMsg());
if (StringUtils.isEmpty(inspectionId)) {
return JsonResult.error(InspectionFileEnum.INSPECTION_ID_NULL.getCode(), InspectionFileEnum.INSPECTION_ID_NULL.getMsg());
}
//根据任务id获取任务
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery()
@@ -407,10 +420,10 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
.eq(Inspection::getMark, 1)
.eq(Inspection::getId, inspectionId));
PlayBackInfoVo vo = new PlayBackInfoVo();
BeanUtils.copyProperties(inspection,vo);
BeanUtils.copyProperties(inspection, vo);
//对视频地址进行处理
if(StringUtils.isNotEmpty(inspection.getAiVideoUrl())){
vo.setAiVideoUrl(CommonConfig.videoURL+inspection.getVideoUrl());
if (StringUtils.isNotEmpty(inspection.getAiVideoUrl())) {
vo.setAiVideoUrl(CommonConfig.videoURL + inspection.getVideoUrl());
}

return JsonResult.success(vo);
@@ -436,37 +449,41 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
//数据转换
return result.convert(t -> {
InspectionFileInfoVo vo = Convert.convert(InspectionFileInfoVo.class, t);
//查询其他属性
//公路代号
// 查询其他属性
// 公路代号
RoadInformation roadInformation = roadInformationMapper.selectOne(Wrappers.<RoadInformation>lambdaQuery()
.eq(RoadInformation::getId, inspection.getRoadId()));
if(ObjectUtil.isNotNull(roadInformation)){
if (ObjectUtil.isNotNull(roadInformation)) {
vo.setCode(roadInformation.getCode());
}
//任务名称
// 任务名称
if (StringUtils.isNotEmpty(inspection.getName())) {
vo.setName(inspection.getName());
}
//任务时间
if (null != inspection.getExecutionStartTime()){
// 任务时间
if (null != inspection.getExecutionStartTime()) {
vo.setExecutionStartTime(inspection.getExecutionStartTime());
}
//缩略图
// 缩略图
if (StringUtils.isNotEmpty(t.getFileThumbnail())) {
vo.setFileThumbnail(CommonConfig.imageURL + t.getFileThumbnail());
}
//问题类型
if(StringUtils.isNotEmpty(t.getQuestionId())){
// 原图
if (StringUtils.isNotEmpty(t.getFileOriginal())) {
vo.setFileOriginal(CommonConfig.imageURL + t.getFileOriginal());
}
// 问题类型
if (StringUtils.isNotEmpty(t.getQuestionId())) {
QuestionType questionType = questionTypeMapper.selectOne(Wrappers.<QuestionType>lambdaQuery()
.eq(QuestionType::getId, t.getQuestionId())
.eq(QuestionType::getMark, 1));
if(null == questionType){
if (null == questionType) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
if(null != questionType.getName()){
if (null != questionType.getName()) {
vo.setQuestionName(questionType.getName());
}
if(StringUtils.isNotEmpty(questionType.getContent())){
if (StringUtils.isNotEmpty(questionType.getContent())) {
vo.setContent(questionType.getContent());
}
}

+ 137
- 122
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java Näytä tiedosto

@@ -33,7 +33,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.util.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
@@ -73,10 +76,10 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
//登录用户信息
String tenantId = CurrentUserUtil.getTenantId();
dto.setTenantId(tenantId);
if(StringUtils.isEmpty(dto.getTenantId())){
return JsonResult.error(WorkOrderEnum.TENANT_ID_IS_NULL.getCode(),WorkOrderEnum.TENANT_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(dto.getTenantId())) {
return JsonResult.error(WorkOrderEnum.TENANT_ID_IS_NULL.getCode(), WorkOrderEnum.TENANT_ID_IS_NULL.getMsg());
}
if(StringUtils.isEmpty(dto.getInspectionFileId())) {
if (StringUtils.isEmpty(dto.getInspectionFileId())) {
return JsonResult.error(WorkOrderEnum.INSPECTION_FILE_ID_IS_NULL.getCode(), WorkOrderEnum.INSPECTION_FILE_ID_IS_NULL.getMsg());
}
// if(StringUtils.isEmpty(dto.getUserId())){
@@ -85,18 +88,18 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
//登录用户信息
User userInfo = CurrentUserUtil.getUserInfo();
String username = userInfo.getUsername();
if(StringUtils.isEmpty(username)){
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(),WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
if (StringUtils.isEmpty(username)) {
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(), WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
}
//根据用户id查询部门id
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1).eq(User::getUsername,username));
if(ObjectUtil.isNull(user)){
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(),WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
.eq(User::getMark, 1).eq(User::getUsername, username));
if (ObjectUtil.isNull(user)) {
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(), WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
}
String deptId = user.getDeptId();
if(StringUtils.isEmpty(deptId)){
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(),WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(deptId)) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
}
WorkOrder workOrder = new WorkOrder();
workOrder.setTenantId(dto.getTenantId());
@@ -121,14 +124,14 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
workOrderFile.setInspectionFileId(dto.getInspectionFileId());
workOrderFile.setWorkOrderId(workOrder.getId());
int num = workOrderFileMapper.insert(workOrderFile);
if(num<=0){
if (num <= 0) {
return JsonResult.error();
}
//更新问题状态为工单已生成
InspectionFile inspectionFile = inspectionFileMapper.selectById(dto.getInspectionFileId());
inspectionFile.setStatus(InspectionFileStatusEnum.GENERATE_ORDER.getCode());
int count = inspectionFileMapper.updateById(inspectionFile);
if(count<=0){
if (count <= 0) {
return JsonResult.error();
}

@@ -137,63 +140,64 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO

/**
* 代办工单
*
* @param query
* @return
*/
@Override
public JsonResult getTodoList(WorkOrderQuery query) {
if(query.getLimit()==null && query.getPage()==null){
if (query.getLimit() == null && query.getPage() == null) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//登录用户信息
User userInfo1 = CurrentUserUtil.getUserInfo();
String username = userInfo1.getUsername();
if(null ==username){
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(),WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
if (null == username) {
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(), WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1)
.eq(User::getUsername, username));
if(ObjectUtil.isNull(user)){
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(),WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
if (ObjectUtil.isNull(user)) {
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(), WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
}
String tenantId = userInfo1.getTenantId();
if(null == tenantId){
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(),WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
if (null == tenantId) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
}
query.setTenantId(tenantId);
//根据登录用户判断角色 1超级管理员 2部门管理员 3普通用户
Integer type = user.getRoleId();
if(RoleEnum.SUPER_ADMIN.getCode()==type){
if (RoleEnum.SUPER_ADMIN.getCode() == type) {
return null;
}
//获取分页数据
IPage<WorkOrder> page = new Page<>(query.getPage(),query.getLimit());
IPage<WorkOrderInfoVo> pageData = new Page<>(query.getPage(),query.getLimit());
IPage<WorkOrder> page = new Page<>(query.getPage(), query.getLimit());
IPage<WorkOrderInfoVo> pageData = new Page<>(query.getPage(), query.getLimit());
//时间处理
Date startTime = null;
Date endTime = null;
if(StringUtils.isNotEmpty(query.getTime())){
startTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,query.getTime()+" 00:00:00");
endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,query.getTime()+" 23:59:59");
if (StringUtils.isNotEmpty(query.getTime())) {
startTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, query.getTime() + " 00:00:00");
endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, query.getTime() + " 23:59:59");
}
query.setOrderStartTime(startTime);
query.setOrderEndTime(endTime);
//用户角色为2部门管理员 3普通用户
if (RoleEnum.ADMIN.getCode()==type || RoleEnum.ORDINARY_USER.getCode()==type){
if (RoleEnum.ADMIN.getCode() == type || RoleEnum.ORDINARY_USER.getCode() == type) {
String deptId = user.getDeptId();
if(StringUtils.isEmpty(deptId)){
if (StringUtils.isEmpty(deptId)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//获取当前分配人对应的工单分页数据
IPage<WorkOrder> workPageData = workOrderMapper.selectPage(page, Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getAssignDeptId, deptId)
.eq(WorkOrder::getStatus,10)
.like(StringUtils.isNotEmpty(user.getId()),WorkOrder::getAssignUser,user.getId())
.eq(WorkOrder::getStatus, 10)
.like(StringUtils.isNotEmpty(user.getId()), WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getTenantId, tenantId)
.between(null !=query.getOrderStartTime() && null !=query.getOrderEndTime(),WorkOrder::getCreateTime,query.getOrderStartTime(),query.getOrderEndTime())
.between(null != query.getOrderStartTime() && null != query.getOrderEndTime(), WorkOrder::getCreateTime, query.getOrderStartTime(), query.getOrderEndTime())
.eq(WorkOrder::getMark, 1));
if(null == workPageData.getRecords()){
if (null == workPageData.getRecords()) {
return null;
}
List<WorkOrderInfoVo> WorkOrderInfoList = new ArrayList<>();
@@ -243,15 +247,15 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
long count1 = inspectionFileList.stream().filter(t -> t.getStatus() == 25).count();
vo.setPromProcessed((int) count1);

return vo;
return vo;
}).collect(Collectors.toList());
//当待处理问题总数为0时,此工单不出现在代办工单列表并且工单状态修改为15已完成
List<WorkOrderInfoVo> collect = workOrderList.stream().filter(f -> f.getPromTodo() == 0).collect(Collectors.toList());
if(null != collect){
if (null != collect) {
for (WorkOrderInfoVo workOrderInfoVo : collect) {
//每一个工单对应的状态发生改变,一个工单id对应一个工单
WorkOrder workOrder = workOrderMapper.selectById(workOrderInfoVo.getId());
if(ObjectUtil.isNotNull(workOrder)){
if (ObjectUtil.isNotNull(workOrder)) {
workOrder.setStatus(15);
workOrder.setUpdateTime(DateUtils.now());
workOrder.setUpdateUser(user.getId());
@@ -260,35 +264,36 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
}
}
//工单的待处理问题个数不为0时 重新返回
WorkOrderInfoList = workOrderList.stream().filter(h -> h.getPromTodo() != 0).collect(Collectors.toList());
WorkOrderInfoList = workOrderList.stream().filter(h -> h.getPromTodo() != 0).collect(Collectors.toList());
pageData.setRecords(WorkOrderInfoList);

return JsonResult.success(pageData);
}
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(),WorkOrderEnum.DATA_IS_NULL.getMsg());
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(), WorkOrderEnum.DATA_IS_NULL.getMsg());
}

/**
* 处理工单
*
* @param query
* @return
*/
@Override
public JsonResult handle(HandleQuery query) {
if(StringUtils.isEmpty(query.getId())){
JsonResult.error(WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getCode(),WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(query.getId())) {
JsonResult.error(WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getCode(), WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getMsg());
}
if(null == query.getPage() && null == query.getLimit()){
if (null == query.getPage() && null == query.getLimit()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//获取分页数据
IPage<InspectionFile> page = new Page<>(query.getPage(),query.getLimit());
IPage<WorkOrderHandleVo> pageData = new Page<>(query.getPage(),query.getLimit());
IPage<InspectionFile> page = new Page<>(query.getPage(), query.getLimit());
IPage<WorkOrderHandleVo> pageData = new Page<>(query.getPage(), query.getLimit());
//根据工单id获取对应的问题集合
List<WorkOrderFile> workOrderFiles = workOrderFileMapper.selectList(Wrappers.<WorkOrderFile>lambdaQuery()
.eq(WorkOrderFile::getWorkOrderId, query.getId()));
if(null == workOrderFiles){
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(),WorkOrderEnum.DATA_IS_NULL.getMsg());
if (null == workOrderFiles) {
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(), WorkOrderEnum.DATA_IS_NULL.getMsg());
}
//工单子表获取对应的问题集合id
List<String> inspectionFiledIds = workOrderFiles.stream().map(o -> o.getInspectionFileId()).collect(Collectors.toList());
@@ -301,8 +306,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
//工单id
vo.setWorkOrderId(query.getId());
//缩略图处理
if(StringUtils.isNotEmpty(t.getFileThumbnail())){
vo.setFileThumbnail(CommonConfig.imageURL+t.getFileThumbnail());
if (StringUtils.isNotEmpty(t.getFileThumbnail())) {
vo.setFileThumbnail(CommonConfig.imageURL + t.getFileThumbnail());
}
if (StringUtils.isNotEmpty(t.getFileOriginal())) {
vo.setFileOriginal(CommonConfig.imageURL + t.getFileOriginal());
}
//任务名称 任务执行时间 道路位置编号
if (StringUtils.isEmpty(t.getInspectionId())) {
@@ -340,6 +348,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO

/**
* 已完成工单
*
* @param query
* @return
*/
@@ -348,42 +357,42 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
// if(query.getOrderEndTime()==null && query.getOrderStartTime()==null){
// throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
// }
if(query.getLimit()==null && query.getPage()==null){
if (query.getLimit() == null && query.getPage() == null) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//获取登录用户信息
User userInfo1 = CurrentUserUtil.getUserInfo();
String username = userInfo1.getUsername();
if(null ==username){
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(),WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
if (null == username) {
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(), WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1)
.eq(User::getUsername, username));
if(ObjectUtil.isNull(user)){
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(),WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
if (ObjectUtil.isNull(user)) {
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(), WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
}
String tenantId = user.getTenantId();
if(null == tenantId){
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(),WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
if (null == tenantId) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
}
query.setTenantId(tenantId);
//根据登录用户判断角色 1超级管理员 2部门管理员 3普通用户
Integer type = user.getRoleId();
//获取分页数据
IPage<WorkOrder> page = new Page<>(query.getPage(),query.getLimit());
IPage<WorkOrderInfoVo> pageData = new Page<>(query.getPage(),query.getLimit());
IPage<WorkOrder> page = new Page<>(query.getPage(), query.getLimit());
IPage<WorkOrderInfoVo> pageData = new Page<>(query.getPage(), query.getLimit());
//时间处理
Date startTime = null;
Date endTime = null;
if(StringUtils.isNotEmpty(query.getTime())){
startTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,query.getTime()+" 00:00:00");
endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,query.getTime()+" 23:59:59");
if (StringUtils.isNotEmpty(query.getTime())) {
startTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, query.getTime() + " 00:00:00");
endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, query.getTime() + " 23:59:59");
}
query.setOrderStartTime(startTime);
query.setOrderEndTime(endTime);
//用户角色为2部门管理员 3普通用户
if(RoleEnum.SUPER_ADMIN.getCode()==type){
if (RoleEnum.SUPER_ADMIN.getCode() == type) {
//超级管理员可查看系统内所有已处理工单
IPage<WorkOrder> workPageData = workOrderMapper.selectPage(page, new LambdaQueryWrapper<WorkOrder>()
.eq(WorkOrder::getStatus, 15)
@@ -425,10 +434,10 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
return JsonResult.success(pageData);
}
//用户角色为2部门管理员 3普通用户
if(RoleEnum.ADMIN.getCode()== user.getRoleId() || RoleEnum.ORDINARY_USER.getCode()== user.getRoleId()){
if (RoleEnum.ADMIN.getCode() == user.getRoleId() || RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
//获取部门
String deptId = user.getDeptId();
if(StringUtils.isEmpty(deptId)){
if (StringUtils.isEmpty(deptId)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//获取当前分配人对应的工单分页数据
@@ -473,30 +482,31 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
return JsonResult.success(pageData);
}

return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(),WorkOrderEnum.DATA_IS_NULL.getMsg());
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(), WorkOrderEnum.DATA_IS_NULL.getMsg());
}

/**
* 工单详情
*
* @param query
* @return
*/
@Override
public JsonResult details(HandleQuery query) {
if(StringUtils.isEmpty(query.getId())){
JsonResult.error(WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getCode(),WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(query.getId())) {
JsonResult.error(WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getCode(), WorkOrderEnum.WORK_ORDER_ID_IS_NULL.getMsg());
}
if(null == query.getPage() && null == query.getLimit()){
if (null == query.getPage() && null == query.getLimit()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//获取分页数据
IPage<InspectionFile> page = new Page<>(query.getPage(),query.getLimit());
IPage<WorkOrderHandleVo> pageData = new Page<>(query.getPage(),query.getLimit());
IPage<InspectionFile> page = new Page<>(query.getPage(), query.getLimit());
IPage<WorkOrderHandleVo> pageData = new Page<>(query.getPage(), query.getLimit());
//根据工单id获取对应的问题集合
List<WorkOrderFile> workOrderFiles = workOrderFileMapper.selectList(Wrappers.<WorkOrderFile>lambdaQuery()
.eq(WorkOrderFile::getWorkOrderId, query.getId()));
if(null == workOrderFiles){
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(),WorkOrderEnum.DATA_IS_NULL.getMsg());
if (null == workOrderFiles) {
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(), WorkOrderEnum.DATA_IS_NULL.getMsg());
}
//工单子表获取对应的问题集合id
List<String> inspectionFiledIds = workOrderFiles.stream().map(o -> o.getInspectionFileId()).collect(Collectors.toList());
@@ -507,7 +517,10 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
WorkOrderHandleVo covert = Convert.convert(WorkOrderHandleVo.class, p);
//缩略图处理
if (StringUtils.isNotEmpty(p.getFileThumbnail())) {
covert.setFileThumbnail(p.getFileThumbnail());
covert.setFileThumbnail(CommonConfig.imageURL + p.getFileThumbnail());
}
if (StringUtils.isNotEmpty(p.getFileOriginal())) {
covert.setFileOriginal(CommonConfig.imageURL + p.getFileThumbnail());
}
//任务名称 任务执行时间 道路位置编号
if (StringUtils.isEmpty(p.getInspectionId())) {
@@ -543,6 +556,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO

/**
* 统计近七天工单数量
*
* @return
*/
@Override
@@ -550,59 +564,59 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
//获取登录用户信息
User userInfo = CurrentUserUtil.getUserInfo();
String username = userInfo.getUsername();
if(StringUtils.isEmpty(username)){
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(),WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
if (StringUtils.isEmpty(username)) {
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(), WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1)
.eq(User::getUsername, username));
if(ObjectUtil.isNull(user)){
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(),WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
if (ObjectUtil.isNull(user)) {
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(), WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
}
String tenantId = user.getTenantId();
if(StringUtils.isEmpty(tenantId)){
return JsonResult.error(WorkOrderEnum.TENANT_ID_IS_NULL.getCode(),WorkOrderEnum.TENANT_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(tenantId)) {
return JsonResult.error(WorkOrderEnum.TENANT_ID_IS_NULL.getCode(), WorkOrderEnum.TENANT_ID_IS_NULL.getMsg());
}
//用户角色
Integer type = user.getRoleId();
if(null == type){
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(),WorkOrderEnum.DATA_IS_NULL.getMsg());
if (null == type) {
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(), WorkOrderEnum.DATA_IS_NULL.getMsg());
}
WorkOrderNumVo vo = new WorkOrderNumVo();
//今日
DateTime endTime = DateUtil.endOfDay(DateUtil.date());
//一周前的时间
DateTime startTime = DateUtil.offset(DateUtil.beginOfDay(DateUtil.date()), DateField.WEEK_OF_MONTH, -1);
if(null == endTime || null == startTime){
if (null == endTime || null == startTime) {
return null;
}
//根据用户角色判断 1超级管理员 2部门管理员 3普通用户
if(RoleEnum.SUPER_ADMIN.getCode() == type){
if (RoleEnum.SUPER_ADMIN.getCode() == type) {
//获取当前登录用户(超级管理员)已完成工单列表
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, 1)
.eq(WorkOrder::getTenantId,tenantId)
.eq(WorkOrder::getStatus,15)
.between(WorkOrder::getUpdateTime,startTime,endTime));
if(StringUtils.isNotEmpty(workOrders)){
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getStatus, 15)
.between(WorkOrder::getUpdateTime, startTime, endTime));
if (StringUtils.isNotEmpty(workOrders)) {
vo.setWeekWorkOrderFinishedSum(workOrders.size());
}
}
//部门管理员 普通用户
if(RoleEnum.ADMIN.getCode() ==type || RoleEnum.ORDINARY_USER.getCode() == type){
if (RoleEnum.ADMIN.getCode() == type || RoleEnum.ORDINARY_USER.getCode() == type) {
//获取部门id
if(StringUtils.isEmpty(user.getDeptId())){
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(),WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(user.getDeptId())) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
}
//获取当前登录用户(被分配人员)的待处理工单列表
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, 1)
.like(WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getStatus,10)
.eq(WorkOrder::getTenantId,tenantId)
.eq(WorkOrder::getDeptId,user.getDeptId())
.between(WorkOrder::getAssignTime,startTime,endTime));
if(StringUtils.isNotEmpty(workOrders)){
.eq(WorkOrder::getStatus, 10)
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getDeptId, user.getDeptId())
.between(WorkOrder::getAssignTime, startTime, endTime));
if (StringUtils.isNotEmpty(workOrders)) {
vo.setWeekWorkOrderTodoSum(workOrders.size());
}
//获取当前登录用户(被分配人员)的已完成工单列表
@@ -613,7 +627,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getDeptId, user.getDeptId())
.between(WorkOrder::getUpdateTime, startTime, endTime));
if(StringUtils.isNotEmpty(result)){
if (StringUtils.isNotEmpty(result)) {
vo.setWeekWorkOrderFinishedSum(result.size());
}
}
@@ -623,6 +637,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO

/**
* 统计上个月的工单数量
*
* @return
*/
@Override
@@ -630,23 +645,23 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
//获取登录用户信息
User userInfo = CurrentUserUtil.getUserInfo();
String username = userInfo.getUsername();
if(StringUtils.isEmpty(username)){
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(),WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
if (StringUtils.isEmpty(username)) {
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(), WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1)
.eq(User::getUsername, username));
if(ObjectUtil.isNull(user)){
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(),WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
if (ObjectUtil.isNull(user)) {
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(), WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
}
String tenantId = user.getTenantId();
if(StringUtils.isEmpty(tenantId)){
return JsonResult.error(WorkOrderEnum.TENANT_ID_IS_NULL.getCode(),WorkOrderEnum.TENANT_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(tenantId)) {
return JsonResult.error(WorkOrderEnum.TENANT_ID_IS_NULL.getCode(), WorkOrderEnum.TENANT_ID_IS_NULL.getMsg());
}
//用户角色
Integer type = user.getRoleId();
if(null == type){
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(),WorkOrderEnum.DATA_IS_NULL.getMsg());
if (null == type) {
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(), WorkOrderEnum.DATA_IS_NULL.getMsg());
}
WorkOrderCountVo vo = new WorkOrderCountVo();
// 上月起始
@@ -660,36 +675,36 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
Calendar.DAY_OF_MONTH, lastMonthEndDateCal.getActualMaximum(Calendar.DAY_OF_MONTH));
DateTime beginTime = DateUtil.beginOfDay(lastMonthFirstDateCal.getTime());
DateTime endTime = DateUtil.endOfDay(lastMonthEndDateCal.getTime());
if(null == endTime || null == beginTime){
if (null == endTime || null == beginTime) {
return null;
}
//根据用户角色判断 1超级管理员 2部门管理员 3普通用户
if(RoleEnum.SUPER_ADMIN.getCode() == type){
//获取当前登录用户(超级管理员)已完成工单列表
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, 1)
.eq(WorkOrder::getTenantId,tenantId)
.eq(WorkOrder::getStatus,15)
.between(WorkOrder::getUpdateTime,beginTime,endTime));
if(StringUtils.isNotEmpty(workOrders)){
vo.setMonthWorkOrderFinishedSum(workOrders.size());
}
//根据用户角色判断 1超级管理员 2部门管理员 3普通用户
if (RoleEnum.SUPER_ADMIN.getCode() == type) {
//获取当前登录用户(超级管理员)已完成工单列表
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, 1)
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getStatus, 15)
.between(WorkOrder::getUpdateTime, beginTime, endTime));
if (StringUtils.isNotEmpty(workOrders)) {
vo.setMonthWorkOrderFinishedSum(workOrders.size());
}
}
//部门管理员 普通用户
if(RoleEnum.ADMIN.getCode() ==type || RoleEnum.ORDINARY_USER.getCode() == type){
if (RoleEnum.ADMIN.getCode() == type || RoleEnum.ORDINARY_USER.getCode() == type) {
//获取部门id
if(StringUtils.isEmpty(user.getDeptId())){
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(),WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(user.getDeptId())) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
}
//获取当前登录用户(被分配人员)的待处理工单列表
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, 1)
.like(WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getStatus,10)
.eq(WorkOrder::getTenantId,tenantId)
.eq(WorkOrder::getDeptId,user.getDeptId())
.between(WorkOrder::getAssignTime,beginTime,endTime));
if(StringUtils.isNotEmpty(workOrders)){
.eq(WorkOrder::getStatus, 10)
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getDeptId, user.getDeptId())
.between(WorkOrder::getAssignTime, beginTime, endTime));
if (StringUtils.isNotEmpty(workOrders)) {
vo.setMonthWorkOrderTodoSum(workOrders.size());
}
//获取当前登录用户(被分配人员)的已完成工单列表
@@ -700,7 +715,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getDeptId, user.getDeptId())
.between(WorkOrder::getUpdateTime, beginTime, endTime));
if(StringUtils.isNotEmpty(result)){
if (StringUtils.isNotEmpty(result)) {
vo.setMonthWorkOrderFinishedSum(result.size());
}
}

+ 11
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/WorkOrderHandleVo.java Näytä tiedosto

@@ -39,10 +39,20 @@ public class WorkOrderHandleVo {
private String content;

/**
* 问题图片 缩略图
* 文件名称
*/
private String fileName;

/**
* 缩略图
*/
private String fileThumbnail;

/**
* 原图
*/
private String fileOriginal;

/**
* 位置
*/

Loading…
Peruuta
Tallenna