提交修改
This commit is contained in:
parent
a43e44fed7
commit
0f43b2697e
@ -35,11 +35,13 @@ import org.apache.commons.collections.CollectionUtils;
|
|||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
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.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -486,7 +488,6 @@ public class ResultRecordController extends AbstractController {
|
|||||||
BigDecimal checkWeight = NumberUtil.objToBigDecimalDefault(resultDetail.getCheckWeight(), BigDecimal.ZERO);
|
BigDecimal checkWeight = NumberUtil.objToBigDecimalDefault(resultDetail.getCheckWeight(), BigDecimal.ZERO);
|
||||||
BigDecimal acquireScore = NumberUtil.objToBigDecimalDefault(resultDetail.getAcquireScore(), BigDecimal.ZERO);
|
BigDecimal acquireScore = NumberUtil.objToBigDecimalDefault(resultDetail.getAcquireScore(), BigDecimal.ZERO);
|
||||||
sum = sum.add(checkWeight.multiply(acquireScore));
|
sum = sum.add(checkWeight.multiply(acquireScore));
|
||||||
|
|
||||||
}
|
}
|
||||||
sum = BigDecimalUtil.setScale(sum, 3);
|
sum = BigDecimalUtil.setScale(sum, 3);
|
||||||
String scoreLevel = resultDetailService.getScoreLevel(sum.doubleValue());
|
String scoreLevel = resultDetailService.getScoreLevel(sum.doubleValue());
|
||||||
@ -497,7 +498,6 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
return R.ok("保存成功").put("recordId", resultRecord.getId());
|
return R.ok("保存成功").put("recordId", resultRecord.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -124,7 +124,7 @@ public class StaffRoleController {
|
|||||||
List<Long> menuIdList = req.getMenuIdList();
|
List<Long> menuIdList = req.getMenuIdList();
|
||||||
for(Long menuId : menuIdList) {
|
for(Long menuId : menuIdList) {
|
||||||
if (menuId <= 0) {
|
if (menuId <= 0) {
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
StaffRoleDepartment staffRoleDepartment = staffRoleDepartmentService.selectStaffRoleDepartmentByDepartmentIdRoleIds(menuId, ids);
|
StaffRoleDepartment staffRoleDepartment = staffRoleDepartmentService.selectStaffRoleDepartmentByDepartmentIdRoleIds(menuId, ids);
|
||||||
if (staffRoleDepartment != null) {
|
if (staffRoleDepartment != null) {
|
||||||
@ -152,8 +152,7 @@ public class StaffRoleController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.getId() == null || req.getId() <= 0) {
|
||||||
if (req.getId() == null) {
|
|
||||||
staffRoleService.insertStaffRole(staffRole);
|
staffRoleService.insertStaffRole(staffRole);
|
||||||
} else {
|
} else {
|
||||||
staffRoleService.updateStaffRoleById(staffRole);
|
staffRoleService.updateStaffRoleById(staffRole);
|
||||||
@ -164,11 +163,10 @@ public class StaffRoleController {
|
|||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/delete")
|
@RequestMapping("/delete/{id}")
|
||||||
@RequiresPermissions("user:lzstaffrole:delete")
|
@RequiresPermissions("user:lzstaffrole:delete")
|
||||||
public R delete(@RequestBody Long[] ids) {
|
public R delete(@PathVariable("id") String id) {
|
||||||
staffRoleService.deleteBatchIds(Arrays.asList(ids));
|
staffRoleService.deleteBatchIds(Arrays.asList(NumberUtil.objToLongDefault(id,0l)));
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,4 +26,5 @@ public class Auth {
|
|||||||
private int downFile;
|
private int downFile;
|
||||||
private int keyResult35;
|
private int keyResult35;
|
||||||
private int keyResult37;
|
private int keyResult37;
|
||||||
|
private int editScore;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.lz.modules.flow.service.impl;
|
package com.lz.modules.flow.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.lz.common.utils.NumberUtil;
|
import com.lz.common.utils.NumberUtil;
|
||||||
@ -17,6 +18,7 @@ import com.lz.modules.flow.model.Auth;
|
|||||||
import com.lz.modules.flow.model.StaffRoleDto;
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.flow.service.RecordAuthService;
|
import com.lz.modules.flow.service.RecordAuthService;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
@ -107,29 +109,7 @@ public class RecordAuthServiceImpl extends ServiceImpl<RecordAuthMapper, RecordA
|
|||||||
if (CollectionUtils.isNotEmpty(auths)) {
|
if (CollectionUtils.isNotEmpty(auths)) {
|
||||||
map = auths.stream().collect(Collectors.toMap(RecordAuth::getIdentity, RecordAuth::getStatus));
|
map = auths.stream().collect(Collectors.toMap(RecordAuth::getIdentity, RecordAuth::getStatus));
|
||||||
}
|
}
|
||||||
Auth auth = new Auth();
|
return JSONObject.parseObject(JSON.toJSONString(map),Auth.class);
|
||||||
auth.setAdd(NumberUtil.objToIntDefault(map.get("add"), 0));
|
|
||||||
auth.setApprovel(NumberUtil.objToIntDefault(map.get("approvel"), 0));
|
|
||||||
auth.setCheckResult(NumberUtil.objToIntDefault(map.get("checkResult"), 0));
|
|
||||||
auth.setCheckWeight(NumberUtil.objToIntDefault(map.get("checkWeight"), 0));
|
|
||||||
auth.setCommit(NumberUtil.objToIntDefault(map.get("commit"), 0));
|
|
||||||
auth.setConfirmCommit(NumberUtil.objToIntDefault(map.get("confirmCommit"), 0));
|
|
||||||
auth.setKeyResult(NumberUtil.objToIntDefault(map.get("keyResult"), 0));
|
|
||||||
auth.setPriority(NumberUtil.objToIntDefault(map.get("priority"), 0));
|
|
||||||
auth.setReject(NumberUtil.objToIntDefault(map.get("reject"), 0));
|
|
||||||
auth.setScoreComment(NumberUtil.objToIntDefault(map.get("scoreComment"), 0));
|
|
||||||
auth.setSuperScore(NumberUtil.objToIntDefault(map.get("superScore"), 0));
|
|
||||||
auth.setTarget(NumberUtil.objToIntDefault(map.get("target"), 0));
|
|
||||||
auth.setEdit(NumberUtil.objToIntDefault(map.get("edit"), 0));
|
|
||||||
auth.setAcquireScore(NumberUtil.objToIntDefault(map.get("acquireScore"), 0));
|
|
||||||
auth.setWenhuaAdd(NumberUtil.objToIntDefault(map.get("wenhuaAdd"), 0));
|
|
||||||
auth.setWenHuaEdit(NumberUtil.objToIntDefault(map.get("wenHuaEdit"), 0));
|
|
||||||
auth.setWaitCommit(NumberUtil.objToIntDefault(map.get("waitCommit"), 0));
|
|
||||||
auth.setApprovelCommit(NumberUtil.objToIntDefault(map.get("approvelCommit"), 0));
|
|
||||||
auth.setUploadFile(NumberUtil.objToIntDefault(map.get("uploadFile"), 0));
|
|
||||||
auth.setKeyResult35(NumberUtil.objToIntDefault(map.get("keyResult35"), 0));
|
|
||||||
auth.setKeyResult37(NumberUtil.objToIntDefault(map.get("keyResult37"), 0));
|
|
||||||
return auth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ 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;
|
||||||
@ -23,6 +24,7 @@ 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;
|
||||||
@ -109,6 +111,8 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils queryPage(Map<String, Object> params) {
|
public PageUtils queryPage(Map<String, Object> params) {
|
||||||
|
|
||||||
|
|
||||||
PageUtils pageUtils = PageUtils.startPage(
|
PageUtils pageUtils = PageUtils.startPage(
|
||||||
NumberUtil.objToIntDefault(params.get("page"), 1),
|
NumberUtil.objToIntDefault(params.get("page"), 1),
|
||||||
NumberUtil.objToIntDefault(params.get("limit"), 10)).doSelect(
|
NumberUtil.objToIntDefault(params.get("limit"), 10)).doSelect(
|
||||||
@ -124,6 +128,7 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
if (staffEntity != null) {
|
if (staffEntity != null) {
|
||||||
resp.setStaffName(staffEntity.getName());
|
resp.setStaffName(staffEntity.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Integer> types = JSONObject.parseObject(resp.getTypeRoleIds(), Map.class);
|
Map<String, Integer> types = JSONObject.parseObject(resp.getTypeRoleIds(), Map.class);
|
||||||
Long type1 = NumberUtil.objToLongDefault(types.get("type1"),0l);
|
Long type1 = NumberUtil.objToLongDefault(types.get("type1"),0l);
|
||||||
Long type2 = NumberUtil.objToLongDefault(types.get("type2"),0l);
|
Long type2 = NumberUtil.objToLongDefault(types.get("type2"),0l);
|
||||||
@ -152,32 +157,35 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
@Override
|
@Override
|
||||||
public void deleteBatchIds(List<Long> asList) {
|
public void deleteBatchIds(List<Long> asList) {
|
||||||
for (Long a : asList) {
|
for (Long a : asList) {
|
||||||
staffRoleMapper.selectByStaffId(a);
|
staffRoleMapper.deleteStaffRoleById(a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SysRoleEntity getRole(Long id) {
|
public SysRoleEntity getRole(Long id) {
|
||||||
StaffRole staffRole = staffRoleMapper.selectStaffRoleById(id);
|
StaffRole staffRole = staffRoleMapper.selectStaffRoleById(id);
|
||||||
SysRoleEntity role = new SysRoleEntity();
|
SysRoleEntity role = new SysRoleEntity();
|
||||||
List<Long> menuIdList= new ArrayList<>();
|
List<Long> menuIdList= new ArrayList<>();
|
||||||
|
List<Long> menuIdList1= new ArrayList<>();
|
||||||
if(staffRole!=null){
|
if(staffRole!=null){
|
||||||
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentMapper.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentMapper.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||||
|
List<DepartmentsEntity> departmentsEntities = departmentsDao.selectAll();
|
||||||
|
Map<String,List<DepartmentsEntity>> map= resultRecordService.getStringListMap(departmentsEntities);
|
||||||
role.setRoleId(staffRole.getId());
|
role.setRoleId(staffRole.getId());
|
||||||
role.setRoleName(staffRole.getDepartmentLevel());
|
role.setRoleName(staffRole.getDepartmentLevel());
|
||||||
for(StaffRoleDepartment staffRoleDepartment: staffRoleDepartments){
|
for(StaffRoleDepartment staffRoleDepartment: staffRoleDepartments){
|
||||||
if(staffRoleDepartment.getDepartmentId().equals("379454542")
|
List<DepartmentsEntity> list = map.get(staffRoleDepartment.getDepartmentId());
|
||||||
|| staffRoleDepartment.getDepartmentId().equals("154274609")){
|
if(list == null || list.size() == 0){
|
||||||
continue;
|
|
||||||
}
|
|
||||||
menuIdList.add(NumberUtil.objToLongDefault(staffRoleDepartment.getDepartmentId(),0l));
|
menuIdList.add(NumberUtil.objToLongDefault(staffRoleDepartment.getDepartmentId(),0l));
|
||||||
|
}else{
|
||||||
|
menuIdList1.add(NumberUtil.objToLongDefault(staffRoleDepartment.getDepartmentId(),0l));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
menuIdList.add(-666666l);
|
menuIdList.add(-666666l);
|
||||||
menuIdList.add(379454542l);
|
menuIdList.addAll(menuIdList1);
|
||||||
menuIdList.add(154274609l);
|
|
||||||
role.setMenuIdList(menuIdList);
|
role.setMenuIdList(menuIdList);
|
||||||
|
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,11 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByCondition" resultType="com.lz.modules.flow.entity.StaffRole">
|
<select id="selectByCondition" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||||
select * from lz_staff_role where is_delete = 0 order by id desc
|
select * from lz_staff_role where is_delete = 0
|
||||||
|
<if test="params.name != null and params.name != '' ">
|
||||||
|
and staff_id in (select id from lz_staff where name like concat('%',#{params.name},'%'))
|
||||||
|
</if>
|
||||||
|
order by id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user