Commit 894aa8b6 by 邓实川 Committed by chenzg

细节判断优化

parent e16bf212
...@@ -32,6 +32,7 @@ import com.github.pagehelper.PageHelper; ...@@ -32,6 +32,7 @@ import com.github.pagehelper.PageHelper;
import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
...@@ -111,7 +112,7 @@ public class QyzxBusinessController { ...@@ -111,7 +112,7 @@ public class QyzxBusinessController {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().build() QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxEntInfoM>().eq(QyzxEntInfoM::getId, userBean.getOrgCode())); .selectOne(new LambdaQueryWrapper<QyzxEntInfoM>().eq(QyzxEntInfoM::getId, userBean.getOrgCode()));
Date endTime = qyzxEntInfoM.getEndTime(); Date endTime = qyzxEntInfoM.getEndTime();
Long day = DateUtil.between(new Date(), endTime, DateUnit.DAY,false); Long day = DateUtil.between(new Date(), endTime, DateUnit.DAY, false);
Integer level = qyzxEntInfoM.getLevel(); Integer level = qyzxEntInfoM.getLevel();
Map<String, Object> map1 = new HashMap<String, Object>(); Map<String, Object> map1 = new HashMap<String, Object>();
...@@ -151,13 +152,22 @@ public class QyzxBusinessController { ...@@ -151,13 +152,22 @@ public class QyzxBusinessController {
@GetMapping(value = "/getPayList/System") @GetMapping(value = "/getPayList/System")
@ApiOperation(value = "获取系统续费商品列表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取系统续费商品列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxPayContent>> getPayListWithSystem(@CurrentUser UserBean userBean) { public Result<Map<String, Object>> getPayListWithSystem(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build() List<QyzxPayContent> list1 = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3).select( .selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3)
QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice, .eq(QyzxPayContent::getSpecification, 1).select(QyzxPayContent::getId,
QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification, QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice,
QyzxPayContent::getExpiration)); QyzxPayContent::getExpiration));
return ResultUtil.data(list, "获取成功"); List<QyzxPayContent> list2 = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3)
.eq(QyzxPayContent::getSpecification, 2).select(QyzxPayContent::getId,
QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice,
QyzxPayContent::getExpiration));
Map<String, Object> map = new HashMap<String, Object>();
map.put("simple", list1);
map.put("professional", list2);
return ResultUtil.data(map, "获取成功");
} }
@PostMapping(value = "/generateOrder") @PostMapping(value = "/generateOrder")
...@@ -211,10 +221,33 @@ public class QyzxBusinessController { ...@@ -211,10 +221,33 @@ public class QyzxBusinessController {
return ResultUtil.pageData(list, page.getTotal(), "查询成功"); return ResultUtil.pageData(list, page.getTotal(), "查询成功");
} }
public static void main(String[] args) {
QyzxInvoiceData qyzxInvoiceData = new QyzxInvoiceData();
qyzxInvoiceData.setBankAccount("123");
qyzxInvoiceData.setBankName("234");
if (!ObjectUtil.isAllNotEmpty(qyzxInvoiceData, qyzxInvoiceData.getBankAccount(),
qyzxInvoiceData.getBankName())) {
System.out.println("请完善发票信息!");
} else {
System.err.println("可以,不错");
}
}
@PostMapping(value = "/invoicing") @PostMapping(value = "/invoicing")
@ApiOperation(value = "开发票", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "开发票", httpMethod = "POST", notes = "接口发布说明")
public Result<QyzxInvoiceData> generateOrder(@CurrentUser UserBean userBean, public Result<QyzxInvoiceData> generateOrder(@CurrentUser UserBean userBean,
@RequestBody QyzxInvoiceData qyzxInvoiceData) { @RequestBody QyzxInvoiceData qyzxInvoiceData) {
if (!ObjectUtil.isAllNotEmpty(qyzxInvoiceData, qyzxInvoiceData.getInvoiceTitle(),
qyzxInvoiceData.getDutyParagraph(), qyzxInvoiceData.getCompanyAddress(),
qyzxInvoiceData.getCompanyPhone(), qyzxInvoiceData.getBankName(), qyzxInvoiceData.getBankAccount(),
qyzxInvoiceData.getInvoiceType(), qyzxInvoiceData.getInvoiceProject(),
qyzxInvoiceData.getInvoiceValue(), qyzxInvoiceData.getConsignee(), qyzxInvoiceData.getConsigneePhone(),
qyzxInvoiceData.getEmail(), qyzxInvoiceData.getShippingArea(), qyzxInvoiceData.getShippingAddress(),
qyzxInvoiceData.getZipCode())) {
return ResultUtil.error("请完善发票信息!");
}
String orderNo = qyzxInvoiceData.getOrderNo(); String orderNo = qyzxInvoiceData.getOrderNo();
QyzxBuyRecord qyzxBuyRecord = QyzxBuyRecord.builder().build() QyzxBuyRecord qyzxBuyRecord = QyzxBuyRecord.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxBuyRecord>().eq(QyzxBuyRecord::getOrderNo, orderNo)); .selectOne(new LambdaQueryWrapper<QyzxBuyRecord>().eq(QyzxBuyRecord::getOrderNo, orderNo));
......
...@@ -8,7 +8,6 @@ package cn.timer.api.controller.yggl; ...@@ -8,7 +8,6 @@ package cn.timer.api.controller.yggl;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -21,9 +20,7 @@ import java.util.regex.Pattern; ...@@ -21,9 +20,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import javax.websocket.server.PathParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
...@@ -42,6 +39,7 @@ import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWra ...@@ -42,6 +39,7 @@ import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWra
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.StringUtil; import com.github.pagehelper.util.StringUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
...@@ -76,13 +74,13 @@ import cn.timer.api.dao.yggl.YgMzDtoMapper; ...@@ -76,13 +74,13 @@ import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.yggl.YgProDtoMapper; import cn.timer.api.dao.yggl.YgProDtoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper; import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper; import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper; import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto; import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.LoginerChargeDto; import cn.timer.api.dto.yggl.LoginerChargeDto;
import cn.timer.api.dto.yggl.LzbQueryDto; import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto; import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgAreaDto; import cn.timer.api.dto.yggl.YgAreaDto;
import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgCityDto; import cn.timer.api.dto.yggl.YgCityDto;
import cn.timer.api.dto.yggl.YgDrjqbDto; import cn.timer.api.dto.yggl.YgDrjqbDto;
import cn.timer.api.dto.yggl.YgDrsDto; import cn.timer.api.dto.yggl.YgDrsDto;
...@@ -93,7 +91,6 @@ import cn.timer.api.dto.yggl.YgbintuDto; ...@@ -93,7 +91,6 @@ import cn.timer.api.dto.yggl.YgbintuDto;
import cn.timer.api.dto.yggl.YgglCartogramDto; import cn.timer.api.dto.yggl.YgglCartogramDto;
import cn.timer.api.dto.yggl.YgjgDto; import cn.timer.api.dto.yggl.YgjgDto;
import cn.timer.api.dto.yggl.YgmzDto; import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgzzDto; import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.Md5; import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
...@@ -135,7 +132,7 @@ public class YgglController { ...@@ -135,7 +132,7 @@ public class YgglController {
// weng(民族) // weng(民族)
@Autowired @Autowired
private YgMzDtoMapper ygMzDtoMapper; private YgMzDtoMapper ygMzDtoMapper;
/** /**
* 获取登录人的相关信息 * 获取登录人的相关信息
* *
...@@ -148,14 +145,16 @@ public class YgglController { ...@@ -148,14 +145,16 @@ public class YgglController {
public Result<YgglMainEmp> loginmessage(@CurrentUser UserBean userBean) { public Result<YgglMainEmp> loginmessage(@CurrentUser UserBean userBean) {
Integer empNum = userBean.getEmpNum(); Integer empNum = userBean.getEmpNum();
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
YgglMainEmp ygglMainEmp=new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper) YgglMainEmp ygglMainEmp = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId,YgglMainEmp::getName,YgglMainEmp::getRzTime,YgglMainEmp::getEmpNum). .select(YgglMainEmp::getBmgwId, YgglMainEmp::getName, YgglMainEmp::getRzTime, YgglMainEmp::getEmpNum)
eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one(); .eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
Integer gw = ygglMainEmp.getBmgwId(); Integer gw = ygglMainEmp.getBmgwId();
ZzglBmgwM bmid = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId).eq(ZzglBmgwM::getId, gw).eq(ZzglBmgwM::getOrgCode, orgCode).one(); ZzglBmgwM bmid = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId)
.eq(ZzglBmgwM::getId, gw).eq(ZzglBmgwM::getOrgCode, orgCode).one();
ygglMainEmp.setUnionid(bmid.toString()); ygglMainEmp.setUnionid(bmid.toString());
return ResultUtil.data(ygglMainEmp, "部门id返回字段为unionid"); return ResultUtil.data(ygglMainEmp, "部门id返回字段为unionid");
} }
/** /**
* 获取登录人和上级主管的empNum和名称 * 获取登录人和上级主管的empNum和名称
* *
...@@ -170,54 +169,56 @@ public class YgglController { ...@@ -170,54 +169,56 @@ public class YgglController {
ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<Integer> list = new ArrayList<Integer>();
Integer empNum = userBean.getEmpNum(); Integer empNum = userBean.getEmpNum();
Integer gw = empNumConfirm(orgCode, empNum).getBmgwId(); Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getOrgCode, orgCode).list(); List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
//获取该员工的上级部门id 的数组list .eq(ZzglBmgwM::getOrgCode, orgCode).list();
// 获取该员工的上级部门id 的数组list
ZzglBmgwM.getUpDepts(list, gw, zzglBmgwMs); ZzglBmgwM.getUpDepts(list, gw, zzglBmgwMs);
List<Integer> leaderList = new ArrayList<Integer>(); List<Integer> leaderList = new ArrayList<Integer>();
for (Integer zzglId : list) { for (Integer zzglId : list) {
for (ZzglBmgwM zzglBmgwM : zzglBmgwMs) { for (ZzglBmgwM zzglBmgwM : zzglBmgwMs) {
if (zzglId.equals(zzglBmgwM.getId()) && zzglBmgwM.getLeader()!=null) { if (zzglId.equals(zzglBmgwM.getId()) && zzglBmgwM.getLeader() != null) {
leaderList.add(zzglBmgwM.getLeader()); leaderList.add(zzglBmgwM.getLeader());
} }
} }
} }
List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList); List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList);
List<LoginerChargeDto> loginerChargeDtos =new ArrayList<LoginerChargeDto>(); List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
for (YgglMainEmp m : ygglMainEmps) { for (YgglMainEmp m : ygglMainEmps) {
if (m.getHeadUrl() == null) { if (m.getHeadUrl() == null) {
m.setHeadUrl(""); m.setHeadUrl("");
} }
loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(),m.getName(),m.getHeadUrl())); loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(), m.getName(), m.getHeadUrl()));
} }
Collections.reverse(loginerChargeDtos); Collections.reverse(loginerChargeDtos);
return ResultUtil.data(loginerChargeDtos, "获取上级部门的部门id"); return ResultUtil.data(loginerChargeDtos, "获取上级部门的部门id");
} }
//根据传来的empNum获取该人员信息,没有则传全部
public List<YgglMainEmp> empNumsConfirm(Integer orgCode,List<Integer> empNumList) { // 根据传来的empNum获取该人员信息,没有则传全部
List<YgglMainEmp> all = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getOrgCode, orgCode).list(); public List<YgglMainEmp> empNumsConfirm(Integer orgCode, List<Integer> empNumList) {
List<YgglMainEmp> all = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, orgCode).list();
List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>(); List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>();
if (empNumList.size()!=0) { if (empNumList.size() != 0) {
for (Integer empNum : empNumList) { for (Integer empNum : empNumList) {
all.stream().filter(item -> empNum.equals(item.getEmpNum())).forEach(action ->{ all.stream().filter(item -> empNum.equals(item.getEmpNum())).forEach(action -> {
ygglMainEmps.add(action); ygglMainEmps.add(action);
}); });
} }
}else { } else {
ygglMainEmps.addAll(all); ygglMainEmps.addAll(all);
} }
return ygglMainEmps; return ygglMainEmps;
} }
//根据传来的empNum获取该人员信息
public YgglMainEmp empNumConfirm(Integer orgCode,Integer empNum) { // 根据传来的empNum获取该人员信息
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one(); public YgglMainEmp empNumConfirm(Integer orgCode, Integer empNum) {
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
return one; return one;
} }
/** /**
* 获取用户头像 * 获取用户头像
* *
...@@ -228,11 +229,13 @@ public class YgglController { ...@@ -228,11 +229,13 @@ public class YgglController {
@ApiOperation(value = "获取用户头像", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "获取用户头像", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 70) @ApiOperationSupport(order = 70)
public Result<List<YgglMainEmp>> headphotos(@CurrentUser UserBean userBean, @RequestBody List<Integer> empNumList) { public Result<List<YgglMainEmp>> headphotos(@CurrentUser UserBean userBean, @RequestBody List<Integer> empNumList) {
if (empNumList.size()==0) { if (empNumList.size() == 0) {
return ResultUtil.error("请输入empNum数组"); return ResultUtil.error("请输入empNum数组");
} }
List<YgglMainEmp> yglList = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda() List<YgglMainEmp> yglList = YgglMainEmp.builder().build()
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getEmpNum, empNumList).select(YgglMainEmp::getEmpNum,YgglMainEmp::getName,YgglMainEmp::getHeadUrl)); .selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.in(YgglMainEmp::getEmpNum, empNumList)
.select(YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getHeadUrl));
for (YgglMainEmp yg : yglList) { for (YgglMainEmp yg : yglList) {
if (StringUtil.isEmpty(yg.getHeadUrl())) { if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl(""); yg.setHeadUrl("");
...@@ -240,6 +243,7 @@ public class YgglController { ...@@ -240,6 +243,7 @@ public class YgglController {
} }
return ResultUtil.data(yglList, "获取用户头像组成功"); return ResultUtil.data(yglList, "获取用户头像组成功");
} }
/** /**
* 获取员工档案 * 获取员工档案
* *
...@@ -428,8 +432,9 @@ public class YgglController { ...@@ -428,8 +432,9 @@ 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.select("name", "emp_num", "bmgw_id", "rz_time", "job_type", "phone", "job_status") queryWrapper.select("name", "emp_num", "bmgw_id", "rz_time", "job_type", "phone", "job_status")
.ne("job_status", YgEnumInterface.jobStatus.YILIZHI.getType()).eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t) .ne("job_status", YgEnumInterface.jobStatus.YILIZHI.getType()).eq("org_code", orgCode)
.eq(j != null && j > -1, "job_status", j).in(!bList.isEmpty(), "bmgw_id", bList) .eq(t != null && t > -1, "job_type", t).eq(j != null && j > -1, "job_status", j)
.in(!bList.isEmpty(), "bmgw_id", bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q)); .and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q));
// List<YgglMainEmp> lo = YgglMainEmp.builder().build().selectList(queryWrapper); // List<YgglMainEmp> lo = YgglMainEmp.builder().build().selectList(queryWrapper);
...@@ -1499,8 +1504,8 @@ public class YgglController { ...@@ -1499,8 +1504,8 @@ public class YgglController {
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>(); UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum()); updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(3).build().update(updateWrapper); YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(3).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime()).lzyy(lzygQueryDto.getLzyy()) YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1); .lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
// 删除员工表 // 删除员工表
// ygglMainEmp.deleteById(); // ygglMainEmp.deleteById();
// 删除员工登陆表 // 删除员工登陆表
...@@ -1525,9 +1530,10 @@ public class YgglController { ...@@ -1525,9 +1530,10 @@ public class YgglController {
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum()); updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>(); UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum()); updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).build().update(updateWrapper); YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date()).build() .build().update(updateWrapper);
.update(updateWrapper1); YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
.sjlzTime(new Date()).build().update(updateWrapper1);
// 查询该员工的关联表 // 查询该员工的关联表
QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>(); QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>();
queryWrapper1.eq("emp_num", lzygQueryDto.getEmpNum()); queryWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
...@@ -1616,29 +1622,28 @@ public class YgglController { ...@@ -1616,29 +1622,28 @@ public class YgglController {
* @param * @param
* @return * @return
*/ */
@PostMapping(value = "/jg") @PostMapping(value = "/jg")
@ApiOperation(value = "展示籍贯所有省市区", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "展示籍贯所有省市区", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 60) @ApiOperationSupport(order = 60)
public Result<List<YgjgDto>> selectjgs(@CurrentUser UserBean userBean) { public Result<List<YgjgDto>> selectjgs(@CurrentUser UserBean userBean) {
List<YgjgDto> oldfather = new ArrayList<YgjgDto>();//老父亲 List<YgjgDto> oldfather = new ArrayList<YgjgDto>();// 老父亲
List<YgProDto> pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).list();// super继承人
List<YgProDto> pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).list();//super继承人 List<YgCityDto> city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).list();
List<YgCityDto> city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).list(); List<YgAreaDto> area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).list();
List<YgAreaDto> area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).list();
for (YgProDto p : pro) {
for (YgProDto p : pro) {
Map<String, Object> map = BeanUtil.beanToMap(p); Map<String, Object> map = BeanUtil.beanToMap(p);
//设置别名对应bean // 设置别名对应bean
HashMap<String, String> mapping = CollUtil.newHashMap(); HashMap<String, String> mapping = CollUtil.newHashMap();
mapping.put("id", "jgid"); mapping.put("id", "jgid");
mapping.put("name", "jgname"); mapping.put("name", "jgname");
YgjgDto ygproDto = BeanUtil.mapToBean(map, YgjgDto.class,CopyOptions.create().setFieldMapping(mapping)); YgjgDto ygproDto = BeanUtil.mapToBean(map, YgjgDto.class, CopyOptions.create().setFieldMapping(mapping));
//添加cityList // 添加cityList
//给一个upid // 给一个upid
List<YgCityDto> outcity= uptocityList(city, ygproDto.getJgid()); List<YgCityDto> outcity = uptocityList(city, ygproDto.getJgid());
//新建一个篮子 // 新建一个篮子
List<YgjgDto> cityDtos = new ArrayList<YgjgDto>(); List<YgjgDto> cityDtos = new ArrayList<YgjgDto>();
for (YgCityDto c : outcity) { for (YgCityDto c : outcity) {
Map<String, Object> map2 = BeanUtil.beanToMap(c); Map<String, Object> map2 = BeanUtil.beanToMap(c);
...@@ -1646,11 +1651,12 @@ public class YgglController { ...@@ -1646,11 +1651,12 @@ public class YgglController {
mapping2.put("id", "jgid"); mapping2.put("id", "jgid");
mapping2.put("name", "jgname"); mapping2.put("name", "jgname");
mapping2.put("province", "upid"); mapping2.put("province", "upid");
YgjgDto ygcityDto = BeanUtil.mapToBean(map2, YgjgDto.class,CopyOptions.create().setFieldMapping(mapping2)); YgjgDto ygcityDto = BeanUtil.mapToBean(map2, YgjgDto.class,
//把果实收起来 CopyOptions.create().setFieldMapping(mapping2));
// 把果实收起来
cityDtos.add(ygcityDto); cityDtos.add(ygcityDto);
List<YgAreaDto> outarea = uptoareaList(area, ygcityDto.getJgid()); List<YgAreaDto> outarea = uptoareaList(area, ygcityDto.getJgid());
List<YgjgDto> areaDtos = new ArrayList<YgjgDto>(); List<YgjgDto> areaDtos = new ArrayList<YgjgDto>();
for (YgAreaDto a : outarea) { for (YgAreaDto a : outarea) {
Map<String, Object> map3 = BeanUtil.beanToMap(a); Map<String, Object> map3 = BeanUtil.beanToMap(a);
...@@ -1658,42 +1664,44 @@ public class YgglController { ...@@ -1658,42 +1664,44 @@ public class YgglController {
mapping3.put("id", "jgid"); mapping3.put("id", "jgid");
mapping3.put("name", "jgname"); mapping3.put("name", "jgname");
mapping3.put("city", "upid"); mapping3.put("city", "upid");
YgjgDto ygjgDto3 = BeanUtil.mapToBean(map3, YgjgDto.class,CopyOptions.create().setFieldMapping(mapping3)); YgjgDto ygjgDto3 = BeanUtil.mapToBean(map3, YgjgDto.class,
CopyOptions.create().setFieldMapping(mapping3));
areaDtos.add(ygjgDto3); areaDtos.add(ygjgDto3);
} }
ygcityDto.setYgjgDtoList(areaDtos); ygcityDto.setYgjgDtoList(areaDtos);
areaDtos.add(ygcityDto); areaDtos.add(ygcityDto);
} }
ygproDto.setYgjgDtoList(cityDtos); ygproDto.setYgjgDtoList(cityDtos);
oldfather.add(ygproDto); oldfather.add(ygproDto);
} }
return ResultUtil.data(oldfather, "老父亲出来了"); return ResultUtil.data(oldfather, "老父亲出来了");
} }
//根据上级id抽取出list
public List<YgCityDto> uptocityList(List<YgCityDto> city, Integer jgid) { // 根据上级id抽取出list
List<YgCityDto> outcity = new ArrayList<YgCityDto>(); public List<YgCityDto> uptocityList(List<YgCityDto> city, Integer jgid) {
for (YgCityDto c : city) { List<YgCityDto> outcity = new ArrayList<YgCityDto>();
if (c.getProvince().equals(jgid)) { for (YgCityDto c : city) {
outcity.add(c); if (c.getProvince().equals(jgid)) {
} outcity.add(c);
} }
city.removeAll(outcity); }
return outcity; city.removeAll(outcity);
} return outcity;
public List<YgAreaDto> uptoareaList(List<YgAreaDto> area, Integer jgid) { }
List<YgAreaDto> outarea = new ArrayList<YgAreaDto>();
for (YgAreaDto a : area) { public List<YgAreaDto> uptoareaList(List<YgAreaDto> area, Integer jgid) {
if (a.getCity().equals(jgid)) { List<YgAreaDto> outarea = new ArrayList<YgAreaDto>();
outarea.add(a); for (YgAreaDto a : area) {
} if (a.getCity().equals(jgid)) {
outarea.add(a);
} }
area.removeAll(outarea); }
return outarea; area.removeAll(outarea);
} return outarea;
}
/** /**
* 展示籍贯/展示所有籍贯(威力增强版) * 展示籍贯/展示所有籍贯(威力增强版)
...@@ -1731,7 +1739,6 @@ public class YgglController { ...@@ -1731,7 +1739,6 @@ public class YgglController {
return ResultUtil.data(maps, "展示籍贯成功"); return ResultUtil.data(maps, "展示籍贯成功");
} }
/** /**
* 查询员工列表 * 查询员工列表
* *
...@@ -1777,7 +1784,9 @@ public class YgglController { ...@@ -1777,7 +1784,9 @@ public class YgglController {
List<YgglCartogramDto> ygglCartogramDto11 = ygglMainEmpMapper.queryWorkingAge(userBean); List<YgglCartogramDto> ygglCartogramDto11 = ygglMainEmpMapper.queryWorkingAge(userBean);
map.put("positive", ygglCartogramDto1.getPositive()); map.put("positive", ygglCartogramDto1.getPositive());
map.put("avgAge", ygglCartogramDto2.getAvgAge()); if (ygglCartogramDto2 != null) {
map.put("avgAge", ygglCartogramDto2.getAvgAge());
}
map.put("induction", ygglCartogramDto3.getInduction()); map.put("induction", ygglCartogramDto3.getInduction());
map.put("probation", ygglCartogramDto4.getProbation()); map.put("probation", ygglCartogramDto4.getProbation());
map.put("regular", ygglCartogramDto4.getRegular()); map.put("regular", ygglCartogramDto4.getRegular());
...@@ -1854,7 +1863,8 @@ public class YgglController { ...@@ -1854,7 +1863,8 @@ public class YgglController {
ageList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString())); ageList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
} }
// 在职 // 在职
Integer zaizhi = jobStatus.get(YgEnumInterface.jobStatus.ZHENSHI.getType()).intValue() + jobStatus.get(YgEnumInterface.jobStatus.SHIYONG.getType()).intValue(); Integer zaizhi = jobStatus.get(YgEnumInterface.jobStatus.ZHENSHI.getType()).intValue()
+ jobStatus.get(YgEnumInterface.jobStatus.SHIYONG.getType()).intValue();
// 本月新入职 // 本月新入职
Integer xinruzhi = workage.get("本月新入职").intValue(); Integer xinruzhi = workage.get("本月新入职").intValue();
// 本月离职 // 本月离职
......
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