Commit 76db7553 authored by curryft's avatar curryft

团队评估

parent 89131df9
package org.rcisoft.business.evaluate.team.controller;
/*固定导入*/
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.evaluate.team.service.TeamAssessmentService;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.rcisoft.core.result.Result;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.controller.PaginationController;
import org.rcisoft.core.util.UserUtil;
import org.rcisoft.core.model.GridModel;
import javax.validation.Valid;
/**
* Created by liuzhichao on 2018-4-18 17:25:07.
*/
@RestController
@RequestMapping("TeamAssessment")
public class TeamAssessmentController {
@Autowired
private TeamAssessmentService teamAssessmentService;
@ApiOperation(value="团队评估列表信息", notes="团队评估列表信息")
@ApiImplicitParams({@ApiImplicitParam(name = "teamId", value = "团队主键", required = true, dataType = "字符串")})
@RequestMapping("/getTeamAssessmentInfo")
public Result TeamAssessmentInfo(@RequestParam String teamId) {
return Result.builder(new PersistModel(1), MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_ERROR, teamAssessmentService.getTeamAssessmentInfo(teamId));
}
@ApiOperation(value="团队评估右侧信息", notes="团队评估右侧信息")
@ApiImplicitParams({@ApiImplicitParam(name = "priId", value = "负责人主键", required = true, dataType = "字符串")})
@RequestMapping("/getTeamAssessmentRightInfo")
public Result TeamAssessmentRightInfo(@RequestParam String priId) {
return Result.builder(new PersistModel(1), MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_ERROR, teamAssessmentService.getTeamAssessmentRightInfo(priId));
}
}
package org.rcisoft.business.evaluate.team.dao;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.evaluate.team.entity.BusTeam;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by liuzhichao on 2018/4/19.
*/
@Repository
public interface BusTeamRepository extends BaseMapper<BusTeam>{
@Select("select a.*,count(b.TEAM_ID) as teamNumber,sum(b.BLD_AREA) as area from `bus_team` a join `bus_project` b on a.`TEAM_ID`=b.`TEAM_ID` where a.`TEAM_ID`=#{teamId} ")
@ResultMap(value = "BaseResultMap" )
BusTeam selectByTeamId(String teamId);
}
package org.rcisoft.business.evaluate.team.dao;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.evaluate.team.entity.SysPrincipal;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created with liuzhichao on 2018-4-18 17:25:08.
*/
@Repository
public interface SysPrincipalRepository extends BaseMapper<SysPrincipal> {
@Select("select * from sys_principal where `PRI_ID` = #{priId} ")
@ResultMap(value = "BaseResultMap" )
SysPrincipal selectByPriId(String priId);
}
package org.rcisoft.business.evaluate.team.entity;
import lombok.*;
import org.rcisoft.core.entity.IdNotDataEntity;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created with liuzhichao on 2018-4-18 17:25:08.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sys_principal")
public class BusTeam implements Serializable {
private String teamId;
private String teamNm;
private String resource;
private String onlineDate;
private String intorduce;
private String priId;
private String recommend;
private String teamType;
private float area;
private Integer teamNumber;
}
package org.rcisoft.business.evaluate.team.entity;
import lombok.*;
import org.rcisoft.core.entity.IdNotDataEntity;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created with liuzhichao on 2018-4-18 17:25:08.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sys_principal")
public class SysPrincipal implements Serializable {
private String priId;
private String userId;
private String priNm;
private String job;
private String jobtitle;
private String bushour;
private String honor;
}
package org.rcisoft.business.evaluate.team.service;
import org.rcisoft.business.evaluate.team.entity.BusTeam;
import org.rcisoft.business.evaluate.team.entity.SysPrincipal;
import java.util.List;
import java.util.Map;
/**
* Created by liuzhichao on 2018/4/19.
*/
public interface TeamAssessmentService {
BusTeam getTeamAssessmentInfo(String teamId);
SysPrincipal getTeamAssessmentRightInfo(String teamId);
}
package org.rcisoft.business.evaluate.team.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.evaluate.team.dao.BusTeamRepository;
import org.rcisoft.business.evaluate.team.dao.SysPrincipalRepository;
import org.rcisoft.business.evaluate.team.entity.BusTeam;
import org.rcisoft.business.evaluate.team.entity.SysPrincipal;
import org.rcisoft.business.evaluate.team.service.TeamAssessmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* Created by liuzhichao on 2018/4/19.
*/
@Service
@Slf4j
public class TeamAssessmentImpl implements TeamAssessmentService {
@Autowired
BusTeamRepository busTeamRepository;
@Autowired
SysPrincipalRepository sysPrincipalRepository;
@Override
public BusTeam getTeamAssessmentInfo(String teamId) {
return busTeamRepository.selectByTeamId(teamId);
}
@Override
public SysPrincipal getTeamAssessmentRightInfo(String priId) {
return sysPrincipalRepository.selectByPriId(priId);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.rcisoft.business.evaluate.team.dao.BusTeamRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.evaluate.team.entity.BusTeam">
<id column="TEAM_ID" jdbcType="VARCHAR" property="teamId"/>
<result column="TEAM_NM" jdbcType="VARCHAR" property="teamId"/>
<result column="RESOURCE" jdbcType="VARCHAR" property="resource"/>
<result column="ONLINE_DATE" jdbcType="VARCHAR" property="onlineDate"/>
<result column="INTRODUCE" jdbcType="VARCHAR" property="intorduce"/>
<result column="PRI_ID" jdbcType="VARCHAR" property="priId"/>
<result column="RECOMMEND" jdbcType="VARCHAR" property="recommend"/>
<result column="TEAM_TYPE" jdbcType="VARCHAR" property="teamType"/>
<result column="area" jdbcType="VARCHAR" property="area"/>
<result column="teamNumber" jdbcType="VARCHAR" property="teamNumber"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.rcisoft.business.evaluate.team.dao.SysPrincipalRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.evaluate.team.entity.SysPrincipal">
<id column="PRI_ID" jdbcType="VARCHAR" property="priId"/>
<result column="USER_ID" jdbcType="VARCHAR" property="userId"/>
<result column="PRI_NM" jdbcType="VARCHAR" property="priNm"/>
<result column="JOB" jdbcType="VARCHAR" property="job"/>
<result column="JOBTITLE" jdbcType="VARCHAR" property="jobtitle"/>
<result column="BUSHOUR" jdbcType="VARCHAR" property="bushour"/>
<result column="HONOR" jdbcType="VARCHAR" property="honor"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment