员工入职机构
This commit is contained in:
parent
c7b3a7d076
commit
9d9f757ce7
|
|
@ -1,8 +1,13 @@
|
|||
package com.nu.modules.employeesInfo.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
|
|
@ -22,126 +27,126 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 员工信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-01
|
||||
* @Date: 2025-04-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="员工信息")
|
||||
@Api(tags = "员工信息")
|
||||
@RestController
|
||||
@RequestMapping("/admin/bizEmployeesInfo/bizEmployeesInfo")
|
||||
@Slf4j
|
||||
public class BizEmployeesInfoController extends JeecgController<BizEmployeesInfo, IBizEmployeesInfoService> {
|
||||
@Autowired
|
||||
private IBizEmployeesInfoService bizEmployeesInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param bizEmployeesInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工信息-分页列表查询")
|
||||
@ApiOperation(value="员工信息-分页列表查询", notes="员工信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<BizEmployeesInfo>> queryPageList(BizEmployeesInfo bizEmployeesInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BizEmployeesInfo> queryWrapper = QueryGenerator.initQueryWrapper(bizEmployeesInfo, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<BizEmployeesInfo> page = new Page<BizEmployeesInfo>(pageNo, pageSize);
|
||||
IPage<BizEmployeesInfo> pageList = bizEmployeesInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param bizEmployeesInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-添加")
|
||||
@ApiOperation(value="员工信息-添加", notes="员工信息-添加")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody BizEmployeesInfo bizEmployeesInfo) {
|
||||
bizEmployeesInfoService.save(bizEmployeesInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param bizEmployeesInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-编辑")
|
||||
@ApiOperation(value="员工信息-编辑", notes="员工信息-编辑")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody BizEmployeesInfo bizEmployeesInfo) {
|
||||
bizEmployeesInfoService.updateById(bizEmployeesInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-通过id删除")
|
||||
@ApiOperation(value="员工信息-通过id删除", notes="员工信息-通过id删除")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
bizEmployeesInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-批量删除")
|
||||
@ApiOperation(value="员工信息-批量删除", notes="员工信息-批量删除")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.bizEmployeesInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工信息-通过id查询")
|
||||
@ApiOperation(value="员工信息-通过id查询", notes="员工信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<BizEmployeesInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
BizEmployeesInfo bizEmployeesInfo = bizEmployeesInfoService.getById(id);
|
||||
if(bizEmployeesInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(bizEmployeesInfo);
|
||||
}
|
||||
@Autowired
|
||||
private IBizEmployeesInfoService bizEmployeesInfoService;
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param bizEmployeesInfo
|
||||
*/
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param bizEmployeesInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工信息-分页列表查询")
|
||||
@ApiOperation(value = "员工信息-分页列表查询", notes = "员工信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<BizEmployeesInfo>> queryPageList(BizEmployeesInfo bizEmployeesInfo,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BizEmployeesInfo> queryWrapper = QueryGenerator.initQueryWrapper(bizEmployeesInfo, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<BizEmployeesInfo> page = new Page<BizEmployeesInfo>(pageNo, pageSize);
|
||||
IPage<BizEmployeesInfo> pageList = bizEmployeesInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param bizEmployeesInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-添加")
|
||||
@ApiOperation(value = "员工信息-添加", notes = "员工信息-添加")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody BizEmployeesInfo bizEmployeesInfo) {
|
||||
bizEmployeesInfoService.save(bizEmployeesInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param bizEmployeesInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-编辑")
|
||||
@ApiOperation(value = "员工信息-编辑", notes = "员工信息-编辑")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody BizEmployeesInfo bizEmployeesInfo) {
|
||||
bizEmployeesInfoService.updateById(bizEmployeesInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-通过id删除")
|
||||
@ApiOperation(value = "员工信息-通过id删除", notes = "员工信息-通过id删除")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
bizEmployeesInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工信息-批量删除")
|
||||
@ApiOperation(value = "员工信息-批量删除", notes = "员工信息-批量删除")
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.bizEmployeesInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工信息-通过id查询")
|
||||
@ApiOperation(value = "员工信息-通过id查询", notes = "员工信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<BizEmployeesInfo> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
BizEmployeesInfo bizEmployeesInfo = bizEmployeesInfoService.getById(id);
|
||||
if (bizEmployeesInfo == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(bizEmployeesInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param bizEmployeesInfo
|
||||
*/
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizEmployeesInfo bizEmployeesInfo) {
|
||||
|
|
@ -149,12 +154,12 @@ public class BizEmployeesInfoController extends JeecgController<BizEmployeesInfo
|
|||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizEmployeesInfo:biz_employees_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.dto.EmployeesApplyMQDto;
|
||||
import com.nu.dto.EmployeesStatusMQDto;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
import com.nu.modules.employeesInfo.service.IBizEmployeesInfoService;
|
||||
|
|
@ -219,4 +220,42 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
return super.importExcel(request, response, EmployeesApply.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请
|
||||
*
|
||||
* @param employeesApply
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工申请-邀请")
|
||||
@ApiOperation(value = "员工申请-邀请", notes = "员工申请-邀请")
|
||||
@PostMapping(value = "/invide")
|
||||
public Result<String> invide(@RequestBody EmployeesApply employeesApply) {
|
||||
//先查下员工在机构负责人停留界面期间是否进行了申请
|
||||
QueryWrapper<EmployeesApply> qw = new QueryWrapper<>();
|
||||
qw.eq("employee_id",employeesApply.getEmployeeId());
|
||||
qw.eq("iz_history","1");
|
||||
qw.eq("status","1");
|
||||
EmployeesApply one = employeesApplyService.getOne(qw);
|
||||
if(one !=null){
|
||||
return Result.error("员工已申请加入机构,请在审核管理中进行审批");
|
||||
}
|
||||
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
|
||||
employeesApply.setId(null);
|
||||
employeesApply.setEmployeeId(employeesApply.getEmployeeId());
|
||||
employeesApply.setStatus("1");
|
||||
employeesApply.setDelFlag("0");
|
||||
employeesApply.setIzHistory("1");
|
||||
employeesApply.setIsInvited("0");
|
||||
employeesApplyService.save(employeesApply);
|
||||
|
||||
//告诉管理平台 像员工-机构关系表nu_biz_employees_org 增加数据
|
||||
EmployeesApplyMQDto mqdto = new EmployeesApplyMQDto();
|
||||
BeanUtils.copyProperties(employeesApply, mqdto);
|
||||
mqdto.setOrgCode(orgCode);
|
||||
rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employees.invide", mqdto);
|
||||
return Result.OK("邀请成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,6 +186,11 @@ public class EmployeesApply implements Serializable {
|
|||
@Excel(name = "是否历史数据", width = 15)
|
||||
@ApiModelProperty(value = "是否历史数据")
|
||||
private java.lang.String izHistory;
|
||||
/**是否为被邀请 0被邀请 1主动申请*/
|
||||
@Excel(name = "是否为被邀请", width = 15)
|
||||
@ApiModelProperty(value = "是否为被邀请")
|
||||
private java.lang.String isInvited;
|
||||
|
||||
/**
|
||||
* 审批字符串 有值时说明是走的审批
|
||||
* auditPass 审批通过
|
||||
|
|
@ -193,4 +198,7 @@ public class EmployeesApply implements Serializable {
|
|||
*/
|
||||
@TableField(exist = false)
|
||||
private String statusVal;
|
||||
/**openId*/
|
||||
@TableField(exist = false)
|
||||
private String openId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface EmployeesApplyMapper extends BaseMapper<EmployeesApply> {
|
||||
|
||||
int cleanErrorInvided(@Param("employeeId") String employeeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.employeesapply.mapper.EmployeesApplyMapper">
|
||||
|
||||
</mapper>
|
||||
<delete id="cleanErrorInvided">
|
||||
delete from nu_biz_employees_apply where employee_id = #{employeeId} and iz_history = '1' and is_invited = '1'
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface IEmployeesApplyService extends IService<EmployeesApply> {
|
||||
|
||||
void cleanErrorInvided(String employeeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.employeesapply.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.nu.modules.employeesapply.mapper.EmployeesApplyMapper;
|
||||
import com.nu.modules.employeesapply.service.IEmployeesApplyService;
|
||||
|
|
@ -7,13 +8,29 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 员工申请
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-05
|
||||
* @Date: 2025-09-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class EmployeesApplyServiceImpl extends ServiceImpl<EmployeesApplyMapper, EmployeesApply> implements IEmployeesApplyService {
|
||||
|
||||
@Override
|
||||
public void cleanErrorInvided(String employeeId) {
|
||||
//删掉已保存的错误数据
|
||||
baseMapper.cleanErrorInvided(employeeId);
|
||||
//将最后一次申请的记录历史状态改为飞历史
|
||||
QueryWrapper<EmployeesApply> qw = new QueryWrapper<>();
|
||||
qw.orderByDesc("create_time");
|
||||
List<EmployeesApply> list = baseMapper.selectList(qw);
|
||||
if (list != null && list.size() > 0) {
|
||||
EmployeesApply employeesApply = list.get(0);
|
||||
employeesApply.setIzHistory("1");
|
||||
baseMapper.updateById(employeesApply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
package com.nu.modules.employessadvisiory.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
import com.nu.modules.employeesInfo.service.IBizEmployeesInfoService;
|
||||
import com.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.nu.modules.employeesapply.service.IEmployeesApplyService;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.employessadvisiory.entity.NuEmployeesAdvisoryInfo;
|
||||
|
|
@ -24,124 +31,154 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 员工咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-09
|
||||
* @Date: 2025-06-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="员工咨询信息")
|
||||
@Api(tags = "员工咨询信息")
|
||||
@RestController
|
||||
@RequestMapping("/admin/employeesAdvisoryInfo")
|
||||
@Slf4j
|
||||
public class NuEmployeesAdvisoryInfoController extends JeecgController<NuEmployeesAdvisoryInfo, INuEmployeesAdvisoryInfoService> {
|
||||
@Autowired
|
||||
private INuEmployeesAdvisoryInfoService nuEmployeesAdvisoryInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工咨询信息-分页列表查询")
|
||||
@ApiOperation(value="员工咨询信息-分页列表查询", notes="员工咨询信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@DS("ope")
|
||||
public Result<IPage<NuEmployeesAdvisoryInfo>> queryPageList(NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuEmployeesAdvisoryInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuEmployeesAdvisoryInfo, req.getParameterMap());
|
||||
Page<NuEmployeesAdvisoryInfo> page = new Page<NuEmployeesAdvisoryInfo>(pageNo, pageSize);
|
||||
IPage<NuEmployeesAdvisoryInfo> pageList = nuEmployeesAdvisoryInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-添加")
|
||||
@ApiOperation(value="员工咨询信息-添加", notes="员工咨询信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo) {
|
||||
nuEmployeesAdvisoryInfoService.save(nuEmployeesAdvisoryInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-编辑")
|
||||
@ApiOperation(value="员工咨询信息-编辑", notes="员工咨询信息-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo) {
|
||||
nuEmployeesAdvisoryInfoService.updateById(nuEmployeesAdvisoryInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-通过id删除")
|
||||
@ApiOperation(value="员工咨询信息-通过id删除", notes="员工咨询信息-通过id删除")
|
||||
@RequiresPermissions("nuEmployeesAdvisoryInfo:nu_employees_advisory_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuEmployeesAdvisoryInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-批量删除")
|
||||
@ApiOperation(value="员工咨询信息-批量删除", notes="员工咨询信息-批量删除")
|
||||
@RequiresPermissions("nuEmployeesAdvisoryInfo:nu_employees_advisory_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuEmployeesAdvisoryInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工咨询信息-通过id查询")
|
||||
@ApiOperation(value="员工咨询信息-通过id查询", notes="员工咨询信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuEmployeesAdvisoryInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo = nuEmployeesAdvisoryInfoService.getById(id);
|
||||
if(nuEmployeesAdvisoryInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuEmployeesAdvisoryInfo);
|
||||
}
|
||||
@Autowired
|
||||
private INuEmployeesAdvisoryInfoService nuEmployeesAdvisoryInfoService;
|
||||
@Autowired
|
||||
private IBizEmployeesInfoService bizEmployeesInfoService;
|
||||
@Autowired
|
||||
private IEmployeesApplyService employeesApplyService;
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
*/
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工咨询信息-分页列表查询")
|
||||
@ApiOperation(value = "员工咨询信息-分页列表查询", notes = "员工咨询信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuEmployeesAdvisoryInfo>> queryPageList(NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
//先查询出需要排除的员工ids
|
||||
QueryWrapper<BizEmployeesInfo> qw1 = new QueryWrapper<>();
|
||||
qw1.select("id");
|
||||
List<BizEmployeesInfo> list1 = bizEmployeesInfoService.list(qw1);
|
||||
List<String> ids1 = list1.stream()
|
||||
.map(BizEmployeesInfo::getId)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<EmployeesApply> qw2 = new QueryWrapper<EmployeesApply>();
|
||||
List<EmployeesApply> list2 = employeesApplyService.list(qw2);
|
||||
List<String> ids2 = list2.stream()
|
||||
.map(EmployeesApply::getEmployeeId)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
if (ids1 != null) {
|
||||
ids1.addAll(ids2);
|
||||
} else {
|
||||
ids1 = ids2;
|
||||
}
|
||||
|
||||
//切换为本地数据源
|
||||
DynamicDataSourceContextHolder.push("ope");
|
||||
QueryWrapper<NuEmployeesAdvisoryInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuEmployeesAdvisoryInfo, req.getParameterMap());
|
||||
Page<NuEmployeesAdvisoryInfo> page = new Page<NuEmployeesAdvisoryInfo>(pageNo, pageSize);
|
||||
if (ids1 != null && ids1.size() > 0) {
|
||||
queryWrapper.notIn("id", ids1);
|
||||
}
|
||||
IPage<NuEmployeesAdvisoryInfo> pageList = nuEmployeesAdvisoryInfoService.page(page, queryWrapper);
|
||||
DynamicDataSourceContextHolder.clear();
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-添加")
|
||||
@ApiOperation(value = "员工咨询信息-添加", notes = "员工咨询信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo) {
|
||||
nuEmployeesAdvisoryInfoService.save(nuEmployeesAdvisoryInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-编辑")
|
||||
@ApiOperation(value = "员工咨询信息-编辑", notes = "员工咨询信息-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo) {
|
||||
nuEmployeesAdvisoryInfoService.updateById(nuEmployeesAdvisoryInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-通过id删除")
|
||||
@ApiOperation(value = "员工咨询信息-通过id删除", notes = "员工咨询信息-通过id删除")
|
||||
@RequiresPermissions("nuEmployeesAdvisoryInfo:nu_employees_advisory_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
nuEmployeesAdvisoryInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工咨询信息-批量删除")
|
||||
@ApiOperation(value = "员工咨询信息-批量删除", notes = "员工咨询信息-批量删除")
|
||||
@RequiresPermissions("nuEmployeesAdvisoryInfo:nu_employees_advisory_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.nuEmployeesAdvisoryInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "员工咨询信息-通过id查询")
|
||||
@ApiOperation(value = "员工咨询信息-通过id查询", notes = "员工咨询信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuEmployeesAdvisoryInfo> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo = nuEmployeesAdvisoryInfoService.getById(id);
|
||||
if (nuEmployeesAdvisoryInfo == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuEmployeesAdvisoryInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuEmployeesAdvisoryInfo
|
||||
*/
|
||||
@RequiresPermissions("nuEmployeesAdvisoryInfo:nu_employees_advisory_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo) {
|
||||
|
|
@ -149,12 +186,12 @@ public class NuEmployeesAdvisoryInfoController extends JeecgController<NuEmploye
|
|||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("nuEmployeesAdvisoryInfo:nu_employees_advisory_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
|
|
|||
|
|
@ -8,14 +8,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.camerainfo.api.CameraInfoApi;
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import com.nu.modules.customerDirective.entity.NuCustomerDirective;
|
||||
import com.nu.modules.customerDirective.service.INuCustomerDirectiveService;
|
||||
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||
import com.nu.modules.nuBaseInfo.mapper.NuBaseInfoMapper;
|
||||
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.nu.modules.nuBizCustomerInfo.mapper.NuBizCustomerInfoMapper;
|
||||
import com.nu.modules.nuBizCustomerInfo.service.INuBizCustomerInfoService;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import com.nu.modules.nubaseinfo.entity.CustomerDirectiveDto;
|
||||
import com.nu.modules.nubaseinfo.entity.CustomerInfoDto;
|
||||
|
|
@ -49,9 +46,6 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
@Autowired
|
||||
private NuBizCustomerInfoMapper customerInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private INuCustomerDirectiveService nuCustomerDirectiveService;
|
||||
|
||||
@Override
|
||||
public void setNuId(NuBaseInfo nuBaseInfo) {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
|
|
@ -150,12 +144,12 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
BeanUtils.copyProperties(nuBizCustomerInfo,customerInfo);
|
||||
nuBaseInfoApiDto.setCustomerInfo(customerInfo);
|
||||
//根据客户id查询服务指令
|
||||
List<NuCustomerDirective> customerDirectiveList = nuCustomerDirectiveService.list(new QueryWrapper<NuCustomerDirective>().lambda().eq(NuCustomerDirective::getCustomerId,customerInfo.getId()));
|
||||
if(customerDirectiveList != null && customerDirectiveList.size() > 0){
|
||||
List<CustomerDirectiveDto> customerDirectiveDtoList = new ArrayList<>();
|
||||
BeanUtils.copyProperties(customerDirectiveList,customerDirectiveDtoList);
|
||||
nuBaseInfoApiDto.setCustomerDirectiveDtoList(customerDirectiveDtoList);
|
||||
}
|
||||
// List<NuCustomerDirective> customerDirectiveList = nuCustomerDirectiveService.list(new QueryWrapper<NuCustomerDirective>().lambda().eq(NuCustomerDirective::getCustomerId,customerInfo.getId()));
|
||||
// if(customerDirectiveList != null && customerDirectiveList.size() > 0){
|
||||
// List<CustomerDirectiveDto> customerDirectiveDtoList = new ArrayList<>();
|
||||
// BeanUtils.copyProperties(customerDirectiveList,customerDirectiveDtoList);
|
||||
// nuBaseInfoApiDto.setCustomerDirectiveDtoList(customerDirectiveDtoList);
|
||||
// }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -25,4 +25,18 @@ public class DynamicQueueNameProvider {
|
|||
public String getKeyName() {
|
||||
return getQueueName();
|
||||
}
|
||||
|
||||
public String getCanNotInvidedQueueName() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isNotBlank(orgCode)) {
|
||||
return orgCode + ".employees.cannotinvided";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getCanNotInvidedKeyName() {
|
||||
return getCanNotInvidedQueueName();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,25 @@ public class EmployeesMQListener {
|
|||
employeesApply.setStatus("1");
|
||||
employeesApply.setDelFlag("0");
|
||||
employeesApply.setIzHistory("1");
|
||||
employeesApply.setIsInvited("1");
|
||||
employeesApplyService.save(employeesApply);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 邀请时发现此员工已申请 清理已保存的数据
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{employeesAsyncDQNP.getCanNotInvidedQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.employees", type = ExchangeTypes.DIRECT),
|
||||
key = "#{employeesAsyncDQNP.getCanNotInvidedKeyName()}"
|
||||
),
|
||||
errorHandler = "employeesMQErrorHandler"
|
||||
)
|
||||
public void handleCanNotInvided(EmployeesApplyMQDto dto) {
|
||||
employeesApplyService.cleanErrorInvided(dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,4 +29,6 @@ public class EmployeesStatusMQDto implements Serializable {
|
|||
private String orgCode;
|
||||
/**入职时间*/
|
||||
private Date entryTime;
|
||||
/**openId*/
|
||||
private Date openId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue