Commit 5737ff20 by 东州 翁 Committed by chenzg

添加方法根据传来的empNum获取该人员的岗位,以及上面所有的部门id,返回integer数组,更正发票资料表的对应表名,工作性质从0开始

parent 7f2be3d9
...@@ -40,8 +40,8 @@ import lombok.NoArgsConstructor; ...@@ -40,8 +40,8 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Table(name="qyzx_invoice_data") @Table(name="qyzx_invoice_usual")
@ApiModel("发票资料表") @ApiModel("常用发票资料表")
public class QyzxInvoiceUsual extends Model<QyzxInvoiceUsual>{ public class QyzxInvoiceUsual extends Model<QyzxInvoiceUsual>{
private static final long serialVersionUID = 2890357568571822258L; private static final long serialVersionUID = 2890357568571822258L;
...@@ -82,6 +82,9 @@ public class QyzxInvoiceUsual extends Model<QyzxInvoiceUsual>{ ...@@ -82,6 +82,9 @@ public class QyzxInvoiceUsual extends Model<QyzxInvoiceUsual>{
@ApiModelProperty(value="邮箱",example="13144400255@163.com") @ApiModelProperty(value="邮箱",example="13144400255@163.com")
private String email; private String email;
@ApiModelProperty(value="收货地区",example="广东省广州市白云区")
private String shippingArea;
@ApiModelProperty(value="收货地址",example="白云东平伯曼酒店") @ApiModelProperty(value="收货地址",example="白云东平伯曼酒店")
private String shippingAddress; private String shippingAddress;
......
...@@ -127,7 +127,7 @@ public class YgglMainEmp extends Model<YgglMainEmp> { ...@@ -127,7 +127,7 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@ApiModelProperty(value="转正备注 ",example="转正备注") @ApiModelProperty(value="转正备注 ",example="转正备注")
private String zzRemark; private String zzRemark;
@ApiModelProperty(value="工作性质 1全职、2实习生、3兼职、4劳务派遣、5劳务、6派遣、7外包、8退休返聘",example="101") @ApiModelProperty(value="工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="101")
private Integer jobType; private Integer jobType;
@ApiModelProperty(value="员工状态 0试用、1正式、2离职中、3已离职",example="101") @ApiModelProperty(value="员工状态 0试用、1正式、2离职中、3已离职",example="101")
......
...@@ -231,6 +231,12 @@ public class QyzxController { ...@@ -231,6 +231,12 @@ public class QyzxController {
public Result<QyzxInvoiceUsual> invoiceusual(@CurrentUser UserBean userBean) { public Result<QyzxInvoiceUsual> invoiceusual(@CurrentUser UserBean userBean) {
QyzxInvoiceUsual one = new LambdaQueryChainWrapper<QyzxInvoiceUsual>(qyzxInvoiceUsualMapper) QyzxInvoiceUsual one = new LambdaQueryChainWrapper<QyzxInvoiceUsual>(qyzxInvoiceUsualMapper)
.eq(QyzxInvoiceUsual::getOrgCode, userBean.getOrgCode()).one(); .eq(QyzxInvoiceUsual::getOrgCode, userBean.getOrgCode()).one();
if (one.getShippingArea() == null) {
one.setShippingArea("");
}
if (one.getShippingAddress() == null) {
one.setShippingAddress("");
}
return ResultUtil.data(one, "显示常用的企业开票资料"); return ResultUtil.data(one, "显示常用的企业开票资料");
} }
......
package cn.timer.api.controller.zzgl; package cn.timer.api.controller.zzgl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import javax.transaction.Transactional; import javax.transaction.Transactional;
...@@ -21,12 +23,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -21,12 +23,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.hutool.core.collection.ListUtil;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth; import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM; import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper; import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper; import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
import cn.timer.api.dto.zzgl.LogDgjlsDto; import cn.timer.api.dto.zzgl.LogDgjlsDto;
...@@ -48,6 +51,9 @@ public class ZzglController { ...@@ -48,6 +51,9 @@ public class ZzglController {
@Autowired @Autowired
ZzglLogDgjlMapper zzglLogDgjlMapper; ZzglLogDgjlMapper zzglLogDgjlMapper;
@Autowired
YgglMainEmpMapper ygglMainEmpMapper;
/** /**
* 架构树/架构图/导出 * 架构树/架构图/导出
...@@ -63,6 +69,15 @@ public class ZzglController { ...@@ -63,6 +69,15 @@ public class ZzglController {
.eq(ZzglBmgwM::getOrgCode, orgCode).list(); .eq(ZzglBmgwM::getOrgCode, orgCode).list();
return ResultUtil.data(zzglBmgwMs); return ResultUtil.data(zzglBmgwMs);
} }
@GetMapping(value = "/depts")
@ApiOperation(value = "只获取部门", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglBmgwM>> selectdepts(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).list();//0:部门;1:岗位
return ResultUtil.data(zzglBmgwMs);
}
/** /**
* 岗位成员 * 岗位成员
...@@ -161,6 +176,8 @@ public class ZzglController { ...@@ -161,6 +176,8 @@ public class ZzglController {
@PostMapping(value = "/dept") @PostMapping(value = "/dept")
@ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明")
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM) { public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM) {
if (zzglBmgwM.getName().trim().length()==0)
return ResultUtil.error("部门岗位名称不能为空");
Boolean a = zzglBmgwM.getId() == null; Boolean a = zzglBmgwM.getId() == null;
if (a && zzglBmgwM.getType() == null) if (a && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0); zzglBmgwM.setType((Integer) 0);
...@@ -170,7 +187,39 @@ public class ZzglController { ...@@ -170,7 +187,39 @@ public class ZzglController {
return ResultUtil.data(zzglBmgwM); return ResultUtil.data(zzglBmgwM);
return ResultUtil.success(); return ResultUtil.success();
} }
//根据传来的empNum获取该人员的岗位,以及上面所有的部门id,返回integer数组
public List<Integer> empNumupdept(Integer orgCode,Integer empNum) {
Set<Integer> lanzi = new HashSet<Integer>();
//所有部门岗位
List<ZzglBmgwM> bmgws = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getOrgCode, orgCode).list();
//个人岗位
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
Integer getId = one.getBmgwId();
Set<Integer> all = empNumupdept2(lanzi, bmgws, getId);
return ListUtil.toList(all);
}
//遍历
public Set<Integer> empNumupdept2(Set<Integer> lanzi,List<ZzglBmgwM> bmgws,Integer getId) {
for (ZzglBmgwM z : bmgws) {
if (getId.equals(z.getId())) {
lanzi.add(getId);
if (z.getUpId()==null || z.getUpId() == 0) {
return lanzi;
}
getId = z.getUpId();
empNumupdept2(lanzi, bmgws, getId);
}
}
return lanzi;
}
/** /**
* 删除部门岗位 * 删除部门岗位
* *
......
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