Commit 0f814de1 by dengshichuan

Merge branch 'wdz' into 'develop'

Wdz

See merge request 8timerv2/8timerapiv200!47
parents 3d7766fc be4c38b2
......@@ -194,4 +194,7 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@Transient
@TableField(exist = false)
private String error;//错误信息提示
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.alibaba.druid.sql.ast.expr.SQLCaseExpr.Item;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
......@@ -99,4 +100,22 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> {
});
}
}
// 遍历,获取该员工所有上级部门(weng)
public static void getUpDepts(ArrayList<Integer> list, Integer objId, List<ZzglBmgwM> objs) {//7290
if (objId != null) {
for (ZzglBmgwM bmgw : objs) {
Integer bmgwId = bmgw.getId();
Integer upId = bmgw.getUpId();
if (bmgwId.equals(objId)) {
list.add(bmgwId);
if (upId!=null) {
getUpDepts(list, upId, objs);
}
}
}
}
}
}
\ No newline at end of file
......@@ -49,8 +49,8 @@ public interface YgEnumInterface {
*/
@Getter
enum YgJobType implements YgEnumInterface{
QUANZHI(1, "全"),SHIXI(2, "实习"),JIANZHI(3, "兼"),LWPQ(4, "劳务派遣"),
LAOWU(5, "劳务"),PAIQIAN(6, "派遣"),WAIBAO(7, "外包"),TUIXIU(8, "退休");
QUANZHI(0, "全"),SHIXI(1, "实习"),JIANZHI(2, "兼"),LWPQ(3, "劳务派遣"),
LAOWU(4, "劳务"),PAIQIAN(5, "派遣"),WAIBAO(6, "外包"),TUIXIU(7, "退休");
private Integer type;
......@@ -76,7 +76,7 @@ public interface YgEnumInterface {
*/
@Getter
enum jobStatus implements YgEnumInterface{
SHIYONG(1,"试用"),ZHENSHI(2,"正式"),LIZHIZHONG(3,"离职中"),YILIZHI(4,"已离职");
SHIYONG(0,"试用"),ZHENSHI(1,"正式"),LIZHIZHONG(2,"离职中"),YILIZHI(3,"已离职");
private Integer type;
......
......@@ -230,7 +230,7 @@ public class QyzxController {
@ApiOperation(value = "显示常用的企业开票资料", httpMethod = "GET", notes = "接口发布说明")
public Result<QyzxInvoiceUsual> invoiceusual(@CurrentUser UserBean userBean) {
QyzxInvoiceUsual one = new LambdaQueryChainWrapper<QyzxInvoiceUsual>(qyzxInvoiceUsualMapper).eq(QyzxInvoiceUsual::getOrgCode, userBean.getOrgCode()).one();
return ResultUtil.data(one, "企业超管头像和电话号码");
return ResultUtil.data(one, "显示常用的企业开票资料");
}
/**
......
......@@ -8,7 +8,8 @@ package cn.timer.api.controller.yggl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
......@@ -77,6 +78,7 @@ import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.LoginerChargeDto;
import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgAreaDto;
......@@ -132,7 +134,96 @@ public class YgglController {
// weng(民族)
@Autowired
private YgMzDtoMapper ygMzDtoMapper;
/**
* 获取登录人的相关信息
*
* @param
* @return
*/
@GetMapping(value = "/loginmessage")
@ApiOperation(value = " 获取登录人的相关信息", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 68)
public Result<YgglMainEmp> loginmessage(@CurrentUser UserBean userBean) {
Integer empNum = userBean.getEmpNum();
Integer orgCode = userBean.getOrgCode();
YgglMainEmp ygglMainEmp=new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId,YgglMainEmp::getName,YgglMainEmp::getRzTime,YgglMainEmp::getEmpNum).
eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
Integer gw = ygglMainEmp.getBmgwId();
ZzglBmgwM bmid = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId).eq(ZzglBmgwM::getId, gw).eq(ZzglBmgwM::getOrgCode, orgCode).one();
ygglMainEmp.setUnionid(bmid.toString());
return ResultUtil.data(ygglMainEmp, "部门id返回字段为unionid");
}
/**
* 获取登录人和上级主管的empNum和名称
*
* @param
* @return
*/
@GetMapping(value = "/loginerChargers")
@ApiOperation(value = " 获取登录人和上级主管的empNum和名称", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 69)
public Result<List<LoginerChargeDto>> loginerChargers(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
Integer empNum = userBean.getEmpNum();
List<LoginerChargeDto> loginerCharges = new ArrayList<LoginerChargeDto>();
Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getOrgCode, orgCode).list();
//获取该员工的上级部门id 的数组list
ZzglBmgwM.getUpDepts(list, gw, zzglBmgwMs);
List<Integer> leaderList = new ArrayList<Integer>();
for (Integer zzglId : list) {
for (ZzglBmgwM zzglBmgwM : zzglBmgwMs) {
if (zzglId.equals(zzglBmgwM.getId()) && zzglBmgwM.getLeader()!=null) {
leaderList.add(zzglBmgwM.getLeader());
}
}
}
List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList);
List<LoginerChargeDto> loginerChargeDtos =new ArrayList<LoginerChargeDto>();
for (YgglMainEmp m : ygglMainEmps) {
loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(),m.getName()));
}
Collections.reverse(loginerChargeDtos);
return ResultUtil.data(loginerChargeDtos, "获取上级部门的部门id");
}
//根据传来的empNum获取该人员信息,没有则传全部
public List<YgglMainEmp> empNumsConfirm(Integer orgCode,List<Integer> empNumList) {
List<YgglMainEmp> all = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getOrgCode, orgCode).list();
List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>();
if (empNumList.size()!=0) {
for (Integer empNum : empNumList) {
all.stream().filter(item -> empNum.equals(item.getEmpNum())).forEach(action ->{
ygglMainEmps.add(action);
});
}
}else {
ygglMainEmps.addAll(all);
}
return ygglMainEmps;
}
//根据传来的empNum获取该人员信息
public YgglMainEmp empNumConfirm(Integer orgCode,Integer empNum) {
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
return one;
}
/**
* 获取企业到期时间和版本
*
* @param
* @return
*/
@GetMapping(value = "/endtimeVersion")
@ApiOperation(value = "获取企业到期时间和版本", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
public Result<YgglMainEmp> endtimeVersion(@CurrentUser UserBean userBean) {
return ResultUtil.error();
}
/**
* 获取员工档案
*
......@@ -321,7 +412,7 @@ public class YgglController {
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.select("name", "emp_num", "bmgw_id", "rz_time", "job_type", "phone", "job_status")
.ne("job_status", 4).eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t)
.ne("job_status", YgEnumInterface.jobStatus.YILIZHI.getType()).eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t)
.eq(j != null && j > -1, "job_status", j).in(!bList.isEmpty(), "bmgw_id", bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q));
......@@ -1392,7 +1483,7 @@ public class YgglController {
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(3).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(3).lzTime(lzygQueryDto.getLzTime()).lzyy(lzygQueryDto.getLzyy())
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime()).lzyy(lzygQueryDto.getLzyy())
.lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
// 删除员工表
// ygglMainEmp.deleteById();
......@@ -1418,8 +1509,8 @@ public class YgglController {
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(4).build().update(updateWrapper);
YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(4).sjlzTime(new Date()).build()
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).build().update(updateWrapper);
YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date()).build()
.update(updateWrapper1);
// 查询该员工的关联表
QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>();
......@@ -1442,7 +1533,7 @@ public class YgglController {
public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().jobStatus(2).build().update(updateWrapper);
YgglMainEmp.builder().jobStatus(YgEnumInterface.jobStatus.ZHENSHI.getType()).build().update(updateWrapper);
QueryWrapper<YgglMainLzb> queryWrapper = new QueryWrapper<YgglMainLzb>();
queryWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
// 删除离职表
......@@ -1760,7 +1851,7 @@ public class YgglController {
ageList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
}
// 在职
Integer zaizhi = jobStatus.get(1).intValue() + jobStatus.get(2).intValue();
Integer zaizhi = jobStatus.get(YgEnumInterface.jobStatus.ZHENSHI.getType()).intValue() + jobStatus.get(YgEnumInterface.jobStatus.SHIYONG.getType()).intValue();
// 本月新入职
Integer xinruzhi = workage.get("本月新入职").intValue();
// 本月离职
......
/**
* @date 2020年4月26日
* @author 翁东州
* @方法中文名称:
*/
package cn.timer.api.dto.yggl;
import java.io.Serializable;
import java.util.Date;
import cn.timer.api.dto.yggl.LzbDto.LzbDtoBuilder;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @date 2020年4月26日
* @author 翁东州
* @方法中文名称:
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LoginerChargeDto implements Serializable{
/**
* @date 2020年4月26日
* @author 翁东州
* @方法中文名称:
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value="主管empNum",example="9688")
private Integer leaderEmpNum;
@ApiModelProperty(value="主管名称",example="李大力")
private String charge;
}
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