YgglController.java 81.8 KB
Newer Older
1 2 3 4 5 6 7
/**
 * @date 2019年11月15日  
 * @author 翁东州
 * @方法中文名称:
 */
package cn.timer.api.controller.yggl;

8 9
import java.text.ParseException;
import java.text.SimpleDateFormat;
10
import java.util.ArrayList;
11
import java.util.Collections;
12 13
import java.util.Date;
import java.util.HashMap;
14
import java.util.HashSet;
15
import java.util.Iterator;
16 17
import java.util.List;
import java.util.Map;
18
import java.util.Map.Entry;
19
import java.util.Set;
20 21
import java.util.regex.Matcher;
import java.util.regex.Pattern;
22
import java.util.stream.Collectors;
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
39 40
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
41
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
东州 翁 committed
42
import com.github.pagehelper.util.StringUtil;
43
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
44

45
import cn.hutool.core.bean.BeanUtil;
46 47
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
48
import cn.hutool.core.collection.ListUtil;
东州 翁 committed
49 50
import cn.hutool.core.date.BetweenFormater.Level;
import cn.hutool.core.date.DateUtil;
51
import cn.hutool.core.util.StrUtil;
52
import cn.timer.api.bean.clazz.CommonArea;
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.yggl.YgglAttaClfjb;
import cn.timer.api.bean.yggl.YgglAttaCzjlb;
import cn.timer.api.bean.yggl.YgglAttaGzjlb;
import cn.timer.api.bean.yggl.YgglAttaGzk;
import cn.timer.api.bean.yggl.YgglAttaHtxxb;
import cn.timer.api.bean.yggl.YgglAttaJjlxr;
import cn.timer.api.bean.yggl.YgglAttaJyjlb;
import cn.timer.api.bean.yggl.YgglAttaLxxxb;
import cn.timer.api.bean.yggl.YgglAttaPxjlxxb;
import cn.timer.api.bean.yggl.YgglAttaSbgjj;
import cn.timer.api.bean.yggl.YgglAttaZcxxb;
import cn.timer.api.bean.yggl.YgglAttaZszjb;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
太阳与水 committed
72
import cn.timer.api.config.enuminterface.YgEnumInterface;
73
import cn.timer.api.config.enums.CommonEnum;
74
import cn.timer.api.controller.yggl.service.YgglService;
75
import cn.timer.api.dao.clazz.CommonAreaMapper;
76
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
77 78 79 80
import cn.timer.api.dao.yggl.YgAreaDtoMapper;
import cn.timer.api.dao.yggl.YgCityDtoMapper;
import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.yggl.YgProDtoMapper;
81 82 83 84
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto;
85
import cn.timer.api.dto.yggl.LoginInfoDto;
86
import cn.timer.api.dto.yggl.LoginerChargeDto;
87 88
import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto;
89
import cn.timer.api.dto.yggl.YgAreaDto;
90
import cn.timer.api.dto.yggl.YgCartogramDto;
91 92 93
import cn.timer.api.dto.yggl.YgCityDto;
import cn.timer.api.dto.yggl.YgDrjqbDto;
import cn.timer.api.dto.yggl.YgDrsDto;
94
import cn.timer.api.dto.yggl.YgKVDto;
东州 翁 committed
95
import cn.timer.api.dto.yggl.YgProDto;
96
import cn.timer.api.dto.yggl.YgQueryDto;
97
import cn.timer.api.dto.yggl.YgbintuDto;
98
import cn.timer.api.dto.yggl.YgglCartogramDto;
99
import cn.timer.api.dto.yggl.YgjgDto;
东州 翁 committed
100
import cn.timer.api.dto.yggl.YgmzDto;
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @date 2019年11月15日
 * @author 翁东州
 * @方法中文名称:
 */
@Api(tags = "3.员工管理")
@RestController
@Transactional
@RequestMapping(value = "/yggl", produces = { "application/json" })
public class YgglController {

	@Autowired
	private YgglMainEmpMapper ygglMainEmpMapper;

	@Autowired
	private QyzxEmpLoginMapper qyzxEmpLoginMapper;

	@Autowired
	private YgglMainLzbMapper ygglMainLzbMapper;
邓实川 committed
127

128 129
	@Autowired
	private ZzglBmgwMMapper zzglBmgwMMapper;
邓实川 committed
130 131

	// weng(籍贯)
132 133 134 135 136 137
	@Autowired
	private YgAreaDtoMapper ygAreaDtoMapper;
	@Autowired
	private YgCityDtoMapper ygCityDtoMapper;
	@Autowired
	private YgProDtoMapper ygProDtoMapper;
邓实川 committed
138 139

	// weng(民族)
140 141
	@Autowired
	private YgMzDtoMapper ygMzDtoMapper;
142

143 144 145 146 147 148 149 150 151
	/**
	 * 获取登录人的相关信息
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/loginmessage")
	@ApiOperation(value = " 获取登录人的相关信息", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 68)
152
	public Result<LoginInfoDto> loginmessage(@CurrentUser UserBean userBean) {
153 154
		Integer empNum = userBean.getEmpNum();
		Integer orgCode = userBean.getOrgCode();
155 156
		LoginInfoDto loginInfo = LoginInfoDto.builder().build();
		YgglMainEmp ygglMainEmp = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
157 158 159 160
				.select(YgglMainEmp::getBmgwId,
						YgglMainEmp::getName,
						YgglMainEmp::getRzTime,
						YgglMainEmp::getZzTime,
161 162 163 164
						YgglMainEmp::getEmpNum)
				.eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
		if (ygglMainEmp != null) {
			Integer gw = ygglMainEmp.getBmgwId();
165 166 167 168 169 170 171 172 173 174
			ZzglBmgwM gwObj = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId,ZzglBmgwM::getName)
					.eq(ZzglBmgwM::getId, gw).eq(ZzglBmgwM::getOrgCode, orgCode).one();
			
			if (gwObj != null) {
				ZzglBmgwM bmObj = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getId,ZzglBmgwM::getName)
						.eq(ZzglBmgwM::getId, gwObj.getUpId()).eq(ZzglBmgwM::getOrgCode, orgCode).one();
				loginInfo.setBmId(bmObj != null ? bmObj.getId() : null);
				loginInfo.setBmName(bmObj != null ? bmObj.getName() : null);
			}
			
175 176 177 178 179 180 181 182
			loginInfo.setEmpNum(ygglMainEmp.getEmpNum());
			loginInfo.setName(ygglMainEmp.getName());
			loginInfo.setGwId(gw);
			loginInfo.setGwName(gwObj != null ? gwObj.getName() : "");
			loginInfo.setEntryTime(ygglMainEmp.getRzTime());
			loginInfo.setRegularTime(ygglMainEmp.getRzTime());
		}
		return ResultUtil.data(loginInfo, "操作成功!");
183
	}
184

185 186 187 188 189 190 191 192
	/**
	 * 获取登录人和上级主管的empNum和名称
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/loginerChargers")
	@ApiOperation(value = " 获取登录人和上级主管的empNum和名称", httpMethod = "GET", notes = "接口发布说明")
193 194 195 196 197 198
	@ApiOperationSupport(order = 69)
	public Result<List<LoginerChargeDto>> loginerChargers(@CurrentUser UserBean userBean) {
		Integer orgCode = userBean.getOrgCode();
		ArrayList<Integer> list = new ArrayList<Integer>();
		Integer empNum = userBean.getEmpNum();
		Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
199 200 201
		List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
				.eq(ZzglBmgwM::getOrgCode, orgCode).list();
		// 获取该员工的上级部门id 的数组list
202 203 204 205
		ZzglBmgwM.getUpDepts(list, gw, zzglBmgwMs);
		List<Integer> leaderList = new ArrayList<Integer>();
		for (Integer zzglId : list) {
			for (ZzglBmgwM zzglBmgwM : zzglBmgwMs) {
206 207
				if (zzglId.equals(zzglBmgwM.getId()) && zzglBmgwM.getLeader() != null) {

208 209 210 211 212
					leaderList.add(zzglBmgwM.getLeader());
				}
			}
		}
		List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList);
213
		List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
214
		for (YgglMainEmp m : ygglMainEmps) {
215 216 217
			if (m.getHeadUrl() == null) {
				m.setHeadUrl("");
			}
218
			loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(), m.getName(), m.getHeadUrl()));
219 220 221 222
		}
		Collections.reverse(loginerChargeDtos);
		return ResultUtil.data(loginerChargeDtos, "获取上级部门的部门id");
	}
223 224 225 226 227

	// 根据传来的empNum获取该人员信息,没有则传全部
	public List<YgglMainEmp> empNumsConfirm(Integer orgCode, List<Integer> empNumList) {
		List<YgglMainEmp> all = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
				.eq(YgglMainEmp::getOrgCode, orgCode).list();
228
		List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>();
229
		if (empNumList.size() != 0) {
230
			for (Integer empNum : empNumList) {
231
				all.stream().filter(item -> empNum.equals(item.getEmpNum())).forEach(action -> {
232 233 234
					ygglMainEmps.add(action);
				});
			}
235
		} else {
236 237
			ygglMainEmps.addAll(all);
		}
238

239 240
		return ygglMainEmps;
	}
241 242 243 244 245

	// 根据传来的empNum获取该人员信息
	public YgglMainEmp empNumConfirm(Integer orgCode, Integer empNum) {
		YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
				.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
246
		return one;
247
	}
邓实川 committed
248

249

250
	/**
东州 翁 committed
251
	 * 获取用户头像
252 253 254 255
	 * 
	 * @param
	 * @return
	 */
东州 翁 committed
256 257
	@PostMapping(value = "/headphotos")
	@ApiOperation(value = "获取用户头像", httpMethod = "POST", notes = "接口发布说明")
258
	@ApiOperationSupport(order = 70)
东州 翁 committed
259
	public Result<List<YgglMainEmp>> headphotos(@CurrentUser UserBean userBean, @RequestBody List<Integer> empNumList) {
260
		if (empNumList.size() == 0) {
东州 翁 committed
261 262
			return ResultUtil.error("请输入empNum数组");
		}
263 264 265 266
		List<YgglMainEmp> yglList = YgglMainEmp.builder().build()
				.selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
						.in(YgglMainEmp::getEmpNum, empNumList)
						.select(YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getHeadUrl));
东州 翁 committed
267 268 269 270 271 272
		for (YgglMainEmp yg : yglList) {
			if (StringUtil.isEmpty(yg.getHeadUrl())) {
				yg.setHeadUrl("");
			}
		}
		return ResultUtil.data(yglList, "获取用户头像组成功");
273
	}
274

275 276
	/**
	 * 获取员工档案
邓实川 committed
277
	 * 
278 279 280 281 282 283 284 285 286 287 288 289
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygda")
	@ApiOperation(value = "获取员工档案", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 1)
	public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean) {
		Integer empNum = userBean.getEmpNum();
		Integer orgCode = userBean.getOrgCode();
		QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("org_code", orgCode).eq("emp_num", empNum);
		YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
邓实川 committed
290 291 292 293
		Date rz = ygglMainEmp.getRzTime();
		if (rz != null) {
			ygglMainEmp.setWorkTime(DateUtil.formatBetween(rz, new Date(), Level.DAY));
		}
294 295
		return ResultUtil.data(ygglMainEmp, "获取员工档案成功");
	}
邓实川 committed
296

东州 翁 committed
297 298 299 300 301 302 303 304 305
	// 获取员工档案
	@GetMapping(value = "/ygda/{empNum}")
	@ApiOperation(value = "获取员工档案(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 2)
	public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		Integer orgCode = userBean.getOrgCode();
		QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("org_code", orgCode).eq("emp_num", empNum);
		YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
306 307
		Date rz = ygglMainEmp.getRzTime();
		if (rz != null) {
邓实川 committed
308
			ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(), Level.DAY));
东州 翁 committed
309
		}
东州 翁 committed
310 311
		return ResultUtil.data(ygglMainEmp, "获取员工档案成功");
	}
邓实川 committed
312

313 314
	/**
	 * 根据岗位id获取员工档案部门岗位名称
邓实川 committed
315
	 * 
316 317 318
	 * @param
	 * @return
	 */
东州 翁 committed
319
	@GetMapping(value = "/ygdabm/{gwid}")
320
	@ApiOperation(value = "获取员工档案部门岗位名称", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
321
	@ApiOperationSupport(order = 3)
邓实川 committed
322 323 324
	public Result<String> selectbmgw(@CurrentUser UserBean userBean, @PathVariable Integer gwid) {
		if (gwid == null || gwid == 0) {
			return ResultUtil.data("无岗位", "获取员工档案部门岗位名称成功");
325
		}
326 327 328
		Integer orgCode = userBean.getOrgCode();
		QueryWrapper<ZzglBmgwM> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("org_code", orgCode).eq("id", gwid);
邓实川 committed
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
		ZzglBmgwM zzglBmgwM = ZzglBmgwM.builder().build().selectOne(queryWrapper);
		String gw = null;
		Integer bmid = null;
		if (zzglBmgwM != null) {
			gw = zzglBmgwM.getName();
			bmid = zzglBmgwM.getUpId();
		}
		// QueryWrapper<ZzglBmgwM> queryWrapper1 = new QueryWrapper<>();
		// queryWrapper1.eq("org_code", orgCode).eq("up_dept_id", gwid);
		ZzglBmgwM z = ZzglBmgwM.builder().build()
				.selectOne(new QueryWrapper<ZzglBmgwM>().eq("org_code", orgCode).eq("id", bmid));
		String bm = null;
		if (z != null) {
			bm = z.getName();
		}
		String bmgw = bm + "/" + gw;
		return ResultUtil.data(bmgw, "获取员工档案部门岗位名称成功");
	}

348
	/**
东州 翁 committed
349
	 * 添加员工档案(weng)
350 351 352 353
	 * 
	 * @param
	 * @return
	 */
东州 翁 committed
354 355
	@PostMapping(value = "/addygda")
	@ApiOperation(value = "添加员工档案", httpMethod = "POST", notes = "接口发布说明")
356
	@ApiOperationSupport(order = 4)
东州 翁 committed
357 358 359 360 361 362 363
	public Result<Object> addygda(@CurrentUser UserBean userBean, @RequestBody AddygdaDto addygdaDto) {
		Integer orgCode = userBean.getOrgCode();
		String name = addygdaDto.getName();
		String phone = addygdaDto.getPhone();
		Integer zjType = addygdaDto.getZjType();
		String zjNum = addygdaDto.getZjNum();
		Integer jobType = addygdaDto.getJobType();
东州 翁 committed
364 365
//		Date rzTime = addygdaDto.getRzTime();// ?????????????为什么新添加员工不给默认入职日期?????????????????????????
		Date rzTime = new Date();
东州 翁 committed
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
		Integer syq = addygdaDto.getSyq();
		Integer sex = addygdaDto.getSex();
		if (StrUtil.hasBlank(phone) || StrUtil.hasBlank(name) || StrUtil.hasBlank(zjNum)) {
			return ResultUtil.error("请输入员工姓名,手机号和身份证号");
		}
		QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
				.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
		if (login == null) {
			QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5("123456"))
					.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(name).build();
			if (!qyzxEmpLogin.insert()) {
				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
				return ResultUtil.error("添加员工登录表失败,请检查输入信息");
			}
			// 添加三张表
			// 员工权限表(未定)
			// 员工企业关联表和员工档案,员工成长表(未定)
383 384
			QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(orgCode)
					.userType(CommonEnum.U_TYPE_EMP.getType()).status(1).build().insert();// usertype2普通员工 status1正常
东州 翁 committed
385 386 387
			YgglMainEmp ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum)
					.jobType(jobType).rzTime(rzTime).syq(syq).sex(sex).empNum(qyzxEmpLogin.getId()).orgCode(orgCode)
					.build();
邓实川 committed
388

东州 翁 committed
389
			ygglMainEmp.insert();
390 391
			
			if(addygdaDto.getBmgwId() != null) {
392
				new LambdaUpdateChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
393 394
					.set(addygdaDto.getBmgwId() != null, YgglMainEmp::getBmgwId, addygdaDto.getBmgwId())
					.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getId, ygglMainEmp.getId()).update();
395
			}
396
			
东州 翁 committed
397 398
			return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
		} else {
邓实川 committed
399

东州 翁 committed
400 401
			YgglMainEmp ishad = YgglMainEmp.builder().build()
					.selectOne(new QueryWrapper<YgglMainEmp>().eq("phone", phone).eq("org_code", orgCode));
402

东州 翁 committed
403 404 405
			if (ishad == null) {
				// 添加三张表
				// 员工权限表(未定)
406 407
				QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(2).status(1).build().insert();// usertype2普通员工
																														// status1正常
东州 翁 committed
408 409 410 411
				YgglMainEmp ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum)
						.jobType(jobType).rzTime(rzTime).syq(syq).sex(sex).empNum(login.getId()).orgCode(orgCode)
						.build();
				ygglMainEmp.insert();
412
				new LambdaUpdateChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
413 414
						.set(addygdaDto.getBmgwId() != null, YgglMainEmp::getBmgwId, addygdaDto.getBmgwId())
						.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getId, ygglMainEmp.getId()).update();
东州 翁 committed
415 416 417 418 419 420
				return ResultUtil.data(ygglMainEmp, "添加员工档案成功!");
			} else {
				return ResultUtil.error("该手机号已被使用,请输入正确手机号");
			}
		}
	}
邓实川 committed
421

422
	/**
东州 翁 committed
423
	 * 修改员工档案
邓实川 committed
424
	 * 
425 426 427
	 * @param
	 * @return
	 */
东州 翁 committed
428 429
	@PostMapping(value = "/updateygda")
	@ApiOperation(value = "修改员工档案", httpMethod = "POST", notes = "接口发布说明")
太阳与水 committed
430
	@ApiOperationSupport(order = 5)
431
	public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp) throws Exception{
432

东州 翁 committed
433 434 435 436
		if (ygglMainEmp.getEmpNum() != null) {
			UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
			updateWrapper.eq("org_code", userBean.getOrgCode()).eq("emp_num", ygglMainEmp.getEmpNum());
			ygglMainEmp.update(updateWrapper);
437
			
438 439 440 441 442 443 444
//			Integer count = qyzxEmpLoginMapper.selectCount(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getPhone, ygglMainEmp.getPhone()));
//			if (count >= 1) {
//				return ResultUtil.error("手机号已被使用!");
//			}
//			
//			QyzxEmpLogin.builder().phone(ygglMainEmp.getPhone()).build()
//		     .update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId, userBean.getEmpNum()));
东州 翁 committed
445 446 447 448
			return ResultUtil.data(ygglMainEmp, "修改成功");
		}
		return ResultUtil.error("请确认该员工是否存在!");
	}
邓实川 committed
449

450
	/**
东州 翁 committed
451
	 * 员工搜索
邓实川 committed
452
	 * 
453 454 455
	 * @param
	 * @return
	 */
东州 翁 committed
456 457
	@PostMapping(value = "/ygquery")
	@ApiOperation(value = "员工搜索/分页", httpMethod = "POST", notes = "接口发布说明")
太阳与水 committed
458
	@ApiOperationSupport(order = 6)
东州 翁 committed
459 460 461 462 463
	public Result<Object> ygquery(@CurrentUser UserBean userBean, @RequestBody YgQueryDto ygQueryDto) {
		Integer orgCode = userBean.getOrgCode();
		Integer b = ygQueryDto.getBmgwid();
		ArrayList<Integer> bList = new ArrayList<Integer>();
		List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
邓实川 committed
464
				.eq(ZzglBmgwM::getOrgCode, orgCode).list();
东州 翁 committed
465
		ZzglBmgwM.getDepts(bList, b, zzglBmgwMs);
466 467
		
		
东州 翁 committed
468 469 470 471
		Integer j = ygQueryDto.getJobStatus();
		Integer t = ygQueryDto.getJobType();
		String q = ygQueryDto.getQuery();
		Page<YgglMainEmp> page = new Page<YgglMainEmp>(
邓实川 committed
472 473
				ygQueryDto.getCurrentPage() == null ? 1 : ygQueryDto.getCurrentPage(),
				ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
东州 翁 committed
474
		QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
邓实川 committed
475
		queryWrapper.select("name", "emp_num", "bmgw_id", "rz_time", "job_type", "phone", "job_status")
476 477
				.ne("job_status", YgEnumInterface.jobStatus.YILIZHI.getType())
				.eq("org_code", orgCode)
478 479 480 481
				.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));

482

东州 翁 committed
483 484 485 486 487
//		List<YgglMainEmp> lo = YgglMainEmp.builder().build().selectList(queryWrapper);
		IPage<YgglMainEmp> ygglMainEmpPage = YgglMainEmp.builder().build().selectPage(page, queryWrapper);
		// List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
		return ResultUtil.data(ygglMainEmpPage, "员工搜索成功");
		// return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
488
	}
邓实川 committed
489

490
	/**
东州 翁 committed
491
	 * 导入威力加强版
邓实川 committed
492
	 * 
493 494 495
	 * @param
	 * @return
	 */
东州 翁 committed
496 497
	@PostMapping(value = "/ygdas")
	@ApiOperation(value = "导入威力加强版", httpMethod = "POST", notes = "接口发布说明")
太阳与水 committed
498
	@ApiOperationSupport(order = 7)
邓实川 committed
499
	public Result<List<YgDrjqbDto>> ygdr(@CurrentUser UserBean userBean, @RequestBody YgDrsDto drList) {
500
		drList.setErrorList(new ArrayList<YgDrjqbDto>());
东州 翁 committed
501
		drList.setOrgCode(userBean.getOrgCode());
邓实川 committed
502 503 504 505 506 507 508 509
		YgDrsDto tofList = errorFilter(drList);// 滤嘴,过滤信息
		if (tofList.getDrList().size() == 0)
			return ResultUtil.data(tofList.getErrorList(), "导入发生错误人员名单");
		YgDrsDto tof = optFilter(tofList);// 彻底规范好数据
		List<YgDrjqbDto> trueList = tof.getDrList();// 拿出正确的信息
		List<YgDrjqbDto> errorList = tof.getErrorList();// 拿出错误的信息
		if (trueList.size() == 0)
			return ResultUtil.data(errorList, "导入发生错误人员名单");
东州 翁 committed
510
		for (YgDrjqbDto e : trueList) {
邓实川 committed
511 512 513 514 515 516 517
			QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
					.eq(QyzxEmpLogin::getPhone, e.getPhone()).one();
			// 证件类型为0
			Integer jobType = Integer.valueOf(e.getJobType());// 工作类型
			Integer syq = Integer.valueOf(e.getSyq());// 试用期
			Integer sex = Integer.valueOf(e.getSex());// 性别,还差一个岗位
			Integer gw = e.getHavebmid();
东州 翁 committed
518 519 520
			String jobNum = e.getYgnbgh();
			Integer jg = e.getJg();
			Date birthday = e.getBirthday();
邓实川 committed
521
			// 入职日期
东州 翁 committed
522
			Date rzdate = new Date();
邓实川 committed
523 524
			SimpleDateFormat straight = new SimpleDateFormat("yyyy-MM-dd");// 正杠
			if (e.getRzTime().indexOf("-") != -1) {
东州 翁 committed
525 526 527 528 529 530 531 532 533
				try {
					rzdate = straight.parse(e.getRzTime());
				} catch (ParseException PException) {
					PException.printStackTrace();
					e.setError("请填写正确的时间格式");
					errorList.add(e);
					continue;
				}
			}
邓实川 committed
534 535
			// 判断是否已有员工登录表
			if (login == null) {// 添加三张表
东州 翁 committed
536 537 538 539 540 541 542 543 544 545
				QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(e.getPhone()).pw(Md5.md5("123456"))
						.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(e.getName()).build();
				if (!qyzxEmpLogin.insert()) {
					TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
					e.setError("员工无法添加!");
					errorList.add(e);
					continue;
				}
				// 员工权限表(未定)
				// 员工企业关联表和员工档案,员工成长表(未定)
邓实川 committed
546
				QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode()).userType(2)
547
						.status(1).build().insert();// userType2普通员工,status1正常
邓实川 committed
548 549 550 551
				YgglMainEmp emp = YgglMainEmp.builder().name(e.getName()).phone(e.getPhone()).zjType(0).zjNum(e.getZj())
						.jobType(jobType).rzTime(rzdate).updateTime(new Date()).updateMan(userBean.getEmpNum()).syq(syq)
						.sex(sex).jobNum(jobNum).bmgwId(gw).empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode())
						.build();
东州 翁 committed
552 553
				emp.insert();
				new LambdaUpdateChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
邓实川 committed
554 555 556 557 558 559
						.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getId, emp.getId())
						.set(birthday != null, YgglMainEmp::getBirthday, birthday)
						.set(jg != null && jg != 0, YgglMainEmp::getJg, jg).update();

				// return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
			} else {
东州 翁 committed
560
				// 添加两张表
邓实川 committed
561
				YgglMainEmp ishad = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
东州 翁 committed
562 563 564
						.eq("phone", e.getPhone()).eq("org_code", userBean.getOrgCode()));
				if (ishad == null) {
					// 员工权限表(未定)
565 566
					QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(userBean.getOrgCode()).userType(2).status(1)
							.build().insert();// userType2普通员工,status1正常
邓实川 committed
567 568 569 570
					YgglMainEmp emp = YgglMainEmp.builder().name(e.getName()).phone(e.getPhone()).zjType(0)
							.zjNum(e.getZj()).jobType(jobType).rzTime(rzdate).updateTime(new Date())
							.updateMan(userBean.getEmpNum()).syq(syq).sex(sex).jobNum(jobNum).empNum(login.getId())
							.orgCode(userBean.getOrgCode()).build();
东州 翁 committed
571 572
					emp.insert();
					new LambdaUpdateChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
邓实川 committed
573 574 575
							.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getId, emp.getId())
							.set(birthday != null, YgglMainEmp::getBirthday, birthday)
							.set(jg != null && jg != 0, YgglMainEmp::getJg, jg).update();
东州 翁 committed
576 577 578 579
				} else {
					e.setError("该手机号码已被使用");
					errorList.add(e);
					continue;
邓实川 committed
580

东州 翁 committed
581 582 583
				}
			}
		}
邓实川 committed
584
		if (errorList.size() == 0) {
东州 翁 committed
585 586 587
			return ResultUtil.success("员工全部导入成功!");
		}
		return ResultUtil.data(errorList, "导入发生错误人员名单");
太阳与水 committed
588
	}
邓实川 committed
589 590

	// 错误选项过滤器
东州 翁 committed
591 592 593 594
	public YgDrsDto errorFilter(YgDrsDto ygDrsDto) {
		List<YgDrjqbDto> drList = ygDrsDto.getDrList();
		List<YgDrjqbDto> newList = new ArrayList<YgDrjqbDto>(drList);
		List<YgDrjqbDto> errorList = ygDrsDto.getErrorList();
邓实川 committed
595 596
		Integer orgCode = ygDrsDto.getOrgCode();

东州 翁 committed
597
		Iterator<YgDrjqbDto> itDr = drList.iterator();
东州 翁 committed
598
		@SuppressWarnings("unused")
邓实川 committed
599 600 601 602
		YgDrjqbDto a = drList.get(0);// 一个员工导入
		Integer size = drList.size();
		for (Integer i = 0; i < size; i++) {//
			YgDrjqbDto d = newList.get(i);// 计数器
东州 翁 committed
603
			if (itDr.hasNext()) {
邓实川 committed
604 605
				a = itDr.next();

东州 翁 committed
606
			}
邓实川 committed
607 608 609 610 611 612
			// 请填写必填项
			String name = newList.get(i).getName();
			String phone = newList.get(i).getPhone();
			String sex = newList.get(i).getSex();
			String zj = newList.get(i).getZj();
			if (StrUtil.hasBlank(name) || StrUtil.hasBlank(phone) || StrUtil.hasBlank(sex) || StrUtil.hasBlank(zj)) {
东州 翁 committed
613
				d.setError("请填写必填项");
邓实川 committed
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
			}
			// 手机号码格式不对
			String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
			if (phone.length() != 11) {
				d.setError("手机号应为11位数");
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
			}
			Pattern p = Pattern.compile(regex);
			Matcher m = p.matcher(phone);
			boolean isMatch = m.matches();
			if (!isMatch) {
				d.setError("手机号格式不对");
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
东州 翁 committed
637
			}
邓实川 committed
638 639 640 641 642 643 644 645 646
			// 手机号码已被使用
			QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
					.eq(QyzxEmpLogin::getPhone, phone).eq(QyzxEmpLogin::getOrgId, orgCode).one();
			if (login != null) {
				d.setError("手机号码已被使用");
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
东州 翁 committed
647
			}
邓实川 committed
648 649 650 651 652 653 654
			// 证件号码信息有误
			if (zj == null || "".equals(zj)) {
				d.setError("证件号码信息有误");
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
东州 翁 committed
655
			}
邓实川 committed
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
			String regularExpression = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|"
					+ "(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
			boolean matches = zj.matches(regularExpression);
			if (!matches) {
				d.setError("证件号码信息有误");
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
			}
			try {
				if (zj.length() == 18) {
					char[] charArray = zj.toCharArray();
					// 前十七位加权因子
					int[] idCardWi = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };
					// 这是除以11后,可能产生的11位余数对应的验证码
					String[] idCardY = { "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2" };
					int sum = 0;
					for (Integer j = 0; j < idCardWi.length; j++) {
						int current = Integer.parseInt(String.valueOf(charArray[j]));
						int count = current * idCardWi[j];
						sum += count;
					}
					char idCardLast = charArray[17];
					int idCardMod = sum % 11;
					if (idCardY[idCardMod].toUpperCase().equals(String.valueOf(idCardLast).toUpperCase())) {
						// System.out.println("成功,接着完善员工的个人信息");
						String birth = zj.substring(6, 14);
						String birthday = birth.substring(0, 4) + "-" + birth.substring(4, 6) + "-"
								+ birth.substring(6, 8);
						SimpleDateFormat straight = new SimpleDateFormat("yyyy-MM-dd");
						d.setBirthday(straight.parse(birthday));
						d.setJg(Integer.parseInt(zj.substring(0, 6)));
					} else {
						// System.out.println("身份证最后一位:" + String.valueOf(idCardLast).toUpperCase() +
						// "错误,正确的应该是:" + idCardY[idCardMod].toUpperCase());
						// return false;
						d.setError("证件号码信息有误");
						errorList.add(d);
						itDr.remove();
						i++;
						continue;
					}
				} else {
					// 给15位数的添加生日籍贯
					String birth = zj.substring(6, 12);
					String birthday = "19" + birth.substring(0, 2) + "-" + birth.substring(2, 4) + "-"
							+ birth.substring(4, 6);
					SimpleDateFormat straight = new SimpleDateFormat("yyyy-MM-dd");
					d.setBirthday(straight.parse(birthday));
					d.setJg(Integer.parseInt(zj.substring(0, 6)));
				}
			} catch (Exception e) {
				e.printStackTrace();
				// System.out.println("异常:" + zj);
				// return false;
				d.setError("证件号码信息有误");
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
东州 翁 committed
717
			}
邓实川 committed
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737
			// 部门岗位有误
			String oneb = newList.get(i).getOneb();
			String twob = newList.get(i).getTwob();
			String threeb = newList.get(i).getThreeb();
			String fourb = newList.get(i).getFourb();
			String gw = newList.get(i).getGw();
			String[] bms = { oneb, twob, threeb, fourb };
			if (StrUtil.hasBlank(gw) && StrUtil.hasBlank(oneb) && StrUtil.hasBlank(twob) && StrUtil.hasBlank(threeb)
					&& StrUtil.hasBlank(fourb)) { // 没填写岗位,通过~ //
			} else {
				// 填写了部门岗位,办他!
				Integer isHaveBmgw = isHavebmgw(bms, gw, orgCode);
				if (isHaveBmgw == 0) {
					d.setError("部门岗位有误");
					errorList.add(d);
					itDr.remove();
					i++;
					continue;
				} else {
					// 获取到部门岗位id啦!
东州 翁 committed
738 739 740
					d.setHavebmid(isHaveBmgw);
				}
			}
邓实川 committed
741 742

		} // for循环完毕!
东州 翁 committed
743
		YgDrsDto tofList = new YgDrsDto(drList, errorList, orgCode);
邓实川 committed
744
		return tofList;
太阳与水 committed
745
	}
邓实川 committed
746 747

	// 选填项过滤器
东州 翁 committed
748 749 750 751 752
	public YgDrsDto optFilter(YgDrsDto ygDrsDto) {
		List<YgDrjqbDto> drList = ygDrsDto.getDrList();
		List<YgDrjqbDto> newList = new ArrayList<YgDrjqbDto>(drList);
		List<YgDrjqbDto> errorList = ygDrsDto.getErrorList();
		Integer orgCode = ygDrsDto.getOrgCode();
邓实川 committed
753

东州 翁 committed
754
		Iterator<YgDrjqbDto> itDr = drList.iterator();
东州 翁 committed
755
		@SuppressWarnings("unused")
邓实川 committed
756 757 758 759
		YgDrjqbDto a = drList.get(0);// 一个员工导入
		Integer size = drList.size();
		for (Integer i = 0; i < size; i++) {//
			YgDrjqbDto d = newList.get(i);// 计数器
东州 翁 committed
760
			if (itDr.hasNext()) {
邓实川 committed
761
				a = itDr.next();
东州 翁 committed
762
			}
邓实川 committed
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779
			// for (YgDrjqbDto d : drList) {
			String ygnbgh = d.getYgnbgh();
			String sex = d.getSex();
			String jobType = d.getJobType();
			String jobStatus = d.getJobStatus();
			String rzTime = d.getRzTime();
			String syq = d.getSyq();

			String zy = d.getZy();
			String address = d.getAddress();
			String hjAddress = d.getHkAddress();
			String qq = d.getQq();
			String weixin = d.getWeixin();
			String email = d.getEmail();
			String[] bathroom = { ygnbgh, sex, jobType, jobStatus, rzTime, syq, zy, address, hjAddress, qq, weixin,
					email };
			boolean child = takeshower(bathroom);
东州 翁 committed
780 781
			if (child == false) {
				d.setError("填写内容不要大于50字数");
邓实川 committed
782 783 784 785
				errorList.add(d);
				itDr.remove();
				i++;
				continue;
东州 翁 committed
786
			}
邓实川 committed
787
			// 公司内部工号
东州 翁 committed
788 789
			if (ygnbgh != null && ygnbgh.length() != 0) {
				d.setYgnbgh(ygnbgh.trim());
邓实川 committed
790
			} else {
东州 翁 committed
791
				SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
邓实川 committed
792
				String bh = format.format(new Date()) + orgCode + i + System.currentTimeMillis();
东州 翁 committed
793 794
				d.setYgnbgh(bh);
			}
邓实川 committed
795
			// 男女(最大优化)
东州 翁 committed
796
			d.setSex(YgEnumInterface.sex.isMan(sex));
邓实川 committed
797
			// 工作性质(最大优化)
东州 翁 committed
798
			d.setJobType(YgEnumInterface.YgJobType.choose(jobType));
邓实川 committed
799
			// 员工状态(最大优化)
东州 翁 committed
800
			d.setJobStatus(YgEnumInterface.jobStatus.isZhen(jobStatus));
邓实川 committed
801
			// 入职日期(最大优化)
802
			d.setRzTime(rzTime != null ? YgEnumInterface.rzTime.tranTime2(YgEnumInterface.rzTime.tranTime(rzTime)) : null);
邓实川 committed
803
			// 试用期(最大优化)
东州 翁 committed
804 805
			d.setSyq(YgEnumInterface.syq.choose(syq));
		}
邓实川 committed
806
		YgDrsDto clear = new YgDrsDto(drList, errorList, orgCode);
东州 翁 committed
807 808
		return clear;
	}
邓实川 committed
809 810 811

	// 浴池,洗去选填项字节大于100的选项
	public boolean takeshower(String[] bathroom) {
东州 翁 committed
812
		for (String b : bathroom) {
813
			if (b!=null&& b.length() > 100) {
邓实川 committed
814 815
				return false;
			}
816
			
邓实川 committed
817 818 819 820 821 822 823
		}
		return true;
	}

	// 判断是否导入组织部门
	public Integer isHavebmgw(String[] bms, String gw, Integer orgCode) {
		// 将姓名转为部门岗位对象
东州 翁 committed
824
		List<ZzglBmgwM> gwList = new ArrayList<ZzglBmgwM>();
邓实川 committed
825
		// 判断有几个部门,且这几个部门是否属实,里面不包括岗位
东州 翁 committed
826
		for (String bm : bms) {
邓实川 committed
827 828 829 830 831 832
			if (!StrUtil.hasBlank(bm)) {
				ZzglBmgwM ibm = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getName, bm)
						.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).one(); // 选择部门类型0为部门,1为岗位
				if (ibm == null) {
					return 0;
				} // 找不到有相关名称的部门则报错
东州 翁 committed
833
				gwList.add(ibm);
邓实川 committed
834
			} else {
东州 翁 committed
835 836 837
				break;
			}
		}
邓实川 committed
838 839 840 841 842
		Integer qiantao = qiantao(gwList, gw, 0, orgCode);
		if (qiantao != 0) {
			return qiantao;// 组织部门成立!
		} else {
			return 0;// 失败
东州 翁 committed
843
		}
邓实川 committed
844

东州 翁 committed
845
	};
邓实川 committed
846 847 848 849 850

	// 判断是否导入组织部门的嵌套并寻找到正确岗位id
	public Integer qiantao(List<ZzglBmgwM> gwList, String gw, Integer upid, Integer orgCode) {
		// 重写
		if (upid != 0 && !gwList.get(0).getUpId().equals(upid)) {
东州 翁 committed
851 852 853
			return 0;
		}
		upid = gwList.get(0).getId();
邓实川 committed
854

东州 翁 committed
855
		if (gwList.size() == 1) {
邓实川 committed
856 857 858
			ZzglBmgwM igw = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getName, gw)
					.eq(ZzglBmgwM::getUpId, upid).eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 1).one();
			if (igw == null) {
东州 翁 committed
859 860 861 862 863
				return 0;
			}
			return igw.getId();
		}
		gwList.remove(0);
邓实川 committed
864
		Integer q = qiantao(gwList, gw, upid, orgCode);
东州 翁 committed
865 866
		return q;
	};
邓实川 committed
867

太阳与水 committed
868
	/**
东州 翁 committed
869
	 * 导出员工
邓实川 committed
870
	 * 
太阳与水 committed
871 872 873
	 * @param
	 * @return
	 */
东州 翁 committed
874 875 876 877
	@GetMapping(value = "/ygdas")
	@ApiOperation(value = "导出", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 8)
	public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) {
邓实川 committed
878 879 880
		int[] jList = { 1, 2, 3 };
		List<YgglMainEmp> list = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
				.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getJobStatus, jList).list();
东州 翁 committed
881
		return ResultUtil.data(list, "导出员工成功");
太阳与水 committed
882
	}
邓实川 committed
883

太阳与水 committed
884
	/**
东州 翁 committed
885
	 * 获取员工教育经历表
邓实川 committed
886
	 * 
太阳与水 committed
887 888 889
	 * @param
	 * @return
	 */
东州 翁 committed
890 891 892 893
	@GetMapping(value = "/jyjlb")
	@ApiOperation(value = "获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 9)
	public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean) {
邓实川 committed
894 895 896
		List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build()
				.selectList(new QueryWrapper<YgglAttaJyjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
897 898
		return ResultUtil.data(ygglAttaJyjlbss, "获取员工教育经历表成功");
	}
邓实川 committed
899

东州 翁 committed
900 901 902 903 904 905 906 907 908
	// 获取员工教育经历表
	@GetMapping(value = "/jyjlb/{empNum}")
	@ApiOperation(value = "获取员工教育经历表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 10)
	public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build().selectList(
				new QueryWrapper<YgglAttaJyjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaJyjlbs, "获取员工教育经历表成功");
	}
邓实川 committed
909

东州 翁 committed
910 911
	/**
	 * 添加/修改员工教育经历表
邓实川 committed
912
	 * 
太阳与水 committed
913 914 915
	 * @param
	 * @return
	 */
东州 翁 committed
916 917 918 919 920 921 922 923
	@PostMapping(value = "/jyjlb")
	@ApiOperation(value = "添加/修改员工教育经历表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 11)
	public Result<YgglAttaJyjlb> addjyjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaJyjlb ygglAttaJyjlb) {
		ygglAttaJyjlb.setEmpNum(ygglAttaJyjlb.getEmpNum());
		ygglAttaJyjlb.setOrgCode(userBean.getOrgCode());
		ygglAttaJyjlb.insertOrUpdate();
		return ResultUtil.data(ygglAttaJyjlb, "添加/修改员工教育经历表成功");
太阳与水 committed
924
	}
邓实川 committed
925

太阳与水 committed
926
	/**
东州 翁 committed
927
	 * 删除员工教育经历表
邓实川 committed
928
	 * 
东州 翁 committed
929 930
	 * @param
	 * @return
太阳与水 committed
931
	 */
东州 翁 committed
932 933 934 935
	@DeleteMapping(value = "/jyjlb/{id}")
	@ApiOperation(value = "删除员工教育经历表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 12)
	public Result<Boolean> deljyjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
太阳与水 committed
936
		Integer orgCode = userBean.getOrgCode();
东州 翁 committed
937 938
		return ResultUtil.data(YgglAttaJyjlb.builder().build()
				.delete(new QueryWrapper<YgglAttaJyjlb>().eq("org_code", orgCode).eq("id", id)), "删除员工教育经历表成功");
太阳与水 committed
939
	}
邓实川 committed
940

东州 翁 committed
941 942
	/**
	 * 获取员工培训经历信息表
邓实川 committed
943
	 * 
东州 翁 committed
944 945 946 947 948 949 950
	 * @param
	 * @return
	 */
	@GetMapping(value = "/pxjlxxb")
	@ApiOperation(value = "获取员工培训经历信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 13)
	public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean) {
邓实川 committed
951 952 953
		List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
954 955
		return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
	}
邓实川 committed
956

东州 翁 committed
957 958 959 960 961 962 963 964 965
	// 获取员工培训经历信息表
	@GetMapping(value = "/pxjlxxb/{empNum}")
	@ApiOperation(value = "获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 14)
	public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build().selectList(
				new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
	}
邓实川 committed
966

东州 翁 committed
967 968
	/**
	 * 添加/修改员工培训经历信息表
邓实川 committed
969
	 * 
东州 翁 committed
970 971 972 973 974
	 * @param
	 * @return
	 */
	@PostMapping(value = "/pxjlxxb")
	@ApiOperation(value = "添加/修改员工培训经历信息表", httpMethod = "POST", notes = "接口发布说明")
975
	@ApiOperationSupport(order = 15)
东州 翁 committed
976 977 978 979 980 981
	public Result<YgglAttaPxjlxxb> addpxjlxxb(@CurrentUser UserBean userBean,
			@RequestBody YgglAttaPxjlxxb ygglAttaPxjlxxb) {
		ygglAttaPxjlxxb.setEmpNum(ygglAttaPxjlxxb.getEmpNum());
		ygglAttaPxjlxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaPxjlxxb.insertOrUpdate();
		return ResultUtil.data(ygglAttaPxjlxxb, "添加/修改员工培训经历信息表成功");
982
	}
邓实川 committed
983

东州 翁 committed
984 985
	/**
	 * 删除员工培训经历信息表
邓实川 committed
986
	 * 
东州 翁 committed
987 988 989 990 991
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/pxjlxxb/{id}")
	@ApiOperation(value = "删除员工培训经历信息表", httpMethod = "DELETE", notes = "接口发布说明")
992
	@ApiOperationSupport(order = 16)
东州 翁 committed
993 994 995 996 997
	public Result<Boolean> delpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaPxjlxxb.builder().build()
				.delete(new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工培训经历信息表成功");
	}
邓实川 committed
998

东州 翁 committed
999 1000
	/**
	 * 获取员工工作经历表
邓实川 committed
1001
	 * 
东州 翁 committed
1002 1003 1004 1005 1006 1007 1008
	 * @param
	 * @return
	 */
	@GetMapping(value = "/gzjlb")
	@ApiOperation(value = "获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 17)
	public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean) {
邓实川 committed
1009 1010 1011
		List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build()
				.selectList(new QueryWrapper<YgglAttaGzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1012
		return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
太阳与水 committed
1013
	}
邓实川 committed
1014

太阳与水 committed
1015 1016 1017
	// 获取员工工作经历表
	@GetMapping(value = "/gzjlb/{empNum}")
	@ApiOperation(value = "获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1018
	@ApiOperationSupport(order = 18)
太阳与水 committed
1019 1020 1021 1022 1023
	public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(
				new QueryWrapper<YgglAttaGzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
	}
邓实川 committed
1024

东州 翁 committed
1025 1026
	/**
	 * 添加/修改员工工作经历表
邓实川 committed
1027
	 * 
东州 翁 committed
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
	 * @param
	 * @return
	 */
	@PostMapping(value = "/gzjlb")
	@ApiOperation(value = "添加/修改员工工作经历表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 19)
	public Result<YgglAttaGzjlb> addgzjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzjlb ygglAttaGzjlb) {
		ygglAttaGzjlb.setEmpNum(ygglAttaGzjlb.getEmpNum());
		ygglAttaGzjlb.setOrgCode(userBean.getOrgCode());
		ygglAttaGzjlb.insertOrUpdate();
		return ResultUtil.data(ygglAttaGzjlb, "添加/修改员工工作经历表成功");
	}
邓实川 committed
1040

东州 翁 committed
1041 1042
	/**
	 * 删除员工工作经历表
邓实川 committed
1043
	 * 
东州 翁 committed
1044 1045 1046 1047 1048 1049 1050 1051 1052
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/gzjlb/{id}")
	@ApiOperation(value = "删除员工工作经历表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 20)
	public Result<Boolean> delgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaGzjlb.builder().build()
邓实川 committed
1053
				.delete(new QueryWrapper<YgglAttaGzjlb>().eq("org_code", orgCode).eq("id", id)), "删除员工工作经历表成功");
东州 翁 committed
1054
	}
邓实川 committed
1055

东州 翁 committed
1056 1057
	/**
	 * 获取员工职称信息表
邓实川 committed
1058
	 * 
东州 翁 committed
1059 1060 1061 1062 1063 1064 1065
	 * @param
	 * @return
	 */
	@GetMapping(value = "/zcxxb")
	@ApiOperation(value = "获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 21)
	public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean) {
邓实川 committed
1066 1067 1068
		List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaZcxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1069 1070
		return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
	}
邓实川 committed
1071

太阳与水 committed
1072 1073 1074
	// 获取员工职称信息表
	@GetMapping(value = "/zcxxb/{empNum}")
	@ApiOperation(value = "获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1075
	@ApiOperationSupport(order = 22)
太阳与水 committed
1076 1077 1078 1079 1080
	public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(
				new QueryWrapper<YgglAttaZcxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
	}
邓实川 committed
1081

东州 翁 committed
1082 1083
	/**
	 * 添加/修改员工职称信息表
邓实川 committed
1084
	 * 
东州 翁 committed
1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096
	 * @param
	 * @return
	 */
	@PostMapping(value = "/zcxxb")
	@ApiOperation(value = "添加/修改员工职称信息表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 23)
	public Result<YgglAttaZcxxb> addzcxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaZcxxb ygglAttaZcxxb) {
		ygglAttaZcxxb.setEmpNum(ygglAttaZcxxb.getEmpNum());
		ygglAttaZcxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaZcxxb.insertOrUpdate();
		return ResultUtil.data(ygglAttaZcxxb, "添加/修改员工职称信息表成功");
	}
邓实川 committed
1097

东州 翁 committed
1098 1099
	/**
	 * 删除员工职称信息表
邓实川 committed
1100
	 * 
东州 翁 committed
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/zcxxb/{id}")
	@ApiOperation(value = "删除员工职称信息表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 24)
	public Result<Boolean> delzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaZcxxb.builder().build()
				.delete(new QueryWrapper<YgglAttaZcxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工职称信息表成功");
	}
邓实川 committed
1112

东州 翁 committed
1113 1114
	/**
	 * 获取员工证书证件表
邓实川 committed
1115
	 * 
东州 翁 committed
1116 1117 1118 1119 1120 1121 1122
	 * @param
	 * @return
	 */
	@GetMapping(value = "/zszjb")
	@ApiOperation(value = "获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 25)
	public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean) {
邓实川 committed
1123 1124 1125
		List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build()
				.selectList(new QueryWrapper<YgglAttaZszjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1126 1127
		return ResultUtil.data(ygglAttaZszjbs, "获取员工证书证件表成功");
	}
邓实川 committed
1128

太阳与水 committed
1129 1130 1131
	// 获取员工证书证件表
	@GetMapping(value = "/zszjb/{empNum}")
	@ApiOperation(value = "获取员工证书证件表(管)", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1132
	@ApiOperationSupport(order = 26)
太阳与水 committed
1133 1134
	public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build().selectList(
邓实川 committed
1135
				new QueryWrapper<YgglAttaZszjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
太阳与水 committed
1136 1137
		return ResultUtil.data(ygglAttaZszjbs, "获取员工证书证件表成功");
	}
邓实川 committed
1138

东州 翁 committed
1139 1140
	/**
	 * 添加/修改员工证书证件表
邓实川 committed
1141
	 * 
东州 翁 committed
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152
	 * @param
	 * @return
	 */
	@PostMapping(value = "/zszjb")
	@ApiOperation(value = "添加/修改员工证书证件表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 27)
	public Result<YgglAttaZszjb> addzszjb(@CurrentUser UserBean userBean, @RequestBody YgglAttaZszjb ygglAttaZszjb) {
		ygglAttaZszjb.setEmpNum(ygglAttaZszjb.getEmpNum());
		ygglAttaZszjb.setOrgCode(userBean.getOrgCode());
		ygglAttaZszjb.insertOrUpdate();
		return ResultUtil.data(ygglAttaZszjb, "添加/修改员工证书证件表成功");
太阳与水 committed
1153
	}
邓实川 committed
1154

东州 翁 committed
1155 1156
	/**
	 * 删除员工证书证件表
邓实川 committed
1157
	 * 
东州 翁 committed
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/zszjb/{id}")
	@ApiOperation(value = "删除员工证书证件表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 28)
	public Result<Boolean> delzszjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaZszjb.builder().build()
				.delete(new QueryWrapper<YgglAttaZszjb>().eq("org_code", orgCode).eq("id", id)), "删除员工证书证件表成功");
太阳与水 committed
1168
	}
邓实川 committed
1169

东州 翁 committed
1170 1171
	/**
	 * 获取员工联系信息表
邓实川 committed
1172
	 * 
东州 翁 committed
1173 1174 1175 1176 1177 1178 1179
	 * @param
	 * @return
	 */
	@GetMapping(value = "/lxxxb")
	@ApiOperation(value = "获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 29)
	public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean) {
邓实川 committed
1180 1181 1182
		List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaLxxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1183 1184
		return ResultUtil.data(ygglAttaLxxxbs, "获取员工联系信息表成功");
	}
邓实川 committed
1185

东州 翁 committed
1186 1187 1188 1189 1190 1191 1192 1193 1194
	// 获取员工联系信息表
	@GetMapping(value = "/lxxxb/{empNum}")
	@ApiOperation(value = "获取员工联系信息表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 30)
	public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build().selectList(
				new QueryWrapper<YgglAttaLxxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaLxxxbs, "获取员工联系信息表成功");
	}
邓实川 committed
1195

东州 翁 committed
1196 1197
	/**
	 * 添加/修改员工联系信息表
邓实川 committed
1198
	 * 
东州 翁 committed
1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210
	 * @param
	 * @return
	 */
	@PostMapping(value = "/lxxxb")
	@ApiOperation(value = "添加/修改员工联系信息表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 31)
	public Result<YgglAttaLxxxb> addlxxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaLxxxb ygglAttaLxxxb) {
		ygglAttaLxxxb.setEmpNum(ygglAttaLxxxb.getEmpNum());
		ygglAttaLxxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaLxxxb.insertOrUpdate();
		return ResultUtil.data(ygglAttaLxxxb, "添加/修改员工联系信息表成功");
	}
邓实川 committed
1211

东州 翁 committed
1212 1213
	/**
	 * 删除员工联系信息表
邓实川 committed
1214
	 * 
东州 翁 committed
1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/lxxxb/{id}")
	@ApiOperation(value = "删除员工联系信息表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 32)
	public Result<Boolean> dellxxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaLxxxb.builder().build()
				.delete(new QueryWrapper<YgglAttaLxxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工联系信息表成功");
	}
邓实川 committed
1226

东州 翁 committed
1227 1228
	/**
	 * 获取员工紧急联系人表
邓实川 committed
1229
	 * 
东州 翁 committed
1230 1231 1232 1233 1234 1235 1236
	 * @param
	 * @return
	 */
	@GetMapping(value = "/jjlxr")
	@ApiOperation(value = "获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 33)
	public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean) {
邓实川 committed
1237 1238 1239
		List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build()
				.selectList(new QueryWrapper<YgglAttaJjlxr>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1240 1241
		return ResultUtil.data(ygglAttaJjlxrs, "获取员工紧急联系人表成功");
	}
邓实川 committed
1242

东州 翁 committed
1243 1244
	// 获取员工紧急联系人表
	@GetMapping(value = "/jjlxr/{empNum}")
1245
	@ApiOperation(value = "获取员工紧急联系人表(管)", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1246
	@ApiOperationSupport(order = 34)
1247 1248 1249 1250
	public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build().selectList(
				new QueryWrapper<YgglAttaJjlxr>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaJjlxrs, "获取员工紧急联系人表成功");
太阳与水 committed
1251
	}
邓实川 committed
1252

东州 翁 committed
1253 1254
	/**
	 * 添加/修改员工紧急联系人表
邓实川 committed
1255
	 * 
东州 翁 committed
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
	 * @param
	 * @return
	 */
	@PostMapping(value = "/jjlxr")
	@ApiOperation(value = "添加/修改员工紧急联系人表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 35)
	public Result<YgglAttaJjlxr> addjjlxr(@CurrentUser UserBean userBean, @RequestBody YgglAttaJjlxr ygglAttaJjlxr) {
		ygglAttaJjlxr.setEmpNum(ygglAttaJjlxr.getEmpNum());
		ygglAttaJjlxr.setOrgCode(userBean.getOrgCode());
		ygglAttaJjlxr.insertOrUpdate();
		return ResultUtil.data(ygglAttaJjlxr, "添加/修改员工紧急联系人表成功");
	}
邓实川 committed
1268

东州 翁 committed
1269 1270
	/**
	 * 删除员工紧急联系人表
邓实川 committed
1271
	 * 
东州 翁 committed
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/jjlxr/{id}")
	@ApiOperation(value = "删除员工紧急联系人表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 36)
	public Result<Boolean> deljjlxr(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaJjlxr.builder().build()
				.delete(new QueryWrapper<YgglAttaJjlxr>().eq("org_code", orgCode).eq("id", id)), "删除员工紧急联系人表成功");
	}
邓实川 committed
1283

东州 翁 committed
1284 1285 1286
	// 获取工资卡信息
	/**
	 * 获取员工工资卡信息
邓实川 committed
1287
	 * 
东州 翁 committed
1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298
	 * @param
	 * @return
	 */
	@GetMapping(value = "/gzk")
	@ApiOperation(value = "获取员工工资卡信息", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 37)
	public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean) {
		List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(new QueryWrapper<YgglAttaGzk>()
				.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
		return ResultUtil.data(ygglAttaGzks, "获取工资卡信息成功");
	}
邓实川 committed
1299

太阳与水 committed
1300 1301 1302
	// 获取工资卡信息
	@GetMapping(value = "/gzk/{empNum}")
	@ApiOperation(value = "获取员工工资卡信息(管)", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1303
	@ApiOperationSupport(order = 38)
太阳与水 committed
1304 1305 1306 1307 1308
	public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(
				new QueryWrapper<YgglAttaGzk>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaGzks, "获取工资卡信息成功");
	}
邓实川 committed
1309

东州 翁 committed
1310 1311
	/**
	 * 添加/修改工资卡信息
邓实川 committed
1312
	 * 
东州 翁 committed
1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324
	 * @param
	 * @return
	 */
	@PostMapping(value = "/gzk")
	@ApiOperation(value = "添加/修改工资卡信息", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 39)
	public Result<YgglAttaGzk> addgzk(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzk ygglAttaGzk) {
		ygglAttaGzk.setEmpNum(ygglAttaGzk.getEmpNum());
		ygglAttaGzk.setOrgCode(userBean.getOrgCode());
		ygglAttaGzk.insertOrUpdate();
		return ResultUtil.data(ygglAttaGzk, "添加/修改工资卡信息成功");
	}
邓实川 committed
1325

东州 翁 committed
1326 1327
	/**
	 * 删除工资卡信息
邓实川 committed
1328
	 * 
东州 翁 committed
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/gzk/{id}")
	@ApiOperation(value = "删除工资卡信息", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 40)
	public Result<Boolean> delgzk(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaGzk.builder().build()
				.delete(new QueryWrapper<YgglAttaGzk>().eq("org_code", orgCode).eq("id", id)), "删除工资卡信息成功");
	}
邓实川 committed
1340

东州 翁 committed
1341 1342
	/**
	 * 获取员工合同信息表
邓实川 committed
1343
	 * 
东州 翁 committed
1344 1345 1346 1347 1348 1349 1350
	 * @param
	 * @return
	 */
	@GetMapping(value = "/htxxb")
	@ApiOperation(value = "获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 41)
	public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean) {
邓实川 committed
1351 1352 1353
		List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaHtxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1354 1355
		return ResultUtil.data(ygglAttaHtxxbs, "获取员工合同信息表成功");
	}
邓实川 committed
1356

太阳与水 committed
1357 1358 1359
	// 获取员工合同信息表
	@GetMapping(value = "/htxxb/{empNum}")
	@ApiOperation(value = "获取员工合同信息表(管)", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1360
	@ApiOperationSupport(order = 42)
太阳与水 committed
1361 1362 1363 1364 1365
	public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build().selectList(
				new QueryWrapper<YgglAttaHtxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaHtxxbs, "获取员工合同信息表成功");
	}
邓实川 committed
1366

太阳与水 committed
1367
	/**
东州 翁 committed
1368
	 * 添加/修改员工合同信息表
邓实川 committed
1369
	 * 
太阳与水 committed
1370 1371 1372
	 * @param
	 * @return
	 */
东州 翁 committed
1373 1374 1375 1376 1377 1378 1379 1380
	@PostMapping(value = "/htxxb")
	@ApiOperation(value = "添加/修改员工合同信息表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 43)
	public Result<YgglAttaHtxxb> addhtxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaHtxxb ygglAttaHtxxb) {
		ygglAttaHtxxb.setEmpNum(ygglAttaHtxxb.getEmpNum());
		ygglAttaHtxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaHtxxb.insertOrUpdate();
		return ResultUtil.data(ygglAttaHtxxb, "添加/修改员工合同信息表成功");
太阳与水 committed
1381
	}
邓实川 committed
1382

太阳与水 committed
1383
	/**
东州 翁 committed
1384
	 * 删除员工合同信息表
邓实川 committed
1385
	 * 
太阳与水 committed
1386 1387 1388
	 * @param
	 * @return
	 */
东州 翁 committed
1389 1390 1391 1392 1393 1394 1395
	@DeleteMapping(value = "/htxxb/{id}")
	@ApiOperation(value = "删除员工合同信息表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 44)
	public Result<Boolean> delhtxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaHtxxb.builder().build()
				.delete(new QueryWrapper<YgglAttaHtxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工合同信息表成功");
太阳与水 committed
1396
	}
邓实川 committed
1397

太阳与水 committed
1398
	/**
东州 翁 committed
1399
	 * 获取员工材料附件表
1400
	 * 
1401 1402 1403
	 * @param
	 * @return
	 */
东州 翁 committed
1404 1405 1406 1407
	@GetMapping(value = "/clfjb")
	@ApiOperation(value = "获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 45)
	public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean) {
邓实川 committed
1408 1409 1410
		List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build()
				.selectList(new QueryWrapper<YgglAttaClfjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1411
		return ResultUtil.data(ygglAttaClfjbs, "获取员工材料附件表成功");
1412
	}
邓实川 committed
1413

东州 翁 committed
1414 1415 1416 1417 1418 1419 1420 1421
	// 获取员工材料附件表
	@GetMapping(value = "/clfjb/{empNum}")
	@ApiOperation(value = "获取员工材料附件表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 46)
	public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build().selectList(
				new QueryWrapper<YgglAttaClfjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaClfjbs, "获取员工材料附件表成功");
1422
	}
邓实川 committed
1423

1424
	/**
东州 翁 committed
1425
	 * 添加/修改员工材料附件表
邓实川 committed
1426
	 * 
1427 1428 1429
	 * @param
	 * @return
	 */
东州 翁 committed
1430 1431 1432 1433 1434 1435 1436 1437
	@PostMapping(value = "/clfjb")
	@ApiOperation(value = "添加/修改员工材料附件表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 47)
	public Result<YgglAttaClfjb> addclfjb(@CurrentUser UserBean userBean, @RequestBody YgglAttaClfjb ygglAttaClfjb) {
		ygglAttaClfjb.setOrgCode(userBean.getOrgCode());
		ygglAttaClfjb.setEmpNum(ygglAttaClfjb.getEmpNum());
		ygglAttaClfjb.insertOrUpdate();
		return ResultUtil.data(ygglAttaClfjb, "添加/修改员工材料附件表成功");
1438
	}
邓实川 committed
1439

1440
	/**
东州 翁 committed
1441
	 * 删除员工材料附件表
邓实川 committed
1442
	 * 
1443 1444 1445 1446 1447
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/clfjb/{id}")
	@ApiOperation(value = "删除员工材料附件表", httpMethod = "DELETE", notes = "接口发布说明")
东州 翁 committed
1448 1449 1450 1451 1452
	@ApiOperationSupport(order = 48)
	public Result<Boolean> delclfjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaClfjb.builder().build()
				.delete(new QueryWrapper<YgglAttaClfjb>().eq("org_code", orgCode).eq("id", id)), "删除员工材料附件表成功");
1453
	}
邓实川 committed
1454

东州 翁 committed
1455 1456
	/**
	 * 获取成长记录表
邓实川 committed
1457
	 * 
东州 翁 committed
1458 1459 1460 1461 1462 1463 1464
	 * @param
	 * @return
	 */
	@GetMapping(value = "/czjlb")
	@ApiOperation(value = "获取成长记录表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 49)
	public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean) {
邓实川 committed
1465 1466 1467
		List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build()
				.selectList(new QueryWrapper<YgglAttaCzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
						userBean.getEmpNum()));
东州 翁 committed
1468 1469
		return ResultUtil.data(ygglAttaCzjlbs, "获取成长记录表成功");
	}
邓实川 committed
1470

东州 翁 committed
1471 1472 1473 1474 1475 1476 1477 1478 1479
	// 获取成长记录表
	@GetMapping(value = "/czjlb/{empNum}")
	@ApiOperation(value = "获取成长记录表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 50)
	public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build().selectList(
				new QueryWrapper<YgglAttaCzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
		return ResultUtil.data(ygglAttaCzjlbs, "获取员工成长记录表成功");
	}
邓实川 committed
1480

东州 翁 committed
1481 1482
	/**
	 * 添加/修改成长记录表
邓实川 committed
1483
	 * 
东州 翁 committed
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495
	 * @param
	 * @return
	 */
	@PostMapping(value = "/czjlb")
	@ApiOperation(value = "添加/修改成长记录表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 51)
	public Result<YgglAttaCzjlb> addczjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaCzjlb ygglAttaCzjlb) {
		ygglAttaCzjlb.setEmpNum(ygglAttaCzjlb.getEmpNum());
		ygglAttaCzjlb.setOrgCode(userBean.getOrgCode());
		ygglAttaCzjlb.insertOrUpdate();
		return ResultUtil.data(ygglAttaCzjlb, "添加/修改成长记录表成功");
	}
邓实川 committed
1496

东州 翁 committed
1497 1498
	/**
	 * 获取单个离职员工信息(管)
邓实川 committed
1499
	 * 
东州 翁 committed
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510
	 * @param
	 * @return
	 */
	@GetMapping(value = "/lzb/{empNum}")
	@ApiOperation(value = "获取单个离职员工信息(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 52)
	public Result<YgglMainLzb> selectlzb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		YgglMainLzb lzyg = new LambdaQueryChainWrapper<YgglMainLzb>(ygglMainLzbMapper)
				.eq(YgglMainLzb::getOrgCode, userBean.getOrgCode()).eq(YgglMainLzb::getEmpNum, empNum).one();
		return ResultUtil.data(lzyg, "获取单个离职员工信息(管)成功");
	}
邓实川 committed
1511

东州 翁 committed
1512 1513
	/**
	 * 员工转正
邓实川 committed
1514
	 * 
东州 翁 committed
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527
	 * @param
	 * @return
	 */
	@PostMapping(value = "/ygzz")
	@ApiOperation(value = "员工转正", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 53)
	public Result<Void> ygzz(@CurrentUser UserBean userBean, @RequestBody YgzzDto ygzzDto) {
		UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
		updateWrapper.eq("emp_num", ygzzDto.getEmpNum());
		YgglMainEmp.builder().jobStatus(2).zzTime(ygzzDto.getZzTime()).sjzzTime(new Date())
				.zzRemark(ygzzDto.getZzRemark()).build().update(updateWrapper);
		return ResultUtil.success("转正成功!");
	}
邓实川 committed
1528

东州 翁 committed
1529 1530
	/**
	 * 计划离职 type2-3
邓实川 committed
1531
	 * 
东州 翁 committed
1532 1533 1534 1535 1536 1537 1538
	 * @param
	 * @return
	 */
	@PostMapping(value = "/addlzjh")
	@ApiOperation(value = "添加离职计划", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 54)
	public Result<YgglMainLzb> addjhlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
1539
		
1540
		Integer empNum = lzygQueryDto.getEmpNum();
1541
		
东州 翁 committed
1542
		QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>();
1543
		queryWrapper.eq("emp_num", empNum).eq("org_code", userBean.getOrgCode());
东州 翁 committed
1544 1545 1546 1547 1548
		YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
		YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
		// 移动员工表数据到离职表
		BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb);
		ygglMainLzb.insert();
1549

东州 翁 committed
1550
		UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
1551
		updateWrapper.eq("emp_num", empNum);
东州 翁 committed
1552
		UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
1553
		updateWrapper1.eq("emp_num", empNum);
1554
		YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).build().update(updateWrapper);
1555 1556
		YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
				.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
1557

东州 翁 committed
1558 1559
		return ResultUtil.data(ygglMainLzb, "添加待离职员工成功");
	}
邓实川 committed
1560

1561
	/**
东州 翁 committed
1562
	 * 确认离职 type3-4
邓实川 committed
1563
	 * 
太阳与水 committed
1564 1565
	 * @param
	 * @return
东州 翁 committed
1566 1567 1568 1569 1570
	 */
	@PostMapping(value = "/qrlz")
	@ApiOperation(value = "确认离职", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 55)
	public Result<Void> addlzb(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
1571
		Integer empNum = lzygQueryDto.getEmpNum();
东州 翁 committed
1572
		QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>();
1573
		queryWrapper.eq("emp_num", empNum);
东州 翁 committed
1574
		UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
1575
		updateWrapper.eq("emp_num", empNum);
东州 翁 committed
1576
		UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
1577
		updateWrapper1.eq("emp_num", empNum);
1578 1579 1580 1581
		YgglMainEmp.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
				.build().update(updateWrapper);
		YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
				.sjlzTime(new Date()).build().update(updateWrapper1);
东州 翁 committed
1582 1583
		// 查询该员工的关联表
		QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>();
1584
		queryWrapper1.eq("emp_num", empNum);
东州 翁 committed
1585 1586 1587
		// 确认离职 删除员工关联表
		QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(lzygQueryDto.getEmpNum()).build();
		qyzxEmpEntAsso.delete(queryWrapper1);
1588
		
1589
		// 初始化 部门主管
1590 1591 1592 1593
		zzglBmgwMMapper.update(ZzglBmgwM.builder().leader(null).build(), new UpdateWrapper<ZzglBmgwM>()
				.lambda()
				.eq(ZzglBmgwM::getLeader, empNum));
		
东州 翁 committed
1594 1595
		return ResultUtil.success("确认离职员工成功");
	}
邓实川 committed
1596

东州 翁 committed
1597 1598
	/**
	 * 放弃离职 type3-2
邓实川 committed
1599
	 * 
东州 翁 committed
1600 1601 1602 1603 1604 1605 1606 1607 1608
	 * @param
	 * @return
	 */
	@PostMapping(value = "/fqlz")
	@ApiOperation(value = "放弃离职", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 56)
	public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
		UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
		updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
1609
		YgglMainEmp.builder().jobStatus(YgEnumInterface.jobStatus.ZHENSHI.getType()).build().update(updateWrapper);
东州 翁 committed
1610 1611 1612 1613 1614 1615 1616
		QueryWrapper<YgglMainLzb> queryWrapper = new QueryWrapper<YgglMainLzb>();
		queryWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
		// 删除离职表
		YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build().delete(queryWrapper);

		return ResultUtil.success("放弃成功");
	}
邓实川 committed
1617

东州 翁 committed
1618 1619 1620 1621 1622
	@PostMapping(value = "/tzlzyy")
	@ApiOperation(value = "调整离职", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 56)
	public Result<YgglMainLzb> tzlzyy(@CurrentUser UserBean userBean, @RequestBody YgglMainLzb ygglMainLzb) {

邓实川 committed
1623 1624 1625 1626 1627 1628 1629 1630
		if (ygglMainLzb.getEmpNum() != null) {
			UpdateWrapper<YgglMainLzb> updateWrapper = new UpdateWrapper<YgglMainLzb>();
			updateWrapper.eq("org_code", userBean.getOrgCode()).eq("emp_num", ygglMainLzb.getEmpNum());
			ygglMainLzb.update(updateWrapper);
			return ResultUtil.data(ygglMainLzb, "修改成功");
		}
		return ResultUtil.error("请确认该员工是否存在!");

东州 翁 committed
1631
	}
邓实川 committed
1632

东州 翁 committed
1633 1634
	/**
	 * 查询离职员工列表
邓实川 committed
1635
	 * 
东州 翁 committed
1636 1637 1638 1639 1640 1641 1642 1643
	 * @param
	 * @return
	 */
	@PostMapping(value = "/querylzyg")
	@ApiOperation(value = "查询离职员工列表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 57)
	public Result<Object> querylzyg(@CurrentUser UserBean userBean, @RequestBody LzbQueryDto lzygQueryDto) {
		lzygQueryDto.setOrgCode(userBean.getOrgCode());
邓实川 committed
1644

东州 翁 committed
1645 1646 1647 1648 1649
		IPage<YgglMainLzb> page = new Page<YgglMainLzb>(
				lzygQueryDto.getCurrentPage() == null ? 1 : lzygQueryDto.getCurrentPage(),
				lzygQueryDto.getTotalPage() == null ? 10 : lzygQueryDto.getTotalPage());
		List<YgglMainLzb> lzb = ygglMainLzbMapper.queryLzb(page, lzygQueryDto);
		return ResultUtil.data(page, lzb, "离职员工搜索成功");
太阳与水 committed
1650
	}
邓实川 committed
1651

1652 1653
	/**
	 * 展示民族/展示所有民族
邓实川 committed
1654
	 * 
1655 1656
	 * @param
	 * @return
邓实川 committed
1657
	 */
1658 1659
	@PostMapping(value = "/mz/{id}")
	@ApiOperation(value = "展示民族/展示所有民族", httpMethod = "POST", notes = "接口发布说明")
东州 翁 committed
1660
	@ApiOperationSupport(order = 59)
1661
	public Result<List<YgmzDto>> selectmzs(@CurrentUser UserBean userBean, @PathVariable Integer id) {
邓实川 committed
1662 1663 1664
		if (id == null || id == 0) {
			List<YgmzDto> allmz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).list();
			return ResultUtil.data(allmz, "展示所有民族");
1665
		}
邓实川 committed
1666 1667
		List<YgmzDto> mz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).eq(YgmzDto::getNumber, id).list();
		return ResultUtil.data(mz, "展示该民族");
1668
	}
1669
	
1670 1671
	@Autowired
	CommonAreaMapper commonAreaMapper;
1672
	
1673 1674 1675 1676 1677 1678 1679 1680 1681 1682
	/**
	 * 籍贯树-Mini
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/native_place")
	@ApiOperation(value = "籍贯树-Mini", httpMethod = "GET", notes = "籍贯树-Mini")
	@ApiOperationSupport(order = 60)
	public Result<List<CommonArea>> selectNativePlace() {
1683
		
1684 1685
		List<CommonArea> listCommonArea = commonAreaMapper.AllAreaForTree();
		return ResultUtil.data(listCommonArea, "操作成功!");
1686
		
1687
	}
邓实川 committed
1688

1689 1690 1691 1692 1693 1694
	/**
	 * 展示籍贯/展示所有籍贯
	 * 
	 * @param
	 * @return
	 */
1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706
	@PostMapping(value = "/jg")
	@ApiOperation(value = "展示籍贯所有省市区", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 60)
	public Result<List<YgjgDto>> selectjgs(@CurrentUser UserBean userBean) {

		List<YgjgDto> oldfather = new ArrayList<YgjgDto>();// 老父亲

		List<YgProDto> pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).list();// super继承人
		List<YgCityDto> city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).list();
		List<YgAreaDto> area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).list();

		for (YgProDto p : pro) {
1707
			Map<String, Object> map = BeanUtil.beanToMap(p);
1708
			// 设置别名对应bean
1709 1710 1711
			HashMap<String, String> mapping = CollUtil.newHashMap();
			mapping.put("id", "jgid");
			mapping.put("name", "jgname");
1712 1713 1714 1715 1716
			YgjgDto ygproDto = BeanUtil.mapToBean(map, YgjgDto.class, CopyOptions.create().setFieldMapping(mapping));
			// 添加cityList
			// 给一个upid
			List<YgCityDto> outcity = uptocityList(city, ygproDto.getJgid());
			// 新建一个篮子
1717 1718 1719 1720 1721 1722 1723
			List<YgjgDto> cityDtos = new ArrayList<YgjgDto>();
			for (YgCityDto c : outcity) {
				Map<String, Object> map2 = BeanUtil.beanToMap(c);
				HashMap<String, String> mapping2 = CollUtil.newHashMap();
				mapping2.put("id", "jgid");
				mapping2.put("name", "jgname");
				mapping2.put("province", "upid");
1724 1725 1726
				YgjgDto ygcityDto = BeanUtil.mapToBean(map2, YgjgDto.class,
						CopyOptions.create().setFieldMapping(mapping2));
				// 把果实收起来
1727
				cityDtos.add(ygcityDto);
1728 1729
				List<YgAreaDto> outarea = uptoareaList(area, ygcityDto.getJgid());

1730 1731 1732 1733 1734 1735 1736
				List<YgjgDto> areaDtos = new ArrayList<YgjgDto>();
				for (YgAreaDto a : outarea) {
					Map<String, Object> map3 = BeanUtil.beanToMap(a);
					HashMap<String, String> mapping3 = CollUtil.newHashMap();
					mapping3.put("id", "jgid");
					mapping3.put("name", "jgname");
					mapping3.put("city", "upid");
1737 1738
					YgjgDto ygjgDto3 = BeanUtil.mapToBean(map3, YgjgDto.class,
							CopyOptions.create().setFieldMapping(mapping3));
1739 1740 1741 1742 1743
					areaDtos.add(ygjgDto3);

				}
				ygcityDto.setYgjgDtoList(areaDtos);
				areaDtos.add(ygcityDto);
1744

1745 1746 1747
			}
			ygproDto.setYgjgDtoList(cityDtos);
			oldfather.add(ygproDto);
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758
		}

		return ResultUtil.data(oldfather, "老父亲出来了");
	}

	// 根据上级id抽取出list
	public List<YgCityDto> uptocityList(List<YgCityDto> city, Integer jgid) {
		List<YgCityDto> outcity = new ArrayList<YgCityDto>();
		for (YgCityDto c : city) {
			if (c.getProvince().equals(jgid)) {
				outcity.add(c);
1759
			}
1760 1761 1762 1763 1764 1765 1766 1767 1768 1769
		}
		city.removeAll(outcity);
		return outcity;
	}

	public List<YgAreaDto> uptoareaList(List<YgAreaDto> area, Integer jgid) {
		List<YgAreaDto> outarea = new ArrayList<YgAreaDto>();
		for (YgAreaDto a : area) {
			if (a.getCity().equals(jgid)) {
				outarea.add(a);
1770
			}
1771 1772 1773 1774
		}
		area.removeAll(outarea);
		return outarea;
	}
1775 1776 1777 1778 1779 1780

	/**
	 * 展示籍贯/展示所有籍贯(威力增强版)
	 * 
	 * @param
	 * @return
1781
	 */
1782
	@PostMapping(value = "/jgshow/{jgid}")
1783 1784
	@ApiOperation(value = "展示籍贯所有省市区威力增强版", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 388)
1785
	public Result<Map<String, String>> selectjgs1(@CurrentUser UserBean userBean, @PathVariable String jgid) {
1786 1787 1788 1789 1790 1791
		// public Result<List<YgjgDto>> selectjgs1(@CurrentUser UserBean userBean,
		// @RequestBody YgjgDto ygjgDto) {
		Integer upId = Integer.valueOf(jgid);
		// List<YgjgDto> maps = new ArrayList<YgjgDto>();
		Map<String, String> maps = new HashMap<String, String>();
		if (upId == null || upId % 100 != 0) { // 省份
邓实川 committed
1792 1793 1794
			List<YgProDto> list = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
					.select(YgProDto::getId, YgProDto::getProvince, YgProDto::getName).orderByAsc(YgProDto::getProvince)
					.list();
1795 1796
			list.forEach((item) -> maps.put((item.getId()).toString(), item.getName()));
		} else if (upId % 10000 == 0) {
邓实川 committed
1797
			List<YgCityDto> list = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper)
1798 1799 1800 1801 1802 1803
					.select(YgCityDto::getId, YgCityDto::getProvince, YgCityDto::getCity, YgCityDto::getName)
					.eq(YgCityDto::getProvince, upId).orderByAsc(YgCityDto::getProvince).orderByAsc(YgCityDto::getCity)
					.list();
			list.forEach((item) -> maps.put((item.getId()).toString(), item.getName()));

		} else if (upId % 100 == 0) {
邓实川 committed
1804 1805 1806
			List<YgAreaDto> list = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper)
					.select(YgAreaDto::getId, YgAreaDto::getName).eq(YgAreaDto::getCity, upId)
					.orderByAsc(YgAreaDto::getProvince).orderByAsc(YgAreaDto::getCity).list();
1807
			list.forEach((item) -> maps.put((item.getId()).toString(), item.getName()));
邓实川 committed
1808
		}
1809
		return ResultUtil.data(maps, "展示籍贯成功");
1810
	}
邓实川 committed
1811

1812 1813
	/**
	 * 查询员工列表
邓实川 committed
1814
	 * 
1815 1816 1817 1818 1819
	 * @param
	 * @return
	 */
	@GetMapping(value = "/queryemp")
	@ApiOperation(value = "查询员工列表", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1820
	@ApiOperationSupport(order = 62)
1821
	public Result<List<YgQueryDto>> queryEmpMessage(@CurrentUser UserBean userBean) {
1822
		List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode());
1823 1824 1825 1826 1827
		for (YgQueryDto yg : ygQueryDto) {
			if (StringUtil.isEmpty(yg.getHeadUrl())) {
				yg.setHeadUrl("");
			}
		}
1828 1829
		return ResultUtil.data(ygQueryDto, "查询成功");
	}
邓实川 committed
1830

1831 1832 1833
	/*************** 统计图 ***************/
	/**
	 * 查询统计图
邓实川 committed
1834
	 * 
1835 1836 1837 1838
	 * @return 成功信息
	 */
	@GetMapping("/yggl")
	@ApiOperation(value = "获取员工管理统计图信息", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1839
	@ApiOperationSupport(order = 63)
1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856
	public Result<Map<String, Object>> queryYgglCartogram(@CurrentUser UserBean userBean) {

		Map<String, Object> map = new HashMap<String, Object>();
		YgglCartogramDto ygglCartogramDto1 = ygglMainEmpMapper.queryPositive(userBean);
		YgglCartogramDto ygglCartogramDto2 = ygglMainEmpMapper.queryAvgAge(userBean);
		YgglCartogramDto ygglCartogramDto3 = ygglMainEmpMapper.queryInduction(userBean);
		YgglCartogramDto ygglCartogramDto4 = ygglMainEmpMapper.queryInservice(userBean);
		YgglCartogramDto ygglCartogramDto5 = ygglMainLzbMapper.queryDeparture(userBean);

		List<YgglCartogramDto> ygglCartogramDto6 = ygglMainEmpMapper.queryDepartmentNum(userBean);
		List<YgglCartogramDto> ygglCartogramDto7 = ygglMainEmpMapper.queryEducation(userBean);
		List<YgglCartogramDto> ygglCartogramDto8 = ygglMainEmpMapper.queryJobsNum(userBean);
		List<YgglCartogramDto> ygglCartogramDto9 = ygglMainEmpMapper.queryEmpAge(userBean);
		List<YgglCartogramDto> ygglCartogramDto10 = ygglMainEmpMapper.queryNativeplace(userBean);
		List<YgglCartogramDto> ygglCartogramDto11 = ygglMainEmpMapper.queryWorkingAge(userBean);

		map.put("positive", ygglCartogramDto1.getPositive());
1857 1858 1859
		if (ygglCartogramDto2 != null) {
			map.put("avgAge", ygglCartogramDto2.getAvgAge());
		}
1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873
		map.put("induction", ygglCartogramDto3.getInduction());
		map.put("probation", ygglCartogramDto4.getProbation());
		map.put("regular", ygglCartogramDto4.getRegular());
		map.put("departure", ygglCartogramDto5.getDepartureNum());

		map.put("department", ygglCartogramDto6);
		map.put("education", ygglCartogramDto7);
		map.put("jobs", ygglCartogramDto8);
		map.put("empAge", ygglCartogramDto9);
		map.put("nativeplace", ygglCartogramDto10);
		map.put("workingAge", ygglCartogramDto11);

		return ResultUtil.data(map, "查询成功");
	}
邓实川 committed
1874

东州 翁 committed
1875
	/**
1876
	 * 员工信息统计图
1877
	 * 
1878 1879 1880 1881 1882 1883 1884 1885
	 * @return 成功信息(weng)
	 */
	@GetMapping("/Cartogram")
	@ApiOperation(value = "获取员工管理统计图信息", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 99)
	public Result<YgCartogramDto> ygCartogram(@CurrentUser UserBean userBean) {
		Integer orgCode = userBean.getOrgCode();
		List<YgbintuDto> bintu = ygglMainEmpMapper.rsybp(orgCode);
1886 1887 1888 1889 1890 1891 1892 1893 1894
		/*
		 * bintu.stream().filter(bean ->{ if (bean.getAge() == null) { bean.setAge(0); }
		 * if (bean.getBm() == null) { bean.setBm("未分配"); } if (bean.getGw() == null) {
		 * bean.setGw("未分配"); } if (bean.getProname() == null) { bean.setProname("未分配");
		 * } if (bean.getEduname() == null) { bean.setEduname("未分配"); } if
		 * (bean.getJobStatus() == null) { bean.setJobStatus(-1); } if
		 * (bean.getWorkage() == null) { bean.setWorkage(-1); } return true;
		 * }).collect(Collectors.toList());
		 */
1895
		Map<String, Long> gw = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getGw, Collectors.counting()));
1896
		List<YgKVDto> gwList = new ArrayList<YgKVDto>();
1897 1898
		for (Map.Entry<String, Long> entry : gw.entrySet()) {
			gwList.add(new YgKVDto(entry.getKey(), entry.getValue().toString()));
1899
		}
1900
		Map<String, Long> bm = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getBm, Collectors.counting()));
1901
		List<YgKVDto> bmList = new ArrayList<YgKVDto>();
1902 1903
		for (Map.Entry<String, Long> entry : bm.entrySet()) {
			bmList.add(new YgKVDto(entry.getKey(), entry.getValue().toString()));
1904
		}
1905 1906 1907 1908
		// Map<String, Map<String, Long>> bmgw =
		// bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getBm,Collectors.groupingBy(YgbintuDto::getGw,Collectors.counting())));
		Map<String, Long> edu = bintu.stream()
				.collect(Collectors.groupingBy(YgbintuDto::getEduname, Collectors.counting()));
1909
		List<YgKVDto> eduList = new ArrayList<YgKVDto>();
1910 1911
		for (Map.Entry<String, Long> entry : edu.entrySet()) {
			eduList.add(new YgKVDto(entry.getKey(), entry.getValue().toString()));
1912
		}
1913 1914
		Map<Integer, Long> jobStatus = bintu.stream()
				.collect(Collectors.groupingBy(YgbintuDto::getJobStatus, Collectors.counting()));
1915
		List<YgKVDto> jobStatusList = new ArrayList<YgKVDto>();
1916 1917
		for (Entry<Integer, Long> entry : jobStatus.entrySet()) {
			jobStatusList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
1918
		}
1919 1920
		Map<String, Long> proname = bintu.stream()
				.collect(Collectors.groupingBy(YgbintuDto::getProname, Collectors.counting()));
1921
		List<YgKVDto> pronameList = new ArrayList<YgKVDto>();
1922 1923
		for (Entry<String, Long> entry : proname.entrySet()) {
			pronameList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
1924
		}
1925
		Map<String, Integer> workage = YgEnumInterface.workage.choose(bintu);
1926
		List<YgKVDto> workageList = new ArrayList<YgKVDto>();
1927 1928
		for (Entry<String, Integer> entry : workage.entrySet()) {
			workageList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
1929
		}
1930
		Map<String, Integer> age = YgEnumInterface.age.choose(bintu);
1931
		List<YgKVDto> ageList = new ArrayList<YgKVDto>();
1932 1933
		for (Entry<String, Integer> entry : age.entrySet()) {
			ageList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
1934
		}
1935
		// 在职
1936 1937
		Integer zaizhi = jobStatus.get(YgEnumInterface.jobStatus.ZHENSHI.getType()).intValue()
				+ jobStatus.get(YgEnumInterface.jobStatus.SHIYONG.getType()).intValue();
1938
		// 本月新入职
1939
		Integer xinruzhi = workage.get("本月新入职").intValue();
1940
		// 本月离职
1941
		Integer lizhi = ygglMainEmpMapper.benyueLz(orgCode);
1942
		// 本月转正
1943
		Integer zhuanzhen = ygglMainEmpMapper.benyueZz(orgCode);
1944
		// 平均年龄
1945 1946
		Integer nianlin = age.get("平均年龄").intValue();
		YgCartogramDto ybp = new YgCartogramDto();
1947 1948 1949 1950 1951
		ybp.setOnTheJob(zaizhi);
		ybp.setNewRecruits(xinruzhi);
		ybp.setDimission(lizhi);
		ybp.setRegularization(zhuanzhen);
		ybp.setAverageAge(nianlin);
1952

1953 1954
		ybp.setDepartment(bmList);
		ybp.setPosition(gwList);
1955 1956 1957 1958 1959
		ybp.setEdu(eduList);
		ybp.setJobStatus(jobStatusList);
		ybp.setProname(pronameList);
		ybp.setWorkage(workageList);
		ybp.setAge(ageList);
1960 1961
		return ResultUtil.data(ybp, "获取员工管理统计图信息成功!");
	}
1962

1963 1964
	/**
	 * 获取员工社保公积金
邓实川 committed
1965
	 * 
东州 翁 committed
1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygsbgjj")
	@ApiOperation(value = "获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 64)
	public Result<List<YgglAttaSbgjj>> selectygsbgjj(@CurrentUser UserBean userBean) {
		List<YgglAttaSbgjj> ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectList(new QueryWrapper<YgglAttaSbgjj>()
				.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
		return ResultUtil.data(ygglAttaSbgjj, "获取员工社保公积金成功");
	}
邓实川 committed
1977

1978 1979
	/**
	 * 获取员工社保公积金
邓实川 committed
1980
	 * 
1981 1982 1983 1984 1985
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygsbgjj/{empNum}")
	@ApiOperation(value = "获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
东州 翁 committed
1986
	@ApiOperationSupport(order = 65)
邓实川 committed
1987 1988 1989 1990
	public Result<YgglAttaSbgjj> selectygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {

		YgglAttaSbgjj ygglAttaSbgjj = YgglAttaSbgjj.builder().build()
				.selectOne(new QueryWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
1991 1992 1993

		return ResultUtil.data(ygglAttaSbgjj, "获取员工社保公积金成功");
	}
邓实川 committed
1994

1995 1996
	/**
	 * 添加/修改员工社保公积金
邓实川 committed
1997
	 * 
1998 1999 2000 2001 2002
	 * @param
	 * @return
	 */
	@PostMapping(value = "/ygsbgjj")
	@ApiOperation(value = "添加/修改员工社保公积金", httpMethod = "POST", notes = "接口发布说明")
东州 翁 committed
2003
	@ApiOperationSupport(order = 66)
邓实川 committed
2004
	public Result<YgglAttaSbgjj> addygsbgjj(@CurrentUser UserBean userBean, @RequestBody YgglAttaSbgjj ygglAttaSbgjj) {
2005 2006 2007 2008
		Integer empNum = ygglAttaSbgjj.getEmpNum();
		if (empNum == null) {
			return ResultUtil.error();
		}
邓实川 committed
2009 2010
		YgglAttaSbgjj AttaSbgjj = YgglAttaSbgjj.builder().build()
				.selectOne(new QueryWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
2011 2012
		if (AttaSbgjj != null) {
			ygglAttaSbgjj.update(new UpdateWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
邓实川 committed
2013
		} else {
2014 2015 2016 2017 2018
			ygglAttaSbgjj.insert();
		}

		return ResultUtil.data(ygglAttaSbgjj, "添加/修改员工社保公积金成功");
	}
邓实川 committed
2019

东州 翁 committed
2020 2021
	/**
	 * 删除员工社保公积金
邓实川 committed
2022
	 * 
东州 翁 committed
2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/ygsbgjj/{id}")
	@ApiOperation(value = "删除员工社保公积金", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 67)
	public Result<Boolean> delygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
		return ResultUtil.data(YgglAttaSbgjj.builder().build()
				.delete(new QueryWrapper<YgglAttaSbgjj>().eq("org_code", orgCode).eq("id", id)), "删除员工社保公积金成功");
	}
邓实川 committed
2034

2035
}