外部人员基础信息
This commit is contained in:
parent
79a29df0de
commit
a5596d503f
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.entity.extemp.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -18,7 +17,7 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExtEmpSaveParam extends BaseQueryParam {
|
||||
public class ExtEmpSaveParam {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.engine.salary.entity.extemp.po;
|
||||
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -22,10 +24,12 @@ public class ExtEmpPO {
|
|||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
private String username;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
/**
|
||||
* 部门ID
|
||||
|
|
@ -34,6 +38,7 @@ public class ExtEmpPO {
|
|||
/**
|
||||
* 分部
|
||||
*/
|
||||
@TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName")
|
||||
private String subcompanyName;
|
||||
/**
|
||||
* 分部ID
|
||||
|
|
@ -42,6 +47,7 @@ public class ExtEmpPO {
|
|||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@TableTitle(title = "岗位", dataIndex = "jobtitleName", key = "jobtitleName")
|
||||
private String jobtitleName;
|
||||
/**
|
||||
* 岗位ID
|
||||
|
|
@ -50,6 +56,7 @@ public class ExtEmpPO {
|
|||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
@TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate")
|
||||
private String companystartdate;
|
||||
/**
|
||||
* 手机
|
||||
|
|
@ -62,6 +69,7 @@ public class ExtEmpPO {
|
|||
/**
|
||||
* 工号
|
||||
*/
|
||||
@TableTitle(title = "工号", dataIndex = "workcode", key = "workcode")
|
||||
private String workcode;
|
||||
/**
|
||||
* 性别
|
||||
|
|
@ -120,4 +128,5 @@ public class ExtEmpPO {
|
|||
*/
|
||||
private String tenantKey;
|
||||
|
||||
}
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,59 +6,53 @@ import java.util.List;
|
|||
|
||||
public interface ExternalEmployeeMapper {
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<ExtEmpPO> listAll();
|
||||
List<ExtEmpPO> listAll();
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
ExtEmpPO getById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param externalEmployee 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(ExtEmpPO externalEmployee);
|
||||
|
||||
/**
|
||||
ExtEmpPO getById(Integer id);
|
||||
|
||||
List<ExtEmpPO> listSome(ExtEmpPO po);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param externalEmployee 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(ExtEmpPO externalEmployee);
|
||||
|
||||
/**
|
||||
int insertIgnoreNull(ExtEmpPO externalEmployee);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param externalEmployee 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(ExtEmpPO externalEmployee);
|
||||
|
||||
/**
|
||||
int update(ExtEmpPO externalEmployee);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param externalEmployee 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(ExtEmpPO externalEmployee);
|
||||
|
||||
/**
|
||||
int updateIgnoreNull(ExtEmpPO externalEmployee);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(Long id);
|
||||
|
||||
int delete(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="username != null">
|
||||
<if test="username != null and username!=''">
|
||||
AND username = #{username}
|
||||
</if>
|
||||
<if test="departmentName != null">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -10,9 +12,11 @@ public interface ExtEmpService {
|
|||
|
||||
List<ExtEmpPO> list(ExtEmpQueryParam param);
|
||||
|
||||
void save(ExtEmpPO po);
|
||||
PageInfo<ExtEmpPO> listPage (ExtEmpQueryParam param);
|
||||
|
||||
void update(ExtEmpPO po);
|
||||
void save(ExtEmpSaveParam po);
|
||||
|
||||
void update(ExtEmpSaveParam po);
|
||||
|
||||
void delete(Collection<Long> ids);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
||||
import com.engine.salary.mapper.extemp.ExternalEmployeeMapper;
|
||||
import com.engine.salary.service.ExtEmpService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -29,16 +35,41 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
|||
|
||||
@Override
|
||||
public List<ExtEmpPO> list(ExtEmpQueryParam param) {
|
||||
return null;
|
||||
return getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(ExtEmpPO po) {
|
||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
||||
List<ExtEmpPO> extEmpPOS = list(param);
|
||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(ExtEmpSaveParam param) {
|
||||
ExtEmpPO po = new ExtEmpPO();
|
||||
BeanUtils.copyProperties(param, po);
|
||||
|
||||
po.setId(IdGenerator.generate());
|
||||
po.setCreator((long) user.getUID());
|
||||
po.setModifier((long) user.getUID());
|
||||
Date now = new Date();
|
||||
po.setCreateTime(now);
|
||||
po.setUpdateTime(now);
|
||||
po.setDeleteType(0);
|
||||
|
||||
getExternalEmployeeMapper().insertIgnoreNull(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(ExtEmpPO po) {
|
||||
public void update(ExtEmpSaveParam param) {
|
||||
ExtEmpPO po = new ExtEmpPO();
|
||||
BeanUtils.copyProperties(param, po);
|
||||
|
||||
po.setModifier((long) user.getUID());
|
||||
Date now = new Date();
|
||||
po.setUpdateTime(now);
|
||||
|
||||
getExternalEmployeeMapper().updateIgnoreNull(po);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
|||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.ExtEmpWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
|
@ -18,7 +19,6 @@ import javax.ws.rs.Produces;
|
|||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 外部人员
|
||||
|
|
@ -35,11 +35,11 @@ public class ExtEmpController {
|
|||
}
|
||||
|
||||
@POST
|
||||
@Path("/list")
|
||||
@Path("/listPage")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<ExtEmpQueryParam, List<ExtEmpPO>>(user).run(getExtEmpWrapper(user)::list, param);
|
||||
return new ResponseResult<ExtEmpQueryParam, PageInfo<ExtEmpPO>>(user).run(getExtEmpWrapper(user)::listPage, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
|
|
|||
|
|
@ -7,11 +7,10 @@ import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
|||
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
||||
import com.engine.salary.service.ExtEmpService;
|
||||
import com.engine.salary.service.impl.ExtEmpServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 累计专项
|
||||
|
|
@ -28,22 +27,16 @@ public class ExtEmpWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
public List<ExtEmpPO> list(ExtEmpQueryParam param) {
|
||||
return null;
|
||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
||||
return getExtEmpService(user).listPage(param);
|
||||
}
|
||||
|
||||
public void save(ExtEmpSaveParam param) {
|
||||
|
||||
ExtEmpPO po = new ExtEmpPO();
|
||||
BeanUtils.copyProperties(param, po);
|
||||
|
||||
getExtEmpService(user).save(po);
|
||||
getExtEmpService(user).save(param);
|
||||
}
|
||||
|
||||
public void update(ExtEmpSaveParam param) {
|
||||
ExtEmpPO po = new ExtEmpPO();
|
||||
BeanUtils.copyProperties(param, po);
|
||||
getExtEmpService(user).update(po);
|
||||
getExtEmpService(user).update(param);
|
||||
}
|
||||
|
||||
public void delete(Collection<Long> ids) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue