Commit 7795245e by 邓实川 Committed by chenzg

客户管理实体、持久层、接口控制器

parent 88d554b2
/**
* <p>Title: IndustryClass.java</p>
* <p>Description: </p>
* @author dsc
* @date 2020年6月5日
* @version 1.0
*/
package cn.timer.api.bean.clazz;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <p>
* Title: CilentSourceClass.java
* </p>
* <p>
* Description:
* </p>
*
* @author dsc
* @date 2020年6月5日
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("客户来源字典表(1.0)")
public class ClientSourceClass extends Model<ClientSourceClass> {
private static final long serialVersionUID = 2504935692833727870L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键", example = "1")
private Integer id;
@ApiModelProperty(value = "来源名", example = "行业")
private String name;
@ApiModelProperty(value = "企业id", example = "企业")
private Integer orgCode;
}
/**
* <p>Title: IndustryClass.java</p>
* <p>Description: </p>
* @author dsc
* @date 2020年6月5日
* @version 1.0
*/
package cn.timer.api.bean.clazz;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <p>
* Title: CilentTypeClass.java
* </p>
* <p>
* Description:
* </p>
*
* @author dsc
* @date 2020年6月5日
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("客户类型字典表(1.0)")
public class ClientTypeClass extends Model<ClientTypeClass> {
private static final long serialVersionUID = 4910747953236931117L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键", example = "1")
private Integer id;
@ApiModelProperty(value = "类型名", example = "行业")
private String name;
@ApiModelProperty(value = "企业id", example = "企业")
private Integer orgCode;
}
......@@ -14,7 +14,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <p>
......@@ -28,6 +33,11 @@ import io.swagger.annotations.ApiModelProperty;
* @date 2020年6月5日
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("行业字典表(1.0)")
public class IndustryClass extends Model<IndustryClass> {
private static final long serialVersionUID = -5008126674106880292L;
......@@ -40,4 +50,8 @@ public class IndustryClass extends Model<IndustryClass> {
@ApiModelProperty(value = "行业名", example = "行业")
private String name;
@ApiModelProperty(value = "企业id", example = "企业")
private Integer orgCode;
}
......@@ -52,7 +52,7 @@ public class SysRegion extends Model<SysRegion>{
private String regionName;
@ApiModelProperty(value = "区域编码", example = "1")
private String regionCode;
private Integer regionCode;
@ApiModelProperty(value = "地名简称", example = "1")
private String simpleName;
......
......@@ -66,24 +66,6 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> {
@ApiModelProperty(value = "业务组管理员名称")
private String managerName;
// @ApiModelProperty(value = "回收规则id")
// private Integer ruleId;
@ApiModelProperty(value = "添加客户之后(one)天没有跟进 (以跟进记录为准)")
private Integer one;
@ApiModelProperty(value = "距上次跟进(two)天没有再次跟进 (以跟进记录为准)")
private Integer two;
@ApiModelProperty(value = "添加客户之后(three)天没有成交 (天数必须大于规则1)")
private Integer three;
@ApiModelProperty(value = "系统提前(four)天自动提醒业务员客户将被回收")
private Integer four;
@ApiModelProperty(value = "我的客户数量最多(five)人(合作中的不算)")
private Integer five;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
......@@ -100,11 +82,17 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> {
@ApiModelProperty(value = "企业id")
private Integer orgCode;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "组成员id")
private Integer[] ids;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "回收规则")
private CrmSeaRule crmSeaRules;
// @ApiModelProperty(value = "组成员empNum(字符串,分割)",example = "1,2,3")
// private String member;
//
......
/**
* Title: CrmClientAssociates.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.bean.crm;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Title: CrmClientAssociates.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "crm_client_associates")
@ApiModel("客户协作人表")
public class CrmClientAssociate extends Model<CrmClientAssociate> {
private static final long serialVersionUID = 6199712192983127587L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
@ApiModelProperty(value = "客户数据id")
private Integer cid;
@ApiModelProperty(value = "协作人id")
private Integer associateId;
@ApiModelProperty(value = "协作人企业id")
private Integer orgCode;
}
......@@ -43,7 +43,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@Table(name = "crm_client_contacts")
@ApiModel("客户联系人表")
public class CrmClientContacts extends Model<CrmClientContacts>{
public class CrmClientContacts extends Model<CrmClientContacts> {
private static final long serialVersionUID = 7527532835555744270L;
......@@ -76,7 +76,13 @@ public class CrmClientContacts extends Model<CrmClientContacts>{
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "企业id")
private Integer orgCode;
@ApiModelProperty(value = "公司")
private String company;
@ApiModelProperty(value = "备注")
private String remark;
// @ApiModelProperty(value = "企业id")
// private Integer orgCode;
}
......@@ -8,13 +8,17 @@
package cn.timer.api.bean.crm;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -45,7 +49,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@Table(name = "crm_client_data")
@ApiModel("客户数据表")
public class CrmClientData extends Model<CrmClientData>{
public class CrmClientData extends Model<CrmClientData> {
private static final long serialVersionUID = -5368056704790782780L;
......@@ -72,26 +76,34 @@ public class CrmClientData extends Model<CrmClientData>{
@ApiModelProperty(value = "行业名")
private String industryName;
@ApiModelProperty(value = "客户邮箱")
private String clientEmail;
@ApiModelProperty(value = "区编号")
private Integer keyId;
@ApiModelProperty(value = "省")
private String province;
@ApiModelProperty(value = "市")
private String city;
@ApiModelProperty(value = "区")
private String district;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "邮编")
private String zipCode;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "客户类型")
private String clientType;
@ApiModelProperty(value = "客户类型id")
private Integer clientType;
@ApiModelProperty(value = "客户来源")
private String clientSource;
@ApiModelProperty(value = "客户类型名")
private String clientTypeName;
@ApiModelProperty(value = "客户来源id")
private Integer clientSource;
@ApiModelProperty(value = "客户来源名")
private String clientSourceName;
@ApiModelProperty(value = "备注")
private String remarks;
......@@ -102,18 +114,51 @@ public class CrmClientData extends Model<CrmClientData>{
@ApiModelProperty(value = "客户所属人姓名")
private String belongUserName;
@ApiModelProperty(value = "协作人empNum")
private Integer associatesUser;
@ApiModelProperty(value = "客户所属业务组id")
private Integer belongGroup;
@ApiModelProperty(value = "协作人姓名")
private String associatesName;
@ApiModelProperty(value = "客户所属业务组名")
private String belongGroupName;
@ApiModelProperty(value = "客户数据状态 0-无 1-潜在 2-意向 3-签约 4-合作中 5-已封档")
private Integer clientStatus;
@ApiModelProperty(value = "附件地址")
private String fileUrl;
@ApiModelProperty(value = "客户联系人数量")
private Integer contactsNum;
@ApiModelProperty(value = "收藏关注 0-否 1-是")
private Integer star;
@ApiModelProperty(value = "创建人")
private Integer createUser;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间")
private Date createdTime;
private Date createTime;
@ApiModelProperty(value = "修改人")
private Integer modifyUser;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
@ApiModelProperty(value = "最近跟进时间")
private Date lastFollowTime;
@ApiModelProperty(value = "企业id")
private Integer orgCode;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "协作人id")
private Integer[] ids;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "客户联系人数据列表")
private List<CrmClientContacts> CrmClientContacts;
}
/**
* Title: CrmClientFollow.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.bean.crm;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Title: CrmClientFollow.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "crm_client_follow")
@ApiModel("客户数据跟进表")
public class CrmClientFollow extends Model<CrmClientFollow> {
private static final long serialVersionUID = -7362549097557018582L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
@ApiModelProperty(value = "客户数据id")
private Integer cid;
@ApiModelProperty(value = "跟进内容")
private Integer content;
@ApiModelProperty(value = "客户数据状态 0-无 1-潜在 2-意向 3-签约 4-合作中 5-已封档")
private String clientStatus;
@ApiModelProperty(value = "联系人姓名")
private String name;
@ApiModelProperty(value = "联系人公司")
private String company;
@ApiModelProperty(value = "联系人职位")
private String position;
@ApiModelProperty(value = "联系人手机号")
private String cellphone;
@ApiModelProperty(value = "创建人")
private Integer createUser;
@ApiModelProperty(value = "企业id")
private Integer orgCode;
@ApiModelProperty(value = "创建人姓名")
private String createUserName;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
......@@ -7,23 +7,39 @@
*/
package cn.timer.api.controller.crm;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.date.DateUtil;
import cn.timer.api.bean.clazz.ClientSourceClass;
import cn.timer.api.bean.clazz.ClientTypeClass;
import cn.timer.api.bean.clazz.IndustryClass;
import cn.timer.api.bean.clazz.SysRegion;
import cn.timer.api.bean.crm.CrmBusinessGroup;
import cn.timer.api.bean.crm.CrmBusinessGroupMember;
import cn.timer.api.bean.crm.CrmClientAssociate;
import cn.timer.api.bean.crm.CrmClientContacts;
import cn.timer.api.bean.crm.CrmClientData;
import cn.timer.api.bean.crm.CrmClientFollow;
import cn.timer.api.bean.crm.CrmSeaRule;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.utils.CheckUtil;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
......@@ -52,14 +68,33 @@ public class CrmController {
return userBean.getOrgCode();
}
@PostMapping("addClient")
@ApiOperation(value = "新增客户", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> addClient(@CurrentUser UserBean userBean, @RequestBody CrmClientData crmClientData) {
private YgglMainEmp getYg(Integer orgCode, Integer empNum) {
return YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).select(YgglMainEmp::getName));
}
crmClientData.setBelongUser(getEmpNum(userBean));
crmClientData.setOrgCode(getOrgCode(userBean));
crmClientData.setCreatedTime(new Date());
return null;
private String getEmpName(Integer orgCode, Integer empNum) {
return getYg(orgCode, empNum).getName();
}
@GetMapping("getIndustry")
@ApiOperation(value = "获取行业列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<IndustryClass>> getIndustry(@CurrentUser UserBean userBean) {
return ResultUtil.data(IndustryClass.builder().build().selectAll());
}
@GetMapping("getClientType")
@ApiOperation(value = "获取客户类型", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ClientTypeClass>> getClientType(@CurrentUser UserBean userBean) {
return ResultUtil.data(ClientTypeClass.builder().build().selectAll());
}
@GetMapping("getClientSource")
@ApiOperation(value = "获取客户来源", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ClientSourceClass>> getClientSource(@CurrentUser UserBean userBean) {
return ResultUtil.data(ClientSourceClass.builder().build().selectAll());
}
@PostMapping("addBusinessGroup")
......@@ -69,11 +104,6 @@ public class CrmController {
@RequestBody CrmBusinessGroup crmBusinessGroup) {
Integer orgCode = getOrgCode(userBean);
Integer empNum = getEmpNum(userBean);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, crmBusinessGroup.getManager()).select(YgglMainEmp::getName));
if (ygglMainEmp == null)
return ResultUtil.error("请确认添加的管理员是否存在");
String name = ygglMainEmp.getName();
CrmBusinessGroup crmBusinessGroupOld = CrmBusinessGroup.builder().build()
.selectOne(new QueryWrapper<CrmBusinessGroup>().lambda().eq(CrmBusinessGroup::getOrgCode, orgCode)
.select(CrmBusinessGroup::getSort).last("limit 1").orderByDesc(CrmBusinessGroup::getId));
......@@ -81,30 +111,253 @@ public class CrmController {
crmBusinessGroup.setSort(1);
else
crmBusinessGroup.setSort(crmBusinessGroupOld.getSort() + 1);// 排序
crmBusinessGroup.setManagerName(name); // 设置管理员姓名
crmBusinessGroup.setManagerName(getEmpName(orgCode, empNum)); // 设置管理员姓名
crmBusinessGroup.setCreateUser(empNum); // 创建人
crmBusinessGroup.setModifyUser(empNum); // 修改人
crmBusinessGroup.setOrgCode(orgCode);
// crmBusinessGroup.setMember(member); // ,字符串拼接
boolean result = crmBusinessGroup.insert();
if (!result)
return ResultUtil.success("保存失败");
return ResultUtil.success("新增失败");
Integer gid = crmBusinessGroup.getId();
Integer[] ids = crmBusinessGroup.getIds();
for (Integer empId : ids) {
CrmBusinessGroupMember.builder().gid(gid).empNum(empId).build().insert();
}
return ResultUtil.success("保存成功");
CrmSeaRule crmSeaRule = crmBusinessGroup.getCrmSeaRules();
crmSeaRule.setGid(gid);
crmSeaRule.insert();
return ResultUtil.success("新增业务组成功");
}
@GetMapping("getBusinessGroup")
@ApiOperation(value = "获取业务组列表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperation(value = "获取业务组列表", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroup(@CurrentUser UserBean userBean) {
return ResultUtil.data(CrmBusinessGroup.builder().build().selectList(
new QueryWrapper<CrmBusinessGroup>().lambda().eq(CrmBusinessGroup::getOrgCode, getOrgCode(userBean))),
return ResultUtil.data(CrmBusinessGroup.builder().build()
.selectList(new QueryWrapper<CrmBusinessGroup>().lambda()
.eq(CrmBusinessGroup::getOrgCode, getOrgCode(userBean)).select(CrmBusinessGroup::getId,
CrmBusinessGroup::getSort, CrmBusinessGroup::getName, CrmBusinessGroup::getManagerName,
CrmBusinessGroup::getModifyTime)),
"获取成功");
}
@GetMapping("getBusinessGroupMembers")
@ApiOperation(value = "获取业务组列表成员", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroupMembers(@CurrentUser UserBean userBean, @RequestParam Integer gid) {
List<CrmBusinessGroupMember> crmBusinessGroupMembers = CrmBusinessGroupMember.builder().build().selectList(
new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid));
List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>();
for (CrmBusinessGroupMember crmBusinessGroupMember : crmBusinessGroupMembers) {
ygglMainEmps.add(getYg(getOrgCode(userBean), crmBusinessGroupMember.getEmpNum()));
}
return ResultUtil.data(ygglMainEmps, "获取成功");
}
@GetMapping("getBusinessGroupRules")
@ApiOperation(value = "获取业务组公海规则", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroupRules(@RequestParam Integer gid) {
List<CrmSeaRule> crmSeaRules = CrmSeaRule.builder().build()
.selectList(new QueryWrapper<CrmSeaRule>().lambda().eq(CrmSeaRule::getGid, gid));
return ResultUtil.data(crmSeaRules, "获取成功");
}
private SysRegion getSysRegion(Integer keyId) {
return SysRegion.builder().build()
.selectOne(new QueryWrapper<SysRegion>().lambda().eq(SysRegion::getKeyId, keyId).select(
SysRegion::getRegionName, SysRegion::getKeyId, SysRegion::getZipCode,
SysRegion::getRegionCode));
}
@PostMapping("addClient")
@Transactional
@ApiOperation(value = "新增客户", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> addClient(@CurrentUser UserBean userBean, @RequestBody CrmClientData crmClientData) {
Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean);
crmClientData.setCreateUser(empNum);
SysRegion district = getSysRegion(crmClientData.getKeyId());
// crmClientData.setZipCode(district.getZipCode());
crmClientData.setDistrict(district.getRegionName());
SysRegion city = getSysRegion(district.getRegionCode());
crmClientData.setCity(city.getRegionName());
SysRegion province = getSysRegion(city.getRegionCode());
crmClientData.setProvince(province.getRegionName());
crmClientData.setBelongUserName(getEmpName(orgCode, crmClientData.getBelongUser()));
crmClientData.setOrgCode(getOrgCode(userBean));
Integer belongGroup = crmClientData.getBelongGroup();
String belongGroupName = CrmBusinessGroup.builder().id(belongGroup).build().selectById().getName();
crmClientData.setBelongGroupName(belongGroupName);
String clientSourceName = ClientSourceClass.builder().id(crmClientData.getClientSource()).build().selectById()
.getName(); // 客户来源
String clientTypeName = ClientTypeClass.builder().id(crmClientData.getClientType()).build().selectById()
.getName(); // 客户类型
String industryName = IndustryClass.builder().id(crmClientData.getIndustry()).build().selectById().getName();// 行业名
crmClientData.setClientSourceName(clientSourceName);
crmClientData.setClientTypeName(clientTypeName);
crmClientData.setIndustryName(industryName);
if (!crmClientData.insert())
return ResultUtil.error("新增失败");
Integer crmDataId = crmClientData.getId();
Integer[] ids = crmClientData.getIds();
for (Integer id : ids) {
CrmClientAssociate.builder().cid(crmDataId).associateId(id).orgCode(getOrgCode(userBean)).build().insert();
}
List<CrmClientContacts> crmClientContacts = crmClientData.getCrmClientContacts();
for (CrmClientContacts crmClientContact : crmClientContacts) {
crmClientContact.setCid(crmDataId);
crmClientContact.insert();
}
crmClientData.setContactsNum(crmClientContacts.size());
crmClientData.deleteById();
return ResultUtil.success("新增成功");
}
// 归属我的客户
private List<CrmClientData> getMyCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status) {
return CrmClientData.builder().build().selectList(new QueryWrapper<CrmClientData>().lambda()
.eq(CrmClientData::getOrgCode, orgCode).eq(CrmClientData::getBelongUser, empNum)
.eq(groupId != null, CrmClientData::getBelongGroup, groupId)
.eq(status != null, CrmClientData::getClientStatus, status).orderByDesc(CrmClientData::getCreateTime));
}
// 我协作的客户
private List<CrmClientData> getMyAssociateCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status) {
List<CrmClientAssociate> crmClientAssociates = CrmClientAssociate.builder().build().selectList(
new QueryWrapper<CrmClientAssociate>().lambda().eq(CrmClientAssociate::getAssociateId, empNum)
.eq(CrmClientAssociate::getOrgCode, orgCode).select(CrmClientAssociate::getCid));
List<CrmClientData> myCrmClientAssociates = new ArrayList<CrmClientData>();
for (CrmClientAssociate crmClientAssociate : crmClientAssociates) {
Integer cid = crmClientAssociate.getCid();
CrmClientData crmClientData = CrmClientData.builder().build()
.selectOne(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getId, cid)
.eq(groupId != null, CrmClientData::getBelongGroup, groupId)
.eq(status != null, CrmClientData::getClientStatus, status));
myCrmClientAssociates.add(crmClientData);
}
return myCrmClientAssociates;
}
// 我的全部客户
private List<CrmClientData> getMyTotalCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status) {
return CheckUtil.distinct(getMyCilent(empNum, orgCode, groupId, status),
getMyAssociateCilent(empNum, orgCode, groupId, status), true);
}
// 我关注的客户
private List<CrmClientData> getMyStarCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status) {
List<CrmClientData> crmClientDatas = getMyTotalCilent(empNum, orgCode, groupId, status);
crmClientDatas.stream().filter(item -> item.getStar().equals(1)).findAny();
return crmClientDatas;
}
// 七天未跟进的客户
private List<CrmClientData> getCilentFollowOvertime(Integer empNum, Integer orgCode, Integer groupId,
Integer status) {
List<CrmClientData> crmClientDatas = getMyTotalCilent(empNum, orgCode, groupId, status);
crmClientDatas.stream().filter(item -> item.getCreateTime().after(DateUtil.offsetHour(new Date(), -7)))
.findAny(); // TODO
return crmClientDatas;
}
@GetMapping("getMyCilentTotal")
@ApiOperation(value = "获取我的客户列表(全)", httpMethod = "GET", notes = "接口发布说明")
public Result<List<CrmClientData>> getMyCilentTotal(@CurrentUser UserBean userBean,
@RequestParam(required = false, defaultValue = "0") Integer type,
@RequestParam(required = false) Integer groupId, @RequestParam(required = false) Integer status) {
Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean);
List<CrmClientData> crmClientDatas = null;
if (type == null || type == 0) // 全部客户(去重)
crmClientDatas = CheckUtil.distinct(getMyCilent(empNum, orgCode, groupId, status),
getMyAssociateCilent(empNum, orgCode, groupId, status), true);
else if (type == 1) // 我负责的客户
crmClientDatas = getMyCilent(empNum, orgCode, groupId, status);
else if (type == 2) // 我协作的客户
crmClientDatas = getMyAssociateCilent(empNum, orgCode, groupId, status);
else if (type == 3) // 我关注的客户
crmClientDatas = getMyStarCilent(empNum, orgCode, groupId, status);
else if (type == 4) // 七天未跟进的客户
crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status);
else
;
Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序
return ResultUtil.data(crmClientDatas, "查询成功");
}
@PostMapping("addCilentLinkMan")
@Transactional
@ApiOperation(value = "新增/编辑客户联系人", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> addCilentLinkMan(@CurrentUser UserBean userBean, CrmClientContacts crmClientContacts) {
if (crmClientContacts.getId() == null) {
Integer num = CrmClientData.builder().build().selectById().getContactsNum();
CrmClientData.builder().id(crmClientContacts.getCid()).contactsNum(++num).build().updateById();
}
if (crmClientContacts.insertOrUpdate())
return ResultUtil.success("新增/编辑成功");
return ResultUtil.success("新增/编辑失败");
}
@DeleteMapping("delCilentLinkMan")
@Transactional
@ApiOperation(value = "删除客户联系人", httpMethod = "DELETE", notes = "接口发布说明")
public Result<Void> delCilentLinkMan(@CurrentUser UserBean userBean, CrmClientContacts crmClientContacts) {
Integer num = CrmClientData.builder().build().selectById().getContactsNum();
CrmClientData.builder().id(crmClientContacts.getCid()).contactsNum(--num).build().updateById();
if (crmClientContacts.deleteById())
return ResultUtil.success("删除成功");
return ResultUtil.success("删除失败");
}
@GetMapping("getCilentLinkMan")
@ApiOperation(value = "获取客户联系人列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<CrmClientContacts>> getCilentLinkMan(@CurrentUser UserBean userBean, Integer cid) {
return ResultUtil.data(CrmClientContacts.builder().build()
.selectList(new QueryWrapper<CrmClientContacts>().lambda().eq(CrmClientContacts::getCid, cid)), "获取成功");
}
@PostMapping("addClientStar")
@ApiOperation(value = "新增客户收藏(仅归属人)", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> addClientStar(@CurrentUser UserBean userBean, @RequestParam Integer cid) {
Integer empNum = getEmpNum(userBean);
CrmClientData crmClientData = CrmClientData.builder().id(cid).build().selectById();
if (crmClientData == null)
return ResultUtil.error("请确认该客户是否存在");
if (!crmClientData.getBelongUser().equals(empNum))
return ResultUtil.error("不是当前客户归属人");
if (CrmClientData.builder().id(cid).star(1).build().updateById())
return ResultUtil.success("收藏成功");
return ResultUtil.error("收藏失败");
}
@PostMapping("addClientFollow")
@Transactional
@ApiOperation(value = "新增跟进记录", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> addClientFollow(@CurrentUser UserBean userBean, @RequestBody CrmClientFollow crmClientFollow) {
Integer orgCode = getOrgCode(userBean);
Integer empNum = getEmpNum(userBean);
CrmClientData.builder().id(crmClientFollow.getCid()).lastFollowTime(new Date()).build().updateById(); // 更新客户最近跟进时间
crmClientFollow.setOrgCode(orgCode);
crmClientFollow.setCreateUserName(getEmpName(orgCode, empNum));
if (crmClientFollow.insert())
return ResultUtil.success("新增成功");
return ResultUtil.error("新增失败");
}
@GetMapping("getCilentFollow")
@ApiOperation(value = "获取跟进记录", httpMethod = "GET", notes = "接口发布说明")
public Result<List<CrmClientFollow>> getCilentFollow(@CurrentUser UserBean userBean, @RequestParam Integer cid) {
Integer orgCode = getOrgCode(userBean);
return ResultUtil.data(CrmClientFollow.builder().build().selectList(new QueryWrapper<CrmClientFollow>().lambda()
.eq(CrmClientFollow::getOrgCode, orgCode).eq(CrmClientFollow::getCid, cid)), "获取成功");
}
// TODO
}
......@@ -126,7 +126,7 @@ public class YgglController {
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
......@@ -156,8 +156,7 @@ public class YgglController {
Integer empNum = userBean.getEmpNum();
Integer orgCode = userBean.getOrgCode();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, empNum));
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum));
Date rz = ygglMainEmp.getRzTime();
if (rz != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(rz, new Date(), Level.DAY));
......@@ -172,8 +171,7 @@ public class YgglController {
public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
Integer orgCode = userBean.getOrgCode();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, empNum));
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum));
Date rz = ygglMainEmp.getRzTime();
if (rz != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(), Level.DAY));
......@@ -195,19 +193,16 @@ public class YgglController {
return ResultUtil.data("岗位不存在");
}
Integer orgCode = userBean.getOrgCode();
ZzglBmgwM zzglBmgwM = ZzglBmgwM.builder().build().selectOne(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, orgCode)
.eq(ZzglBmgwM::getId, gwid));
ZzglBmgwM zzglBmgwM = ZzglBmgwM.builder().build().selectOne(
new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getId, gwid));
String gw = null;
Integer bmid = null;
if (zzglBmgwM != null) {
gw = zzglBmgwM.getName();
bmid = zzglBmgwM.getUpId();
}
ZzglBmgwM z = ZzglBmgwM.builder().build()
.selectOne(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, orgCode)
.eq(ZzglBmgwM::getId, bmid));
ZzglBmgwM z = ZzglBmgwM.builder().build().selectOne(
new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getId, bmid));
String bm = null;
if (z != null) {
bm = z.getName();
......@@ -226,7 +221,8 @@ public class YgglController {
@PostMapping(value = "/addygda")
@ApiOperation(value = "4.添加员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 4)
public Result<Object> addygda(@CurrentUser UserBean userBean, @Validated @RequestBody AddygdaDto addygdaDto) throws Exception {
public Result<Object> addygda(@CurrentUser UserBean userBean, @Validated @RequestBody AddygdaDto addygdaDto)
throws Exception {
Integer orgCode = userBean.getOrgCode();
String name = addygdaDto.getName();
String phone = addygdaDto.getPhone();
......@@ -258,7 +254,7 @@ public class YgglController {
if (!isvalid) {
return ResultUtil.error("证件格式不对!");
}
Integer jobType = addygdaDto.getJobType();
Date rzTime = addygdaDto.getRzTime() == null ? new Date() : addygdaDto.getRzTime();
Integer syq = addygdaDto.getSyq();
......@@ -276,27 +272,23 @@ public class YgglController {
return ResultUtil.error("添加员工登录表失败,请检查输入信息");
}
}
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode));
if (ygglMainEmp == null) {
QyzxEmpEntAsso.builder()
.empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType())
.build()
.insert();
ygglMainEmp = YgglMainEmp.builder()
.name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime)
.syq(syq).sex(sex).empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId)
.build();
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType())
.status(CommonEnum.U_STS_ON.getType()).build().insert();
ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
ygglMainEmp.insert();
return ResultUtil.data(ygglMainEmp, "添加员工成功!");
} else {
return ResultUtil.error("该手机号已被使用,请输入正确手机号");
}
}
/**
......@@ -311,23 +303,21 @@ public class YgglController {
public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp)
throws Exception {
if (ObjectUtil.isAllNotEmpty(ygglMainEmp.getRzTime(),ygglMainEmp.getZzTime()) &&
!DateFormatUtils.getCompareDate(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())) {
if (ObjectUtil.isAllNotEmpty(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())
&& !DateFormatUtils.getCompareDate(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())) {
ResultUtil.error("入职日期 不可以大于 转正日期");
}
if (ygglMainEmp.getEmpNum() != null) {
ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getEmpNum, ygglMainEmp.getEmpNum()));
ygglMainEmp
.update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getEmpNum, ygglMainEmp.getEmpNum()));
return ResultUtil.data(ygglMainEmp, "修改成功");
}
return ResultUtil.data(ygglMainEmp, "修改成功");
}
/**
* 员工搜索
......@@ -354,9 +344,11 @@ public class YgglController {
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda()
.select(YgglMainEmp::getName, YgglMainEmp::getEmpNum, YgglMainEmp::getBmgwId, YgglMainEmp::getRzTime, YgglMainEmp::getJobType, YgglMainEmp::getPhone, YgglMainEmp::getJobStatus)
.ne(YgglMainEmp::getJobStatus, YgEnumInterface.jobStatus.YILIZHI.getType()).eq(YgglMainEmp::getOrgCode, orgCode)
.eq(t != null && t > -1, YgglMainEmp::getJobType, t).eq(j != null && j > -1, YgglMainEmp::getJobStatus, j)
.select(YgglMainEmp::getName, YgglMainEmp::getEmpNum, YgglMainEmp::getBmgwId, YgglMainEmp::getRzTime,
YgglMainEmp::getJobType, YgglMainEmp::getPhone, YgglMainEmp::getJobStatus)
.ne(YgglMainEmp::getJobStatus, YgEnumInterface.jobStatus.YILIZHI.getType())
.eq(YgglMainEmp::getOrgCode, orgCode).eq(t != null && t > -1, YgglMainEmp::getJobType, t)
.eq(j != null && j > -1, YgglMainEmp::getJobStatus, j)
.in(!bList.isEmpty(), YgglMainEmp::getBmgwId, bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like(YgglMainEmp::getName, q).or().like(YgglMainEmp::getPhone, q));
......@@ -373,48 +365,47 @@ public class YgglController {
@PostMapping(value = "/import_emp_record")
@ApiOperation(value = "7.导入员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 7)
public Result<JSONObject> importEmpRecord(
@CurrentUser UserBean userBean ,@Validated @RequestBody ValidList<AddygdaDto> listAddygdaDto ) throws Exception {
public Result<JSONObject> importEmpRecord(@CurrentUser UserBean userBean,
@Validated @RequestBody ValidList<AddygdaDto> listAddygdaDto) throws Exception {
Integer orgCode = userBean.getOrgCode();
// 查询所有员工手机号
// List<QyzxEmpLogin> listEl = qyzxEmpLoginMapper
// .selectList(new QueryWrapper<QyzxEmpLogin>().lambda()
// .select(QyzxEmpLogin::getPhone));
List<YgglMainEmp> listMe = ygglMainEmpMapper
.selectList(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, orgCode)
.select(YgglMainEmp::getPhone,YgglMainEmp::getZjNum));
listMe = listMe != null ? listMe.stream()
.filter(o -> o != null && o.getPhone() != null).collect(Collectors.toList()) : null;
List<YgglMainEmp> listMe = ygglMainEmpMapper.selectList(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, orgCode).select(YgglMainEmp::getPhone, YgglMainEmp::getZjNum));
listMe = listMe != null
? listMe.stream().filter(o -> o != null && o.getPhone() != null).collect(Collectors.toList())
: null;
// 抽取 登录表 的phone的集合
List<String> listPhone = listMe.stream().map(YgglMainEmp::getPhone).collect(Collectors.toList());
// 抽取 登录表 的zjNum的集合
List<String> listzjNum = listMe.stream().map(YgglMainEmp::getZjNum).collect(Collectors.toList());
List<YgglMainEmp> listYmp = new ArrayList<YgglMainEmp>();
// 过滤掉 导入数据中, listPhone已存在 的 phone 的对象集合
List<AddygdaDto> list = listAddygdaDto.stream()
.filter(o -> o != null && !listPhone.contains(o.getPhone()) && !listzjNum.contains(o.getZjNum())).collect(Collectors.toList());
.filter(o -> o != null && !listPhone.contains(o.getPhone()) && !listzjNum.contains(o.getZjNum()))
.collect(Collectors.toList());
// 过滤出 导入数据中, listPhone已存在 的 phone 的对象集合
List<AddygdaDto> phoneRepetitions = listAddygdaDto.stream()
.filter(o -> o != null && listPhone.contains(o.getPhone())).collect(Collectors.toList());
// 过滤出 导入数据中, listzjNum 已存在 的 ZjNum 的对象集合
List<AddygdaDto> idCardRepetitions = listAddygdaDto.stream()
.filter(o -> o != null && listzjNum.contains(o.getZjNum())).collect(Collectors.toList());
List<YgglMainEmp> insertErrors = new ArrayList<YgglMainEmp>();
YgglMainEmp yme;
for (AddygdaDto ad : list) {
String name = ad.getName();
String phone = ad.getPhone();
Integer zjType = ad.getZjType();
......@@ -445,75 +436,69 @@ public class YgglController {
Integer syq = ad.getSyq();
Integer sex = ad.getSex();
Integer bmgwId = ad.getBmgwId();
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
if (login == null) {
// 初始化密码 pwd
login = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pwd))
.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(name).build();
login = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pwd)).sts(CommonEnum.U_STS_ON.getType())
.orgId(userBean.getOrgCode()).username(name).build();
if (!login.insert()) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("添加员工登录表失败,请检查输入信息");
}
}
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode)
.userType(SysRoleType.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType()).build().insert();// usertype2普通员工 status1正常
yme = YgglMainEmp.builder()
.name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime)
.syq(syq).sex(sex).empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId)
.build();
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType())
.status(CommonEnum.U_STS_ON.getType()).build().insert();// usertype2普通员工 status1正常
yme = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
if (yme.insert()) {
listYmp.add(yme);
}else {
} else {
// 存放 插入失败的 数据
insertErrors.add(yme);
}
}
JSONObject obj = JSONUtil.createObj();
obj.set("empList", listYmp);
obj.set("phoneRepetitions", phoneRepetitions);
obj.set("idCardRepetitions", idCardRepetitions);
obj.set("insertErrors", insertErrors);
//listEl.stream().filter(i -> i != null).collect(Collectors.<QyzxEmpLogin>toList());
// listEl.stream().filter(i -> i !=
// null).collect(Collectors.<QyzxEmpLogin>toList());
return ResultUtil.data(obj, "导入员工档案成功!");
}
/**
* 获取导入模板
*
* @param
* @return
* @throws IOException
* @throws IOException
*/
@GetMapping(value = "/impoet_template")
@ApiOperation(value = "8.获取导入模板", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 8)
public Result<Object> getImpoetTemplate(HttpServletResponse response) throws IOException {
ImportEmpDto ied = ImportEmpDto.builder()
.name("张三")
.phone("15219671123")
ImportEmpDto ied = ImportEmpDto.builder().name("张三").phone("15219671123")
// 证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他
.zjType(0)
.zjNum("445381199611063586")
.zjType(0).zjNum("445381199611063586")
// 工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘
.jobType(0)
.rzTime("2010-10-10 10:10:10")
.jobType(0).rzTime("2010-10-10 10:10:10")
// 试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)
.syq(1)
// 性别 0:男;1:女
.sex(0)
.build();
.sex(0).build();
List<ImportEmpDto> listAd = CollUtil.newArrayList(ied);
// 通过工具类创建writer
ExcelWriter writer = ExcelUtil.getWriter(true);
//自定义标题别名
// 自定义标题别名
writer.addHeaderAlias("name", "姓名");
writer.addHeaderAlias("phone", "手机号");
writer.addHeaderAlias("sex", "性别");
......@@ -522,7 +507,7 @@ public class YgglController {
writer.addHeaderAlias("jobType", "工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘");
writer.addHeaderAlias("syq", "试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)");
writer.addHeaderAlias("rzTime", "入职日期");
// 合并单元格后的标题行,使用默认标题样式
writer.merge(7, "员工导入模板");
writer.setFreezePane(2);
......@@ -531,17 +516,17 @@ public class YgglController {
writer.setColumnWidth(7, 20);
// 一次性写出内容,使用默认样式,强制输出标题
writer.write(listAd, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=8timer_emp_import.xlsx");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=8timer_emp_import.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
// 关闭writer,释放内存
writer.close();
//此处记得关闭输出Servlet流
// 此处记得关闭输出Servlet流
IoUtil.close(out);
return ResultUtil.data(null, "获取模板成功");
}
......@@ -557,7 +542,7 @@ public class YgglController {
@ApiOperationSupport(order = 9)
public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) {
List<YgglMainEmp> list = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getJobStatus, 1,2,3).list();
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getJobStatus, 1, 2, 3).list();
return ResultUtil.data(list, "导出员工成功");
}
......@@ -571,10 +556,9 @@ public class YgglController {
@ApiOperation(value = "10.获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 10)
public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean) {
List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaJyjlb>().lambda()
.eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJyjlb::getEmpNum,userBean.getEmpNum()));
List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build().selectList(
new QueryWrapper<YgglAttaJyjlb>().lambda().eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJyjlb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaJyjlbss);
}
......@@ -583,10 +567,9 @@ public class YgglController {
@ApiOperation(value = "11.获取员工教育经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 11)
public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build().selectList(
new QueryWrapper<YgglAttaJyjlb>().lambda()
.eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJyjlb::getEmpNum, empNum));
List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaJyjlb>().lambda()
.eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaJyjlb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaJyjlbs);
}
......@@ -617,10 +600,8 @@ public class YgglController {
@ApiOperationSupport(order = 13)
public Result<Boolean> deljyjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJyjlb.builder().build()
.delete(new QueryWrapper<YgglAttaJyjlb>().lambda()
.eq(YgglAttaJyjlb::getOrgCode, orgCode)
.eq(YgglAttaJyjlb::getId, id)), "删除员工教育经历表成功");
return ResultUtil.data(YgglAttaJyjlb.builder().build().delete(new QueryWrapper<YgglAttaJyjlb>().lambda()
.eq(YgglAttaJyjlb::getOrgCode, orgCode).eq(YgglAttaJyjlb::getId, id)), "删除员工教育经历表成功");
}
/**
......@@ -645,10 +626,9 @@ public class YgglController {
@ApiOperation(value = "15.获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 15)
public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build().selectList(
new QueryWrapper<YgglAttaPxjlxxb>().lambda()
.eq(YgglAttaPxjlxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaPxjlxxb::getEmpNum, empNum));
List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
.eq(YgglAttaPxjlxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaPxjlxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaPxjlxxbs);
}
......@@ -680,10 +660,8 @@ public class YgglController {
@ApiOperationSupport(order = 17)
public Result<Boolean> delpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaPxjlxxb.builder().build()
.delete(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
.eq(YgglAttaPxjlxxb::getOrgCode, orgCode)
.eq(YgglAttaPxjlxxb::getId, id)), "删除员工培训经历信息表成功");
return ResultUtil.data(YgglAttaPxjlxxb.builder().build().delete(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
.eq(YgglAttaPxjlxxb::getOrgCode, orgCode).eq(YgglAttaPxjlxxb::getId, id)), "删除员工培训经历信息表成功");
}
/**
......@@ -696,9 +674,8 @@ public class YgglController {
@ApiOperation(value = "18.获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 18)
public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean) {
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaGzjlb>().lambda()
.eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode())
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(
new QueryWrapper<YgglAttaGzjlb>().lambda().eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzjlb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzjlbs);
}
......@@ -708,10 +685,9 @@ public class YgglController {
@ApiOperation(value = "19.获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 19)
public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(
new QueryWrapper<YgglAttaGzjlb>().lambda()
.eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzjlb::getEmpNum, empNum));
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaGzjlb>().lambda()
.eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaGzjlb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaGzjlbs);
}
......@@ -742,10 +718,8 @@ public class YgglController {
@ApiOperationSupport(order = 21)
public Result<Boolean> delgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzjlb.builder().build()
.delete(new QueryWrapper<YgglAttaGzjlb>().lambda()
.eq(YgglAttaGzjlb::getOrgCode, orgCode)
.eq(YgglAttaGzjlb::getId, id)), "删除员工工作经历表成功");
return ResultUtil.data(YgglAttaGzjlb.builder().build().delete(new QueryWrapper<YgglAttaGzjlb>().lambda()
.eq(YgglAttaGzjlb::getOrgCode, orgCode).eq(YgglAttaGzjlb::getId, id)), "删除员工工作经历表成功");
}
/**
......@@ -758,9 +732,8 @@ public class YgglController {
@ApiOperation(value = "22.获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 22)
public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean) {
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaZcxxb>().lambda()
.eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode())
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(
new QueryWrapper<YgglAttaZcxxb>().lambda().eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZcxxb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaZcxxbs);
}
......@@ -770,10 +743,9 @@ public class YgglController {
@ApiOperation(value = "23.获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 23)
public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(
new QueryWrapper<YgglAttaZcxxb>().lambda()
.eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZcxxb::getEmpNum, empNum));
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaZcxxb>().lambda()
.eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaZcxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaZcxxbs);
}
......@@ -804,10 +776,8 @@ public class YgglController {
@ApiOperationSupport(order = 25)
public Result<Boolean> delzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZcxxb.builder().build()
.delete(new QueryWrapper<YgglAttaZcxxb>().lambda()
.eq(YgglAttaZcxxb::getOrgCode, orgCode)
.eq(YgglAttaZcxxb::getId, id)), "删除员工职称信息表成功");
return ResultUtil.data(YgglAttaZcxxb.builder().build().delete(new QueryWrapper<YgglAttaZcxxb>().lambda()
.eq(YgglAttaZcxxb::getOrgCode, orgCode).eq(YgglAttaZcxxb::getId, id)), "删除员工职称信息表成功");
}
/**
......@@ -820,10 +790,9 @@ public class YgglController {
@ApiOperation(value = "26.获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 26)
public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean) {
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build()
.selectList(new QueryWrapper<YgglAttaZszjb>().lambda()
.eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZszjb::getEmpNum,userBean.getEmpNum()));
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build().selectList(
new QueryWrapper<YgglAttaZszjb>().lambda().eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZszjb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaZszjbs);
}
......@@ -832,10 +801,9 @@ public class YgglController {
@ApiOperation(value = "27.获取员工证书证件表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 27)
public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build().selectList(
new QueryWrapper<YgglAttaZszjb>().lambda()
.eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZszjb::getEmpNum, empNum));
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build()
.selectList(new QueryWrapper<YgglAttaZszjb>().lambda()
.eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaZszjb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaZszjbs);
}
......@@ -866,10 +834,8 @@ public class YgglController {
@ApiOperationSupport(order = 29)
public Result<Boolean> delzszjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZszjb.builder().build()
.delete(new QueryWrapper<YgglAttaZszjb>().lambda()
.eq(YgglAttaZszjb::getOrgCode, orgCode)
.eq(YgglAttaZszjb::getId, id)), "删除员工证书证件表成功");
return ResultUtil.data(YgglAttaZszjb.builder().build().delete(new QueryWrapper<YgglAttaZszjb>().lambda()
.eq(YgglAttaZszjb::getOrgCode, orgCode).eq(YgglAttaZszjb::getId, id)), "删除员工证书证件表成功");
}
/**
......@@ -882,9 +848,8 @@ public class YgglController {
@ApiOperation(value = "30.获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 30)
public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean) {
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaLxxxb>().lambda()
.eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode())
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build().selectList(
new QueryWrapper<YgglAttaLxxxb>().lambda().eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaLxxxb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaLxxxbs);
}
......@@ -894,10 +859,9 @@ public class YgglController {
@ApiOperation(value = "31.获取员工联系信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 31)
public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build().selectList(
new QueryWrapper<YgglAttaLxxxb>().lambda()
.eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaLxxxb::getEmpNum, empNum));
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaLxxxb>().lambda()
.eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaLxxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaLxxxbs);
}
......@@ -928,10 +892,8 @@ public class YgglController {
@ApiOperationSupport(order = 33)
public Result<Boolean> dellxxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaLxxxb.builder().build()
.delete(new QueryWrapper<YgglAttaLxxxb>().lambda()
.eq(YgglAttaLxxxb::getOrgCode, orgCode)
.eq(YgglAttaLxxxb::getId, id)), "删除员工联系信息表成功");
return ResultUtil.data(YgglAttaLxxxb.builder().build().delete(new QueryWrapper<YgglAttaLxxxb>().lambda()
.eq(YgglAttaLxxxb::getOrgCode, orgCode).eq(YgglAttaLxxxb::getId, id)), "删除员工联系信息表成功");
}
/**
......@@ -944,9 +906,8 @@ public class YgglController {
@ApiOperation(value = "34.获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 34)
public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean) {
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build()
.selectList(new QueryWrapper<YgglAttaJjlxr>().lambda()
.eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode())
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build().selectList(
new QueryWrapper<YgglAttaJjlxr>().lambda().eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJjlxr::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaJjlxrs);
}
......@@ -956,10 +917,9 @@ public class YgglController {
@ApiOperation(value = "35.获取员工紧急联系人表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 35)
public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build().selectList(
new QueryWrapper<YgglAttaJjlxr>().lambda()
.eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJjlxr::getEmpNum, empNum));
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build()
.selectList(new QueryWrapper<YgglAttaJjlxr>().lambda()
.eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode()).eq(YgglAttaJjlxr::getEmpNum, empNum));
return ResultUtil.data(ygglAttaJjlxrs);
}
......@@ -990,10 +950,8 @@ public class YgglController {
@ApiOperationSupport(order = 37)
public Result<Boolean> deljjlxr(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJjlxr.builder().build()
.delete(new QueryWrapper<YgglAttaJjlxr>().lambda()
.eq(YgglAttaJjlxr::getOrgCode, orgCode)
.eq(YgglAttaJjlxr::getId, id)), "删除员工紧急联系人表成功");
return ResultUtil.data(YgglAttaJjlxr.builder().build().delete(new QueryWrapper<YgglAttaJjlxr>().lambda()
.eq(YgglAttaJjlxr::getOrgCode, orgCode).eq(YgglAttaJjlxr::getId, id)), "删除员工紧急联系人表成功");
}
// 获取工资卡信息
......@@ -1008,8 +966,7 @@ public class YgglController {
@ApiOperationSupport(order = 38)
public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean) {
List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build()
.selectList(new QueryWrapper<YgglAttaGzk>().lambda()
.eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode())
.selectList(new QueryWrapper<YgglAttaGzk>().lambda().eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzk::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzks);
}
......@@ -1019,10 +976,8 @@ public class YgglController {
@ApiOperation(value = "39.获取员工工资卡信息(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 39)
public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(
new QueryWrapper<YgglAttaGzk>().lambda()
.eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzk::getEmpNum, empNum));
List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(new QueryWrapper<YgglAttaGzk>()
.lambda().eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode()).eq(YgglAttaGzk::getEmpNum, empNum));
return ResultUtil.data(ygglAttaGzks);
}
......@@ -1053,10 +1008,8 @@ public class YgglController {
@ApiOperationSupport(order = 41)
public Result<Boolean> delgzk(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzk.builder().build()
.delete(new QueryWrapper<YgglAttaGzk>().lambda()
.eq(YgglAttaGzk::getOrgCode, orgCode)
.eq(YgglAttaGzk::getId, id)), "删除工资卡信息成功");
return ResultUtil.data(YgglAttaGzk.builder().build().delete(new QueryWrapper<YgglAttaGzk>().lambda()
.eq(YgglAttaGzk::getOrgCode, orgCode).eq(YgglAttaGzk::getId, id)), "删除工资卡信息成功");
}
/**
......@@ -1069,9 +1022,8 @@ public class YgglController {
@ApiOperation(value = "42.获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 42)
public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean) {
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaHtxxb>().lambda()
.eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode())
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build().selectList(
new QueryWrapper<YgglAttaHtxxb>().lambda().eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaHtxxb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaHtxxbs);
}
......@@ -1081,10 +1033,9 @@ public class YgglController {
@ApiOperation(value = "43.获取员工合同信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 43)
public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build().selectList(
new QueryWrapper<YgglAttaHtxxb>().lambda()
.eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaHtxxb::getEmpNum, empNum));
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaHtxxb>().lambda()
.eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaHtxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaHtxxbs);
}
......@@ -1115,10 +1066,8 @@ public class YgglController {
@ApiOperationSupport(order = 45)
public Result<Boolean> delhtxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaHtxxb.builder().build()
.delete(new QueryWrapper<YgglAttaHtxxb>().lambda()
.eq(YgglAttaHtxxb::getOrgCode, orgCode)
.eq(YgglAttaHtxxb::getId, id)), "删除员工合同信息表成功");
return ResultUtil.data(YgglAttaHtxxb.builder().build().delete(new QueryWrapper<YgglAttaHtxxb>().lambda()
.eq(YgglAttaHtxxb::getOrgCode, orgCode).eq(YgglAttaHtxxb::getId, id)), "删除员工合同信息表成功");
}
/**
......@@ -1131,9 +1080,8 @@ public class YgglController {
@ApiOperation(value = "46.获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 46)
public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean) {
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build()
.selectList(new QueryWrapper<YgglAttaClfjb>().lambda()
.eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode())
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build().selectList(
new QueryWrapper<YgglAttaClfjb>().lambda().eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaClfjb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaClfjbs);
}
......@@ -1143,10 +1091,9 @@ public class YgglController {
@ApiOperation(value = "47.获取员工材料附件表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 47)
public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build().selectList(
new QueryWrapper<YgglAttaClfjb>().lambda()
.eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaClfjb::getEmpNum, empNum));
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build()
.selectList(new QueryWrapper<YgglAttaClfjb>().lambda()
.eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaClfjb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaClfjbs);
}
......@@ -1177,10 +1124,8 @@ public class YgglController {
@ApiOperationSupport(order = 49)
public Result<Boolean> delclfjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaClfjb.builder().build()
.delete(new QueryWrapper<YgglAttaClfjb>().lambda()
.eq(YgglAttaClfjb::getOrgCode, orgCode)
.eq(YgglAttaClfjb::getId, id)), "删除员工材料附件表成功");
return ResultUtil.data(YgglAttaClfjb.builder().build().delete(new QueryWrapper<YgglAttaClfjb>().lambda()
.eq(YgglAttaClfjb::getOrgCode, orgCode).eq(YgglAttaClfjb::getId, id)), "删除员工材料附件表成功");
}
/**
......@@ -1193,9 +1138,8 @@ public class YgglController {
@ApiOperation(value = "50.获取成长记录表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 50)
public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean) {
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaCzjlb>().lambda()
.eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode())
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build().selectList(
new QueryWrapper<YgglAttaCzjlb>().lambda().eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaCzjlb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaCzjlbs);
}
......@@ -1205,10 +1149,9 @@ public class YgglController {
@ApiOperation(value = "51.获取成长记录表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 51)
public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build().selectList(
new QueryWrapper<YgglAttaCzjlb>().lambda()
.eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaCzjlb::getEmpNum, empNum));
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaCzjlb>().lambda()
.eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaCzjlb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaCzjlbs);
}
......@@ -1253,10 +1196,10 @@ public class YgglController {
@ApiOperation(value = "54.员工转正", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 54)
public Result<Void> ygzz(@CurrentUser UserBean userBean, @RequestBody YgzzDto ygzzDto) {
YgglMainEmp.builder().jobStatus(jobStatus.ZHENSHI.getType()).zzTime(ygzzDto.getZzTime()).sjzzTime(new Date())
.zzRemark(ygzzDto.getZzRemark()).build().update(new UpdateWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
.zzRemark(ygzzDto.getZzRemark()).build()
.update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
return ResultUtil.success("转正成功!");
}
......@@ -1274,19 +1217,18 @@ public class YgglController {
Integer empNum = lzygQueryDto.getEmpNum();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
.eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb,"before_leaving_sts");
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
ygglMainLzb.insert();
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).beforeLeavingSts(ygglMainEmp.getJobStatus())
.build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, empNum));
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType())
.beforeLeavingSts(ygglMainEmp.getJobStatus()).build()
.update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, empNum));
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, empNum));
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build()
.update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, empNum));
return ResultUtil.data(ygglMainLzb, "添加待离职员工成功");
}
......@@ -1308,15 +1250,16 @@ public class YgglController {
YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date())
.build().update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, empNum));
LambdaQueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getEmpNum, empNum);
LambdaQueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<QyzxEmpEntAsso>().lambda()
.eq(QyzxEmpEntAsso::getEmpNum, empNum);
// 确认离职 删除员工关联表
qyzxEmpEntAssoMapper.delete(queryWrapper);
// 初始化 部门主管
zzglBmgwMMapper.update(ZzglBmgwM.builder().leader(null).build(),
new UpdateWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getLeader, empNum));
// 更新当前企业
List<QyzxEmpEntAsso> listEEA = qyzxEmpEntAssoMapper.selectList(queryWrapper);
if (listEEA != null && listEEA.size() > 0) {
......@@ -1336,19 +1279,16 @@ public class YgglController {
@ApiOperation(value = "57.放弃离职", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 57)
public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(
new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
YgglMainEmp.builder().jobStatus(ygglMainEmp.getBeforeLeavingSts()).build().update(new UpdateWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum()));
YgglMainEmp ygglMainEmp = ygglMainEmpMapper
.selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
YgglMainEmp.builder().jobStatus(ygglMainEmp.getBeforeLeavingSts()).build()
.update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum()));
// 删除离职表
YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build().delete(new QueryWrapper<YgglMainLzb>().lambda()
.eq(YgglMainLzb::getEmpNum, lzygQueryDto.getEmpNum()));
YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build()
.delete(new QueryWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, lzygQueryDto.getEmpNum()));
return ResultUtil.success("放弃成功");
}
......@@ -1359,9 +1299,9 @@ public class YgglController {
public Result<YgglMainLzb> tzlzyy(@CurrentUser UserBean userBean, @RequestBody YgglMainLzb ygglMainLzb) {
if (ygglMainLzb.getEmpNum() != null) {
ygglMainLzb.update(new UpdateWrapper<YgglMainLzb>().lambda()
.eq(YgglMainLzb::getOrgCode, userBean.getOrgCode())
.eq(YgglMainLzb::getEmpNum, ygglMainLzb.getEmpNum()));
ygglMainLzb
.update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getOrgCode, userBean.getOrgCode())
.eq(YgglMainLzb::getEmpNum, ygglMainLzb.getEmpNum()));
return ResultUtil.data(ygglMainLzb, "修改成功");
}
return ResultUtil.error("请确认该员工是否存在!");
......@@ -1575,9 +1515,9 @@ public class YgglController {
@ApiOperation(value = "65.获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 65)
public Result<List<YgglAttaSbgjj>> selectygsbgjj(@CurrentUser UserBean userBean) {
List<YgglAttaSbgjj> ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectList(new QueryWrapper<YgglAttaSbgjj>().lambda()
.eq(YgglAttaSbgjj::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaSbgjj::getEmpNum, userBean.getEmpNum()));
List<YgglAttaSbgjj> ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectList(
new QueryWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaSbgjj::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaSbgjj);
}
......@@ -1634,10 +1574,8 @@ public class YgglController {
@ApiOperationSupport(order = 68)
public Result<Boolean> delygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaSbgjj.builder().build()
.delete(new QueryWrapper<YgglAttaSbgjj>().lambda()
.eq(YgglAttaSbgjj::getOrgCode, orgCode)
.eq(YgglAttaSbgjj::getId, id)));
return ResultUtil.data(YgglAttaSbgjj.builder().build().delete(new QueryWrapper<YgglAttaSbgjj>().lambda()
.eq(YgglAttaSbgjj::getOrgCode, orgCode).eq(YgglAttaSbgjj::getId, id)));
}
@GetMapping(value = "/sysRegion")
......@@ -1645,7 +1583,7 @@ public class YgglController {
public Result<List<Tree<String>>> sysRegion() {
List<SysRegion> nodeList = SysRegion.builder().build()
.selectList(new LambdaQueryWrapper<SysRegion>().select(SysRegion::getKeyId, SysRegion::getRegionCode,
SysRegion::getRegionName, SysRegion::getMerName, SysRegion::getLevel));
SysRegion::getRegionName, SysRegion::getMerName, SysRegion::getLevel, SysRegion::getZipCode));
// 配置
TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
......@@ -1657,15 +1595,16 @@ public class YgglController {
List<Tree<String>> treeNodes = TreeUtil.build(nodeList, "0", treeNodeConfig, (treeNode, tree) -> {
tree.setId(treeNode.getKeyId().toString());
tree.setParentId(treeNode.getRegionCode());
tree.setParentId(treeNode.getRegionCode().toString());
tree.setName(treeNode.getRegionName());
// 扩展属性 ...
tree.putExtra("mer_name", treeNode.getMerName());
tree.putExtra("zip_code", treeNode.getZipCode());
});
return ResultUtil.data(treeNodes);
}
/**
* 获取登录人的相关信息
*
......
/**
* Title: CilentSourceClassMapper.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.dao.clazz;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.clazz.ClientSourceClass;
/**
* Title: CilentSourceClassMapper.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
public interface CilentSourceClassMapper extends BaseMapper<ClientSourceClass> {
}
/**
* Title: CilentSourceClassMapper.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.dao.clazz;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.clazz.ClientTypeClass;
/**
* Title: CilentTypeClassMapper.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
public interface CilentTypeClassMapper extends BaseMapper<ClientTypeClass> {
}
/**
* Title: IndustryMapper.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.dao.clazz;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.clazz.IndustryClass;
/**
* Title: IndustryClassMapper.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
public interface IndustryClassMapper extends BaseMapper<IndustryClass> {
}
/**
* Title: CrmClientAssociatesMapper.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.dao.crm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.crm.CrmClientAssociate;
/**
* Title: CrmClientAssociatesMapper.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
public interface CrmClientAssociatesMapper extends BaseMapper<CrmClientAssociate> {
}
/**
* Title: CrmClientFollowMapper.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.dao.crm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.crm.CrmClientFollow;
/**
* Title: CrmClientFollowMapper.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
public interface CrmClientFollowMapper extends BaseMapper<CrmClientFollow> {
}
/**
* Title: CrmSeaRuleMapper.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.dao.crm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.crm.CrmSeaRule;
/**
* Title: CrmSeaRuleMapper.java
*
* @Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
public interface CrmSeaRuleMapper extends BaseMapper<CrmSeaRule> {
}
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