Преглед изворни кода

小程序任务列表

tags/v1.0.0^2
chengwang пре 1 година
родитељ
комит
3b287b0bf1
6 измењених фајлова са 63 додато и 20 уклоњено
  1. +54
    -19
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java
  2. +1
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/InspectionInfoVo.java
  3. +2
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-dev.yml
  4. +2
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-local.yml
  5. +2
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-prod.yml
  6. +2
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-test.yml

+ 54
- 19
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java Прегледај датотеку

@@ -15,6 +15,7 @@ import com.tuoheng.common.core.utils.*;
import com.tuoheng.miniprogram.dao.*;
import com.tuoheng.miniprogram.entity.*;
import com.tuoheng.miniprogram.entity.query.InspectionQuery;
import com.tuoheng.miniprogram.enums.UserTypeEnum;
import com.tuoheng.miniprogram.service.IInspectionService;
import com.tuoheng.miniprogram.utils.ShiroUtils;
import com.tuoheng.miniprogram.vo.AirLineVO;
@@ -68,7 +69,7 @@ public class InspectionServiceImpl implements IInspectionService {
// String username = SecurityUserUtils.username();
//获取租户id
String tenantId = ShiroUtils.getTenantId();
String username = "wangwang";
String username = "admin";
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(StringUtils.isNotEmpty(username), User::getUsername, username)
.eq(User::getStatus, 1).eq(User::getMark, 1));
@@ -95,19 +96,15 @@ public class InspectionServiceImpl implements IInspectionService {
}
query.setStartTimeDate(startTime);
query.setEndTimeDate(endTime);
// 根据部门id获取此部门id和所有下级部门id封装list集合
List<String> deptLists = deptMapper.selectAllChildListById(query.getDeptId());
if (StringUtils.isEmpty(deptLists)){
Integer type = user.getType();
if(null == type){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}

List<InspectionInfoVo> inspectionInfoVoList = new ArrayList<>();

for (int i = 0; i < deptLists.size(); i++) {
String deptId = deptLists.get(i);
query.setDeptId(deptId);
IPage<InspectionInfoVo> pageData = inspectionMapper.queryPage(page,query);
pageData.getRecords().stream().forEach(x->{
//用户角色判断 1超级管理员 2部门管理员 3普通用户
if(UserTypeEnum.SUPER_ADMIN.getCode()==type){
IPage<InspectionInfoVo> IPageData = inspectionMapper.queryPage(page, query);
IPageData.getRecords().stream().forEach(x->{
int problemsFoundNum = 0;
int problemsVerifiedNum = 0;
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
@@ -119,25 +116,63 @@ public class InspectionServiceImpl implements IInspectionService {
}
problemsVerifiedNum = inspectionFileList.size();
for (InspectionFile inspectionFile : inspectionFileList) {
if (5 == inspectionFile.getStatus()) {
if (15 == inspectionFile.getStatus()) {
problemsFoundNum += 1;
}
}
//获取任务deptId1:1为部门任务 0为子部门任务
if(deptIdInt.equals(deptId)){
x.setFlag(1);
}else {
x.setFlag(0);
}
x.setFlag(1);
x.setProblemsFoundNum(problemsFoundNum);
x.setProblemsVerifiedNum(problemsVerifiedNum);
});
List<InspectionInfoVo> records = pageData.getRecords();
List<InspectionInfoVo> records = IPageData.getRecords();
for (InspectionInfoVo record : records) {
inspectionInfoVoList.add(record);
}

}
//登录用户角色为部门管理员或普通用户
if(UserTypeEnum.ADMIN.getCode()==type || UserTypeEnum.ORDINARY_USER.getCode()==type){
// 根据部门id获取此部门id和所有下级部门id封装list集合
List<String> deptLists = deptMapper.selectAllChildListById(query.getDeptId());
if (StringUtils.isEmpty(deptLists)){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
for (int i = 0; i < deptLists.size(); i++) {
String deptId = deptLists.get(i);
query.setDeptId(deptId);
IPage<InspectionInfoVo> pageData = inspectionMapper.queryPage(page,query);
pageData.getRecords().stream().forEach(x->{
int problemsFoundNum = 0;
int problemsVerifiedNum = 0;
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
.eq(StringUtils.isNotEmpty(x.getId()), InspectionFile::getInspectionId, x.getId())
.eq(InspectionFile::getTenantId, 0)
.eq(InspectionFile::getMark,1));
if(StringUtils.isEmpty(inspectionFileList)){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
problemsVerifiedNum = inspectionFileList.size();
for (InspectionFile inspectionFile : inspectionFileList) {
if (15 == inspectionFile.getStatus()) {
problemsFoundNum += 1;
}
}
//获取任务deptId1:1为部门任务 0为子部门任务
if(deptIdInt.equals(deptId)){
x.setFlag(1);
}else {
x.setFlag(0);
}
x.setProblemsFoundNum(problemsFoundNum);
x.setProblemsVerifiedNum(problemsVerifiedNum);
});
List<InspectionInfoVo> records = pageData.getRecords();
for (InspectionInfoVo record : records) {
inspectionInfoVoList.add(record);
}
}
}

pageDataVo.setRecords(inspectionInfoVoList);



+ 1
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/InspectionInfoVo.java Прегледај датотеку

@@ -71,7 +71,7 @@ public class InspectionInfoVo {
private Integer problemsFoundNum;

/**
* 已核实问题数量(status状态为10已忽略和15已确认)
* 已核实问题数量(status状态15已确认)
*/
private Integer problemsVerifiedNum;


+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-dev.yml Прегледај датотеку

@@ -77,6 +77,8 @@ tuoheng:
live-channel-domain-url: https://streaming.t-aaron.com/
# 高德Key
gaodeKey: c01a978a4a24759282f6e3a9b9a0974d
#飞手平台地址
pilot-url: http://192.168.11.11:7011/pilot/web/
# 文件配置
uploads:
#上传的服务器上的映射文件夹

+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-local.yml Прегледај датотеку

@@ -77,6 +77,8 @@ tuoheng:
live-channel-domain-url: https://streaming.t-aaron.com/
# 高德Key
gaodeKey: c01a978a4a24759282f6e3a9b9a0974d
#飞手平台地址
pilot-url: http://192.168.11.11:7011/pilot/web/
# 文件配置
uploads:
#上传的服务器上的映射文件夹

+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-prod.yml Прегледај датотеку

@@ -77,6 +77,8 @@ tuoheng:
live-channel-domain-url: https://streaming.t-aaron.com/
# 高德Key
gaodeKey: c01a978a4a24759282f6e3a9b9a0974d
#飞手平台地址
pilot-url: http://192.168.11.11:7011/pilot/web/
# 文件配置
uploads:
#上传的服务器上的映射文件夹

+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-test.yml Прегледај датотеку

@@ -77,6 +77,8 @@ tuoheng:
live-channel-domain-url: https://streaming.t-aaron.com/
# 高德Key
gaodeKey: c01a978a4a24759282f6e3a9b9a0974d
#飞手平台地址
pilot-url: http://192.168.11.11:7011/pilot/web/
# 文件配置
uploads:
#上传的服务器上的映射文件夹

Loading…
Откажи
Сачувај