提交修改
This commit is contained in:
commit
b89bd9b444
@ -65,6 +65,7 @@ public class ShiroConfig {
|
|||||||
filterMap.put("/aaa.txt", "anon");
|
filterMap.put("/aaa.txt", "anon");
|
||||||
filterMap.put("/dtlg/login", "anon");
|
filterMap.put("/dtlg/login", "anon");
|
||||||
filterMap.put("/oneCode/**", "anon");
|
filterMap.put("/oneCode/**", "anon");
|
||||||
|
filterMap.put("/modules/**", "anon");//临时添加,后期去掉
|
||||||
filterMap.put("/dtlg/luck", "anon");
|
filterMap.put("/dtlg/luck", "anon");
|
||||||
filterMap.put("/dtlg/look", "anon");
|
filterMap.put("/dtlg/look", "anon");
|
||||||
filterMap.put("/dtlg/jump", "anon");
|
filterMap.put("/dtlg/jump", "anon");
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
package com.lz.modules.app.controller;
|
package com.lz.modules.app.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.lz.common.utils.BigDecimalUtil;
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
import com.lz.modules.app.dto.*;
|
import com.lz.modules.app.dto.CharBarDto;
|
||||||
|
import com.lz.modules.app.dto.DepartmentsDto;
|
||||||
|
import com.lz.modules.app.dto.GraphicsDto;
|
||||||
|
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
|
||||||
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
||||||
import com.lz.modules.app.enums.ResultRecordTypeEnum;
|
import com.lz.modules.app.enums.ResultRecordTypeEnum;
|
||||||
import com.lz.modules.app.resp.OwnResultResp;
|
import com.lz.modules.app.resp.OwnResultResp;
|
||||||
@ -15,16 +16,20 @@ import com.lz.modules.app.service.DepartmentsService;
|
|||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.sys.controller.AbstractController;
|
import com.lz.modules.sys.controller.AbstractController;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
|
||||||
import com.lz.modules.sys.service.app.ChartService;
|
import com.lz.modules.sys.service.app.ChartService;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
|
import com.sun.org.apache.bcel.internal.generic.NEW;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.time.YearMonth;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: djc
|
* @Author: djc
|
||||||
@ -49,36 +54,30 @@ public class ReportResultController extends AbstractController{
|
|||||||
|
|
||||||
|
|
||||||
@RequestMapping("chart")
|
@RequestMapping("chart")
|
||||||
public R reportChart(String monthTime){
|
public R reportChart(String monthTime,String departmentId){
|
||||||
if(StringUtil.isBlank(monthTime)){
|
if(StringUtil.isBlank(monthTime)){
|
||||||
String time = LocalDate.now().toString();
|
monthTime = YearMonth.now().toString();
|
||||||
monthTime = time.substring(0,time.length()-3);
|
|
||||||
}
|
}
|
||||||
ReportChartResp data = new ReportChartResp();
|
ReportChartResp data = new ReportChartResp();
|
||||||
//月初目标
|
//月初目标
|
||||||
List<GraphicsStatisticalDto> start = chartService.resultProgressDistribution(ResultRecordTypeEnum.TARGET.getType(),monthTime);
|
List<GraphicsStatisticalDto> start = chartService.resultProgressDistribution(ResultRecordTypeEnum.TARGET.getType(),monthTime,departmentId);
|
||||||
//月末结果
|
//月末结果
|
||||||
List<GraphicsStatisticalDto> end = chartService.resultProgressDistribution(ResultRecordTypeEnum.RESULT.getType(),monthTime);
|
List<GraphicsStatisticalDto> end = chartService.resultProgressDistribution(ResultRecordTypeEnum.RESULT.getType(),monthTime,departmentId);
|
||||||
//人员等级分布
|
//人员等级分布
|
||||||
|
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(departmentId);
|
||||||
|
int total = staffService.countStaffByAllDeparmentIds(allDeparmentIds);
|
||||||
List<GraphicsStatisticalDto> staffLevels = resultRecordService.staffDistribution(monthTime);
|
List<GraphicsStatisticalDto> staffLevels = resultRecordService.staffDistribution(monthTime);
|
||||||
|
List<String> names = new ArrayList<>();
|
||||||
List<GraphicsStatisticalDto> sortStaffLevels = new ArrayList<>();
|
List<Double> datas = new ArrayList<>();
|
||||||
// 0人是否需要展示
|
int konwn = 0;
|
||||||
Map<String,Integer> map = Maps.newHashMap();
|
|
||||||
for (GraphicsStatisticalDto staffLevel : staffLevels) {
|
for (GraphicsStatisticalDto staffLevel : staffLevels) {
|
||||||
map.put(staffLevel.getCategory(),staffLevel.getNumber());
|
names.add(staffLevel.getCategory());
|
||||||
}
|
datas.add(BigDecimalUtil.div(Double.valueOf(staffLevel.getNumber()),Double.valueOf(total),2));
|
||||||
// 默认等级赋予默认值并排序
|
konwn = konwn + staffLevel.getNumber();
|
||||||
for (String level : levels) {
|
logger.info("等级:" + staffLevel.getCategory() + " 人数:" + staffLevel.getNumber());
|
||||||
GraphicsStatisticalDto dto = new GraphicsStatisticalDto();
|
|
||||||
dto.setCategory(level);
|
|
||||||
if(!map.containsKey(level)){
|
|
||||||
dto.setNumber(0);
|
|
||||||
}else {
|
|
||||||
dto.setNumber(map.get(level));
|
|
||||||
}
|
|
||||||
sortStaffLevels.add(dto);
|
|
||||||
}
|
}
|
||||||
|
names.add("未知");
|
||||||
|
datas.add(BigDecimalUtil.div(Double.valueOf((total - konwn)),Double.valueOf(total),2));
|
||||||
//部门等级占比
|
//部门等级占比
|
||||||
GraphicsDto dto = new GraphicsDto();
|
GraphicsDto dto = new GraphicsDto();
|
||||||
dto.setRows(start);
|
dto.setRows(start);
|
||||||
@ -86,9 +85,12 @@ public class ReportResultController extends AbstractController{
|
|||||||
dto = new GraphicsDto();
|
dto = new GraphicsDto();
|
||||||
dto.setRows(end);
|
dto.setRows(end);
|
||||||
data.setResultDistribution(dto);
|
data.setResultDistribution(dto);
|
||||||
dto = new GraphicsDto();
|
CharBarDto barDto= new CharBarDto();
|
||||||
dto.setRows(sortStaffLevels);
|
barDto.setNames(names);
|
||||||
data.setStaffDistribution(dto);
|
barDto.setDatas(datas);
|
||||||
|
barDto.setTotal(total);
|
||||||
|
data.setStaffDistribution(barDto);
|
||||||
|
data.setMonthTime(YearMonth.now().toString());
|
||||||
return R.ok().put("data",data);
|
return R.ok().put("data",data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,3 +159,25 @@ public class ReportResultController extends AbstractController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 0人是否需要展示
|
||||||
|
/* List<GraphicsStatisticalDto> sortStaffLevels = new ArrayList<>();
|
||||||
|
Map<String,Integer> map = Maps.newHashMap();
|
||||||
|
for (GraphicsStatisticalDto staffLevel : staffLevels) {
|
||||||
|
map.put(staffLevel.getCategory(),staffLevel.getNumber());
|
||||||
|
}
|
||||||
|
// 默认等级赋予默认值并排序
|
||||||
|
for (String level : levels) {
|
||||||
|
GraphicsStatisticalDto dto = new GraphicsStatisticalDto();
|
||||||
|
dto.setCategory(level);
|
||||||
|
if(!map.containsKey(level)){
|
||||||
|
dto.setNumber(0);
|
||||||
|
}else {
|
||||||
|
dto.setNumber(map.get(level));
|
||||||
|
}
|
||||||
|
sortStaffLevels.add(dto);
|
||||||
|
}*/
|
||||||
@ -399,11 +399,10 @@ public class ResultRecordController extends AbstractController {
|
|||||||
if (!StringUtil.in(resultRecord.getStatus(),6)) {
|
if (!StringUtil.in(resultRecord.getStatus(),6)) {
|
||||||
return R.error("您的提交记录中有状态不正确,请重新选择");
|
return R.error("您的提交记录中有状态不正确,请重新选择");
|
||||||
}
|
}
|
||||||
resultRecordService.reject(resultRecord);
|
|
||||||
}
|
}
|
||||||
if(batchOpt == 3 ){
|
if(batchOpt == 3 ){
|
||||||
for (ResultRecord resultRecord : resultRecords) {
|
for (ResultRecord resultRecord : resultRecords) {
|
||||||
r = resultRecordService.reject(resultRecord);
|
r = resultRecordService.reject(resultRecord,1); //更新驳回状态
|
||||||
if (!r.isSuccess()) {
|
if (!r.isSuccess()) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,8 +80,7 @@ public class StaffRoleController {
|
|||||||
List<RecordRole> roles = recordRoleService.selectAll();
|
List<RecordRole> roles = recordRoleService.selectAll();
|
||||||
return R.ok().put("lzStaffRole", lzStaffRole)
|
return R.ok().put("lzStaffRole", lzStaffRole)
|
||||||
.put("staffs", newList)
|
.put("staffs", newList)
|
||||||
.put("targetRoles", roles)
|
.put("targetRoles", roles);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
20
src/main/java/com/lz/modules/app/dto/CharBarDto.java
Normal file
20
src/main/java/com/lz/modules/app/dto/CharBarDto.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package com.lz.modules.app.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: djc
|
||||||
|
* @Desc:
|
||||||
|
* @Date: 2020/9/21 10:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CharBarDto {
|
||||||
|
|
||||||
|
private List<String> names;
|
||||||
|
|
||||||
|
private List<Double> datas;
|
||||||
|
|
||||||
|
private int total;
|
||||||
|
}
|
||||||
@ -1,16 +0,0 @@
|
|||||||
package com.lz.modules.app.dto;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: djc
|
|
||||||
* @Desc:
|
|
||||||
* @Date: 2020/9/16 16:39
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class ChartDto {
|
|
||||||
//属性名
|
|
||||||
private String name;
|
|
||||||
//属性值
|
|
||||||
private String value;
|
|
||||||
}
|
|
||||||
@ -1,12 +1,9 @@
|
|||||||
package com.lz.modules.app.resp;
|
package com.lz.modules.app.resp;
|
||||||
|
|
||||||
import com.lz.modules.app.dto.ChartDto;
|
import com.lz.modules.app.dto.CharBarDto;
|
||||||
import com.lz.modules.app.dto.GraphicsDto;
|
import com.lz.modules.app.dto.GraphicsDto;
|
||||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: djc
|
* @Author: djc
|
||||||
* @Desc:
|
* @Desc:
|
||||||
@ -19,8 +16,8 @@ public class ReportChartResp {
|
|||||||
//月末结果
|
//月末结果
|
||||||
private GraphicsDto resultDistribution;
|
private GraphicsDto resultDistribution;
|
||||||
//个人等级占比
|
//个人等级占比
|
||||||
private GraphicsDto staffDistribution;
|
private CharBarDto staffDistribution;
|
||||||
//部门等级占比
|
//当前月份
|
||||||
private GraphicsDto departmentDistribution;
|
private String monthTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,8 +78,10 @@ public interface StaffService extends IService<StaffEntity> {
|
|||||||
List<StaffEntity> selectBySearchName(IPage page, FindByNameModel nameModel);
|
List<StaffEntity> selectBySearchName(IPage page, FindByNameModel nameModel);
|
||||||
SysUserEntity getUser(String userName);
|
SysUserEntity getUser(String userName);
|
||||||
|
|
||||||
//查询部门下的所有人员 包括子部门下人员
|
//查询部门下的所有子部门
|
||||||
List<Long> selectAllStaffByDepartmentId(String departmentId);
|
List<String> selectAllDeparmentIdsByDepartmentParentId(String departmentId);
|
||||||
|
//统计部门下的人数
|
||||||
|
int countStaffByAllDeparmentIds(List<String> deparmentIds);
|
||||||
|
|
||||||
List<StaffEntity> selectAll();
|
List<StaffEntity> selectAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.lz.common.utils.DateUtils;
|
import com.lz.common.utils.*;
|
||||||
import com.lz.common.utils.PageUtils;
|
|
||||||
import com.lz.common.utils.Query;
|
|
||||||
import com.lz.common.utils.R;
|
|
||||||
import com.lz.modules.app.dao.DepartmentsDao;
|
import com.lz.modules.app.dao.DepartmentsDao;
|
||||||
import com.lz.modules.app.dto.*;
|
import com.lz.modules.app.dto.*;
|
||||||
import com.lz.modules.app.dao.StaffDao;
|
import com.lz.modules.app.dao.StaffDao;
|
||||||
@ -18,6 +15,7 @@ import com.lz.modules.app.service.*;
|
|||||||
import com.lz.modules.equipment.entity.model.FindByNameModel;
|
import com.lz.modules.equipment.entity.model.FindByNameModel;
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -27,6 +25,8 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@Service("staffService")
|
@Service("staffService")
|
||||||
@ -50,6 +50,8 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
|||||||
DepartmentsStaffRelateService departmentsStaffRelateService;
|
DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentsDao departmentsDao;
|
private DepartmentsDao departmentsDao;
|
||||||
|
@Autowired
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -383,11 +385,42 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Long> selectAllStaffByDepartmentId(String departmentId) {
|
public List<String> selectAllDeparmentIdsByDepartmentParentId(String departmentId) {
|
||||||
//154344269,154322459,154274609,154254673
|
//默认所有
|
||||||
List<String> parentsIds = Lists.newArrayList("154344269","154322459","154274609","154254673");
|
if(StringUtil.isBlank(departmentId)){
|
||||||
|
departmentId = "1";
|
||||||
|
}
|
||||||
|
List<String> parentsIds = Lists.newArrayList(departmentId);
|
||||||
List<String> departmentsList = new ArrayList<>();
|
List<String> departmentsList = new ArrayList<>();
|
||||||
return null;
|
List<String> childs = departmentsDao.selectDepartmentIdsByparentIds(parentsIds);
|
||||||
|
if(CollectionUtils.isEmpty(childs)){
|
||||||
|
departmentsList.addAll(parentsIds);
|
||||||
|
return departmentsList;
|
||||||
|
}
|
||||||
|
departmentsList.addAll(childs);
|
||||||
|
List<String> allChilds = getAllChilds(departmentsList, childs);
|
||||||
|
return allChilds;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countStaffByAllDeparmentIds(List<String> deparmentIds) {
|
||||||
|
if(CollectionUtils.isEmpty(deparmentIds)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
//获取所有子部门
|
||||||
|
List<DepartmentsStaffRelateEntity> list = departmentsStaffRelateService.list(new QueryWrapper<DepartmentsStaffRelateEntity>()
|
||||||
|
.select("staff_id")
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.in("department_id", deparmentIds));
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
//获取人员个数去重
|
||||||
|
List<String> staffs = list.stream().map(e -> e.getStaffId() + "").collect(Collectors.toList());
|
||||||
|
List<String> staffdistincts = staffs.stream().distinct().collect(Collectors.toList());
|
||||||
|
return staffdistincts.size();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -403,12 +436,11 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
|||||||
*/
|
*/
|
||||||
private List<String> getAllChilds(List<String> departmentsList,List<String> parentIds){
|
private List<String> getAllChilds(List<String> departmentsList,List<String> parentIds){
|
||||||
List<String> childs = departmentsDao.selectDepartmentIdsByparentIds(parentIds);
|
List<String> childs = departmentsDao.selectDepartmentIdsByparentIds(parentIds);
|
||||||
/* while (childs!=null){
|
if(CollectionUtils.isEmpty(childs)){
|
||||||
|
return departmentsList;
|
||||||
}*/
|
}
|
||||||
return null;
|
departmentsList.addAll(childs);
|
||||||
|
return getAllChilds(departmentsList,childs);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -139,11 +139,18 @@ public class EquipmentBrandController {
|
|||||||
EquipmentType type = map.get(brand.getTypeId());
|
EquipmentType type = map.get(brand.getTypeId());
|
||||||
if(type !=null){
|
if(type !=null){
|
||||||
resp.setTypeName(type.getType());
|
resp.setTypeName(type.getType());
|
||||||
|
}else{
|
||||||
|
resp.setTypeName("【分类被删】");
|
||||||
}
|
}
|
||||||
resps.add(resp);
|
resps.add(resp);
|
||||||
}
|
}
|
||||||
|
EquipmentType type = new EquipmentType();
|
||||||
|
type.setId(null);
|
||||||
|
type.setType("全部");
|
||||||
|
equipmentTypes.add(0, type);
|
||||||
return R.ok().put("total", page.getTotalCount())
|
return R.ok().put("total", page.getTotalCount())
|
||||||
.put("rows", resps)
|
.put("rows", resps)
|
||||||
|
.put("types", equipmentTypes)
|
||||||
;
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,7 @@ public class EquipmentInfoController {
|
|||||||
private TCountService tCountService;
|
private TCountService tCountService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加设备表页面
|
* 添加设备表页面
|
||||||
*
|
*
|
||||||
@ -104,13 +105,13 @@ public class EquipmentInfoController {
|
|||||||
public R equipmentInfoEdit(@RequestBody EquipmentInfoReq req) throws Exception {
|
public R equipmentInfoEdit(@RequestBody EquipmentInfoReq req) throws Exception {
|
||||||
EquipmentInfo equipmentInfo = equipmentInfoService.selectEquipmentInfoById(req.getId());
|
EquipmentInfo equipmentInfo = equipmentInfoService.selectEquipmentInfoById(req.getId());
|
||||||
BeanUtils.copyProperty(equipmentInfo, req, true);
|
BeanUtils.copyProperty(equipmentInfo, req, true);
|
||||||
Long typeId = NumberUtil.objToLongDefault(equipmentInfo.getType(), 0);
|
/*Long typeId = NumberUtil.objToLongDefault(equipmentInfo.getType(), 0);//20200921注释掉,后台不支持修改类型,品牌等,只能修改备注,时间,金额
|
||||||
EquipmentType type = equipmentTypeService.selectEquipmentTypeById(typeId);
|
EquipmentType type = equipmentTypeService.selectEquipmentTypeById(typeId);
|
||||||
equipmentInfo.setType(type.getType());
|
equipmentInfo.setType(type.getType());
|
||||||
|
|
||||||
Long brandId = NumberUtil.objToLongDefault(equipmentInfo.getBrandName(), 0);
|
Long brandId = NumberUtil.objToLongDefault(equipmentInfo.getBrandName(), 0);
|
||||||
EquipmentBrand equipmentBrand = equipmentBrandService.selectEquipmentBrandById(brandId);
|
EquipmentBrand equipmentBrand = equipmentBrandService.selectEquipmentBrandById(brandId);
|
||||||
equipmentInfo.setBrandName(equipmentBrand.getBrand());
|
equipmentInfo.setBrandName(equipmentBrand.getBrand());*/
|
||||||
equipmentInfoService.updateEquipmentInfoById(equipmentInfo);
|
equipmentInfoService.updateEquipmentInfoById(equipmentInfo);
|
||||||
return R.ok("编辑成功");
|
return R.ok("编辑成功");
|
||||||
}
|
}
|
||||||
@ -149,8 +150,17 @@ public class EquipmentInfoController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/modules/usereq/equipmentInfoList")
|
@RequestMapping(value = "/modules/usereq/equipmentInfoList")
|
||||||
public R equipmentInfoList(@RequestBody EquipmentInfoReq req) throws Exception {
|
public R equipmentInfoList(@RequestBody EquipmentInfoReq req) throws Exception {
|
||||||
|
List<EquipmentType> types = equipmentTypeService.selectAll();
|
||||||
|
List<TCount> tcounts = tCountService.selectListLimit(10);
|
||||||
|
EquipmentType type = new EquipmentType();
|
||||||
|
type.setId(null);
|
||||||
|
type.setType("全部");
|
||||||
|
types.add(0, type);
|
||||||
PageUtils page = equipmentInfoService.selectByCondition(req);
|
PageUtils page = equipmentInfoService.selectByCondition(req);
|
||||||
return R.ok().put("total", page.getTotalCount())
|
return R.ok().put("total", page.getTotalCount())
|
||||||
.put("rows", page.getList());
|
.put("rows", page.getList())
|
||||||
|
.put("types", types)
|
||||||
|
.put("tCounts", tcounts)
|
||||||
|
.put("curCount", req.getCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -129,6 +129,11 @@ public class EquipmentSpecsController {
|
|||||||
@RequestMapping(value = "/modules/specs/brandList")
|
@RequestMapping(value = "/modules/specs/brandList")
|
||||||
public R brandList(@RequestBody EquipmentSpecsReq req) throws Exception {
|
public R brandList(@RequestBody EquipmentSpecsReq req) throws Exception {
|
||||||
List<EquipmentBrand> brands = equipmentBrandService.selectByTypeId(req.getTypeId());
|
List<EquipmentBrand> brands = equipmentBrandService.selectByTypeId(req.getTypeId());
|
||||||
|
EquipmentBrand band = new EquipmentBrand();
|
||||||
|
band.setId(null);
|
||||||
|
band.setTypeId(null);
|
||||||
|
band.setBrand("全部");
|
||||||
|
brands.add(0, band);
|
||||||
return R.ok().put("brands",brands);
|
return R.ok().put("brands",brands);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,8 +162,22 @@ public class EquipmentSpecsController {
|
|||||||
for (EquipmentSpecs specs : specsList) {
|
for (EquipmentSpecs specs : specsList) {
|
||||||
EquipmentSpecsResp resp = new EquipmentSpecsResp();
|
EquipmentSpecsResp resp = new EquipmentSpecsResp();
|
||||||
resp.setId(specs.getId());
|
resp.setId(specs.getId());
|
||||||
resp.setType(typeMap.get(specs.getTypeId()).getType());
|
EquipmentType type = typeMap.get(specs.getTypeId());
|
||||||
resp.setBrand(brandMap.get(specs.getBrandId()).getBrand());
|
if(type == null){
|
||||||
|
resp.setType("【分类被删】");
|
||||||
|
}else{
|
||||||
|
resp.setType(type.getType());
|
||||||
|
resp.setTypeId(type.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
EquipmentBrand brand = brandMap.get(specs.getBrandId());
|
||||||
|
if(brand == null){
|
||||||
|
resp.setBrand("【品牌被删】");
|
||||||
|
}else{
|
||||||
|
resp.setBrand(brand.getBrand());
|
||||||
|
resp.setBrandId(brand.getId());
|
||||||
|
}
|
||||||
|
|
||||||
resp.setSpecs(specs.getSpecs());
|
resp.setSpecs(specs.getSpecs());
|
||||||
resp.setRank(specs.getRank());
|
resp.setRank(specs.getRank());
|
||||||
resp.setSkus(specs.getSkus());
|
resp.setSkus(specs.getSkus());
|
||||||
@ -166,7 +185,12 @@ public class EquipmentSpecsController {
|
|||||||
resp.setRemark(specs.getRemark());
|
resp.setRemark(specs.getRemark());
|
||||||
resps.add(resp);
|
resps.add(resp);
|
||||||
}
|
}
|
||||||
|
EquipmentType type = new EquipmentType();
|
||||||
|
type.setId(null);
|
||||||
|
type.setType("全部");
|
||||||
|
types.add(0, type);
|
||||||
return R.ok().put("total", page.getTotalCount())
|
return R.ok().put("total", page.getTotalCount())
|
||||||
.put("rows", resps);
|
.put("rows", resps)
|
||||||
|
.put("types", types);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package com.lz.modules.equipment.controller;
|
package com.lz.modules.equipment.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
import com.lz.modules.equipment.entity.OneCode;
|
import com.lz.modules.equipment.entity.OneCode;
|
||||||
|
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||||
import com.lz.modules.equipment.service.OneCodeService;
|
import com.lz.modules.equipment.service.OneCodeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@ -24,6 +26,17 @@ public class OneCodeController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取code编码,
|
||||||
|
* */
|
||||||
|
@RequestMapping("/get/getPrints")
|
||||||
|
public R getPrints(@RequestBody OneCodeReq req) {
|
||||||
|
|
||||||
|
PageUtils pageUtils = oneCodeService.selectByReq(req);
|
||||||
|
|
||||||
|
return R.ok().put("codes", pageUtils);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量生成指定数量编码,
|
* 批量生成指定数量编码,
|
||||||
* */
|
* */
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public interface EquipmentBrandMapper extends BaseMapper<EquipmentBrand> {
|
|||||||
|
|
||||||
EquipmentBrand selectEquipmentBrandByTypeBrand(@Param("typeId") Long typeId, @Param("brand") String brand);
|
EquipmentBrand selectEquipmentBrandByTypeBrand(@Param("typeId") Long typeId, @Param("brand") String brand);
|
||||||
|
|
||||||
List<EquipmentBrand> selectByCondition(IPage page, EquipmentBrandReq req);
|
List<EquipmentBrand> selectByCondition(@Param("page") IPage page, @Param("req") EquipmentBrandReq req);
|
||||||
List<EquipmentBrand> selectEquipmentBrandByTypeAndLikeBrand(@Param("typeId") Long typeId, @Param("brand") String brand);
|
List<EquipmentBrand> selectEquipmentBrandByTypeAndLikeBrand(@Param("typeId") Long typeId, @Param("brand") String brand);
|
||||||
|
|
||||||
List<EquipmentBrand> selectAll();
|
List<EquipmentBrand> selectAll();
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public interface EquipmentInfoMapper extends BaseMapper<EquipmentInfo> {
|
|||||||
EquipmentInfo selectEquipmentInfoByCode(@Param("code") String code);
|
EquipmentInfo selectEquipmentInfoByCode(@Param("code") String code);
|
||||||
|
|
||||||
|
|
||||||
List<EquipmentInfo> selectByCondition(IPage page, EquipmentInfoReq req);
|
List<EquipmentInfo> selectByCondition(@Param("page") IPage page, @Param("req") EquipmentInfoReq req);
|
||||||
|
|
||||||
List<EquipmentInfo> selectByStaffIdOrDepId(@Param("page") IPage page, @Param("nameModel") FindEquipmentsByNameModel nameModel);
|
List<EquipmentInfo> selectByStaffIdOrDepId(@Param("page") IPage page, @Param("nameModel") FindEquipmentsByNameModel nameModel);
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ public interface EquipmentSpecsMapper extends BaseMapper<EquipmentSpecs> {
|
|||||||
|
|
||||||
EquipmentSpecs selectEquipmentSpecsByTypeBrandSpecss(@Param("typeId") Long typeId, @Param("brandId") Long brandId, @Param("specs") String specs);
|
EquipmentSpecs selectEquipmentSpecsByTypeBrandSpecss(@Param("typeId") Long typeId, @Param("brandId") Long brandId, @Param("specs") String specs);
|
||||||
|
|
||||||
List<EquipmentSpecs> selectByCondition(IPage page, EquipmentSpecsReq req);
|
List<EquipmentSpecs> selectByCondition(@Param("page") IPage page, @Param("req") EquipmentSpecsReq req);
|
||||||
List<EquipmentSpecs> selectEquipmentSpecsByTypeBrandLikeSpecss(@Param("typeId") Long typeId, @Param("brandId") Long brandId, @Param("specs") String specs);
|
List<EquipmentSpecs> selectEquipmentSpecsByTypeBrandLikeSpecss(@Param("typeId") Long typeId, @Param("brandId") Long brandId, @Param("specs") String specs);
|
||||||
|
|
||||||
EquipmentSpecs selectSpecs(@Param("specs") String specs);
|
EquipmentSpecs selectSpecs(@Param("specs") String specs);
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public interface EquipmentTypeMapper extends BaseMapper<EquipmentType> {
|
|||||||
|
|
||||||
List<EquipmentType> selectByType(@Param("type") String type);
|
List<EquipmentType> selectByType(@Param("type") String type);
|
||||||
|
|
||||||
List<EquipmentType> selectByCondition(IPage page, EquipmentTypeReq req);
|
List<EquipmentType> selectByCondition(@Param("page") IPage page, @Param("req") EquipmentTypeReq req);
|
||||||
|
|
||||||
|
|
||||||
List<EquipmentType> selectAll();
|
List<EquipmentType> selectAll();
|
||||||
|
|||||||
@ -8,7 +8,9 @@ package com.lz.modules.equipment.dao;
|
|||||||
* @since 2020-07-29
|
* @since 2020-07-29
|
||||||
*/
|
*/
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.lz.modules.equipment.entity.OneCode;
|
import com.lz.modules.equipment.entity.OneCode;
|
||||||
|
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@ -40,4 +42,6 @@ public interface OneCodeMapper extends BaseMapper<OneCode> {
|
|||||||
OneCode selectByCode(@Param("code") String code);
|
OneCode selectByCode(@Param("code") String code);
|
||||||
|
|
||||||
Long updatePrintOneCodes(List<String> codes);
|
Long updatePrintOneCodes(List<String> codes);
|
||||||
|
|
||||||
|
List selectByCondition(@Param("page") IPage page, @Param("req") OneCodeReq req);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package com.lz.modules.equipment.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 菜单权限表
|
||||||
|
* </p>*员工表
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2020-07-30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OneCodeReq implements java.io.Serializable {
|
||||||
|
|
||||||
|
private int page = 1;
|
||||||
|
private int rows = 10;
|
||||||
|
private Long id;
|
||||||
|
//是否删除0未删除,1删除
|
||||||
|
private Integer isDelete;
|
||||||
|
//创建时间
|
||||||
|
private Date gmtCreate;
|
||||||
|
//修改时间
|
||||||
|
private Date gmtModified;
|
||||||
|
//编码
|
||||||
|
private String code;
|
||||||
|
//是否打印 0未打印 1打印
|
||||||
|
private Integer isPrint;
|
||||||
|
}
|
||||||
@ -2,7 +2,9 @@ package com.lz.modules.equipment.service;
|
|||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.modules.equipment.entity.OneCode;
|
import com.lz.modules.equipment.entity.OneCode;
|
||||||
|
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -40,4 +42,6 @@ public interface OneCodeService extends IService<OneCode> {
|
|||||||
OneCode selectByCode(String code);
|
OneCode selectByCode(String code);
|
||||||
|
|
||||||
Long updatePrintOneCodes(List<String> codes);
|
Long updatePrintOneCodes(List<String> codes);
|
||||||
|
|
||||||
|
PageUtils selectByReq(OneCodeReq req);
|
||||||
}
|
}
|
||||||
@ -16,6 +16,7 @@ import com.lz.modules.equipment.entity.model.FindByNameModel;
|
|||||||
import com.lz.modules.equipment.entity.model.FindEquipmentsByNameModel;
|
import com.lz.modules.equipment.entity.model.FindEquipmentsByNameModel;
|
||||||
import com.lz.modules.equipment.service.IEquipmentInfoService;
|
import com.lz.modules.equipment.service.IEquipmentInfoService;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -33,6 +34,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, EquipmentInfo> implements IEquipmentInfoService {
|
public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, EquipmentInfo> implements IEquipmentInfoService {
|
||||||
|
|
||||||
|
|
||||||
@ -98,6 +100,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeEquipmentInfo(EquipmentDto dto, SysUserEntity infoDto) {
|
public void changeEquipmentInfo(EquipmentDto dto, SysUserEntity infoDto) {
|
||||||
|
log.info("编辑传入内容{}", dto);
|
||||||
EquipmentType equipmentType = equipmentTypeMapper.selectEquipmentTypeById(dto.getTypeId());
|
EquipmentType equipmentType = equipmentTypeMapper.selectEquipmentTypeById(dto.getTypeId());
|
||||||
EquipmentBrand equipmentBrand = equipmentBrandMapper.selectEquipmentBrandById(dto.getBrandId());
|
EquipmentBrand equipmentBrand = equipmentBrandMapper.selectEquipmentBrandById(dto.getBrandId());
|
||||||
EquipmentSpecs equipmentSpecs = equipmentSpecsMapper.selectEquipmentSpecsById(dto.getSpecId());
|
EquipmentSpecs equipmentSpecs = equipmentSpecsMapper.selectEquipmentSpecsById(dto.getSpecId());
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
package com.lz.modules.equipment.service.impl;
|
package com.lz.modules.equipment.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.modules.equipment.dao.OneCodeMapper;
|
import com.lz.modules.equipment.dao.OneCodeMapper;
|
||||||
import com.lz.modules.equipment.entity.OneCode;
|
import com.lz.modules.equipment.entity.OneCode;
|
||||||
|
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||||
import com.lz.modules.equipment.service.OneCodeService;
|
import com.lz.modules.equipment.service.OneCodeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -80,4 +82,12 @@ public class OneCodeServiceImpl extends ServiceImpl<OneCodeMapper, OneCode> impl
|
|||||||
return oneCodeMapper.updatePrintOneCodes(codes);
|
return oneCodeMapper.updatePrintOneCodes(codes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils selectByReq(OneCodeReq req){
|
||||||
|
PageUtils pageUtils = PageUtils.startPage(req.getPage(), req.getRows()).doSelect(
|
||||||
|
page -> oneCodeMapper.selectByCondition(page, req)
|
||||||
|
);
|
||||||
|
return pageUtils;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,12 +5,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.lz.common.utils.NumberUtil;
|
import com.lz.common.utils.NumberUtil;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.StringUtil;
|
|
||||||
import com.lz.modules.app.dao.DepartmentsDao;
|
import com.lz.modules.app.dao.DepartmentsDao;
|
||||||
import com.lz.modules.app.dao.StaffDao;
|
import com.lz.modules.app.dao.StaffDao;
|
||||||
import com.lz.modules.app.dto.StaffRoleResp;
|
import com.lz.modules.app.dto.StaffRoleResp;
|
||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.flow.dao.RecordRoleMapper;
|
import com.lz.modules.flow.dao.RecordRoleMapper;
|
||||||
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
|
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
|
||||||
import com.lz.modules.flow.dao.StaffRoleMapper;
|
import com.lz.modules.flow.dao.StaffRoleMapper;
|
||||||
@ -18,13 +19,11 @@ import com.lz.modules.flow.entity.RecordRole;
|
|||||||
import com.lz.modules.flow.entity.StaffRole;
|
import com.lz.modules.flow.entity.StaffRole;
|
||||||
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
||||||
import com.lz.modules.flow.service.RecordRoleService;
|
import com.lz.modules.flow.service.RecordRoleService;
|
||||||
import com.lz.modules.flow.service.StaffRoleDepartmentService;
|
|
||||||
import com.lz.modules.flow.service.StaffRoleService;
|
import com.lz.modules.flow.service.StaffRoleService;
|
||||||
import com.lz.modules.sys.entity.SysMenuEntity;
|
import com.lz.modules.sys.entity.SysMenuEntity;
|
||||||
import com.lz.modules.sys.entity.SysRoleEntity;
|
import com.lz.modules.sys.entity.SysRoleEntity;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -70,6 +69,9 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RecordRoleService recordRoleService;
|
private RecordRoleService recordRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StaffRole selectStaffRoleById(Long id) {
|
public StaffRole selectStaffRoleById(Long id) {
|
||||||
return staffRoleMapper.selectStaffRoleById(id);
|
return staffRoleMapper.selectStaffRoleById(id);
|
||||||
@ -196,22 +198,48 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
//根据两个属性进行过滤
|
//根据两个属性进行过滤
|
||||||
.filter(s -> s.getDepartmentParentId().equals("1"))
|
.filter(s -> s.getDepartmentParentId().equals("1"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
List<DepartmentsStaffRelateEntity> departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll();
|
||||||
|
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap = new HashMap<>();
|
||||||
|
for(DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities){
|
||||||
|
if(new Integer(1).equals(d.getIsLeader())){
|
||||||
|
departmentsStaffRelateEntityMap.put(d.getDepartmentId(),d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<StaffEntity> staffEntities = staffDao.selectAll();
|
||||||
|
Map<Long ,StaffEntity> staffMap = new HashMap<>();
|
||||||
|
for(StaffEntity staffEntity : staffEntities){
|
||||||
|
staffMap.put(staffEntity.getId(),staffEntity);
|
||||||
|
}
|
||||||
List<SysMenuEntity> list = new ArrayList<>();
|
List<SysMenuEntity> list = new ArrayList<>();
|
||||||
for(DepartmentsEntity d:parentDepartments){
|
for (DepartmentsEntity d : parentDepartments) {
|
||||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(),0l),d.getDepartmentName(),0l,"");
|
String departmentName = d.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,d.getDepartmentId());
|
||||||
getMenuList(tDepartments,entity,list);
|
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(), 0l),departmentName , 0l, "");
|
||||||
|
getMenuList(tDepartments, entity, list,departmentsStaffRelateEntityMap,staffMap);
|
||||||
list.add(entity);
|
list.add(entity);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getMenuList(List<DepartmentsEntity> tDepartments,SysMenuEntity sysMenuEntity,List<SysMenuEntity> list) {
|
public String getSuffix(Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap,String departmentId){
|
||||||
|
String suffix = "";
|
||||||
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateEntityMap.get(departmentId);
|
||||||
|
if(departmentsStaffRelateEntity !=null){
|
||||||
|
StaffEntity staffEntity = staffMap.get(departmentsStaffRelateEntity.getStaffId());
|
||||||
|
if(staffEntity !=null ){
|
||||||
|
suffix = " , "+staffEntity.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getMenuList(List<DepartmentsEntity> tDepartments,SysMenuEntity sysMenuEntity,List<SysMenuEntity> list,
|
||||||
|
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap) {
|
||||||
for(DepartmentsEntity child : tDepartments) {
|
for(DepartmentsEntity child : tDepartments) {
|
||||||
if(NumberUtil.objToLongDefault(child.getDepartmentParentId(),0l).equals(sysMenuEntity.getMenuId())){
|
if(NumberUtil.objToLongDefault(child.getDepartmentParentId(),0l).equals(sysMenuEntity.getMenuId())){
|
||||||
|
String departmentName = child.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,child.getDepartmentId());
|
||||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(),0l),
|
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(),0l),
|
||||||
child.getDepartmentName(),sysMenuEntity.getMenuId(),sysMenuEntity.getName());
|
departmentName,sysMenuEntity.getMenuId(),sysMenuEntity.getName());
|
||||||
getMenuList(tDepartments,entity,list);
|
getMenuList(tDepartments,entity,list,departmentsStaffRelateEntityMap,staffMap);
|
||||||
list.add(entity);
|
list.add(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,6 @@ package com.lz.modules.sys.dao.app;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.lz.modules.app.dto.ChartDto;
|
|
||||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||||
import com.lz.modules.app.req.ResultRecordReq;
|
import com.lz.modules.app.req.ResultRecordReq;
|
||||||
import com.lz.modules.app.resp.OwnResultResp;
|
import com.lz.modules.app.resp.OwnResultResp;
|
||||||
@ -57,8 +56,5 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
|||||||
|
|
||||||
List<GraphicsStatisticalDto> staffDistribution(@Param("monthTime") String monthTime);
|
List<GraphicsStatisticalDto> staffDistribution(@Param("monthTime") String monthTime);
|
||||||
|
|
||||||
List<ChartDto> departmentDistribution(@Param("monthTime") String monthTime);
|
|
||||||
|
|
||||||
|
|
||||||
ResultRecord selectResultRecordByStaffIdStatus(@Param("staffId") Long staffId, @Param("status") int status);
|
ResultRecord selectResultRecordByStaffIdStatus(@Param("staffId") Long staffId, @Param("status") int status);
|
||||||
}
|
}
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.lz.modules.sys.service.app;
|
package com.lz.modules.sys.service.app;
|
||||||
|
|
||||||
import com.lz.modules.app.dto.ChartDto;
|
|
||||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -18,7 +17,7 @@ public interface ChartService {
|
|||||||
* @param monthTime
|
* @param monthTime
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<GraphicsStatisticalDto> resultProgressDistribution(int type, String monthTime);
|
List<GraphicsStatisticalDto> resultProgressDistribution(int type, String monthTime,String departmentId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
import com.lz.common.emun.WorkMsgTypeEnum;
|
import com.lz.common.emun.WorkMsgTypeEnum;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.modules.app.dto.ChartDto;
|
|
||||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
@ -12,6 +11,7 @@ import com.lz.modules.app.req.ResultRecordReq;
|
|||||||
import com.lz.modules.app.resp.OwnResultResp;
|
import com.lz.modules.app.resp.OwnResultResp;
|
||||||
import com.lz.modules.app.utils.t.TwoTuple;
|
import com.lz.modules.app.utils.t.TwoTuple;
|
||||||
import com.lz.modules.flow.entity.Flow;
|
import com.lz.modules.flow.entity.Flow;
|
||||||
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
|
|
||||||
@ -81,16 +81,11 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
|||||||
*/
|
*/
|
||||||
List<GraphicsStatisticalDto> staffDistribution(String monthTime);
|
List<GraphicsStatisticalDto> staffDistribution(String monthTime);
|
||||||
|
|
||||||
/**
|
|
||||||
* 部门等级占比
|
|
||||||
* @param monthTime
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<ChartDto> departmentDistribution(String monthTime);
|
|
||||||
|
|
||||||
Map<String, List<DepartmentsEntity>> getStringListMap(List<DepartmentsEntity> tDepartments);
|
Map<String, List<DepartmentsEntity>> getStringListMap(List<DepartmentsEntity> tDepartments);
|
||||||
|
|
||||||
ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status);
|
ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status);
|
||||||
|
|
||||||
R reject( ResultRecord resultRecord);
|
R reject( ResultRecord resultRecord,Integer status);
|
||||||
|
StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, List<StaffRoleDto> staffRoleDtos, Long roleId);
|
||||||
}
|
}
|
||||||
@ -1,8 +1,6 @@
|
|||||||
package com.lz.modules.sys.service.app.impl;
|
package com.lz.modules.sys.service.app.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.lz.common.utils.StringUtil;
|
|
||||||
import com.lz.modules.app.dto.ChartDto;
|
|
||||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
||||||
@ -10,7 +8,6 @@ import com.lz.modules.app.service.StaffService;
|
|||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ChartService;
|
import com.lz.modules.sys.service.app.ChartService;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -29,15 +26,18 @@ public class ChartServiceImpl implements ChartService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StaffService staffService;
|
private StaffService staffService;
|
||||||
@Override
|
@Override
|
||||||
public List<GraphicsStatisticalDto> resultProgressDistribution(int type, String monthTime) {
|
public List<GraphicsStatisticalDto> resultProgressDistribution(int type, String monthTime,String departmentId) {
|
||||||
List<GraphicsStatisticalDto> dtos = new ArrayList<>();
|
List<GraphicsStatisticalDto> dtos = new ArrayList<>();
|
||||||
int total = staffService.count(new QueryWrapper<StaffEntity>().eq("is_delete", 0));
|
//获取所有人员总数
|
||||||
|
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(departmentId);
|
||||||
|
int total = staffService.countStaffByAllDeparmentIds(allDeparmentIds);
|
||||||
|
//已提交
|
||||||
int commit = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
int commit = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
||||||
.eq("is_delete", 0)
|
.eq("is_delete", 0)
|
||||||
.eq("type", type)
|
.eq("type", type)
|
||||||
.like("month_time",monthTime)
|
.like("month_time",monthTime)
|
||||||
.ne("status", ResultRecordStatusEnum.CREATE.getStatus()));
|
.ne("status", ResultRecordStatusEnum.CREATE.getStatus()));
|
||||||
|
//已完成
|
||||||
int finished = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
int finished = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
||||||
.eq("is_delete", 0)
|
.eq("is_delete", 0)
|
||||||
.eq("type", type)
|
.eq("type", type)
|
||||||
@ -45,17 +45,23 @@ public class ChartServiceImpl implements ChartService {
|
|||||||
.in("status", ResultRecordStatusEnum.REFUSE.getStatus(),ResultRecordStatusEnum.AGREE.getStatus()));
|
.in("status", ResultRecordStatusEnum.REFUSE.getStatus(),ResultRecordStatusEnum.AGREE.getStatus()));
|
||||||
|
|
||||||
GraphicsStatisticalDto dto = new GraphicsStatisticalDto();
|
GraphicsStatisticalDto dto = new GraphicsStatisticalDto();
|
||||||
dto.setCategory("未提交");
|
if(total-commit>0){
|
||||||
dto.setNumber(total-commit);
|
dto.setCategory("未提交");
|
||||||
dtos.add(dto);
|
dto.setNumber(total-commit);
|
||||||
dto = new GraphicsStatisticalDto();
|
dtos.add(dto);
|
||||||
dto.setCategory("已完成");
|
}
|
||||||
dto.setNumber(finished);
|
if(finished>0){
|
||||||
dtos.add(dto);
|
dto = new GraphicsStatisticalDto();
|
||||||
dto = new GraphicsStatisticalDto();
|
dto.setCategory("已完成");
|
||||||
dto.setCategory("审核中");
|
dto.setNumber(finished);
|
||||||
dto.setNumber(commit-finished);
|
dtos.add(dto);
|
||||||
dtos.add(dto);
|
}
|
||||||
|
if(commit-finished>0){
|
||||||
|
dto = new GraphicsStatisticalDto();
|
||||||
|
dto.setCategory("审核中");
|
||||||
|
dto.setNumber(commit-finished);
|
||||||
|
dtos.add(dto);
|
||||||
|
}
|
||||||
return dtos;
|
return dtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -214,49 +214,10 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
public List<Step> getStepList(ResultRecord resultRecord) {
|
public List<Step> getStepList(ResultRecord resultRecord) {
|
||||||
Long staffId = resultRecord.getStaffId();
|
Long staffId = resultRecord.getStaffId();
|
||||||
int type = resultRecord.getType();
|
int type = resultRecord.getType();
|
||||||
String departmentId = resultRecord.getDepartmentId();
|
|
||||||
List<Step> stepList = new ArrayList<>();
|
List<Step> stepList = new ArrayList<>();
|
||||||
|
|
||||||
StaffEntity mySelf = staffService.selectStaffById(staffId);
|
StaffEntity mySelf = staffService.selectStaffById(staffId);
|
||||||
TwoTuple<Long, List<FlowDepartment>> flowInfo = resultRecordService.getFlowInfo(staffId, type);
|
|
||||||
Long flowId = flowInfo.getFirst();
|
|
||||||
List<FlowDepartment> list = flowInfo.getSecond();
|
|
||||||
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
|
|
||||||
Map<String, FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
|
|
||||||
//approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
|
|
||||||
List<String> approvalList = new ArrayList<>();
|
|
||||||
Map<String,String> roleNameMap = new HashMap<>();
|
|
||||||
approvalList.add("ME");
|
|
||||||
roleNameMap.put("ME",mySelf.getName());
|
|
||||||
for (FlowRelation flowRelation : flowRelations) {
|
|
||||||
FlowDepartment flowDepartment = staffEntityMap.get(flowRelation.getChild());
|
|
||||||
if (flowDepartment != null || flowRelation.getCanReplace() == 0) {
|
|
||||||
approvalList.add(flowRelation.getChild());
|
|
||||||
String departmentLevel = flowRelation.getChild();
|
|
||||||
if(flowDepartment != null ){
|
|
||||||
StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId());
|
|
||||||
roleNameMap.put(departmentLevel,flowStaff.getName());
|
|
||||||
}else{
|
|
||||||
List<StaffRole> staffRoles = staffRoleService.selectByRole(departmentLevel);
|
|
||||||
Long approvalStaffId = 0l;
|
|
||||||
for (StaffRole staffRole : staffRoles) {
|
|
||||||
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
|
||||||
Map<String, String> departmentIdMap = departmentsService.selectUserAllDepartmentIds(departmentId);
|
|
||||||
for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) {
|
|
||||||
String value = departmentIdMap.get(staffRoleDepartment.getDepartmentId());
|
|
||||||
if (StringUtil.isNotBlank(value)) {
|
|
||||||
approvalStaffId =staffRole.getStaffId();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StaffEntity flowStaff = staffService.selectStaffById(approvalStaffId);
|
|
||||||
roleNameMap.put(departmentLevel,flowStaff.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap));
|
|
||||||
List<Flow> flows = flowService.selectByFlowId(flowId);
|
|
||||||
List<FlowRecord> flowRecordList = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
|
List<FlowRecord> flowRecordList = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
|
||||||
SimpleDateFormat myFmt2 = new SimpleDateFormat("MM-dd HH:mm");
|
SimpleDateFormat myFmt2 = new SimpleDateFormat("MM-dd HH:mm");
|
||||||
FlowRecord lastFlowRecord = null;
|
FlowRecord lastFlowRecord = null;
|
||||||
@ -270,8 +231,43 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
stepList.add(new Step(name, time, 1, ""));
|
stepList.add(new Step(name, time, 1, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
|
||||||
|
List<String> approvalList = new ArrayList<>();
|
||||||
|
Map<String,String> roleNameMap = new HashMap<>();
|
||||||
|
approvalList.add("ME");
|
||||||
|
roleNameMap.put("ME",mySelf.getName());
|
||||||
|
|
||||||
|
TwoTuple<Long, List<FlowDepartment>> flowInfo = resultRecordService.getFlowInfo(staffId, type);
|
||||||
|
List<FlowDepartment> list = flowInfo.getSecond();
|
||||||
|
|
||||||
|
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
|
||||||
|
Map<String, FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
|
||||||
|
|
||||||
|
|
||||||
|
Long flowId = flowInfo.getFirst();
|
||||||
|
List<Flow> flows = flowService.selectByFlowId(flowId);
|
||||||
|
|
||||||
int flowIndex = lastFlowRecord != null ? lastFlowRecord.getFlowIndex() + 1 : 1;
|
int flowIndex = lastFlowRecord != null ? lastFlowRecord.getFlowIndex() + 1 : 1;
|
||||||
log.info("flowIndex = " + flowIndex);
|
log.info("flowIndex = " + flowIndex);
|
||||||
|
for (FlowRelation flowRelation : flowRelations) {
|
||||||
|
FlowDepartment flowDepartment = staffEntityMap.get(flowRelation.getChild());
|
||||||
|
if (flowDepartment != null || flowRelation.getCanReplace() == 0) {
|
||||||
|
approvalList.add(flowRelation.getChild());
|
||||||
|
String departmentLevel = flowRelation.getChild();
|
||||||
|
if(flowDepartment != null ){
|
||||||
|
StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId());
|
||||||
|
roleNameMap.put(departmentLevel,flowStaff.getName());
|
||||||
|
}else{
|
||||||
|
Long roleId = flows.get(flowIndex - 1).getRoleId();
|
||||||
|
List<StaffRoleDto> staffRoleDtos = new ArrayList<>();
|
||||||
|
StaffEntity approvalStaff = resultRecordService.getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId);
|
||||||
|
roleNameMap.put(departmentLevel,approvalStaff.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap));
|
||||||
for (int i = flowIndex; i < flowIndex + 10; i++) {
|
for (int i = flowIndex; i < flowIndex + 10; i++) {
|
||||||
int index = resultRecordService.getDepartmentLevelIndex(flows, i);
|
int index = resultRecordService.getDepartmentLevelIndex(flows, i);
|
||||||
if (index < 0 || index >= approvalList.size()) {
|
if (index < 0 || index >= approvalList.size()) {
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import com.lz.common.emun.WorkMsgTypeEnum;
|
|||||||
import com.lz.common.utils.*;
|
import com.lz.common.utils.*;
|
||||||
import com.lz.modules.app.dao.DepartmentsDao;
|
import com.lz.modules.app.dao.DepartmentsDao;
|
||||||
import com.lz.modules.app.dao.DepartmentsStaffRelateDao;
|
import com.lz.modules.app.dao.DepartmentsStaffRelateDao;
|
||||||
import com.lz.modules.app.dto.ChartDto;
|
|
||||||
import com.lz.modules.app.dto.EmployeesDto;
|
import com.lz.modules.app.dto.EmployeesDto;
|
||||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
@ -466,7 +465,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
} else {
|
} else {
|
||||||
FlowDepartment flowD = staffEntityMap.get(departmentLevel);
|
FlowDepartment flowD = staffEntityMap.get(departmentLevel);
|
||||||
if (flowD == null) {
|
if (flowD == null) {
|
||||||
approvalStaff = getApprovalStaff(resultRecord, departmentLevel, approvalStaff, staffRoleDtos, roleId);
|
approvalStaff = getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId);
|
||||||
} else {
|
} else {
|
||||||
approvalStaff = staffService.selectStaffById(flowD.getStaffId());
|
approvalStaff = staffService.selectStaffById(flowD.getStaffId());
|
||||||
StaffRoleDto staffRoleDto = new StaffRoleDto(approvalStaff.getId(), roleId);
|
StaffRoleDto staffRoleDto = new StaffRoleDto(approvalStaff.getId(), roleId);
|
||||||
@ -516,7 +515,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, StaffEntity approvalStaff, List<StaffRoleDto> staffRoleDtos, Long roleId) {
|
@Override
|
||||||
|
public StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel,List<StaffRoleDto> staffRoleDtos, Long roleId) {
|
||||||
|
StaffEntity approvalStaff = null;
|
||||||
List<StaffRole> staffRoles = staffRoleService.selectByRole(departmentLevel);
|
List<StaffRole> staffRoles = staffRoleService.selectByRole(departmentLevel);
|
||||||
for (StaffRole staffRole : staffRoles) {
|
for (StaffRole staffRole : staffRoles) {
|
||||||
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||||
@ -585,11 +586,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
resultRecordService.updateResultRecordById(resultRecord);
|
resultRecordService.updateResultRecordById(resultRecord);
|
||||||
} else if (req.getStatus() == 5) { // 驳回
|
} else if (req.getStatus() == 5) { // 驳回
|
||||||
status = 5;
|
status = 5;
|
||||||
r = reject(resultRecord);
|
r = reject(resultRecord,status);
|
||||||
} else if (req.getStatus() == 7) {
|
} else if (req.getStatus() == 7) {
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(), resultRecord.getType());
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(), resultRecord.getType());
|
||||||
if (flowRecords != null && flowRecords.size() == 2) { // 表示可以撤回
|
if (flowRecords != null && flowRecords.size() == 2) { // 表示可以撤回
|
||||||
r = reject(resultRecord);
|
r = reject(resultRecord,5);
|
||||||
} else if (flowRecords != null && flowRecords.size() > 2) {
|
} else if (flowRecords != null && flowRecords.size() > 2) {
|
||||||
return R.error("你的领导己经审批,不能撤回了");
|
return R.error("你的领导己经审批,不能撤回了");
|
||||||
}
|
}
|
||||||
@ -621,14 +622,14 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R reject( ResultRecord resultRecord){
|
public R reject( ResultRecord resultRecord,Integer status){
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
|
||||||
StaffEntity mySelf = staffService.selectStaffById(resultRecord.getStaffId());
|
StaffEntity mySelf = staffService.selectStaffById(resultRecord.getStaffId());
|
||||||
StaffEntity approvalStaff = mySelf;
|
StaffEntity approvalStaff = mySelf;
|
||||||
if (flowRecords.size() >= 2) {
|
if (flowRecords.size() >= 2) {
|
||||||
FlowRecord secondFlowRecord = flowRecords.get(flowRecords.size() - 2);
|
FlowRecord secondFlowRecord = flowRecords.get(flowRecords.size() - 2);
|
||||||
resultRecord.setFlowStaffIdRole(secondFlowRecord.getFlowStaffIdRole());
|
resultRecord.setFlowStaffIdRole(secondFlowRecord.getFlowStaffIdRole());
|
||||||
resultRecord.setStatus(5); //更新驳回状态为5
|
resultRecord.setStatus(status); //更新驳回状态为5
|
||||||
List<StaffRoleDto> list = JSONObject.parseArray(resultRecord.getFlowStaffIdRole(), StaffRoleDto.class);
|
List<StaffRoleDto> list = JSONObject.parseArray(resultRecord.getFlowStaffIdRole(), StaffRoleDto.class);
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
StaffRoleDto staffRoleDto = list.get(0);
|
StaffRoleDto staffRoleDto = list.get(0);
|
||||||
@ -693,9 +694,4 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
public List<GraphicsStatisticalDto> staffDistribution(String monthTime) {
|
public List<GraphicsStatisticalDto> staffDistribution(String monthTime) {
|
||||||
return resultRecordMapper.staffDistribution(monthTime);
|
return resultRecordMapper.staffDistribution(monthTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ChartDto> departmentDistribution(String monthTime) {
|
|
||||||
return resultRecordMapper.departmentDistribution(monthTime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -265,12 +265,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="staffDistribution" resultType="com.lz.modules.app.dto.GraphicsStatisticalDto">
|
<select id="staffDistribution" resultType="com.lz.modules.app.dto.GraphicsStatisticalDto">
|
||||||
SELECT count(score_level) number ,CASE score_level when 0 THEN '未知' ELSE score_level END category from lz_result_record where is_delete = 0 and status =4 and type =2 and DATE_FORMAT(month_time,'%Y-%m') = #{monthTime} GROUP BY score_level
|
SELECT count(score_level) number ,score_level category from lz_result_record where is_delete = 0 and status =4 and type =2 and score_level !=0 and DATE_FORMAT(month_time,'%Y-%m') = #{monthTime} GROUP BY score_level
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="departmentDistribution" resultType="com.lz.modules.app.dto.ChartDto">
|
|
||||||
SELECT count(score_level) value,score_level name from lz_result_record where is_delete = 0 and status =4 and type =2 and DATE_FORMAT(month_time,'%Y-%m') = #{monthTime} GROUP BY score_level
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -89,9 +89,9 @@
|
|||||||
|
|
||||||
<select id="selectByCondition" resultType="com.lz.modules.equipment.entity.EquipmentBrand">
|
<select id="selectByCondition" resultType="com.lz.modules.equipment.entity.EquipmentBrand">
|
||||||
select * from equipment_brand where is_delete = 0
|
select * from equipment_brand where is_delete = 0
|
||||||
<if test="typeId != null">and type_id = #{typeId}</if>
|
<if test="req.typeId != null">and type_id = #{req.typeId}</if>
|
||||||
<if test="brand != null and brand != '' ">
|
<if test="req.brand != null and req.brand != '' ">
|
||||||
AND brand LIKE CONCAT('%',#{brand},'%')
|
AND brand LIKE CONCAT('%',#{req.brand},'%')
|
||||||
</if>
|
</if>
|
||||||
order by rank desc , id desc
|
order by rank desc , id desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -171,60 +171,60 @@
|
|||||||
|
|
||||||
<select id="selectByCondition" resultType="com.lz.modules.equipment.entity.EquipmentInfo">
|
<select id="selectByCondition" resultType="com.lz.modules.equipment.entity.EquipmentInfo">
|
||||||
select * from equipment_info where is_delete = 0
|
select * from equipment_info where is_delete = 0
|
||||||
<if test="type != null">and type = #{type}</if>
|
<if test="req.type != null">and type = #{req.type}</if>
|
||||||
<if test="brandName != null">and brand_name = #{brandName}</if>
|
<if test="req.brandName != null">and brand_name = #{req.brandName}</if>
|
||||||
<if test="specType != null and specType != '' ">
|
<if test="req.specType != null and req.specType != '' ">
|
||||||
AND spec_type LIKE CONCAT('%',#{specType},'%')
|
AND spec_type LIKE CONCAT('%',#{req.specType},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="equipmentState != null">and equipment_state = #{equipmentState}</if>
|
<if test="req.equipmentState != null">and equipment_state = #{req.equipmentState}</if>
|
||||||
<if test="user != null and user != '' ">
|
<if test="req.user != null and req.user != '' ">
|
||||||
AND user LIKE CONCAT('%',#{user},'%')
|
AND user LIKE CONCAT('%',#{req.user},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="owner != null and owner != '' ">
|
<if test="req.owner != null and req.owner != '' ">
|
||||||
AND owner LIKE CONCAT('%',#{owner},'%')
|
AND owner LIKE CONCAT('%',#{req.owner},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="gmtInStartTime != null and gmtInStartTime != '' ">
|
<if test="req.gmtInStartTime != null and req.gmtInStartTime != '' ">
|
||||||
AND DATE_FORMAT(gmt_inbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{gmtInStartTime}, '%Y-%m-%d %H:%i:%S')
|
AND DATE_FORMAT(gmt_inbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{req.gmtInStartTime}, '%Y-%m-%d %H:%i:%S')
|
||||||
</if>
|
</if>
|
||||||
<if test="gmtInEndTime != null and gmtInEndTime != '' ">
|
<if test="req.gmtInEndTime != null and req.gmtInEndTime != '' ">
|
||||||
AND DATE_FORMAT(gmt_inbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ <= ]]> DATE_FORMAT(#{gmtInEndTime}, '%Y-%m-%d %H:%i:%S')
|
AND DATE_FORMAT(gmt_inbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ <= ]]> DATE_FORMAT(#{req.gmtInEndTime}, '%Y-%m-%d %H:%i:%S')
|
||||||
</if>
|
</if>
|
||||||
<if test="gmtOutStartTime != null and gmtOutStartTime != '' ">
|
<if test="req.gmtOutStartTime != null and req.gmtOutStartTime != '' ">
|
||||||
AND DATE_FORMAT(gmt_outbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{gmtOutStartTime}, '%Y-%m-%d %H:%i:%S')
|
AND DATE_FORMAT(gmt_outbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{req.gmtOutStartTime}, '%Y-%m-%d %H:%i:%S')
|
||||||
</if>
|
</if>
|
||||||
<if test="gmtOutEndTime != null and gmtOutEndTime != '' ">
|
<if test="req.gmtOutEndTime != null and req.gmtOutEndTime != '' ">
|
||||||
AND DATE_FORMAT(gmt_outbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ <= ]]> DATE_FORMAT(#{gmtOutEndTime}, '%Y-%m-%d %H:%i:%S')
|
AND DATE_FORMAT(gmt_outbound, '%Y-%m-%d %H:%i:%S') <![CDATA[ <= ]]> DATE_FORMAT(#{req.gmtOutEndTime}, '%Y-%m-%d %H:%i:%S')
|
||||||
</if>
|
</if>
|
||||||
<if test="mark != null and mark != '' ">
|
<if test="req.mark != null and req.mark != '' ">
|
||||||
AND mark LIKE CONCAT('%',#{mark},'%')
|
AND mark LIKE CONCAT('%',#{req.mark},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="originalCode != null and originalCode != '' ">
|
<if test="req.originalCode != null and req.originalCode != '' ">
|
||||||
AND original_code LIKE CONCAT('%',#{originalCode},'%')
|
AND original_code LIKE CONCAT('%',#{req.originalCode},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="code != null and code != '' ">
|
<if test="req.code != null and req.code != '' ">
|
||||||
AND code LIKE CONCAT('%',#{code},'%')
|
AND code LIKE CONCAT('%',#{req.code},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="qr != null and qr != '' ">
|
<if test="req.qr != null and req.qr != '' ">
|
||||||
AND qr LIKE CONCAT('%',#{qr},'%')
|
AND qr LIKE CONCAT('%',#{req.qr},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<choose>
|
<choose>
|
||||||
<when test="other != null and other == 2">
|
<when test="req.other != null and req.other == 2">
|
||||||
AND count = #{count}-1
|
AND count = #{req.count}-1
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
AND count = #{count}
|
AND count = #{req.count}
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
<if test="other != null and other != '' ">
|
<if test="req.other != null and req.other != '' ">
|
||||||
<if test="other==1">
|
<if test="req.other==1">
|
||||||
AND mark !='' and mark is not null
|
AND mark !='' and mark is not null
|
||||||
</if>
|
</if>
|
||||||
<if test="other==2">
|
<if test="req.other==2">
|
||||||
and code not in (select code from equipment_info where is_delete = 0 AND count = #{count})
|
and code not in (select code from equipment_info where is_delete = 0 AND count = #{req.count})
|
||||||
</if>
|
</if>
|
||||||
<if test="other==3">
|
<if test="req.other==3">
|
||||||
and equipment_state = 2
|
and equipment_state = 2
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|||||||
@ -103,12 +103,12 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectByCondition" resultType="com.lz.modules.equipment.entity.EquipmentSpecs">
|
<select id="selectByCondition" resultType="EquipmentSpecs">
|
||||||
select * from equipment_specs where is_delete = 0
|
select * from equipment_specs where is_delete = 0
|
||||||
<if test="typeId != null">and type_id = #{typeId}</if>
|
<if test="req.typeId != null">and type_id = #{req.typeId}</if>
|
||||||
<if test="brandId != null">and brand_id = #{brandId}</if>
|
<if test="req.brandId != null">and brand_id = #{req.brandId}</if>
|
||||||
<if test="specs != null and specs != '' ">
|
<if test="req.specs != null and req.specs != '' ">
|
||||||
AND specs LIKE CONCAT('%',#{specs},'%')
|
AND specs LIKE CONCAT('%',#{req.specs},'%')
|
||||||
</if>
|
</if>
|
||||||
order by rank desc, id desc
|
order by rank desc, id desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -95,8 +95,8 @@
|
|||||||
|
|
||||||
<select id="selectByCondition" resultType="EquipmentType">
|
<select id="selectByCondition" resultType="EquipmentType">
|
||||||
select * from equipment_type where is_delete = 0
|
select * from equipment_type where is_delete = 0
|
||||||
<if test="type != null and type != '' ">
|
<if test="req.type != null and req.type != '' ">
|
||||||
AND type LIKE CONCAT('%',#{type},'%')
|
AND type LIKE CONCAT('%',#{req.type},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
order by rank desc , id desc
|
order by rank desc , id desc
|
||||||
|
|||||||
@ -114,5 +114,12 @@
|
|||||||
</foreach>)
|
</foreach>)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectByCondition" resultType="OneCode" >
|
||||||
|
select * from one_code where is_delete = 0
|
||||||
|
<if test="req.isPrint != null">and isPrint = #{req.isPrint}</if>
|
||||||
|
<if test="req.code != null and req.code != ''">and code like CONCAT('%', #{req.code}, '%') </if>
|
||||||
|
order by id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<update id="deleteTCountById" parameterType="java.lang.Long">
|
<update id="deleteTCountById" parameterType="java.lang.Long">
|
||||||
update equipment_t_count set is_delete = 1 where id=#{id} limit 1
|
update equipment_t_count set is_delete = 1 where id=#{id} limit 1
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectMaxCount" resultType="com.lz.modules.equipment.entity.TCount">
|
<select id="selectMaxCount" resultType="com.lz.modules.equipment.entity.TCount">
|
||||||
|
|||||||
@ -58,7 +58,7 @@
|
|||||||
group by staff_id
|
group by staff_id
|
||||||
</select>
|
</select>
|
||||||
<select id="selectAll" resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
|
<select id="selectAll" resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
|
||||||
select * from lz_departments_staff_relate
|
select * from lz_departments_staff_relate where is_delete = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectLastDepartmentByStaffId"
|
<select id="selectLastDepartmentByStaffId"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user