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; ...@@ -14,7 +14,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* <p> * <p>
...@@ -28,6 +33,11 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -28,6 +33,11 @@ import io.swagger.annotations.ApiModelProperty;
* @date 2020年6月5日 * @date 2020年6月5日
* @version 1.0 * @version 1.0
*/ */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("行业字典表(1.0)")
public class IndustryClass extends Model<IndustryClass> { public class IndustryClass extends Model<IndustryClass> {
private static final long serialVersionUID = -5008126674106880292L; private static final long serialVersionUID = -5008126674106880292L;
...@@ -40,4 +50,8 @@ public class IndustryClass extends Model<IndustryClass> { ...@@ -40,4 +50,8 @@ public class IndustryClass extends Model<IndustryClass> {
@ApiModelProperty(value = "行业名", example = "行业") @ApiModelProperty(value = "行业名", example = "行业")
private String name; private String name;
@ApiModelProperty(value = "企业id", example = "企业")
private Integer orgCode;
} }
...@@ -52,7 +52,7 @@ public class SysRegion extends Model<SysRegion>{ ...@@ -52,7 +52,7 @@ public class SysRegion extends Model<SysRegion>{
private String regionName; private String regionName;
@ApiModelProperty(value = "区域编码", example = "1") @ApiModelProperty(value = "区域编码", example = "1")
private String regionCode; private Integer regionCode;
@ApiModelProperty(value = "地名简称", example = "1") @ApiModelProperty(value = "地名简称", example = "1")
private String simpleName; private String simpleName;
......
...@@ -66,24 +66,6 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> { ...@@ -66,24 +66,6 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> {
@ApiModelProperty(value = "业务组管理员名称") @ApiModelProperty(value = "业务组管理员名称")
private String managerName; 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 = "创建时间") @ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private Date createTime; private Date createTime;
...@@ -103,8 +85,14 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> { ...@@ -103,8 +85,14 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> {
@Transient @Transient
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "组成员id")
private Integer[] ids; private Integer[] ids;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "回收规则")
private CrmSeaRule crmSeaRules;
// @ApiModelProperty(value = "组成员empNum(字符串,分割)",example = "1,2,3") // @ApiModelProperty(value = "组成员empNum(字符串,分割)",example = "1,2,3")
// private String member; // 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; ...@@ -43,7 +43,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@Table(name = "crm_client_contacts") @Table(name = "crm_client_contacts")
@ApiModel("客户联系人表") @ApiModel("客户联系人表")
public class CrmClientContacts extends Model<CrmClientContacts>{ public class CrmClientContacts extends Model<CrmClientContacts> {
private static final long serialVersionUID = 7527532835555744270L; private static final long serialVersionUID = 7527532835555744270L;
...@@ -77,6 +77,12 @@ public class CrmClientContacts extends Model<CrmClientContacts>{ ...@@ -77,6 +77,12 @@ public class CrmClientContacts extends Model<CrmClientContacts>{
@ApiModelProperty(value = "地址") @ApiModelProperty(value = "地址")
private String address; private String address;
@ApiModelProperty(value = "企业id") @ApiModelProperty(value = "公司")
private Integer orgCode; private String company;
@ApiModelProperty(value = "备注")
private String remark;
// @ApiModelProperty(value = "企业id")
// private Integer orgCode;
} }
...@@ -8,13 +8,17 @@ ...@@ -8,13 +8,17 @@
package cn.timer.api.bean.crm; package cn.timer.api.bean.crm;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; 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.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
...@@ -45,7 +49,7 @@ import lombok.NoArgsConstructor; ...@@ -45,7 +49,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@Table(name = "crm_client_data") @Table(name = "crm_client_data")
@ApiModel("客户数据表") @ApiModel("客户数据表")
public class CrmClientData extends Model<CrmClientData>{ public class CrmClientData extends Model<CrmClientData> {
private static final long serialVersionUID = -5368056704790782780L; private static final long serialVersionUID = -5368056704790782780L;
...@@ -76,22 +80,30 @@ public class CrmClientData extends Model<CrmClientData>{ ...@@ -76,22 +80,30 @@ public class CrmClientData extends Model<CrmClientData>{
@ApiModelProperty(value = "客户邮箱") @ApiModelProperty(value = "客户邮箱")
private String clientEmail; private String clientEmail;
@ApiModelProperty(value = "区编号")
private Integer keyId;
@ApiModelProperty(value = "省") @ApiModelProperty(value = "省")
private String province; private String province;
@ApiModelProperty(value = "市") @ApiModelProperty(value = "市")
private String city; private String city;
@ApiModelProperty(value = "区") @ApiModelProperty(value = "区")
private String district; private String district;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "邮编") @ApiModelProperty(value = "邮编")
private String zipCode; private String zipCode;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "客户类型id")
private Integer clientType;
@ApiModelProperty(value = "客户类型名")
private String clientTypeName;
@ApiModelProperty(value = "客户类型") @ApiModelProperty(value = "客户来源id")
private String clientType; private Integer clientSource;
@ApiModelProperty(value = "客户来源") @ApiModelProperty(value = "客户来源")
private String clientSource; private String clientSourceName;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remarks; private String remarks;
...@@ -102,18 +114,51 @@ public class CrmClientData extends Model<CrmClientData>{ ...@@ -102,18 +114,51 @@ public class CrmClientData extends Model<CrmClientData>{
@ApiModelProperty(value = "客户所属人姓名") @ApiModelProperty(value = "客户所属人姓名")
private String belongUserName; private String belongUserName;
@ApiModelProperty(value = "协作人empNum") @ApiModelProperty(value = "客户所属业务组id")
private Integer associatesUser; private Integer belongGroup;
@ApiModelProperty(value = "协作人姓名") @ApiModelProperty(value = "客户所属业务组名")
private String associatesName; private String belongGroupName;
@ApiModelProperty(value = "客户数据状态 0-无 1-潜在 2-意向 3-签约 4-合作中 5-已封档")
private Integer clientStatus;
@ApiModelProperty(value = "附件地址") @ApiModelProperty(value = "附件地址")
private String fileUrl; 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 = "创建时间") @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") @ApiModelProperty(value = "企业id")
private Integer orgCode; 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 @@ ...@@ -7,23 +7,39 @@
*/ */
package cn.timer.api.controller.crm; 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.Date;
import java.util.List;
import org.springframework.transaction.annotation.Transactional; 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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.CrmBusinessGroup;
import cn.timer.api.bean.crm.CrmBusinessGroupMember; 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.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.bean.yggl.YgglMainEmp;
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.utils.CheckUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -52,14 +68,33 @@ public class CrmController { ...@@ -52,14 +68,33 @@ public class CrmController {
return userBean.getOrgCode(); return userBean.getOrgCode();
} }
@PostMapping("addClient") private YgglMainEmp getYg(Integer orgCode, Integer empNum) {
@ApiOperation(value = "新增客户", httpMethod = "POST", notes = "接口发布说明") return YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
public Result<Object> addClient(@CurrentUser UserBean userBean, @RequestBody CrmClientData crmClientData) { .eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).select(YgglMainEmp::getName));
}
crmClientData.setBelongUser(getEmpNum(userBean)); private String getEmpName(Integer orgCode, Integer empNum) {
crmClientData.setOrgCode(getOrgCode(userBean)); return getYg(orgCode, empNum).getName();
crmClientData.setCreatedTime(new Date()); }
return null;
@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") @PostMapping("addBusinessGroup")
...@@ -69,11 +104,6 @@ public class CrmController { ...@@ -69,11 +104,6 @@ public class CrmController {
@RequestBody CrmBusinessGroup crmBusinessGroup) { @RequestBody CrmBusinessGroup crmBusinessGroup) {
Integer orgCode = getOrgCode(userBean); Integer orgCode = getOrgCode(userBean);
Integer empNum = getEmpNum(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() CrmBusinessGroup crmBusinessGroupOld = CrmBusinessGroup.builder().build()
.selectOne(new QueryWrapper<CrmBusinessGroup>().lambda().eq(CrmBusinessGroup::getOrgCode, orgCode) .selectOne(new QueryWrapper<CrmBusinessGroup>().lambda().eq(CrmBusinessGroup::getOrgCode, orgCode)
.select(CrmBusinessGroup::getSort).last("limit 1").orderByDesc(CrmBusinessGroup::getId)); .select(CrmBusinessGroup::getSort).last("limit 1").orderByDesc(CrmBusinessGroup::getId));
...@@ -81,30 +111,253 @@ public class CrmController { ...@@ -81,30 +111,253 @@ public class CrmController {
crmBusinessGroup.setSort(1); crmBusinessGroup.setSort(1);
else else
crmBusinessGroup.setSort(crmBusinessGroupOld.getSort() + 1);// 排序 crmBusinessGroup.setSort(crmBusinessGroupOld.getSort() + 1);// 排序
crmBusinessGroup.setManagerName(name); // 设置管理员姓名 crmBusinessGroup.setManagerName(getEmpName(orgCode, empNum)); // 设置管理员姓名
crmBusinessGroup.setCreateUser(empNum); // 创建人 crmBusinessGroup.setCreateUser(empNum); // 创建人
crmBusinessGroup.setModifyUser(empNum); // 修改人 crmBusinessGroup.setModifyUser(empNum); // 修改人
crmBusinessGroup.setOrgCode(orgCode); crmBusinessGroup.setOrgCode(orgCode);
// crmBusinessGroup.setMember(member); // ,字符串拼接 // crmBusinessGroup.setMember(member); // ,字符串拼接
boolean result = crmBusinessGroup.insert(); boolean result = crmBusinessGroup.insert();
if (!result) if (!result)
return ResultUtil.success("保存失败"); return ResultUtil.success("新增失败");
Integer gid = crmBusinessGroup.getId(); Integer gid = crmBusinessGroup.getId();
Integer[] ids = crmBusinessGroup.getIds(); Integer[] ids = crmBusinessGroup.getIds();
for (Integer empId : ids) { for (Integer empId : ids) {
CrmBusinessGroupMember.builder().gid(gid).empNum(empId).build().insert(); 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") @GetMapping("getBusinessGroup")
@ApiOperation(value = "获取业务组列表", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "获取业务组列表", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroup(@CurrentUser UserBean userBean) { public Result<Object> getBusinessGroup(@CurrentUser UserBean userBean) {
return ResultUtil.data(CrmBusinessGroup.builder().build().selectList( return ResultUtil.data(CrmBusinessGroup.builder().build()
new QueryWrapper<CrmBusinessGroup>().lambda().eq(CrmBusinessGroup::getOrgCode, getOrgCode(userBean))), .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 // TODO
} }
...@@ -156,8 +156,7 @@ public class YgglController { ...@@ -156,8 +156,7 @@ public class YgglController {
Integer empNum = userBean.getEmpNum(); Integer empNum = userBean.getEmpNum();
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda() YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, orgCode) .eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum));
.eq(YgglMainEmp::getEmpNum, empNum));
Date rz = ygglMainEmp.getRzTime(); Date rz = ygglMainEmp.getRzTime();
if (rz != null) { if (rz != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(rz, new Date(), Level.DAY)); ygglMainEmp.setWorkTime(DateUtil.formatBetween(rz, new Date(), Level.DAY));
...@@ -172,8 +171,7 @@ public class YgglController { ...@@ -172,8 +171,7 @@ public class YgglController {
public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda() YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, orgCode) .eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum));
.eq(YgglMainEmp::getEmpNum, empNum));
Date rz = ygglMainEmp.getRzTime(); Date rz = ygglMainEmp.getRzTime();
if (rz != null) { if (rz != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(), Level.DAY)); ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(), Level.DAY));
...@@ -195,19 +193,16 @@ public class YgglController { ...@@ -195,19 +193,16 @@ public class YgglController {
return ResultUtil.data("岗位不存在"); return ResultUtil.data("岗位不存在");
} }
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
ZzglBmgwM zzglBmgwM = ZzglBmgwM.builder().build().selectOne(new QueryWrapper<ZzglBmgwM>().lambda() ZzglBmgwM zzglBmgwM = ZzglBmgwM.builder().build().selectOne(
.eq(ZzglBmgwM::getOrgCode, orgCode) new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getId, gwid));
.eq(ZzglBmgwM::getId, gwid));
String gw = null; String gw = null;
Integer bmid = null; Integer bmid = null;
if (zzglBmgwM != null) { if (zzglBmgwM != null) {
gw = zzglBmgwM.getName(); gw = zzglBmgwM.getName();
bmid = zzglBmgwM.getUpId(); bmid = zzglBmgwM.getUpId();
} }
ZzglBmgwM z = ZzglBmgwM.builder().build() ZzglBmgwM z = ZzglBmgwM.builder().build().selectOne(
.selectOne(new QueryWrapper<ZzglBmgwM>().lambda() new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getId, bmid));
.eq(ZzglBmgwM::getOrgCode, orgCode)
.eq(ZzglBmgwM::getId, bmid));
String bm = null; String bm = null;
if (z != null) { if (z != null) {
bm = z.getName(); bm = z.getName();
...@@ -226,7 +221,8 @@ public class YgglController { ...@@ -226,7 +221,8 @@ public class YgglController {
@PostMapping(value = "/addygda") @PostMapping(value = "/addygda")
@ApiOperation(value = "4.添加员工档案", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "4.添加员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 4) @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(); Integer orgCode = userBean.getOrgCode();
String name = addygdaDto.getName(); String name = addygdaDto.getName();
String phone = addygdaDto.getPhone(); String phone = addygdaDto.getPhone();
...@@ -281,15 +277,11 @@ public class YgglController { ...@@ -281,15 +277,11 @@ public class YgglController {
.eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode)); .eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode));
if (ygglMainEmp == null) { if (ygglMainEmp == null) {
QyzxEmpEntAsso.builder() QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType())
.empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType()) .status(CommonEnum.U_STS_ON.getType()).build().insert();
.build() ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.insert(); .jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
ygglMainEmp = YgglMainEmp.builder() .empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
.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(); ygglMainEmp.insert();
return ResultUtil.data(ygglMainEmp, "添加员工成功!"); return ResultUtil.data(ygglMainEmp, "添加员工成功!");
...@@ -311,15 +303,15 @@ public class YgglController { ...@@ -311,15 +303,15 @@ public class YgglController {
public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp) public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp)
throws Exception { throws Exception {
if (ObjectUtil.isAllNotEmpty(ygglMainEmp.getRzTime(),ygglMainEmp.getZzTime()) && if (ObjectUtil.isAllNotEmpty(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())
!DateFormatUtils.getCompareDate(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())) { && !DateFormatUtils.getCompareDate(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())) {
ResultUtil.error("入职日期 不可以大于 转正日期"); ResultUtil.error("入职日期 不可以大于 转正日期");
} }
if (ygglMainEmp.getEmpNum() != null) { if (ygglMainEmp.getEmpNum() != null) {
ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda() ygglMainEmp
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()) .update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getEmpNum, ygglMainEmp.getEmpNum())); .eq(YgglMainEmp::getEmpNum, ygglMainEmp.getEmpNum()));
return ResultUtil.data(ygglMainEmp, "修改成功"); return ResultUtil.data(ygglMainEmp, "修改成功");
...@@ -327,8 +319,6 @@ public class YgglController { ...@@ -327,8 +319,6 @@ public class YgglController {
return ResultUtil.data(ygglMainEmp, "修改成功"); return ResultUtil.data(ygglMainEmp, "修改成功");
} }
/** /**
* 员工搜索 * 员工搜索
* *
...@@ -354,9 +344,11 @@ public class YgglController { ...@@ -354,9 +344,11 @@ public class YgglController {
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage()); ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>(); QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda() queryWrapper.lambda()
.select(YgglMainEmp::getName, YgglMainEmp::getEmpNum, YgglMainEmp::getBmgwId, YgglMainEmp::getRzTime, YgglMainEmp::getJobType, YgglMainEmp::getPhone, YgglMainEmp::getJobStatus) .select(YgglMainEmp::getName, YgglMainEmp::getEmpNum, YgglMainEmp::getBmgwId, YgglMainEmp::getRzTime,
.ne(YgglMainEmp::getJobStatus, YgEnumInterface.jobStatus.YILIZHI.getType()).eq(YgglMainEmp::getOrgCode, orgCode) YgglMainEmp::getJobType, YgglMainEmp::getPhone, YgglMainEmp::getJobStatus)
.eq(t != null && t > -1, YgglMainEmp::getJobType, t).eq(j != null && j > -1, YgglMainEmp::getJobStatus, j) .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) .in(!bList.isEmpty(), YgglMainEmp::getBmgwId, bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like(YgglMainEmp::getName, q).or().like(YgglMainEmp::getPhone, q)); .and(!StrUtil.hasBlank(q), wq -> wq.like(YgglMainEmp::getName, q).or().like(YgglMainEmp::getPhone, q));
...@@ -373,8 +365,8 @@ public class YgglController { ...@@ -373,8 +365,8 @@ public class YgglController {
@PostMapping(value = "/import_emp_record") @PostMapping(value = "/import_emp_record")
@ApiOperation(value = "7.导入员工档案", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "7.导入员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
public Result<JSONObject> importEmpRecord( public Result<JSONObject> importEmpRecord(@CurrentUser UserBean userBean,
@CurrentUser UserBean userBean ,@Validated @RequestBody ValidList<AddygdaDto> listAddygdaDto ) throws Exception { @Validated @RequestBody ValidList<AddygdaDto> listAddygdaDto) throws Exception {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
// 查询所有员工手机号 // 查询所有员工手机号
...@@ -382,14 +374,12 @@ public class YgglController { ...@@ -382,14 +374,12 @@ public class YgglController {
// .selectList(new QueryWrapper<QyzxEmpLogin>().lambda() // .selectList(new QueryWrapper<QyzxEmpLogin>().lambda()
// .select(QyzxEmpLogin::getPhone)); // .select(QyzxEmpLogin::getPhone));
List<YgglMainEmp> listMe = ygglMainEmpMapper List<YgglMainEmp> listMe = ygglMainEmpMapper.selectList(new QueryWrapper<YgglMainEmp>().lambda()
.selectList(new QueryWrapper<YgglMainEmp>().lambda() .eq(YgglMainEmp::getOrgCode, orgCode).select(YgglMainEmp::getPhone, YgglMainEmp::getZjNum));
.eq(YgglMainEmp::getOrgCode, orgCode)
.select(YgglMainEmp::getPhone,YgglMainEmp::getZjNum));
listMe = listMe != null ? listMe.stream() listMe = listMe != null
.filter(o -> o != null && o.getPhone() != null).collect(Collectors.toList()) : null; ? listMe.stream().filter(o -> o != null && o.getPhone() != null).collect(Collectors.toList())
: null;
// 抽取 登录表 的phone的集合 // 抽取 登录表 的phone的集合
List<String> listPhone = listMe.stream().map(YgglMainEmp::getPhone).collect(Collectors.toList()); List<String> listPhone = listMe.stream().map(YgglMainEmp::getPhone).collect(Collectors.toList());
...@@ -400,7 +390,8 @@ public class YgglController { ...@@ -400,7 +390,8 @@ public class YgglController {
// 过滤掉 导入数据中, listPhone已存在 的 phone 的对象集合 // 过滤掉 导入数据中, listPhone已存在 的 phone 的对象集合
List<AddygdaDto> list = listAddygdaDto.stream() 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 的对象集合 // 过滤出 导入数据中, listPhone已存在 的 phone 的对象集合
List<AddygdaDto> phoneRepetitions = listAddygdaDto.stream() List<AddygdaDto> phoneRepetitions = listAddygdaDto.stream()
...@@ -450,24 +441,22 @@ public class YgglController { ...@@ -450,24 +441,22 @@ public class YgglController {
.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one(); .eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
if (login == null) { if (login == null) {
// 初始化密码 pwd // 初始化密码 pwd
login = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pwd)) login = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pwd)).sts(CommonEnum.U_STS_ON.getType())
.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(name).build(); .orgId(userBean.getOrgCode()).username(name).build();
if (!login.insert()) { if (!login.insert()) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("添加员工登录表失败,请检查输入信息"); return ResultUtil.error("添加员工登录表失败,请检查输入信息");
} }
} }
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode) QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType())
.userType(SysRoleType.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType()).build().insert();// usertype2普通员工 status1正常 .status(CommonEnum.U_STS_ON.getType()).build().insert();// usertype2普通员工 status1正常
yme = YgglMainEmp.builder() yme = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType) .jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime) .empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
.syq(syq).sex(sex).empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId)
.build();
if (yme.insert()) { if (yme.insert()) {
listYmp.add(yme); listYmp.add(yme);
}else { } else {
// 存放 插入失败的 数据 // 存放 插入失败的 数据
insertErrors.add(yme); insertErrors.add(yme);
} }
...@@ -480,7 +469,8 @@ public class YgglController { ...@@ -480,7 +469,8 @@ public class YgglController {
obj.set("idCardRepetitions", idCardRepetitions); obj.set("idCardRepetitions", idCardRepetitions);
obj.set("insertErrors", insertErrors); 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, "导入员工档案成功!"); return ResultUtil.data(obj, "导入员工档案成功!");
} }
...@@ -495,25 +485,20 @@ public class YgglController { ...@@ -495,25 +485,20 @@ public class YgglController {
@ApiOperation(value = "8.获取导入模板", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "8.获取导入模板", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
public Result<Object> getImpoetTemplate(HttpServletResponse response) throws IOException { public Result<Object> getImpoetTemplate(HttpServletResponse response) throws IOException {
ImportEmpDto ied = ImportEmpDto.builder() ImportEmpDto ied = ImportEmpDto.builder().name("张三").phone("15219671123")
.name("张三")
.phone("15219671123")
// 证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他 // 证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他
.zjType(0) .zjType(0).zjNum("445381199611063586")
.zjNum("445381199611063586")
// 工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘 // 工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘
.jobType(0) .jobType(0).rzTime("2010-10-10 10:10:10")
.rzTime("2010-10-10 10:10:10")
// 试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项) // 试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)
.syq(1) .syq(1)
// 性别 0:男;1:女 // 性别 0:男;1:女
.sex(0) .sex(0).build();
.build();
List<ImportEmpDto> listAd = CollUtil.newArrayList(ied); List<ImportEmpDto> listAd = CollUtil.newArrayList(ied);
// 通过工具类创建writer // 通过工具类创建writer
ExcelWriter writer = ExcelUtil.getWriter(true); ExcelWriter writer = ExcelUtil.getWriter(true);
//自定义标题别名 // 自定义标题别名
writer.addHeaderAlias("name", "姓名"); writer.addHeaderAlias("name", "姓名");
writer.addHeaderAlias("phone", "手机号"); writer.addHeaderAlias("phone", "手机号");
writer.addHeaderAlias("sex", "性别"); writer.addHeaderAlias("sex", "性别");
...@@ -533,13 +518,13 @@ public class YgglController { ...@@ -533,13 +518,13 @@ public class YgglController {
writer.write(listAd, true); writer.write(listAd, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=8timer_emp_import.xlsx"); response.setHeader("Content-Disposition", "attachment;filename=8timer_emp_import.xlsx");
ServletOutputStream out = response.getOutputStream(); ServletOutputStream out = response.getOutputStream();
writer.flush(out, true); writer.flush(out, true);
// 关闭writer,释放内存 // 关闭writer,释放内存
writer.close(); writer.close();
//此处记得关闭输出Servlet流 // 此处记得关闭输出Servlet流
IoUtil.close(out); IoUtil.close(out);
return ResultUtil.data(null, "获取模板成功"); return ResultUtil.data(null, "获取模板成功");
...@@ -557,7 +542,7 @@ public class YgglController { ...@@ -557,7 +542,7 @@ public class YgglController {
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) { public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) {
List<YgglMainEmp> list = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper) 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, "导出员工成功"); return ResultUtil.data(list, "导出员工成功");
} }
...@@ -571,10 +556,9 @@ public class YgglController { ...@@ -571,10 +556,9 @@ public class YgglController {
@ApiOperation(value = "10.获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "10.获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean) {
List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build() List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaJyjlb>().lambda() new QueryWrapper<YgglAttaJyjlb>().lambda().eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaJyjlb::getEmpNum, userBean.getEmpNum()));
.eq(YgglAttaJyjlb::getEmpNum,userBean.getEmpNum()));
return ResultUtil.data(ygglAttaJyjlbss); return ResultUtil.data(ygglAttaJyjlbss);
} }
...@@ -583,10 +567,9 @@ public class YgglController { ...@@ -583,10 +567,9 @@ public class YgglController {
@ApiOperation(value = "11.获取员工教育经历表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "11.获取员工教育经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build().selectList( List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build()
new QueryWrapper<YgglAttaJyjlb>().lambda() .selectList(new QueryWrapper<YgglAttaJyjlb>().lambda()
.eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaJyjlb::getEmpNum, empNum));
.eq(YgglAttaJyjlb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaJyjlbs); return ResultUtil.data(ygglAttaJyjlbs);
} }
...@@ -617,10 +600,8 @@ public class YgglController { ...@@ -617,10 +600,8 @@ public class YgglController {
@ApiOperationSupport(order = 13) @ApiOperationSupport(order = 13)
public Result<Boolean> deljyjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> deljyjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJyjlb.builder().build() return ResultUtil.data(YgglAttaJyjlb.builder().build().delete(new QueryWrapper<YgglAttaJyjlb>().lambda()
.delete(new QueryWrapper<YgglAttaJyjlb>().lambda() .eq(YgglAttaJyjlb::getOrgCode, orgCode).eq(YgglAttaJyjlb::getId, id)), "删除员工教育经历表成功");
.eq(YgglAttaJyjlb::getOrgCode, orgCode)
.eq(YgglAttaJyjlb::getId, id)), "删除员工教育经历表成功");
} }
/** /**
...@@ -645,10 +626,9 @@ public class YgglController { ...@@ -645,10 +626,9 @@ public class YgglController {
@ApiOperation(value = "15.获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "15.获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 15) @ApiOperationSupport(order = 15)
public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build().selectList( List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build()
new QueryWrapper<YgglAttaPxjlxxb>().lambda() .selectList(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
.eq(YgglAttaPxjlxxb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaPxjlxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaPxjlxxb::getEmpNum, empNum));
.eq(YgglAttaPxjlxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaPxjlxxbs); return ResultUtil.data(ygglAttaPxjlxxbs);
} }
...@@ -680,10 +660,8 @@ public class YgglController { ...@@ -680,10 +660,8 @@ public class YgglController {
@ApiOperationSupport(order = 17) @ApiOperationSupport(order = 17)
public Result<Boolean> delpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaPxjlxxb.builder().build() return ResultUtil.data(YgglAttaPxjlxxb.builder().build().delete(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
.delete(new QueryWrapper<YgglAttaPxjlxxb>().lambda() .eq(YgglAttaPxjlxxb::getOrgCode, orgCode).eq(YgglAttaPxjlxxb::getId, id)), "删除员工培训经历信息表成功");
.eq(YgglAttaPxjlxxb::getOrgCode, orgCode)
.eq(YgglAttaPxjlxxb::getId, id)), "删除员工培训经历信息表成功");
} }
/** /**
...@@ -696,9 +674,8 @@ public class YgglController { ...@@ -696,9 +674,8 @@ public class YgglController {
@ApiOperation(value = "18.获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "18.获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 18) @ApiOperationSupport(order = 18)
public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean) {
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build() List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaGzjlb>().lambda() new QueryWrapper<YgglAttaGzjlb>().lambda().eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzjlb::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaGzjlb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzjlbs); return ResultUtil.data(ygglAttaGzjlbs);
} }
...@@ -708,10 +685,9 @@ public class YgglController { ...@@ -708,10 +685,9 @@ public class YgglController {
@ApiOperation(value = "19.获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "19.获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 19) @ApiOperationSupport(order = 19)
public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList( List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build()
new QueryWrapper<YgglAttaGzjlb>().lambda() .selectList(new QueryWrapper<YgglAttaGzjlb>().lambda()
.eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaGzjlb::getEmpNum, empNum));
.eq(YgglAttaGzjlb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaGzjlbs); return ResultUtil.data(ygglAttaGzjlbs);
} }
...@@ -742,10 +718,8 @@ public class YgglController { ...@@ -742,10 +718,8 @@ public class YgglController {
@ApiOperationSupport(order = 21) @ApiOperationSupport(order = 21)
public Result<Boolean> delgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzjlb.builder().build() return ResultUtil.data(YgglAttaGzjlb.builder().build().delete(new QueryWrapper<YgglAttaGzjlb>().lambda()
.delete(new QueryWrapper<YgglAttaGzjlb>().lambda() .eq(YgglAttaGzjlb::getOrgCode, orgCode).eq(YgglAttaGzjlb::getId, id)), "删除员工工作经历表成功");
.eq(YgglAttaGzjlb::getOrgCode, orgCode)
.eq(YgglAttaGzjlb::getId, id)), "删除员工工作经历表成功");
} }
/** /**
...@@ -758,9 +732,8 @@ public class YgglController { ...@@ -758,9 +732,8 @@ public class YgglController {
@ApiOperation(value = "22.获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "22.获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 22) @ApiOperationSupport(order = 22)
public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean) {
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build() List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaZcxxb>().lambda() new QueryWrapper<YgglAttaZcxxb>().lambda().eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZcxxb::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaZcxxb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaZcxxbs); return ResultUtil.data(ygglAttaZcxxbs);
} }
...@@ -770,10 +743,9 @@ public class YgglController { ...@@ -770,10 +743,9 @@ public class YgglController {
@ApiOperation(value = "23.获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "23.获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 23) @ApiOperationSupport(order = 23)
public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList( List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build()
new QueryWrapper<YgglAttaZcxxb>().lambda() .selectList(new QueryWrapper<YgglAttaZcxxb>().lambda()
.eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaZcxxb::getEmpNum, empNum));
.eq(YgglAttaZcxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaZcxxbs); return ResultUtil.data(ygglAttaZcxxbs);
} }
...@@ -804,10 +776,8 @@ public class YgglController { ...@@ -804,10 +776,8 @@ public class YgglController {
@ApiOperationSupport(order = 25) @ApiOperationSupport(order = 25)
public Result<Boolean> delzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZcxxb.builder().build() return ResultUtil.data(YgglAttaZcxxb.builder().build().delete(new QueryWrapper<YgglAttaZcxxb>().lambda()
.delete(new QueryWrapper<YgglAttaZcxxb>().lambda() .eq(YgglAttaZcxxb::getOrgCode, orgCode).eq(YgglAttaZcxxb::getId, id)), "删除员工职称信息表成功");
.eq(YgglAttaZcxxb::getOrgCode, orgCode)
.eq(YgglAttaZcxxb::getId, id)), "删除员工职称信息表成功");
} }
/** /**
...@@ -820,10 +790,9 @@ public class YgglController { ...@@ -820,10 +790,9 @@ public class YgglController {
@ApiOperation(value = "26.获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "26.获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 26) @ApiOperationSupport(order = 26)
public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean) {
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build() List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaZszjb>().lambda() new QueryWrapper<YgglAttaZszjb>().lambda().eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaZszjb::getEmpNum, userBean.getEmpNum()));
.eq(YgglAttaZszjb::getEmpNum,userBean.getEmpNum()));
return ResultUtil.data(ygglAttaZszjbs); return ResultUtil.data(ygglAttaZszjbs);
} }
...@@ -832,10 +801,9 @@ public class YgglController { ...@@ -832,10 +801,9 @@ public class YgglController {
@ApiOperation(value = "27.获取员工证书证件表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "27.获取员工证书证件表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 27) @ApiOperationSupport(order = 27)
public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build().selectList( List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build()
new QueryWrapper<YgglAttaZszjb>().lambda() .selectList(new QueryWrapper<YgglAttaZszjb>().lambda()
.eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaZszjb::getEmpNum, empNum));
.eq(YgglAttaZszjb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaZszjbs); return ResultUtil.data(ygglAttaZszjbs);
} }
...@@ -866,10 +834,8 @@ public class YgglController { ...@@ -866,10 +834,8 @@ public class YgglController {
@ApiOperationSupport(order = 29) @ApiOperationSupport(order = 29)
public Result<Boolean> delzszjb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delzszjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZszjb.builder().build() return ResultUtil.data(YgglAttaZszjb.builder().build().delete(new QueryWrapper<YgglAttaZszjb>().lambda()
.delete(new QueryWrapper<YgglAttaZszjb>().lambda() .eq(YgglAttaZszjb::getOrgCode, orgCode).eq(YgglAttaZszjb::getId, id)), "删除员工证书证件表成功");
.eq(YgglAttaZszjb::getOrgCode, orgCode)
.eq(YgglAttaZszjb::getId, id)), "删除员工证书证件表成功");
} }
/** /**
...@@ -882,9 +848,8 @@ public class YgglController { ...@@ -882,9 +848,8 @@ public class YgglController {
@ApiOperation(value = "30.获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "30.获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 30) @ApiOperationSupport(order = 30)
public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean) {
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build() List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaLxxxb>().lambda() new QueryWrapper<YgglAttaLxxxb>().lambda().eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaLxxxb::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaLxxxb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaLxxxbs); return ResultUtil.data(ygglAttaLxxxbs);
} }
...@@ -894,10 +859,9 @@ public class YgglController { ...@@ -894,10 +859,9 @@ public class YgglController {
@ApiOperation(value = "31.获取员工联系信息表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "31.获取员工联系信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 31) @ApiOperationSupport(order = 31)
public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build().selectList( List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build()
new QueryWrapper<YgglAttaLxxxb>().lambda() .selectList(new QueryWrapper<YgglAttaLxxxb>().lambda()
.eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaLxxxb::getEmpNum, empNum));
.eq(YgglAttaLxxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaLxxxbs); return ResultUtil.data(ygglAttaLxxxbs);
} }
...@@ -928,10 +892,8 @@ public class YgglController { ...@@ -928,10 +892,8 @@ public class YgglController {
@ApiOperationSupport(order = 33) @ApiOperationSupport(order = 33)
public Result<Boolean> dellxxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> dellxxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaLxxxb.builder().build() return ResultUtil.data(YgglAttaLxxxb.builder().build().delete(new QueryWrapper<YgglAttaLxxxb>().lambda()
.delete(new QueryWrapper<YgglAttaLxxxb>().lambda() .eq(YgglAttaLxxxb::getOrgCode, orgCode).eq(YgglAttaLxxxb::getId, id)), "删除员工联系信息表成功");
.eq(YgglAttaLxxxb::getOrgCode, orgCode)
.eq(YgglAttaLxxxb::getId, id)), "删除员工联系信息表成功");
} }
/** /**
...@@ -944,9 +906,8 @@ public class YgglController { ...@@ -944,9 +906,8 @@ public class YgglController {
@ApiOperation(value = "34.获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "34.获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 34) @ApiOperationSupport(order = 34)
public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean) { public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean) {
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build() List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaJjlxr>().lambda() new QueryWrapper<YgglAttaJjlxr>().lambda().eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaJjlxr::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaJjlxr::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaJjlxrs); return ResultUtil.data(ygglAttaJjlxrs);
} }
...@@ -956,10 +917,9 @@ public class YgglController { ...@@ -956,10 +917,9 @@ public class YgglController {
@ApiOperation(value = "35.获取员工紧急联系人表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "35.获取员工紧急联系人表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 35) @ApiOperationSupport(order = 35)
public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build().selectList( List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build()
new QueryWrapper<YgglAttaJjlxr>().lambda() .selectList(new QueryWrapper<YgglAttaJjlxr>().lambda()
.eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode()).eq(YgglAttaJjlxr::getEmpNum, empNum));
.eq(YgglAttaJjlxr::getEmpNum, empNum));
return ResultUtil.data(ygglAttaJjlxrs); return ResultUtil.data(ygglAttaJjlxrs);
} }
...@@ -990,10 +950,8 @@ public class YgglController { ...@@ -990,10 +950,8 @@ public class YgglController {
@ApiOperationSupport(order = 37) @ApiOperationSupport(order = 37)
public Result<Boolean> deljjlxr(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> deljjlxr(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJjlxr.builder().build() return ResultUtil.data(YgglAttaJjlxr.builder().build().delete(new QueryWrapper<YgglAttaJjlxr>().lambda()
.delete(new QueryWrapper<YgglAttaJjlxr>().lambda() .eq(YgglAttaJjlxr::getOrgCode, orgCode).eq(YgglAttaJjlxr::getId, id)), "删除员工紧急联系人表成功");
.eq(YgglAttaJjlxr::getOrgCode, orgCode)
.eq(YgglAttaJjlxr::getId, id)), "删除员工紧急联系人表成功");
} }
// 获取工资卡信息 // 获取工资卡信息
...@@ -1008,8 +966,7 @@ public class YgglController { ...@@ -1008,8 +966,7 @@ public class YgglController {
@ApiOperationSupport(order = 38) @ApiOperationSupport(order = 38)
public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean) { public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean) {
List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build() List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build()
.selectList(new QueryWrapper<YgglAttaGzk>().lambda() .selectList(new QueryWrapper<YgglAttaGzk>().lambda().eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzk::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaGzk::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzks); return ResultUtil.data(ygglAttaGzks);
} }
...@@ -1019,10 +976,8 @@ public class YgglController { ...@@ -1019,10 +976,8 @@ public class YgglController {
@ApiOperation(value = "39.获取员工工资卡信息(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "39.获取员工工资卡信息(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 39) @ApiOperationSupport(order = 39)
public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList( List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(new QueryWrapper<YgglAttaGzk>()
new QueryWrapper<YgglAttaGzk>().lambda() .lambda().eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode()).eq(YgglAttaGzk::getEmpNum, empNum));
.eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaGzk::getEmpNum, empNum));
return ResultUtil.data(ygglAttaGzks); return ResultUtil.data(ygglAttaGzks);
} }
...@@ -1053,10 +1008,8 @@ public class YgglController { ...@@ -1053,10 +1008,8 @@ public class YgglController {
@ApiOperationSupport(order = 41) @ApiOperationSupport(order = 41)
public Result<Boolean> delgzk(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delgzk(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzk.builder().build() return ResultUtil.data(YgglAttaGzk.builder().build().delete(new QueryWrapper<YgglAttaGzk>().lambda()
.delete(new QueryWrapper<YgglAttaGzk>().lambda() .eq(YgglAttaGzk::getOrgCode, orgCode).eq(YgglAttaGzk::getId, id)), "删除工资卡信息成功");
.eq(YgglAttaGzk::getOrgCode, orgCode)
.eq(YgglAttaGzk::getId, id)), "删除工资卡信息成功");
} }
/** /**
...@@ -1069,9 +1022,8 @@ public class YgglController { ...@@ -1069,9 +1022,8 @@ public class YgglController {
@ApiOperation(value = "42.获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "42.获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 42) @ApiOperationSupport(order = 42)
public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean) {
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build() List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaHtxxb>().lambda() new QueryWrapper<YgglAttaHtxxb>().lambda().eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaHtxxb::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaHtxxb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaHtxxbs); return ResultUtil.data(ygglAttaHtxxbs);
} }
...@@ -1081,10 +1033,9 @@ public class YgglController { ...@@ -1081,10 +1033,9 @@ public class YgglController {
@ApiOperation(value = "43.获取员工合同信息表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "43.获取员工合同信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 43) @ApiOperationSupport(order = 43)
public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build().selectList( List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build()
new QueryWrapper<YgglAttaHtxxb>().lambda() .selectList(new QueryWrapper<YgglAttaHtxxb>().lambda()
.eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaHtxxb::getEmpNum, empNum));
.eq(YgglAttaHtxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaHtxxbs); return ResultUtil.data(ygglAttaHtxxbs);
} }
...@@ -1115,10 +1066,8 @@ public class YgglController { ...@@ -1115,10 +1066,8 @@ public class YgglController {
@ApiOperationSupport(order = 45) @ApiOperationSupport(order = 45)
public Result<Boolean> delhtxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delhtxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaHtxxb.builder().build() return ResultUtil.data(YgglAttaHtxxb.builder().build().delete(new QueryWrapper<YgglAttaHtxxb>().lambda()
.delete(new QueryWrapper<YgglAttaHtxxb>().lambda() .eq(YgglAttaHtxxb::getOrgCode, orgCode).eq(YgglAttaHtxxb::getId, id)), "删除员工合同信息表成功");
.eq(YgglAttaHtxxb::getOrgCode, orgCode)
.eq(YgglAttaHtxxb::getId, id)), "删除员工合同信息表成功");
} }
/** /**
...@@ -1131,9 +1080,8 @@ public class YgglController { ...@@ -1131,9 +1080,8 @@ public class YgglController {
@ApiOperation(value = "46.获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "46.获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 46) @ApiOperationSupport(order = 46)
public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean) {
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build() List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaClfjb>().lambda() new QueryWrapper<YgglAttaClfjb>().lambda().eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaClfjb::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaClfjb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaClfjbs); return ResultUtil.data(ygglAttaClfjbs);
} }
...@@ -1143,10 +1091,9 @@ public class YgglController { ...@@ -1143,10 +1091,9 @@ public class YgglController {
@ApiOperation(value = "47.获取员工材料附件表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "47.获取员工材料附件表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 47) @ApiOperationSupport(order = 47)
public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build().selectList( List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build()
new QueryWrapper<YgglAttaClfjb>().lambda() .selectList(new QueryWrapper<YgglAttaClfjb>().lambda()
.eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaClfjb::getEmpNum, empNum));
.eq(YgglAttaClfjb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaClfjbs); return ResultUtil.data(ygglAttaClfjbs);
} }
...@@ -1177,10 +1124,8 @@ public class YgglController { ...@@ -1177,10 +1124,8 @@ public class YgglController {
@ApiOperationSupport(order = 49) @ApiOperationSupport(order = 49)
public Result<Boolean> delclfjb(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delclfjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaClfjb.builder().build() return ResultUtil.data(YgglAttaClfjb.builder().build().delete(new QueryWrapper<YgglAttaClfjb>().lambda()
.delete(new QueryWrapper<YgglAttaClfjb>().lambda() .eq(YgglAttaClfjb::getOrgCode, orgCode).eq(YgglAttaClfjb::getId, id)), "删除员工材料附件表成功");
.eq(YgglAttaClfjb::getOrgCode, orgCode)
.eq(YgglAttaClfjb::getId, id)), "删除员工材料附件表成功");
} }
/** /**
...@@ -1193,9 +1138,8 @@ public class YgglController { ...@@ -1193,9 +1138,8 @@ public class YgglController {
@ApiOperation(value = "50.获取成长记录表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "50.获取成长记录表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean) { public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean) {
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build() List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build().selectList(
.selectList(new QueryWrapper<YgglAttaCzjlb>().lambda() new QueryWrapper<YgglAttaCzjlb>().lambda().eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaCzjlb::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaCzjlb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaCzjlbs); return ResultUtil.data(ygglAttaCzjlbs);
} }
...@@ -1205,10 +1149,9 @@ public class YgglController { ...@@ -1205,10 +1149,9 @@ public class YgglController {
@ApiOperation(value = "51.获取成长记录表(管)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "51.获取成长记录表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 51) @ApiOperationSupport(order = 51)
public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) { public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build().selectList( List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build()
new QueryWrapper<YgglAttaCzjlb>().lambda() .selectList(new QueryWrapper<YgglAttaCzjlb>().lambda()
.eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode()) .eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaCzjlb::getEmpNum, empNum));
.eq(YgglAttaCzjlb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaCzjlbs); return ResultUtil.data(ygglAttaCzjlbs);
} }
...@@ -1255,8 +1198,8 @@ public class YgglController { ...@@ -1255,8 +1198,8 @@ public class YgglController {
public Result<Void> ygzz(@CurrentUser UserBean userBean, @RequestBody YgzzDto ygzzDto) { public Result<Void> ygzz(@CurrentUser UserBean userBean, @RequestBody YgzzDto ygzzDto) {
YgglMainEmp.builder().jobStatus(jobStatus.ZHENSHI.getType()).zzTime(ygzzDto.getZzTime()).sjzzTime(new Date()) YgglMainEmp.builder().jobStatus(jobStatus.ZHENSHI.getType()).zzTime(ygzzDto.getZzTime()).sjzzTime(new Date())
.zzRemark(ygzzDto.getZzRemark()).build().update(new UpdateWrapper<YgglMainEmp>().lambda() .zzRemark(ygzzDto.getZzRemark()).build()
.eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum())); .update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
return ResultUtil.success("转正成功!"); return ResultUtil.success("转正成功!");
} }
...@@ -1274,19 +1217,18 @@ public class YgglController { ...@@ -1274,19 +1217,18 @@ public class YgglController {
Integer empNum = lzygQueryDto.getEmpNum(); Integer empNum = lzygQueryDto.getEmpNum();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda() YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum) .eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build(); YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表 // 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb,"before_leaving_sts"); BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
ygglMainLzb.insert(); ygglMainLzb.insert();
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType())
.beforeLeavingSts(ygglMainEmp.getJobStatus()).build()
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).beforeLeavingSts(ygglMainEmp.getJobStatus()) .update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, empNum));
.build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, empNum));
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime()) 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, "添加待离职员工成功"); return ResultUtil.data(ygglMainLzb, "添加待离职员工成功");
} }
...@@ -1308,7 +1250,8 @@ public class YgglController { ...@@ -1308,7 +1250,8 @@ public class YgglController {
YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date()) YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date())
.build().update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, empNum)); .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); qyzxEmpEntAssoMapper.delete(queryWrapper);
...@@ -1337,18 +1280,15 @@ public class YgglController { ...@@ -1337,18 +1280,15 @@ public class YgglController {
@ApiOperationSupport(order = 57) @ApiOperationSupport(order = 57)
public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) { public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
YgglMainEmp ygglMainEmp = ygglMainEmpMapper
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne( .selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum())
new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())); .eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
YgglMainEmp.builder().jobStatus(ygglMainEmp.getBeforeLeavingSts()).build()
YgglMainEmp.builder().jobStatus(ygglMainEmp.getBeforeLeavingSts()).build().update(new UpdateWrapper<YgglMainEmp>().lambda() .update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum()));
.eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum()));
// 删除离职表 // 删除离职表
YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build().delete(new QueryWrapper<YgglMainLzb>().lambda() YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build()
.eq(YgglMainLzb::getEmpNum, lzygQueryDto.getEmpNum())); .delete(new QueryWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, lzygQueryDto.getEmpNum()));
return ResultUtil.success("放弃成功"); return ResultUtil.success("放弃成功");
} }
...@@ -1359,8 +1299,8 @@ public class YgglController { ...@@ -1359,8 +1299,8 @@ public class YgglController {
public Result<YgglMainLzb> tzlzyy(@CurrentUser UserBean userBean, @RequestBody YgglMainLzb ygglMainLzb) { public Result<YgglMainLzb> tzlzyy(@CurrentUser UserBean userBean, @RequestBody YgglMainLzb ygglMainLzb) {
if (ygglMainLzb.getEmpNum() != null) { if (ygglMainLzb.getEmpNum() != null) {
ygglMainLzb.update(new UpdateWrapper<YgglMainLzb>().lambda() ygglMainLzb
.eq(YgglMainLzb::getOrgCode, userBean.getOrgCode()) .update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getOrgCode, userBean.getOrgCode())
.eq(YgglMainLzb::getEmpNum, ygglMainLzb.getEmpNum())); .eq(YgglMainLzb::getEmpNum, ygglMainLzb.getEmpNum()));
return ResultUtil.data(ygglMainLzb, "修改成功"); return ResultUtil.data(ygglMainLzb, "修改成功");
} }
...@@ -1575,8 +1515,8 @@ public class YgglController { ...@@ -1575,8 +1515,8 @@ public class YgglController {
@ApiOperation(value = "65.获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "65.获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 65) @ApiOperationSupport(order = 65)
public Result<List<YgglAttaSbgjj>> selectygsbgjj(@CurrentUser UserBean userBean) { public Result<List<YgglAttaSbgjj>> selectygsbgjj(@CurrentUser UserBean userBean) {
List<YgglAttaSbgjj> ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectList(new QueryWrapper<YgglAttaSbgjj>().lambda() List<YgglAttaSbgjj> ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectList(
.eq(YgglAttaSbgjj::getOrgCode, userBean.getOrgCode()) new QueryWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaSbgjj::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaSbgjj::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaSbgjj); return ResultUtil.data(ygglAttaSbgjj);
} }
...@@ -1634,10 +1574,8 @@ public class YgglController { ...@@ -1634,10 +1574,8 @@ public class YgglController {
@ApiOperationSupport(order = 68) @ApiOperationSupport(order = 68)
public Result<Boolean> delygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer id) { public Result<Boolean> delygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaSbgjj.builder().build() return ResultUtil.data(YgglAttaSbgjj.builder().build().delete(new QueryWrapper<YgglAttaSbgjj>().lambda()
.delete(new QueryWrapper<YgglAttaSbgjj>().lambda() .eq(YgglAttaSbgjj::getOrgCode, orgCode).eq(YgglAttaSbgjj::getId, id)));
.eq(YgglAttaSbgjj::getOrgCode, orgCode)
.eq(YgglAttaSbgjj::getId, id)));
} }
@GetMapping(value = "/sysRegion") @GetMapping(value = "/sysRegion")
...@@ -1645,7 +1583,7 @@ public class YgglController { ...@@ -1645,7 +1583,7 @@ public class YgglController {
public Result<List<Tree<String>>> sysRegion() { public Result<List<Tree<String>>> sysRegion() {
List<SysRegion> nodeList = SysRegion.builder().build() List<SysRegion> nodeList = SysRegion.builder().build()
.selectList(new LambdaQueryWrapper<SysRegion>().select(SysRegion::getKeyId, SysRegion::getRegionCode, .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(); TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
...@@ -1657,10 +1595,11 @@ public class YgglController { ...@@ -1657,10 +1595,11 @@ public class YgglController {
List<Tree<String>> treeNodes = TreeUtil.build(nodeList, "0", treeNodeConfig, (treeNode, tree) -> { List<Tree<String>> treeNodes = TreeUtil.build(nodeList, "0", treeNodeConfig, (treeNode, tree) -> {
tree.setId(treeNode.getKeyId().toString()); tree.setId(treeNode.getKeyId().toString());
tree.setParentId(treeNode.getRegionCode()); tree.setParentId(treeNode.getRegionCode().toString());
tree.setName(treeNode.getRegionName()); tree.setName(treeNode.getRegionName());
// 扩展属性 ... // 扩展属性 ...
tree.putExtra("mer_name", treeNode.getMerName()); tree.putExtra("mer_name", treeNode.getMerName());
tree.putExtra("zip_code", treeNode.getZipCode());
}); });
return ResultUtil.data(treeNodes); 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