考核管理
This commit is contained in:
parent
70ff54bff9
commit
2f493037e4
@ -93,7 +93,7 @@ public class GovEnterpriseScoreController {
|
||||
@PostMapping(value = "/rankList")
|
||||
public Result<List<EnterpriseScoreDto>> rankList(@RequestBody EnterpriseScoreVo enterpriseScoreVo) {
|
||||
LambdaQueryWrapper<EnterpriseScore> queryWrapper = Wrappers.<EnterpriseScore>lambdaQuery();
|
||||
if(null != enterpriseScoreVo.getEnterpriseType()) {
|
||||
if (null != enterpriseScoreVo.getEnterpriseType()) {
|
||||
queryWrapper.eq(EnterpriseScore::getEnterpriseType, enterpriseScoreVo.getEnterpriseType());
|
||||
}
|
||||
if (null != enterpriseScoreVo.getListType()) {
|
||||
@ -116,10 +116,40 @@ public class GovEnterpriseScoreController {
|
||||
if (StringUtils.isNotBlank(enterpriseScoreVo.getEngineeringName())) {
|
||||
queryWrapper.like(EnterpriseScore::getEngineeringName, enterpriseScoreVo.getEngineeringName());
|
||||
}
|
||||
queryWrapper.isNotNull(EnterpriseScore::getScore);
|
||||
List<EnterpriseScoreDto> list = enterpriseScoreService.pageList(queryWrapper);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 排行榜企业数量查询
|
||||
*
|
||||
* @param enterpriseScoreVo
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "企业对应工程得分管理", operType = "查询", operDesc = "排行榜企业数量查询")
|
||||
@ApiOperation(value = " 排行榜企业数量查询", notes = "排行榜企业数量查询", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseType", value = "企业类型", paramType = "body", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "listType", value = "榜单类型(1:红榜;2:黑榜;)", paramType = "body", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/rankEnterpriseStat")
|
||||
public Result<Object> rankEnterpriseStat(@ApiIgnore @RequestBody EnterpriseScoreVo enterpriseScoreVo) {
|
||||
LambdaQueryWrapper<EnterpriseScore> queryWrapper = Wrappers.<EnterpriseScore>lambdaQuery();
|
||||
if (null != enterpriseScoreVo.getEnterpriseType()) {
|
||||
queryWrapper.eq(EnterpriseScore::getEnterpriseType, enterpriseScoreVo.getEnterpriseType());
|
||||
}
|
||||
if (null != enterpriseScoreVo.getListType()) {
|
||||
if (enterpriseScoreVo.getListType() == 1) {
|
||||
queryWrapper.between(EnterpriseScore::getScore, 60, 100);
|
||||
} else {
|
||||
queryWrapper.between(EnterpriseScore::getScore, 0, 60);
|
||||
}
|
||||
}
|
||||
queryWrapper.isNotNull(EnterpriseScore::getScore);
|
||||
return Result.success(enterpriseScoreService.enterpriseNum(queryWrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
@ -165,6 +195,7 @@ public class GovEnterpriseScoreController {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "企业对应工程得分管理", operType = "删除", operDesc = "删除企业对应工程得分信息")
|
||||
@ -189,6 +220,7 @@ public class GovEnterpriseScoreController {
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "企业对应工程得分管理", operType = "批量删除", operDesc = "批量删除企业对应工程得分信息")
|
||||
@ -209,6 +241,7 @@ public class GovEnterpriseScoreController {
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "企业对应工程得分管理", operType = "查询", operDesc = "通过id查询企业对应工程得分信息")
|
||||
|
||||
@ -23,8 +23,10 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@ -78,6 +80,27 @@ public class GovEnterpriseScoreDetailController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param enterpriseScoreDetail
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "企业对应工程得分明细管理", operType = "列表查询", operDesc = "列表查询企业对应工程得分明细信息(按分项)")
|
||||
@ApiOperation(value = " 列表查询企业对应工程得分明细信息(按分项)", notes = "列表查询企业对应工程得分明细信息(按分项)", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "scoreId", value = "企业评分ID", paramType = "body", required = true, dataType = "String")
|
||||
@PostMapping(value = "/listByItem")
|
||||
public Result<Map<String, Object>> listByItem(@RequestBody EnterpriseScoreDetail enterpriseScoreDetail) {
|
||||
List<String> item = enterpriseScoreDetailService.getItem(enterpriseScoreDetail.getScoreId());
|
||||
QueryWrapper<EnterpriseScoreDetail> queryWrapper = QueryGenerator.initQueryWrapper(enterpriseScoreDetail);
|
||||
List<EnterpriseScoreDetail> list = enterpriseScoreDetailService.list(queryWrapper);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
for (String im : item) {
|
||||
resultMap.put(im, list.stream().filter(l -> l.getSubItem().equals(im)).collect(Collectors.toList()));
|
||||
}
|
||||
return Result.success(resultMap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
||||
@ -23,10 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@ -82,6 +80,27 @@ public class GovEnterpriseScoreStandardController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param enterpriseScoreStandard
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "企业类型评分标准管理", operType = "列表查询", operDesc = "列表查询企业类型评分标准信息(按分项)")
|
||||
@ApiOperation(value = " 列表查询企业类型评分标准信息(按分项)", notes = "列表查询企业类型评分标准信息(按分项)", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "enterpriseType", value = "企业类型", paramType = "body", dataType = "Integer")
|
||||
@PostMapping(value = "/listByItem")
|
||||
public Result<Map<String, Object>> listByItem(@RequestBody EnterpriseScoreStandard enterpriseScoreStandard) {
|
||||
List<String> item = enterpriseScoreStandardService.getItem(enterpriseScoreStandard.getEnterpriseType());
|
||||
QueryWrapper<EnterpriseScoreStandard> queryWrapper = QueryGenerator.initQueryWrapper(enterpriseScoreStandard);
|
||||
List<EnterpriseScoreStandard> list = enterpriseScoreStandardService.list(queryWrapper);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
for (String im : item) {
|
||||
resultMap.put(im, list.stream().filter(l -> l.getSubItem().equals(im)).collect(Collectors.toList()));
|
||||
}
|
||||
return Result.success(resultMap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
||||
@ -155,25 +155,18 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
|
||||
String userId = MapUtils.getString(map, "userId");
|
||||
userId = Aes.decrypt(userId, "ssologin66!@#$%^");
|
||||
SystemUser systemUser = new SystemUser();
|
||||
Integer type = 0;
|
||||
String sn = "";
|
||||
Long moduleId = 0L;
|
||||
if (userId.equals("myy")) {
|
||||
systemUser = systemUserMapper.selectOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, "hzxmgl"));
|
||||
type = 2;
|
||||
sn = systemUser.getSn();
|
||||
moduleId = 1670639811581595650L;
|
||||
}
|
||||
if (userId.equals("test")) {
|
||||
systemUser = systemUserMapper.selectOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, "hzxm"));
|
||||
type = 4;
|
||||
if (systemUser != null) {
|
||||
sn = governmentService.getGovByUser(systemUser.getAccountType(), systemUser.getSn()).getGovernmentSn();
|
||||
}
|
||||
moduleId = 1670603312504918018L;
|
||||
}
|
||||
if (systemUser == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
}
|
||||
Long moduleId = moduleTemplateMapper.selectList(Wrappers.<ModuleTemplate>lambdaQuery().eq(ModuleTemplate::getGovernmentSn, sn)
|
||||
.eq(ModuleTemplate::getModuleType, type)).get(0).getModuleId();
|
||||
List<BaseMenu> baseMenus = baseMenuMapper.selectList(Wrappers.<BaseMenu>lambdaQuery().in(BaseMenu::getModuleId, moduleId)
|
||||
.eq(BaseMenu::getStatus, 1).orderByAsc(BaseMenu::getPriority));
|
||||
return TreeUtil.formatHz(baseMenus);
|
||||
|
||||
@ -22,4 +22,6 @@ public interface EnterpriseScoreDetailMapper extends BaseMapper<EnterpriseScoreD
|
||||
Page<EnterpriseScoreDetail> pageList(Page page, @Param(Constants.WRAPPER) Wrapper<EnterpriseScoreDetail> wrapper);
|
||||
|
||||
List<EnterpriseScoreDetail> pageList(@Param(Constants.WRAPPER) Wrapper<EnterpriseScoreDetail> wrapper);
|
||||
|
||||
List<String> getItem(Long scoreId);
|
||||
}
|
||||
|
||||
@ -23,4 +23,6 @@ public interface EnterpriseScoreMapper extends BaseMapper<EnterpriseScore> {
|
||||
Page<EnterpriseScoreDto> pageList(Page page, @Param(Constants.WRAPPER)Wrapper<EnterpriseScore> wrapper);
|
||||
|
||||
List<EnterpriseScoreDto> pageList(@Param(Constants.WRAPPER)Wrapper<EnterpriseScore> wrapper);
|
||||
|
||||
Integer enterpriseNum(Wrapper<EnterpriseScore> queryWrapper);
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import com.zhgd.xmgl.modules.safety.entity.EnterpriseScoreStandard;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 企业类型评分标准
|
||||
* @author: pengj
|
||||
@ -17,4 +19,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface EnterpriseScoreStandardMapper extends BaseMapper<EnterpriseScoreStandard> {
|
||||
|
||||
Integer score(@Param(Constants.WRAPPER) Wrapper<EnterpriseScoreStandard> wrapper);
|
||||
|
||||
List<String> getItem(Integer enterpriseType);
|
||||
}
|
||||
|
||||
@ -6,4 +6,8 @@
|
||||
SELECT * FROM enterprise_score_detail
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getItem" resultType="java.lang.String">
|
||||
SELECT sub_item FROM enterprise_score_detail WHERE score_id = #{scoreId} GROUP BY sub_item
|
||||
</select>
|
||||
</mapper>
|
||||
@ -23,4 +23,8 @@
|
||||
LEFT JOIN engineering e ON s.engineering_sn = e.engineering_sn) a
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="enterpriseNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(enterprise_sn) FROM enterprise_score ${ew.customSqlSegment} GROUP BY enterprise_sn
|
||||
</select>
|
||||
</mapper>
|
||||
@ -6,4 +6,8 @@
|
||||
SELECT IFNULL(SUM(standard_score), 0) FROM enterprise_score_standard
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getItem" resultType="java.lang.String">
|
||||
SELECT sub_item FROM enterprise_score_standard WHERE enterprise_type = #{enterpriseType} GROUP BY sub_item
|
||||
</select>
|
||||
</mapper>
|
||||
@ -23,4 +23,6 @@ public interface IEnterpriseScoreDetailService extends IService<EnterpriseScoreD
|
||||
boolean saveInfo(List<EnterpriseScoreDetail> enterpriseScoreDetails);
|
||||
|
||||
boolean updateInfo(List<EnterpriseScoreDetail> enterpriseScoreDetails);
|
||||
|
||||
List<String> getItem(Long scoreId);
|
||||
}
|
||||
|
||||
@ -22,4 +22,6 @@ public interface IEnterpriseScoreService extends IService<EnterpriseScore> {
|
||||
List<EnterpriseScoreDto> pageList(Wrapper<EnterpriseScore> queryWrapper);
|
||||
|
||||
boolean saveInfo(EnterpriseScore enterpriseScore);
|
||||
|
||||
Integer enterpriseNum(Wrapper<EnterpriseScore> queryWrapper);
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.safety.entity.EnterpriseScoreStandard;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 企业类型评分标准
|
||||
* @author: pengj
|
||||
@ -13,4 +15,6 @@ import com.zhgd.xmgl.modules.safety.entity.EnterpriseScoreStandard;
|
||||
public interface IEnterpriseScoreStandardService extends IService<EnterpriseScoreStandard> {
|
||||
|
||||
Integer score(Wrapper<EnterpriseScoreStandard> wrapper);
|
||||
|
||||
List<String> getItem(Integer enterpriseType);
|
||||
}
|
||||
|
||||
@ -49,6 +49,9 @@ public class EnterpriseScoreDetailServiceImpl extends ServiceImpl<EnterpriseScor
|
||||
|
||||
@Override
|
||||
public boolean saveInfo(List<EnterpriseScoreDetail> enterpriseScoreDetails) {
|
||||
for (EnterpriseScoreDetail enterpriseScoreDetail : enterpriseScoreDetails) {
|
||||
enterpriseScoreDetail.setScore(enterpriseScoreDetail.getStandardScore() - enterpriseScoreDetail.getDeductPoints());
|
||||
}
|
||||
boolean flag = this.saveBatch(enterpriseScoreDetails);
|
||||
if (flag) {
|
||||
Integer totalScore = enterpriseScoreDetails.stream().map(e -> e.getScore()).reduce(Integer::sum).orElse(0);
|
||||
@ -62,6 +65,9 @@ public class EnterpriseScoreDetailServiceImpl extends ServiceImpl<EnterpriseScor
|
||||
|
||||
@Override
|
||||
public boolean updateInfo(List<EnterpriseScoreDetail> enterpriseScoreDetails) {
|
||||
for (EnterpriseScoreDetail enterpriseScoreDetail : enterpriseScoreDetails) {
|
||||
enterpriseScoreDetail.setScore(enterpriseScoreDetail.getStandardScore() - enterpriseScoreDetail.getDeductPoints());
|
||||
}
|
||||
boolean flag = this.updateBatchById(enterpriseScoreDetails);
|
||||
if (flag) {
|
||||
Integer totalScore = enterpriseScoreDetails.stream().map(e -> e.getScore()).reduce(Integer::sum).orElse(0);
|
||||
@ -72,4 +78,9 @@ public class EnterpriseScoreDetailServiceImpl extends ServiceImpl<EnterpriseScor
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getItem(Long scoreId) {
|
||||
return baseMapper.getItem(scoreId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,4 +84,9 @@ public class EnterpriseScoreServiceImpl extends ServiceImpl<EnterpriseScoreMappe
|
||||
engineeringMainService.save(engineeringMain);
|
||||
return this.save(enterpriseScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer enterpriseNum(Wrapper<EnterpriseScore> queryWrapper) {
|
||||
return baseMapper.enterpriseNum(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import com.zhgd.xmgl.modules.safety.mapper.EnterpriseScoreStandardMapper;
|
||||
import com.zhgd.xmgl.modules.safety.service.IEnterpriseScoreStandardService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 企业类型评分标准
|
||||
* @author: pengj
|
||||
@ -19,4 +21,9 @@ public class EnterpriseScoreStandardServiceImpl extends ServiceImpl<EnterpriseSc
|
||||
public Integer score(Wrapper<EnterpriseScoreStandard> wrapper) {
|
||||
return baseMapper.score(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getItem(Integer enterpriseType) {
|
||||
return baseMapper.getItem(enterpriseType);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user