Commit e5b4f77b by dengshichuan

Merge branch 'wdz' into 'develop'

Wdz

See merge request 8timerv2/8timerapiv200!16
parents 05ae6411 2dbbc6ac
......@@ -77,7 +77,7 @@ public interface YgEnumInterface {
*/
@Getter
enum jobStatus implements YgEnumInterface{
ZHENSHI(0,"正式"),SHIYONG(1,"试用");
ZHENSHI(1,"正式"),SHIYONG(2,"试用"),LIZHIZHONG(3,"离职中"),YILIZHI(4,"已离职");
private Integer type;
......@@ -91,6 +91,8 @@ public interface YgEnumInterface {
jobStatus zos = (index == null || index.length() == 0) ? YgEnumInterface.jobStatus.ZHENSHI: (index.indexOf(jobStatus.ZHENSHI.name)!= -1)||(index.indexOf(jobStatus.ZHENSHI.type)!= -1) ? jobStatus.ZHENSHI:jobStatus.SHIYONG;
return zos.type.toString();
}
}
/**
......@@ -179,40 +181,71 @@ public interface YgEnumInterface {
@Getter
enum workage implements YgEnumInterface{
//NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000);
NEW(0,183,0),HALF(184,365,0),ONE(366,548,0),ONEHALF(549,730,0),TWO(731,1000,0),LONG(1001,10000,0);
NEW(0,30,0),ROOKIE(31,183,0),HALF(184,365,0),ONE(366,548,0),ONEHALF(549,730,0),TWO(731,1000,0),LONG(1001,10000,0);
private Integer begin;
private Integer end;
private Integer number;
workage(Integer begin, Integer end,Integer number) {
this.begin = begin;
this.end = end;
this.number = number;
}
public static Map<String, Integer> choose(List<YgbintuDto> bintu) {
for (YgbintuDto b : bintu) {
Integer index = b.getWorkage();
for (workage item : workage.values()) {
if (index>= item.begin && index<=item.end) {
item.number++;
System.out.println("item"+ item+":"+item.number);
}
if (index>= item.begin && index<=item.end) item.number++;
}
}
Map<String, Integer> result = new HashMap<String, Integer>();
result.put("x<0.5", NEW.number);
result.put("本月新入职", NEW.number);
result.put("x<0.5", NEW.number+ROOKIE.number);
result.put("0.5<x<1", HALF.number);
result.put("1<x<1.5", ONE.number);
result.put("1.5<x<2", ONEHALF.number);
result.put("2<x<3", TWO.number);
result.put("x++", LONG.number);
NEW.number=0;ROOKIE.number=0;HALF.number=0;ONE.number=0;ONEHALF.number=0;TWO.number=0;LONG.number=0;
return result;
}
}
/**
* 年龄
*/
@Getter
enum age implements YgEnumInterface{
//NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000);
CHILD(1,17,0),TEEN(18,25,0),YOUNG(26,32,0),MAN(33,38,0),MIDDLE(39,45,0),OLD(46,1000,0);
private Integer begin;
private Integer end;
private Integer number;
age(Integer begin, Integer end,Integer number) {
this.begin = begin;
this.end = end;
this.number = number;
}
public static Map<String, Integer> choose(List<YgbintuDto> bintu) {
Integer average = 0;
Integer i = 0;
Integer j = 0;
for (YgbintuDto b : bintu) {
Integer index = b.getAge();
for (; i < age.values().length; i++) {
if (index>= age.values()[i].begin && index<=age.values()[i].end) age.values()[i].number++;j++;
}
average = average + index;
}
Map<String, Integer> result = new HashMap<String, Integer>();
result.put("18以下", CHILD.number);
result.put("18-25", TEEN.number);
result.put("25-32", YOUNG.number);
result.put("32-38", MAN.number);
result.put("38-45", MIDDLE.number);
result.put("45以上", OLD.number);
Integer pInjun = j>0 ?(average/j) :0;
result.put("平均年龄", pInjun);
CHILD.number =0;TEEN.number=0;YOUNG.number=0;MAN.number=0;MIDDLE.number=0;OLD.number=0;
return result;
}
}
}
......@@ -3,7 +3,7 @@ import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.dto.yggl.YgtitleDto;
import cn.timer.api.dto.yggl.YgCartogramDto;
......@@ -12,6 +12,6 @@ import cn.timer.api.dto.yggl.YgtitleDto;
* @author Tang 2019-11-15
*/
@Repository
public interface YgtitleDtoMapper extends BaseMapper<YgtitleDto> {
public interface YgCartogramDtoMapper extends BaseMapper<YgCartogramDto> {
}
......@@ -3,6 +3,7 @@ package cn.timer.api.dao.yggl;
import java.util.List;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -25,9 +26,22 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @param userBean
* @return
*/
List<YgbintuDto> rsybp();
List<YgbintuDto> rsybp(Integer orgCode);
/**
* 查询当月离职人数
* @param userBean
* @return
*/
Integer benyueLz(Integer orgCode);
/**
* 查询当月转正人数
* @param userBean
* @return
*/
Integer benyueZz(Integer orgCode);
/**
* 查询员工信息
* @param userBean
* @return
......
......@@ -52,7 +52,8 @@ public class AddygdaDto extends Page implements Serializable{
@ApiModelProperty(value="性别 0:男;1:女",example="0")
private Integer sex;
@ApiModelProperty(value="部门岗位id",example="0")
private Integer bmgwId;
}
/**
* @date 2020年4月1日
* @author 翁东州
* @方法中文名称:
*/
package cn.timer.api.dto.yggl;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @date 2020年4月1日
* @author 翁东州
* @方法中文名称:
*/
public class YgCartogramDto {
@ApiModelProperty(value="统计图--标头 ",example="标头")
private YgtitleDto ygtitleDto;
@ApiModelProperty(value="统计图--饼图和直方图 ",example="饼图和直方图")
private YgbintuDto ygbintuDto;
* @author Tang 2019-11-15
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("统计图--仪表盘内容")
public class YgCartogramDto implements Serializable{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value="在职人数")
private Integer zaizhi;
@ApiModelProperty(value="本月新入职 ")
private Integer xinruzhi;
@ApiModelProperty(value="本月离职")
private Integer lizhi;
@ApiModelProperty(value="本月转正")
private Integer zhuanzhen;
@ApiModelProperty(value="平均年龄")
private Integer nianlin;
@ApiModelProperty(value="部门")
private List<YgKVDto> bm;
@ApiModelProperty(value="岗位")
private List<YgKVDto> gw;
@ApiModelProperty(value="学历")
private List<YgKVDto> edu;
@ApiModelProperty(value="工作状态")
private List<YgKVDto> jobStatus;
@ApiModelProperty(value="省份")
private List<YgKVDto> proname;
@ApiModelProperty(value="工作日")
private List<YgKVDto> workage;
@ApiModelProperty(value="年龄")
private List<YgKVDto> age;
}
package cn.timer.api.dto.yggl;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2019-11-15
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("yggl_atta_title")
@ApiModel("统计图--标头")
public class YgtitleDto{
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="id编号",example="1")
private Integer id;
@ApiModelProperty(value="在职人数",example="1")
private Integer zaizhi;
@ApiModelProperty(value="本月新入职 ",example="1")
private Integer xinruzhi;
@ApiModelProperty(value="本月离职",example="1")
private Integer lizhi;
@ApiModelProperty(value="本月转正",example="1")
private Integer zhuanzhen;
@ApiModelProperty(value="平均年龄",example="22")
private Integer nianlin;
@ApiModelProperty(value="组织机构代码",example="117")
private Integer orgCode;
}
package cn.timer.api.dto.yggl;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2019-11-15
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("统计图--键值对Dto")
public class YgKVDto{
@ApiModelProperty(value="键 ")
private String name;
@ApiModelProperty(value="值")
private String value;
}
......@@ -169,14 +169,25 @@
</sql>
<!-- rsybp人事仪表盘 -->
<select id="rsybp" resultMap="Bintu">
SELECT e.id AS id,e.age AS age,e.bmgw_id AS bmgwId,b.`name` AS gw,bb.`name` AS bm, p.`name` AS proname,d.`name` AS eduname,e.job_status AS jobStatus,datediff(CURDATE(),e.rz_time) AS workage
SELECT e.id AS id,IFNULL(e.age,0) AS age,IFNULL(e.bmgw_id,0) AS bmgwId,IFNULL(b.`name`,'null') AS gw,IFNULL(bb.`name`,'null') AS bm,IFNULL( p.`name`,'null') AS proname,IFNULL(d.`name` ,'null')AS eduname,IFNULL(e.job_status,0) AS jobStatus,IFNULL(datediff(CURDATE(),e.rz_time),0)AS workage
FROM yggl_main_emp e
LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id
LEFT JOIN zzgl_bmgw_m bb ON bb.id = b.up_id
LEFT JOIN province_class p ON left (e.`jg`,2) = p.province
LEFT JOIN education_class d ON d.number = e.edu
WHERE e.org_code = 117 AND b.org_code =117;
WHERE e.org_code = 117
</select>
<!-- benyueLz本月离职人数 -->
<select id="benyueLz" resultType="Integer">
SELECT COUNT(datediff(CURDATE(),l.sjlz_time)) FROM yggl_main_lzb l WHERE datediff(CURDATE(),l.sjlz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
</select>
<!-- benyueZz本月转正人数 -->
<select id="benyueZz" resultType="Integer">
SELECT COUNT(datediff(CURDATE(),e.sjzz_time)) FROM yggl_main_emp e WHERE datediff(CURDATE(),e.sjzz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
</select>
<!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT
......
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