Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhuyy 2023-02-13 09:01:23 +08:00
commit b3ec0947d3
4 changed files with 27 additions and 6 deletions

View File

@ -50,9 +50,13 @@ public class ExchangeController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "current", value = "当前页"), @ApiImplicitParam(name = "current", value = "当前页"),
@ApiImplicitParam(name = "size", value = "每页条数"), @ApiImplicitParam(name = "size", value = "每页条数"),
@ApiImplicitParam(name = "id", value = "人员选调id")}) @ApiImplicitParam(name = "userName", value = "姓名"),
public AjaxResult exchangePage(){ @ApiImplicitParam(name = "numberId", value = "身份证号"),
return exchangeService.exchangePage(getPage()); @ApiImplicitParam(name = "willCompanyName", value = "调入企业名称"),
@ApiImplicitParam(name = "CompanyName", value = "调出企业名称"),
@ApiImplicitParam(name = "receipts", value = "单据状态")})
public AjaxResult exchangePage(String userName,String numberId,String willCompanyName,String CompanyName,String receipts){
return exchangeService.exchangePage(getPage(),userName,numberId,willCompanyName,CompanyName,receipts);
} }
@GetMapping("selectById") @GetMapping("selectById")
@ApiOperation(value = "查看") @ApiOperation(value = "查看")

View File

@ -16,6 +16,9 @@ import java.time.LocalDateTime;
@Data @Data
public class ExchangePageDto { public class ExchangePageDto {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "员工id") @ApiModelProperty(value = "员工id")
private String personnelId; private String personnelId;

View File

@ -16,7 +16,7 @@ import com.ydool.staff.request.PersonnelUpdateRequest;
*/ */
public interface IExchangeService { public interface IExchangeService {
AjaxResult exchangePage(Page page); AjaxResult exchangePage(Page page,String userName,String numberId,String willCompanyName,String CompanyName,String receipts);
AjaxResult saveExchange(ExchangeRequest exchangeRequest); AjaxResult saveExchange(ExchangeRequest exchangeRequest);

View File

@ -4,8 +4,11 @@ import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.query.MPJQueryWrapper;
import com.ydool.common.constant.ArgsConst; import com.ydool.common.constant.ArgsConst;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto; import com.ydool.staff.dto.AttachmentDto;
@ -67,8 +70,19 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
@Resource @Resource
private UserMapper userMapper; private UserMapper userMapper;
@Override @Override
public AjaxResult exchangePage(Page page) { public AjaxResult exchangePage(Page page,String userName,String numberId,String willCompanyName,String companyName,String receipts) {
Page exchangePage = page(page, new LambdaQueryWrapper<>()); QueryWrapper<Exchange> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(StrUtil.isNotBlank(willCompanyName),Exchange::getWillCompanyId,willCompanyName)
.exists(StrUtil.isNotBlank(companyName),
"select p.id from t_lc_personnel p where t_lc_exchange.personnel_id = p.id and p.company_name = " +"'"+ companyName+"'")
.exists(StrUtil.isNotBlank(receipts),
"select p.id from t_lc_personnel p where t_lc_exchange.personnel_id = p.id and p.receipts = " +"'"+ receipts+"'")
.exists(StrUtil.isNotBlank(userName),
"select p.id from t_lc_personnel p where t_lc_exchange.personnel_id = p.id and p.user_name like '%" + userName + "%'")
.exists(StrUtil.isNotBlank(numberId),
"select p.id from t_lc_personnel p where t_lc_exchange.personnel_id = p.id and p.number_id =" + numberId);
Page exchangePage = page(page,wrapper);
List<Exchange> list = exchangePage.getRecords(); List<Exchange> list = exchangePage.getRecords();
exchangePage.setRecords(list.stream().map(e->{ exchangePage.setRecords(list.stream().map(e->{
ExchangePageDto dto = BeanUtil.copyProperties(e, ExchangePageDto.class); ExchangePageDto dto = BeanUtil.copyProperties(e, ExchangePageDto.class);