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

8
import java.io.IOException;
lal committed
9
import java.text.ParseException;
lal committed
10
import java.text.SimpleDateFormat;
tangzhaoqian committed
11 12 13 14 15 16 17 18 19
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;

20
import javax.annotation.Resource;
21 22
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
tangzhaoqian committed
23 24
import javax.transaction.Transactional;

25
import cn.timer.api.utils.redis.RedisUtil;
tangzhaoqian committed
26
import org.springframework.beans.factory.annotation.Autowired;
27
import org.springframework.beans.factory.annotation.Value;
ilal committed
28 29 30
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
tangzhaoqian committed
31
import org.springframework.transaction.interceptor.TransactionAspectSupport;
ilal committed
32 33
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
34
import org.springframework.validation.annotation.Validated;
tangzhaoqian committed
35 36 37 38 39 40 41
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;
ilal committed
42
import org.springframework.web.client.RestTemplate;
tangzhaoqian committed
43 44 45 46 47 48 49 50 51 52 53

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.StringUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;

import cn.hutool.core.bean.BeanUtil;
54
import cn.hutool.core.collection.CollUtil;
55
import cn.hutool.core.collection.CollectionUtil;
tangzhaoqian committed
56 57
import cn.hutool.core.date.BetweenFormater.Level;
import cn.hutool.core.date.DateUtil;
58
import cn.hutool.core.io.IoUtil;
tangzhaoqian committed
59 60 61
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil;
62
import cn.hutool.core.util.IdcardUtil;
63
import cn.hutool.core.util.ObjectUtil;
64
import cn.hutool.core.util.ReUtil;
tangzhaoqian committed
65
import cn.hutool.core.util.StrUtil;
66
import cn.hutool.json.JSONObject;
tangzhaoqian committed
67
import cn.hutool.json.JSONUtil;
68 69
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
tangzhaoqian committed
70 71
import cn.timer.api.bean.clazz.CommonArea;
import cn.timer.api.bean.clazz.SysRegion;
ilal committed
72 73 74
import cn.timer.api.bean.kqgl.UserEquiRelation;
import cn.timer.api.bean.kqmk.KqglAssoKqj;
import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
lal committed
75
import cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance;
lal committed
76
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
ilal committed
77
import cn.timer.api.bean.kqmk.KqglAssoYhkqz;
ilal committed
78
import cn.timer.api.bean.kqmk.KqglAssoYhsb;
tangzhaoqian committed
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
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;
import cn.timer.api.config.enuminterface.YgEnumInterface;
99
import cn.timer.api.config.enuminterface.YgEnumInterface.jobStatus;
tangzhaoqian committed
100
import cn.timer.api.config.enums.CommonEnum;
101
import cn.timer.api.config.enums.SysRoleType;
102
import cn.timer.api.config.exception.Regular;
103
import cn.timer.api.config.validation.ValidList;
lal committed
104
import cn.timer.api.controller.kqgl.ClockInTool;
lal committed
105
import cn.timer.api.controller.kqgl.atttimer.RealTimeUpdate;
106
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
tangzhaoqian committed
107
import cn.timer.api.dao.clazz.CommonAreaMapper;
ilal committed
108 109
import cn.timer.api.dao.kqgl.UserEquiRelationMapper;
import cn.timer.api.dao.kqmk.KqglAssoKqzdkfsMapper;
lal committed
110
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
111
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
tangzhaoqian committed
112 113 114 115 116
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
lal committed
117
import cn.timer.api.dto.kqmk.AdditionalDto;
tangzhaoqian committed
118
import cn.timer.api.dto.yggl.AddygdaDto;
119
import cn.timer.api.dto.yggl.EmpQuery;
120
import cn.timer.api.dto.yggl.ImportEmpDto;
tangzhaoqian committed
121 122 123 124
import cn.timer.api.dto.yggl.LoginInfoDto;
import cn.timer.api.dto.yggl.LoginerChargeDto;
import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto;
ilal committed
125
import cn.timer.api.dto.yggl.ModifyAvatarDto;
ilal committed
126
import cn.timer.api.dto.yggl.UserInfo;
tangzhaoqian committed
127 128 129 130 131 132 133
import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgKVDto;
import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgbintuDto;
import cn.timer.api.dto.yggl.YgglCartogramDto;
import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.dto.yggl.YgzzDto;
134
import cn.timer.api.utils.DateFormatUtils;
tangzhaoqian committed
135 136 137 138 139 140 141 142 143 144 145 146 147
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
148
@Transactional(rollbackOn = Exception.class)
tangzhaoqian committed
149 150 151
@RequestMapping(value = "/yggl", produces = { "application/json" })
public class YgglController {

152 153
	@Value(value = "${config-8timer.init-password}")
	private String pwd;
154

tangzhaoqian committed
155 156
	@Autowired
	private YgglMainEmpMapper ygglMainEmpMapper;
157

158 159
	@Autowired
	private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
tangzhaoqian committed
160 161 162 163 164 165 166 167 168 169 170 171 172 173

	@Autowired
	private QyzxEmpLoginMapper qyzxEmpLoginMapper;

	@Autowired
	private YgglMainLzbMapper ygglMainLzbMapper;

	@Autowired
	private ZzglBmgwMMapper zzglBmgwMMapper;

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

174 175 176 177 178 179
	@Resource
	private RedisUtil redisUtil;

	@Value("${server.servlet.session.timeout}")
	public Integer session_timeout;

tangzhaoqian committed
180 181 182 183 184 185 186
	/**
	 * 获取员工档案
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygda")
187
	@ApiOperation(value = "1.获取员工档案", httpMethod = "GET", notes = "接口发布说明")
tangzhaoqian committed
188 189 190 191
	@ApiOperationSupport(order = 1)
	public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean) {
		Integer empNum = userBean.getEmpNum();
		Integer orgCode = userBean.getOrgCode();
192
		YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
193
				.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum));
tangzhaoqian committed
194 195 196 197
		Date rz = ygglMainEmp.getRzTime();
		if (rz != null) {
			ygglMainEmp.setWorkTime(DateUtil.formatBetween(rz, new Date(), Level.DAY));
		}
198
		return ResultUtil.data(ygglMainEmp);
tangzhaoqian committed
199 200 201 202
	}

	// 获取员工档案
	@GetMapping(value = "/ygda/{empNum}")
203
	@ApiOperation(value = "2.获取员工档案(管)", httpMethod = "GET", notes = "接口发布说明")
tangzhaoqian committed
204 205 206
	@ApiOperationSupport(order = 2)
	public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
		Integer orgCode = userBean.getOrgCode();
207
		YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
208
				.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum));
tangzhaoqian committed
209 210 211 212
		Date rz = ygglMainEmp.getRzTime();
		if (rz != null) {
			ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(), Level.DAY));
		}
213
		return ResultUtil.data(ygglMainEmp);
tangzhaoqian committed
214 215 216 217 218 219 220 221 222
	}

	/**
	 * 根据岗位id获取员工档案部门岗位名称
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygdabm/{gwid}")
223
	@ApiOperation(value = "3.获取员工档案部门岗位名称", httpMethod = "GET", notes = "接口发布说明")
tangzhaoqian committed
224 225 226
	@ApiOperationSupport(order = 3)
	public Result<String> selectbmgw(@CurrentUser UserBean userBean, @PathVariable Integer gwid) {
		if (gwid == null || gwid == 0) {
227
			return ResultUtil.data("岗位不存在");
tangzhaoqian committed
228 229
		}
		Integer orgCode = userBean.getOrgCode();
230 231
		ZzglBmgwM zzglBmgwM = ZzglBmgwM.builder().build().selectOne(
				new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getId, gwid));
tangzhaoqian committed
232 233 234 235 236 237
		String gw = null;
		Integer bmid = null;
		if (zzglBmgwM != null) {
			gw = zzglBmgwM.getName();
			bmid = zzglBmgwM.getUpId();
		}
238 239
		ZzglBmgwM z = ZzglBmgwM.builder().build().selectOne(
				new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getId, bmid));
tangzhaoqian committed
240 241 242 243 244
		String bm = null;
		if (z != null) {
			bm = z.getName();
		}
		String bmgw = bm + "/" + gw;
245
		return ResultUtil.data(bmgw);
tangzhaoqian committed
246 247
	}

lal committed
248 249 250
	
	@Autowired
	private RealTimeUpdate realtimeupdate;
ilal committed
251 252 253 254 255 256 257 258
	@Autowired
	private KqglAssoKqzdkfsMapper kqglassokqzdkfsmapper;
	
	@Value("${config-8timer.machine8timerUrl}")
	public String mac_command; // 回调地址
	
	@Autowired
	private UserEquiRelationMapper userequirelationmapper;
tangzhaoqian committed
259
	/**
260
	 * 添加员工档案
261
	 * 
262 263
	 * @param userBean
	 * @param addygdaDto
tangzhaoqian committed
264 265 266
	 * @return
	 */
	@PostMapping(value = "/addygda")
267
	@ApiOperation(value = "4.添加员工档案", httpMethod = "POST", notes = "接口发布说明")
tangzhaoqian committed
268
	@ApiOperationSupport(order = 4)
269 270
	public Result<Object> addygda(@CurrentUser UserBean userBean, @Validated @RequestBody AddygdaDto addygdaDto)
			throws Exception {
tangzhaoqian committed
271
		Integer orgCode = userBean.getOrgCode();
ilal committed
272
		String customNum = addygdaDto.getCustomNum();//自定义工号
tangzhaoqian committed
273 274 275 276
		String name = addygdaDto.getName();
		String phone = addygdaDto.getPhone();
		Integer zjType = addygdaDto.getZjType();
		String zjNum = addygdaDto.getZjNum();
mobh committed
277
		Integer attgroupid = addygdaDto.getAttgroupid();//考勤组id
278 279 280
		boolean isvalid = true;
		switch (zjType) {
		case 0:
281
			isvalid = IdcardUtil.isValidCard15(zjNum) || IdcardUtil.isValidCard18(zjNum);
282 283
			break;
		case 1:
284
			String[] strs = IdcardUtil.isValidCard10(zjNum);
邓实川 committed
285 286 287 288 289 290
			if (strs == null) {
				isvalid = false;
				break;
			}
			String str2 = strs != null && strs.length > 2 ? strs[2] : "false";
			isvalid = "澳门/香港".contains(strs[0]) && "true".equals(str2);
291 292
			break;
		case 2:
293
			isvalid = IdcardUtil.isValidTWCard(zjNum);
294 295 296 297 298 299 300
			break;
		case 3:
			isvalid = ReUtil.isMatch(Regular.PASSPORT1, zjNum) || ReUtil.isMatch(Regular.PASSPORT2, zjNum);
			break;
		default:
			break;
		}
ilal committed
301 302 303
//		if (!isvalid) {
//			return ResultUtil.error("证件格式不对!");
//		}
304

tangzhaoqian committed
305
		Integer jobType = addygdaDto.getJobType();
306
		Date rzTime = addygdaDto.getRzTime() == null ? new Date() : addygdaDto.getRzTime();
tangzhaoqian committed
307 308
		Integer syq = addygdaDto.getSyq();
		Integer sex = addygdaDto.getSex();
309
		Integer bmgwId = addygdaDto.getBmgwId();
lal committed
310
		
311

tangzhaoqian committed
312 313 314
		QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
				.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
		if (login == null) {
315
			// 初始化密码 pwd
316
			login = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pwd))
tangzhaoqian committed
317
					.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(name).build();
318
			if (!login.insert()) {
tangzhaoqian committed
319 320 321
				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
				return ResultUtil.error("添加员工登录表失败,请检查输入信息");
			}
322
		}
323

324 325 326 327
		YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
				.eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode));

		if (ygglMainEmp == null) {
328 329 330
			QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType())
					.status(CommonEnum.U_STS_ON.getType()).build().insert();
			ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
331
					.jobStatus(jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
ilal committed
332 333 334 335
					.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).customNum(customNum).build();
			
			if(addygdaDto.getAttgroupid() != null) {
				KqglAssoYhkqz.builder().kqzid(attgroupid).userid(login.getId()).qyid(userBean.getOrgCode()).build().insert();
ilal committed
336 337 338 339 340 341 342 343
				
				List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, addygdaDto.getAttgroupid()).eq(KqglAssoKqzdkfs::getType, 1));
				
				for(KqglAssoKqzdkfs abp:kqjs) {
					KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();
					KqglAssoYhsb kqjry = KqglAssoYhsb.builder().build().selectOne(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, login.getId()).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
					if(kqjry == null) {
						
ilal committed
344
//						YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, login.getId()));
ilal committed
345 346 347 348 349
						String url = mac_command+"/addUserName";
				        HttpHeaders headers = new HttpHeaders();
				        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
				        params.add("devId", kqj.getCode());
				        params.add("userId", login.getId());
ilal committed
350
				        params.add("userName", ygglMainEmp.getName());
ilal committed
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
				        RestTemplate restTemplate = new RestTemplate();
				        HttpEntity httpEntity = new HttpEntity(params, headers);
				        ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
						
				        KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, login.getId()).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
				        
						KqglAssoYhsb uskqj = KqglAssoYhsb.builder().userId(login.getId()).kqjid(kqj.getId()).type(1).build();
						
						UserEquiRelation isgly = userequirelationmapper.selectByuserId(login.getId());
						if(isgly != null) {
							uskqj.setIsGly(isgly.getIsGly());
						}else {
							uskqj.setIsGly(0);
						}
						if (!uskqj.insert()) 
							return ResultUtil.error("操作失败--新增用户与设备关系");
					}
				}
				
ilal committed
370
			}
lal committed
371 372 373 374 375 376 377 378 379 380 381 382
			
			if(syq == 0) {
				ygglMainEmp.setZzTime(rzTime);
			}else {
				
				String sdf = new SimpleDateFormat("yyyy-MM-dd").format(rzTime);
				
				String zztime = ClockInTool.requires_extra_times(sdf, syq, 4, 1);
				
				ygglMainEmp.setZzTime(ClockInTool.strToDateLong(zztime));
			}
			
tangzhaoqian committed
383
			ygglMainEmp.insert();
lal committed
384 385
			
			//假期规则初始化
lal committed
386
			String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
lal committed
387 388 389
			List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
			for(KqglAssoLeaveRules r : rul) {
				if(r.getLeaveBalance() == 0) {
lal committed
390
					KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).balanceDays(-1).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
lal committed
391
				}else {
lal committed
392
					KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
lal committed
393 394 395 396
				}
			}
			
			
lal committed
397 398 399 400 401
			try {
				realtimeupdate.AttendanceTask(userBean.getOrgCode(), ygglMainEmp.getEmpNum(), 2,null);
			} catch (ParseException e) {
				e.printStackTrace();
			}
lal committed
402
			
403
			return ResultUtil.data(ygglMainEmp, "添加员工成功!");
tangzhaoqian committed
404
		} else {
405
			return ResultUtil.error("该手机号已被使用,请输入正确手机号");
tangzhaoqian committed
406
		}
407

tangzhaoqian committed
408 409 410 411 412 413 414 415 416
	}

	/**
	 * 修改员工档案
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/updateygda")
417
	@ApiOperation(value = "5.修改员工档案", httpMethod = "POST", notes = "接口发布说明")
tangzhaoqian committed
418 419 420 421
	@ApiOperationSupport(order = 5)
	public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp)
			throws Exception {

422 423
		if (ObjectUtil.isAllNotEmpty(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())
				&& !DateFormatUtils.getCompareDate(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())) {
424
			return ResultUtil.error("入职日期 不可以大于 转正日期");
425
		}
426

tangzhaoqian committed
427
		if (ygglMainEmp.getEmpNum() != null) {
428 429 430
			ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda()
					.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
					.eq(YgglMainEmp::getEmpNum, ygglMainEmp.getEmpNum()));
tangzhaoqian committed
431 432 433

			return ResultUtil.data(ygglMainEmp, "修改成功");
		}
434
		return ResultUtil.data(ygglMainEmp, "修改成功");
tangzhaoqian committed
435 436 437 438 439 440 441 442 443
	}

	/**
	 * 员工搜索
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/ygquery")
444
	@ApiOperation(value = "6.员工搜索/分页", httpMethod = "POST", notes = "接口发布说明")
tangzhaoqian committed
445 446 447 448 449 450 451 452 453 454 455 456
	@ApiOperationSupport(order = 6)
	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)
				.eq(ZzglBmgwM::getOrgCode, orgCode).list();
		ZzglBmgwM.getDepts(bList, b, zzglBmgwMs);

		Integer j = ygQueryDto.getJobStatus();
		Integer t = ygQueryDto.getJobType();
		String q = ygQueryDto.getQuery();
457
		Page<YgglMainEmp> page = new Page<YgglMainEmp>(ygQueryDto.getCurrentPage(), ygQueryDto.getTotalPage());
tangzhaoqian committed
458
		QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
459
		queryWrapper.lambda()
460 461
				.select(YgglMainEmp::getName, YgglMainEmp::getEmpNum, YgglMainEmp::getBmgwId, YgglMainEmp::getRzTime,
						YgglMainEmp::getJobType, YgglMainEmp::getPhone, YgglMainEmp::getJobStatus)
462
				.ne(YgglMainEmp::getJobStatus, jobStatus.YILIZHI.getType())
463 464
				.eq(YgglMainEmp::getOrgCode, orgCode).eq(t != null && t > -1, YgglMainEmp::getJobType, t)
				.eq(j != null && j > -1, YgglMainEmp::getJobStatus, j)
465 466
				.in(!bList.isEmpty(), YgglMainEmp::getBmgwId, bList)
				.and(!StrUtil.hasBlank(q), wq -> wq.like(YgglMainEmp::getName, q).or().like(YgglMainEmp::getPhone, q));
tangzhaoqian committed
467 468

		IPage<YgglMainEmp> ygglMainEmpPage = YgglMainEmp.builder().build().selectPage(page, queryWrapper);
469

470
		return ResultUtil.data(ygglMainEmpPage);
tangzhaoqian committed
471
	}
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510
	
	@Autowired
	private ZzglBmgwMService zzglBmgwMService;
	
	/**
	 * 员工列表-分页
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/selects_emp")
	@ApiOperation(value = "6.员工列表-分页", httpMethod = "POST", notes = "员工列表-分页")
	@ApiOperationSupport(order = 6)
	public Result<Object> selectsEmp(@CurrentUser UserBean userBean, @RequestBody EmpQuery empQuery) {
		Integer orgCode = userBean.getOrgCode();
		Integer bmgwId = empQuery.getBmgwid();
		Page<YgglMainEmp> page = new Page<YgglMainEmp>(empQuery.getCurrentPage(), empQuery.getTotalPage());
		List<Integer> empNums = CollUtil.toList();
		
		if (bmgwId != null) {
			List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), bmgwId);
			if (CollectionUtil.isNotEmpty(usersQuery)) {
				empNums = usersQuery.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
			}else {
				return ResultUtil.data(null);
			}
			
			if (CollectionUtil.isEmpty(empNums)) {
				return ResultUtil.data(null);
			}
		}
		empQuery.setOrgCode(orgCode);
		empQuery.setEmpNums(empNums);
		IPage<YgglMainEmp> ygglMainEmpPage = ygglMainEmpMapper.selectME(page, empQuery);

		List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
		
		return ResultUtil.data(page, ygglMainEmps);
	}
511

tangzhaoqian committed
512 513 514 515
	/**
	 * 导入员工档案
	 */
	@PostMapping(value = "/import_emp_record")
516
	@ApiOperation(value = "7.导入员工档案", httpMethod = "POST", notes = "接口发布说明")
tangzhaoqian committed
517
	@ApiOperationSupport(order = 7)
518 519
	public Result<JSONObject> importEmpRecord(@CurrentUser UserBean userBean,
			@Validated @RequestBody ValidList<AddygdaDto> listAddygdaDto) throws Exception {
520

521 522 523 524 525
		Integer orgCode = userBean.getOrgCode();
		// 查询所有员工手机号
//		List<QyzxEmpLogin> listEl = qyzxEmpLoginMapper
//				.selectList(new QueryWrapper<QyzxEmpLogin>().lambda()
//						.select(QyzxEmpLogin::getPhone));
526 527 528 529 530 531 532

		List<YgglMainEmp> listMe = ygglMainEmpMapper.selectList(new QueryWrapper<YgglMainEmp>().lambda()
				.eq(YgglMainEmp::getOrgCode, orgCode).select(YgglMainEmp::getPhone, YgglMainEmp::getZjNum));

		listMe = listMe != null
				? listMe.stream().filter(o -> o != null && o.getPhone() != null).collect(Collectors.toList())
				: null;
533 534

		// 抽取 登录表 的phone的集合
535 536 537
		List<String> listPhone = listMe.stream().map(YgglMainEmp::getPhone).collect(Collectors.toList());
		// 抽取 登录表 的zjNum的集合
		List<String> listzjNum = listMe.stream().map(YgglMainEmp::getZjNum).collect(Collectors.toList());
538

539
		List<YgglMainEmp> listYmp = new ArrayList<YgglMainEmp>();
540

ilal committed
541 542 543 544 545
		// 过滤掉 导入数据中, listPhone已存在 的 phone 的对象集合和证件号码
//		List<AddygdaDto> list = listAddygdaDto.stream()
//				.filter(o -> o != null && !listPhone.contains(o.getPhone()) && !listzjNum.contains(o.getZjNum()))
//				.collect(Collectors.toList());
		
546
		// 过滤掉 导入数据中, listPhone已存在 的 phone 的对象集合
547
		List<AddygdaDto> list = listAddygdaDto.stream()
ilal committed
548
				.filter(o -> o != null && !listPhone.contains(o.getPhone())).collect(Collectors.toList());
549

550
		// 过滤出 导入数据中, listPhone已存在 的 phone 的对象集合
551 552
		List<AddygdaDto> phoneRepetitions = listAddygdaDto.stream()
				.filter(o -> o != null && listPhone.contains(o.getPhone())).collect(Collectors.toList());
553

554
		// 过滤出 导入数据中, listzjNum 已存在 的 ZjNum 的对象集合
555
		List<AddygdaDto> idCardRepetitions = listAddygdaDto.stream()
556
				.filter(o -> o != null && listzjNum.contains(o.getZjNum())).collect(Collectors.toList());
557

558
		List<YgglMainEmp> insertErrors = new ArrayList<YgglMainEmp>();
559

560 561
		YgglMainEmp yme;
		for (AddygdaDto ad : list) {
562

563 564 565 566 567 568 569
			String name = ad.getName();
			String phone = ad.getPhone();
			Integer zjType = ad.getZjType();
			String zjNum = ad.getZjNum();
			boolean isvalid = true;
			switch (zjType) {
			case 0:
570
				isvalid = IdcardUtil.isValidCard15(zjNum) || IdcardUtil.isValidCard18(zjNum);
571 572
				break;
			case 1:
573
				String[] strs = IdcardUtil.isValidCard10(zjNum);
tangzhaoqian committed
574 575 576 577 578 579
				if (strs == null) {
					isvalid = false;
					break;
				}
				String str2 = strs != null && strs.length > 2 ? strs[2] : "false";
				isvalid = "澳门/香港".contains(strs[0]) && "true".equals(str2);
580 581
				break;
			case 2:
582
				isvalid = IdcardUtil.isValidTWCard(zjNum);
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597
				break;
			case 3:
				isvalid = ReUtil.isMatch(Regular.PASSPORT1, zjNum) || ReUtil.isMatch(Regular.PASSPORT2, zjNum);
				break;
			default:
				break;
			}
			if (!isvalid) {
				return ResultUtil.error("证件格式不对!");
			}
			Integer jobType = ad.getJobType();
			Date rzTime = ad.getRzTime() == null ? new Date() : ad.getRzTime();
			Integer syq = ad.getSyq();
			Integer sex = ad.getSex();
			Integer bmgwId = ad.getBmgwId();
598

599 600 601 602
			QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
					.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
			if (login == null) {
				// 初始化密码 pwd
603 604
				login = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pwd)).sts(CommonEnum.U_STS_ON.getType())
						.orgId(userBean.getOrgCode()).username(name).build();
605 606 607 608 609
				if (!login.insert()) {
					TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
					return ResultUtil.error("添加员工登录表失败,请检查输入信息");
				}
			}
tangzhaoqian committed
610

611 612 613 614 615
			QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType())
					.status(CommonEnum.U_STS_ON.getType()).build().insert();// usertype2普通员工 status1正常
			yme = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
					.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
					.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
616 617
			if (yme.insert()) {
				listYmp.add(yme);
618
			} else {
619
				// 存放 插入失败的 数据
620
				insertErrors.add(yme);
621
			}
ilal committed
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
			
			
			
			//假期规则初始化
			String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
			List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
			for(KqglAssoLeaveRules r : rul) {
				if(r.getLeaveBalance() == 0) {
					KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(-1).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
				}else {
					KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
				}
			}
			
			
637
		}
638

639 640 641
		JSONObject obj = JSONUtil.createObj();
		obj.set("empList", listYmp);
		obj.set("phoneRepetitions", phoneRepetitions);
642 643
		obj.set("idCardRepetitions", idCardRepetitions);
		obj.set("insertErrors", insertErrors);
644 645 646

		// listEl.stream().filter(i -> i !=
		// null).collect(Collectors.<QyzxEmpLogin>toList());
647
		return ResultUtil.data(obj, "导入员工档案成功!");
tangzhaoqian committed
648
	}
649

tangzhaoqian committed
650
	/**
651
	 * 获取导入模板
tangzhaoqian committed
652 653 654
	 * 
	 * @param
	 * @return
655
	 * @throws IOException
tangzhaoqian committed
656
	 */
657 658 659 660
	@GetMapping(value = "/impoet_template")
	@ApiOperation(value = "8.获取导入模板", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 8)
	public Result<Object> getImpoetTemplate(HttpServletResponse response) throws IOException {
661
		ImportEmpDto ied = ImportEmpDto.builder().name("张三").phone("15219671123")
662
				// 证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他
663
				.zjType(0).zjNum("445381199611063586")
664
				// 工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘
665
				.jobType(0).rzTime("2010-10-10 10:10:10")
666 667 668
				// 试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)
				.syq(1)
				// 性别 0:男;1:女
669
				.sex(0).build();
670 671 672 673
		List<ImportEmpDto> listAd = CollUtil.newArrayList(ied);
		// 通过工具类创建writer
		ExcelWriter writer = ExcelUtil.getWriter(true);

674
		// 自定义标题别名
675 676 677 678 679 680 681 682
		writer.addHeaderAlias("name", "姓名");
		writer.addHeaderAlias("phone", "手机号");
		writer.addHeaderAlias("sex", "性别");
		writer.addHeaderAlias("zjType", "证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他");
		writer.addHeaderAlias("zjNum", "证件号");
		writer.addHeaderAlias("jobType", "工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘");
		writer.addHeaderAlias("syq", "试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)");
		writer.addHeaderAlias("rzTime", "入职日期");
683

684 685 686 687 688 689 690 691
		// 合并单元格后的标题行,使用默认标题样式
		writer.merge(7, "员工导入模板");
		writer.setFreezePane(2);
		writer.setColumnWidth(1, 15);
		writer.setColumnWidth(4, 22);
		writer.setColumnWidth(7, 20);
		// 一次性写出内容,使用默认样式,强制输出标题
		writer.write(listAd, true);
692 693 694

		response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
		response.setHeader("Content-Disposition", "attachment;filename=8timer_emp_import.xlsx");
695 696
		ServletOutputStream out = response.getOutputStream();
		writer.flush(out, true);
697

698 699
		// 关闭writer,释放内存
		writer.close();
700
		// 此处记得关闭输出Servlet流
701
		IoUtil.close(out);
702

703
		return ResultUtil.data(null, "获取模板成功");
tangzhaoqian committed
704 705 706 707 708 709 710 711 712 713

	}

	/**
	 * 导出员工
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygdas")
714 715
	@ApiOperation(value = "9.导出员工", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 9)
tangzhaoqian committed
716 717
	public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) {
		List<YgglMainEmp> list = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
718
				.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getJobStatus, jobStatus.SHIYONG.getType(), jobStatus.ZHENSHI.getType(), jobStatus.LIZHIZHONG.getType()).list();
tangzhaoqian committed
719 720 721 722 723 724 725 726 727 728
		return ResultUtil.data(list, "导出员工成功");
	}

	/**
	 * 获取员工教育经历表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/jyjlb")
729 730
	@ApiOperation(value = "10.获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 10)
tangzhaoqian committed
731
	public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean) {
732 733 734
		List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build().selectList(
				new QueryWrapper<YgglAttaJyjlb>().lambda().eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode())
						.eq(YgglAttaJyjlb::getEmpNum, userBean.getEmpNum()));
735
		return ResultUtil.data(ygglAttaJyjlbss);
tangzhaoqian committed
736 737 738 739
	}

	// 获取员工教育经历表
	@GetMapping(value = "/jyjlb/{empNum}")
740 741
	@ApiOperation(value = "11.获取员工教育经历表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 11)
tangzhaoqian committed
742
	public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
743 744 745
		List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build()
				.selectList(new QueryWrapper<YgglAttaJyjlb>().lambda()
						.eq(YgglAttaJyjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaJyjlb::getEmpNum, empNum));
746
		return ResultUtil.data(ygglAttaJyjlbs);
tangzhaoqian committed
747 748 749 750 751 752 753 754 755
	}

	/**
	 * 添加/修改员工教育经历表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/jyjlb")
756 757
	@ApiOperation(value = "12.添加/修改员工教育经历表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 12)
tangzhaoqian committed
758 759 760 761
	public Result<YgglAttaJyjlb> addjyjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaJyjlb ygglAttaJyjlb) {
		ygglAttaJyjlb.setEmpNum(ygglAttaJyjlb.getEmpNum());
		ygglAttaJyjlb.setOrgCode(userBean.getOrgCode());
		ygglAttaJyjlb.insertOrUpdate();
762
		return ResultUtil.data(ygglAttaJyjlb, "修改员工教育经历表成功");
tangzhaoqian committed
763 764 765 766 767 768 769 770 771
	}

	/**
	 * 删除员工教育经历表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/jyjlb/{id}")
772 773
	@ApiOperation(value = "13.删除员工教育经历表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 13)
tangzhaoqian committed
774 775
	public Result<Boolean> deljyjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
776 777
		return ResultUtil.data(YgglAttaJyjlb.builder().build().delete(new QueryWrapper<YgglAttaJyjlb>().lambda()
				.eq(YgglAttaJyjlb::getOrgCode, orgCode).eq(YgglAttaJyjlb::getId, id)), "删除员工教育经历表成功");
tangzhaoqian committed
778 779 780 781 782 783 784 785 786
	}

	/**
	 * 获取员工培训经历信息表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/pxjlxxb")
787 788
	@ApiOperation(value = "14.获取员工培训经历信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 14)
tangzhaoqian committed
789 790
	public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean) {
		List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build()
791 792 793
				.selectList(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
						.eq(YgglAttaPxjlxxb::getOrgCode, userBean.getOrgCode())
						.eq(YgglAttaPxjlxxb::getEmpNum, userBean.getEmpNum()));
794
		return ResultUtil.data(ygglAttaPxjlxxbs);
tangzhaoqian committed
795 796 797 798
	}

	// 获取员工培训经历信息表
	@GetMapping(value = "/pxjlxxb/{empNum}")
799 800
	@ApiOperation(value = "15.获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 15)
tangzhaoqian committed
801
	public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
802 803 804
		List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
						.eq(YgglAttaPxjlxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaPxjlxxb::getEmpNum, empNum));
805
		return ResultUtil.data(ygglAttaPxjlxxbs);
tangzhaoqian committed
806 807 808 809 810 811 812 813 814
	}

	/**
	 * 添加/修改员工培训经历信息表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/pxjlxxb")
815 816
	@ApiOperation(value = "16.添加/修改员工培训经历信息表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 16)
tangzhaoqian committed
817 818 819 820 821
	public Result<YgglAttaPxjlxxb> addpxjlxxb(@CurrentUser UserBean userBean,
			@RequestBody YgglAttaPxjlxxb ygglAttaPxjlxxb) {
		ygglAttaPxjlxxb.setEmpNum(ygglAttaPxjlxxb.getEmpNum());
		ygglAttaPxjlxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaPxjlxxb.insertOrUpdate();
822
		return ResultUtil.data(ygglAttaPxjlxxb, "修改员工培训经历信息表成功");
tangzhaoqian committed
823 824 825 826 827 828 829 830 831
	}

	/**
	 * 删除员工培训经历信息表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/pxjlxxb/{id}")
832 833
	@ApiOperation(value = "17.删除员工培训经历信息表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 17)
tangzhaoqian committed
834 835
	public Result<Boolean> delpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
836 837
		return ResultUtil.data(YgglAttaPxjlxxb.builder().build().delete(new QueryWrapper<YgglAttaPxjlxxb>().lambda()
				.eq(YgglAttaPxjlxxb::getOrgCode, orgCode).eq(YgglAttaPxjlxxb::getId, id)), "删除员工培训经历信息表成功");
tangzhaoqian committed
838 839 840 841 842 843 844 845 846
	}

	/**
	 * 获取员工工作经历表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/gzjlb")
847 848
	@ApiOperation(value = "18.获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 18)
tangzhaoqian committed
849
	public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean) {
850 851
		List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(
				new QueryWrapper<YgglAttaGzjlb>().lambda().eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode())
852
						.eq(YgglAttaGzjlb::getEmpNum, userBean.getEmpNum()));
853
		return ResultUtil.data(ygglAttaGzjlbs);
tangzhaoqian committed
854 855 856 857
	}

	// 获取员工工作经历表
	@GetMapping(value = "/gzjlb/{empNum}")
858 859
	@ApiOperation(value = "19.获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 19)
tangzhaoqian committed
860
	public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
861 862 863
		List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build()
				.selectList(new QueryWrapper<YgglAttaGzjlb>().lambda()
						.eq(YgglAttaGzjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaGzjlb::getEmpNum, empNum));
864
		return ResultUtil.data(ygglAttaGzjlbs);
tangzhaoqian committed
865 866 867 868 869 870 871 872 873
	}

	/**
	 * 添加/修改员工工作经历表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/gzjlb")
874 875
	@ApiOperation(value = "20.添加/修改员工工作经历表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 20)
tangzhaoqian committed
876 877 878 879
	public Result<YgglAttaGzjlb> addgzjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzjlb ygglAttaGzjlb) {
		ygglAttaGzjlb.setEmpNum(ygglAttaGzjlb.getEmpNum());
		ygglAttaGzjlb.setOrgCode(userBean.getOrgCode());
		ygglAttaGzjlb.insertOrUpdate();
880
		return ResultUtil.data(ygglAttaGzjlb, "修改员工工作经历表成功");
tangzhaoqian committed
881 882 883 884 885 886 887 888 889
	}

	/**
	 * 删除员工工作经历表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/gzjlb/{id}")
890 891
	@ApiOperation(value = "21.删除员工工作经历表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 21)
tangzhaoqian committed
892 893
	public Result<Boolean> delgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
894 895
		return ResultUtil.data(YgglAttaGzjlb.builder().build().delete(new QueryWrapper<YgglAttaGzjlb>().lambda()
				.eq(YgglAttaGzjlb::getOrgCode, orgCode).eq(YgglAttaGzjlb::getId, id)), "删除员工工作经历表成功");
tangzhaoqian committed
896 897 898 899 900 901 902 903 904
	}

	/**
	 * 获取员工职称信息表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/zcxxb")
905 906
	@ApiOperation(value = "22.获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 22)
tangzhaoqian committed
907
	public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean) {
908 909
		List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(
				new QueryWrapper<YgglAttaZcxxb>().lambda().eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode())
910
						.eq(YgglAttaZcxxb::getEmpNum, userBean.getEmpNum()));
911
		return ResultUtil.data(ygglAttaZcxxbs);
tangzhaoqian committed
912 913 914 915
	}

	// 获取员工职称信息表
	@GetMapping(value = "/zcxxb/{empNum}")
916 917
	@ApiOperation(value = "23.获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 23)
tangzhaoqian committed
918
	public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
919 920 921
		List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaZcxxb>().lambda()
						.eq(YgglAttaZcxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaZcxxb::getEmpNum, empNum));
922
		return ResultUtil.data(ygglAttaZcxxbs);
tangzhaoqian committed
923 924 925 926 927 928 929 930 931
	}

	/**
	 * 添加/修改员工职称信息表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/zcxxb")
932 933
	@ApiOperation(value = "24.添加/修改员工职称信息表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 24)
tangzhaoqian committed
934 935 936 937
	public Result<YgglAttaZcxxb> addzcxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaZcxxb ygglAttaZcxxb) {
		ygglAttaZcxxb.setEmpNum(ygglAttaZcxxb.getEmpNum());
		ygglAttaZcxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaZcxxb.insertOrUpdate();
938
		return ResultUtil.data(ygglAttaZcxxb, "修改员工职称信息表成功");
tangzhaoqian committed
939 940 941 942 943 944 945 946 947
	}

	/**
	 * 删除员工职称信息表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/zcxxb/{id}")
948 949
	@ApiOperation(value = "25.删除员工职称信息表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 25)
tangzhaoqian committed
950 951
	public Result<Boolean> delzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
952 953
		return ResultUtil.data(YgglAttaZcxxb.builder().build().delete(new QueryWrapper<YgglAttaZcxxb>().lambda()
				.eq(YgglAttaZcxxb::getOrgCode, orgCode).eq(YgglAttaZcxxb::getId, id)), "删除员工职称信息表成功");
tangzhaoqian committed
954 955 956 957 958 959 960 961 962
	}

	/**
	 * 获取员工证书证件表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/zszjb")
963 964
	@ApiOperation(value = "26.获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 26)
tangzhaoqian committed
965
	public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean) {
966 967 968
		List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build().selectList(
				new QueryWrapper<YgglAttaZszjb>().lambda().eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode())
						.eq(YgglAttaZszjb::getEmpNum, userBean.getEmpNum()));
969
		return ResultUtil.data(ygglAttaZszjbs);
tangzhaoqian committed
970 971 972 973
	}

	// 获取员工证书证件表
	@GetMapping(value = "/zszjb/{empNum}")
974 975
	@ApiOperation(value = "27.获取员工证书证件表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 27)
tangzhaoqian committed
976
	public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
977 978 979
		List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build()
				.selectList(new QueryWrapper<YgglAttaZszjb>().lambda()
						.eq(YgglAttaZszjb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaZszjb::getEmpNum, empNum));
980
		return ResultUtil.data(ygglAttaZszjbs);
tangzhaoqian committed
981 982 983 984 985 986 987 988 989
	}

	/**
	 * 添加/修改员工证书证件表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/zszjb")
990 991
	@ApiOperation(value = "28.添加/修改员工证书证件表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 28)
tangzhaoqian committed
992 993 994 995
	public Result<YgglAttaZszjb> addzszjb(@CurrentUser UserBean userBean, @RequestBody YgglAttaZszjb ygglAttaZszjb) {
		ygglAttaZszjb.setEmpNum(ygglAttaZszjb.getEmpNum());
		ygglAttaZszjb.setOrgCode(userBean.getOrgCode());
		ygglAttaZszjb.insertOrUpdate();
996
		return ResultUtil.data(ygglAttaZszjb, "修改员工证书证件表成功");
tangzhaoqian committed
997 998 999 1000 1001 1002 1003 1004 1005
	}

	/**
	 * 删除员工证书证件表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/zszjb/{id}")
1006 1007
	@ApiOperation(value = "29.删除员工证书证件表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 29)
tangzhaoqian committed
1008 1009
	public Result<Boolean> delzszjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
1010 1011
		return ResultUtil.data(YgglAttaZszjb.builder().build().delete(new QueryWrapper<YgglAttaZszjb>().lambda()
				.eq(YgglAttaZszjb::getOrgCode, orgCode).eq(YgglAttaZszjb::getId, id)), "删除员工证书证件表成功");
tangzhaoqian committed
1012 1013 1014 1015 1016 1017 1018 1019 1020
	}

	/**
	 * 获取员工联系信息表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/lxxxb")
1021 1022
	@ApiOperation(value = "30.获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 30)
tangzhaoqian committed
1023
	public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean) {
1024 1025
		List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build().selectList(
				new QueryWrapper<YgglAttaLxxxb>().lambda().eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode())
1026
						.eq(YgglAttaLxxxb::getEmpNum, userBean.getEmpNum()));
1027
		return ResultUtil.data(ygglAttaLxxxbs);
tangzhaoqian committed
1028 1029 1030 1031
	}

	// 获取员工联系信息表
	@GetMapping(value = "/lxxxb/{empNum}")
1032 1033
	@ApiOperation(value = "31.获取员工联系信息表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 31)
tangzhaoqian committed
1034
	public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
1035 1036 1037
		List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaLxxxb>().lambda()
						.eq(YgglAttaLxxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaLxxxb::getEmpNum, empNum));
1038
		return ResultUtil.data(ygglAttaLxxxbs);
tangzhaoqian committed
1039 1040 1041 1042 1043 1044 1045 1046 1047
	}

	/**
	 * 添加/修改员工联系信息表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/lxxxb")
1048 1049
	@ApiOperation(value = "32.添加/修改员工联系信息表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 32)
tangzhaoqian committed
1050 1051 1052 1053
	public Result<YgglAttaLxxxb> addlxxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaLxxxb ygglAttaLxxxb) {
		ygglAttaLxxxb.setEmpNum(ygglAttaLxxxb.getEmpNum());
		ygglAttaLxxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaLxxxb.insertOrUpdate();
1054
		return ResultUtil.data(ygglAttaLxxxb, "修改员工联系信息表成功");
tangzhaoqian committed
1055 1056 1057 1058 1059 1060 1061 1062 1063
	}

	/**
	 * 删除员工联系信息表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/lxxxb/{id}")
1064 1065
	@ApiOperation(value = "33.删除员工联系信息表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 33)
tangzhaoqian committed
1066 1067
	public Result<Boolean> dellxxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
1068 1069
		return ResultUtil.data(YgglAttaLxxxb.builder().build().delete(new QueryWrapper<YgglAttaLxxxb>().lambda()
				.eq(YgglAttaLxxxb::getOrgCode, orgCode).eq(YgglAttaLxxxb::getId, id)), "删除员工联系信息表成功");
tangzhaoqian committed
1070 1071 1072 1073 1074 1075 1076 1077 1078
	}

	/**
	 * 获取员工紧急联系人表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/jjlxr")
1079 1080
	@ApiOperation(value = "34.获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 34)
tangzhaoqian committed
1081
	public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean) {
1082 1083
		List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build().selectList(
				new QueryWrapper<YgglAttaJjlxr>().lambda().eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode())
1084
						.eq(YgglAttaJjlxr::getEmpNum, userBean.getEmpNum()));
1085
		return ResultUtil.data(ygglAttaJjlxrs);
tangzhaoqian committed
1086 1087 1088 1089
	}

	// 获取员工紧急联系人表
	@GetMapping(value = "/jjlxr/{empNum}")
1090 1091
	@ApiOperation(value = "35.获取员工紧急联系人表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 35)
tangzhaoqian committed
1092
	public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
1093 1094 1095
		List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build()
				.selectList(new QueryWrapper<YgglAttaJjlxr>().lambda()
						.eq(YgglAttaJjlxr::getOrgCode, userBean.getOrgCode()).eq(YgglAttaJjlxr::getEmpNum, empNum));
1096
		return ResultUtil.data(ygglAttaJjlxrs);
tangzhaoqian committed
1097 1098 1099 1100 1101 1102 1103 1104 1105
	}

	/**
	 * 添加/修改员工紧急联系人表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/jjlxr")
1106 1107
	@ApiOperation(value = "36.添加/修改员工紧急联系人表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 36)
tangzhaoqian committed
1108 1109 1110 1111
	public Result<YgglAttaJjlxr> addjjlxr(@CurrentUser UserBean userBean, @RequestBody YgglAttaJjlxr ygglAttaJjlxr) {
		ygglAttaJjlxr.setEmpNum(ygglAttaJjlxr.getEmpNum());
		ygglAttaJjlxr.setOrgCode(userBean.getOrgCode());
		ygglAttaJjlxr.insertOrUpdate();
1112
		return ResultUtil.data(ygglAttaJjlxr, "修改员工紧急联系人表成功");
tangzhaoqian committed
1113 1114 1115 1116 1117 1118 1119 1120 1121
	}

	/**
	 * 删除员工紧急联系人表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/jjlxr/{id}")
1122 1123
	@ApiOperation(value = "37.删除员工紧急联系人表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 37)
tangzhaoqian committed
1124 1125
	public Result<Boolean> deljjlxr(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
1126 1127
		return ResultUtil.data(YgglAttaJjlxr.builder().build().delete(new QueryWrapper<YgglAttaJjlxr>().lambda()
				.eq(YgglAttaJjlxr::getOrgCode, orgCode).eq(YgglAttaJjlxr::getId, id)), "删除员工紧急联系人表成功");
tangzhaoqian committed
1128 1129 1130 1131 1132 1133 1134 1135 1136 1137
	}

	// 获取工资卡信息
	/**
	 * 获取员工工资卡信息
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/gzk")
1138 1139
	@ApiOperation(value = "38.获取员工工资卡信息", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 38)
tangzhaoqian committed
1140
	public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean) {
1141
		List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build()
1142
				.selectList(new QueryWrapper<YgglAttaGzk>().lambda().eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode())
1143
						.eq(YgglAttaGzk::getEmpNum, userBean.getEmpNum()));
1144
		return ResultUtil.data(ygglAttaGzks);
tangzhaoqian committed
1145 1146 1147 1148
	}

	// 获取工资卡信息
	@GetMapping(value = "/gzk/{empNum}")
1149 1150
	@ApiOperation(value = "39.获取员工工资卡信息(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 39)
tangzhaoqian committed
1151
	public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
1152 1153
		List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(new QueryWrapper<YgglAttaGzk>()
				.lambda().eq(YgglAttaGzk::getOrgCode, userBean.getOrgCode()).eq(YgglAttaGzk::getEmpNum, empNum));
1154
		return ResultUtil.data(ygglAttaGzks);
tangzhaoqian committed
1155 1156 1157 1158 1159 1160 1161 1162 1163
	}

	/**
	 * 添加/修改工资卡信息
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/gzk")
1164 1165
	@ApiOperation(value = "40.添加/修改工资卡信息", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 40)
tangzhaoqian committed
1166 1167 1168 1169
	public Result<YgglAttaGzk> addgzk(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzk ygglAttaGzk) {
		ygglAttaGzk.setEmpNum(ygglAttaGzk.getEmpNum());
		ygglAttaGzk.setOrgCode(userBean.getOrgCode());
		ygglAttaGzk.insertOrUpdate();
1170
		return ResultUtil.data(ygglAttaGzk, "修改工资卡信息成功");
tangzhaoqian committed
1171 1172 1173 1174 1175 1176 1177 1178 1179
	}

	/**
	 * 删除工资卡信息
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/gzk/{id}")
1180 1181
	@ApiOperation(value = "41.删除工资卡信息", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 41)
tangzhaoqian committed
1182 1183
	public Result<Boolean> delgzk(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
1184 1185
		return ResultUtil.data(YgglAttaGzk.builder().build().delete(new QueryWrapper<YgglAttaGzk>().lambda()
				.eq(YgglAttaGzk::getOrgCode, orgCode).eq(YgglAttaGzk::getId, id)), "删除工资卡信息成功");
tangzhaoqian committed
1186 1187 1188 1189 1190 1191 1192 1193 1194
	}

	/**
	 * 获取员工合同信息表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/htxxb")
1195 1196
	@ApiOperation(value = "42.获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 42)
tangzhaoqian committed
1197
	public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean) {
1198 1199
		List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build().selectList(
				new QueryWrapper<YgglAttaHtxxb>().lambda().eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode())
1200
						.eq(YgglAttaHtxxb::getEmpNum, userBean.getEmpNum()));
1201
		return ResultUtil.data(ygglAttaHtxxbs);
tangzhaoqian committed
1202 1203 1204 1205
	}

	// 获取员工合同信息表
	@GetMapping(value = "/htxxb/{empNum}")
1206 1207
	@ApiOperation(value = "43.获取员工合同信息表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 43)
tangzhaoqian committed
1208
	public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
1209 1210 1211
		List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build()
				.selectList(new QueryWrapper<YgglAttaHtxxb>().lambda()
						.eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaHtxxb::getEmpNum, empNum));
1212
		return ResultUtil.data(ygglAttaHtxxbs);
tangzhaoqian committed
1213 1214 1215 1216 1217 1218 1219 1220 1221
	}

	/**
	 * 添加/修改员工合同信息表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/htxxb")
1222 1223
	@ApiOperation(value = "44.添加/修改员工合同信息表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 44)
tangzhaoqian committed
1224 1225 1226 1227
	public Result<YgglAttaHtxxb> addhtxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaHtxxb ygglAttaHtxxb) {
		ygglAttaHtxxb.setEmpNum(ygglAttaHtxxb.getEmpNum());
		ygglAttaHtxxb.setOrgCode(userBean.getOrgCode());
		ygglAttaHtxxb.insertOrUpdate();
1228
		return ResultUtil.data(ygglAttaHtxxb, "修改员工合同信息表成功");
tangzhaoqian committed
1229 1230 1231 1232 1233 1234 1235 1236 1237
	}

	/**
	 * 删除员工合同信息表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/htxxb/{id}")
1238 1239
	@ApiOperation(value = "45.删除员工合同信息表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 45)
tangzhaoqian committed
1240 1241
	public Result<Boolean> delhtxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
1242 1243
		return ResultUtil.data(YgglAttaHtxxb.builder().build().delete(new QueryWrapper<YgglAttaHtxxb>().lambda()
				.eq(YgglAttaHtxxb::getOrgCode, orgCode).eq(YgglAttaHtxxb::getId, id)), "删除员工合同信息表成功");
tangzhaoqian committed
1244 1245 1246 1247 1248 1249 1250 1251 1252
	}

	/**
	 * 获取员工材料附件表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/clfjb")
1253 1254
	@ApiOperation(value = "46.获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 46)
tangzhaoqian committed
1255
	public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean) {
1256 1257
		List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build().selectList(
				new QueryWrapper<YgglAttaClfjb>().lambda().eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode())
1258
						.eq(YgglAttaClfjb::getEmpNum, userBean.getEmpNum()));
1259
		return ResultUtil.data(ygglAttaClfjbs);
tangzhaoqian committed
1260 1261 1262 1263
	}

	// 获取员工材料附件表
	@GetMapping(value = "/clfjb/{empNum}")
1264 1265
	@ApiOperation(value = "47.获取员工材料附件表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 47)
tangzhaoqian committed
1266
	public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
1267 1268 1269
		List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build()
				.selectList(new QueryWrapper<YgglAttaClfjb>().lambda()
						.eq(YgglAttaClfjb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaClfjb::getEmpNum, empNum));
1270
		return ResultUtil.data(ygglAttaClfjbs);
tangzhaoqian committed
1271 1272 1273 1274 1275 1276 1277 1278 1279
	}

	/**
	 * 添加/修改员工材料附件表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/clfjb")
1280 1281
	@ApiOperation(value = "48.添加/修改员工材料附件表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 48)
tangzhaoqian committed
1282 1283 1284 1285
	public Result<YgglAttaClfjb> addclfjb(@CurrentUser UserBean userBean, @RequestBody YgglAttaClfjb ygglAttaClfjb) {
		ygglAttaClfjb.setOrgCode(userBean.getOrgCode());
		ygglAttaClfjb.setEmpNum(ygglAttaClfjb.getEmpNum());
		ygglAttaClfjb.insertOrUpdate();
1286
		return ResultUtil.data(ygglAttaClfjb, "修改员工材料附件表成功");
tangzhaoqian committed
1287 1288 1289 1290 1291 1292 1293 1294 1295
	}

	/**
	 * 删除员工材料附件表
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/clfjb/{id}")
1296 1297
	@ApiOperation(value = "49.删除员工材料附件表", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 49)
tangzhaoqian committed
1298 1299
	public Result<Boolean> delclfjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
1300 1301
		return ResultUtil.data(YgglAttaClfjb.builder().build().delete(new QueryWrapper<YgglAttaClfjb>().lambda()
				.eq(YgglAttaClfjb::getOrgCode, orgCode).eq(YgglAttaClfjb::getId, id)), "删除员工材料附件表成功");
tangzhaoqian committed
1302 1303 1304 1305 1306 1307 1308 1309 1310
	}

	/**
	 * 获取成长记录表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/czjlb")
1311 1312
	@ApiOperation(value = "50.获取成长记录表", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 50)
tangzhaoqian committed
1313
	public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean) {
1314 1315
		List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build().selectList(
				new QueryWrapper<YgglAttaCzjlb>().lambda().eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode())
1316
						.eq(YgglAttaCzjlb::getEmpNum, userBean.getEmpNum()));
1317
		return ResultUtil.data(ygglAttaCzjlbs);
tangzhaoqian committed
1318 1319 1320 1321
	}

	// 获取成长记录表
	@GetMapping(value = "/czjlb/{empNum}")
1322 1323
	@ApiOperation(value = "51.获取成长记录表(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 51)
tangzhaoqian committed
1324
	public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
1325 1326 1327
		List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build()
				.selectList(new QueryWrapper<YgglAttaCzjlb>().lambda()
						.eq(YgglAttaCzjlb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaCzjlb::getEmpNum, empNum));
1328
		return ResultUtil.data(ygglAttaCzjlbs);
tangzhaoqian committed
1329 1330 1331 1332 1333 1334 1335 1336 1337
	}

	/**
	 * 添加/修改成长记录表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/czjlb")
1338 1339
	@ApiOperation(value = "52.添加/修改成长记录表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 52)
tangzhaoqian committed
1340 1341 1342 1343
	public Result<YgglAttaCzjlb> addczjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaCzjlb ygglAttaCzjlb) {
		ygglAttaCzjlb.setEmpNum(ygglAttaCzjlb.getEmpNum());
		ygglAttaCzjlb.setOrgCode(userBean.getOrgCode());
		ygglAttaCzjlb.insertOrUpdate();
1344
		return ResultUtil.data(ygglAttaCzjlb, "修改成长记录表成功");
tangzhaoqian committed
1345 1346 1347 1348 1349 1350 1351 1352 1353
	}

	/**
	 * 获取单个离职员工信息(管)
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/lzb/{empNum}")
1354 1355
	@ApiOperation(value = "53.获取单个离职员工信息(管)", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 53)
tangzhaoqian committed
1356 1357 1358
	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();
1359
		return ResultUtil.data(lzyg);
tangzhaoqian committed
1360 1361 1362
	}

	/**
邓实川 committed
1363
	 * 员工转正 0-1
tangzhaoqian committed
1364 1365 1366 1367 1368
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/ygzz")
1369 1370
	@ApiOperation(value = "54.员工转正", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 54)
tangzhaoqian committed
1371
	public Result<Void> ygzz(@CurrentUser UserBean userBean, @RequestBody YgzzDto ygzzDto) {
1372

1373
		YgglMainEmp.builder().jobStatus(jobStatus.ZHENSHI.getType()).zzTime(ygzzDto.getZzTime()).sjzzTime(new Date())
1374 1375
				.zzRemark(ygzzDto.getZzRemark()).build()
				.update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
1376
		return ResultUtil.success("转正成功!");
tangzhaoqian committed
1377 1378 1379
	}

	/**
邓实川 committed
1380
	 * 计划离职 type1-2
tangzhaoqian committed
1381 1382 1383 1384 1385
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/addlzjh")
1386 1387
	@ApiOperation(value = "55.添加离职计划", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 55)
tangzhaoqian committed
1388 1389 1390 1391
	public Result<YgglMainLzb> addjhlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {

		Integer empNum = lzygQueryDto.getEmpNum();

1392
		YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
tangzhaoqian committed
1393 1394
				.eq(YgglMainEmp::getEmpNum, empNum)
				.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
tangzhaoqian committed
1395 1396 1397 1398 1399
		
		if (ygglMainEmp.getJobStatus() == jobStatus.LIZHIZHONG.getType()) {
			return ResultUtil.success("你已在离职中");
		}
		
tangzhaoqian committed
1400 1401
		YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
		// 移动员工表数据到离职表
1402
		BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
tangzhaoqian committed
1403 1404
		ygglMainLzb.insert();

1405
		YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(jobStatus.LIZHIZHONG.getType())
1406
				.beforeLeavingSts(ygglMainEmp.getJobStatus()).build()
tangzhaoqian committed
1407 1408 1409 1410
				.update(new UpdateWrapper<YgglMainEmp>().lambda()
						.eq(YgglMainEmp::getEmpNum, empNum)
						.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
		
1411
		YgglMainLzb.builder().jobStatus(jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
1412
				.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build()
tangzhaoqian committed
1413 1414 1415
				.update(new UpdateWrapper<YgglMainLzb>().lambda()
						.eq(YgglMainLzb::getEmpNum, empNum)
						.eq(YgglMainLzb::getOrgCode, userBean.getOrgCode()));
tangzhaoqian committed
1416 1417 1418 1419 1420

		return ResultUtil.data(ygglMainLzb, "添加待离职员工成功");
	}

	/**
邓实川 committed
1421
	 * 确认离职 type2-3
tangzhaoqian committed
1422 1423 1424 1425 1426
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/qrlz")
1427 1428
	@ApiOperation(value = "56.确认离职", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 56)
tangzhaoqian committed
1429 1430
	public Result<Void> addlzb(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
		Integer empNum = lzygQueryDto.getEmpNum();
1431
		// 删除员工档案表
tangzhaoqian committed
1432 1433 1434
		ygglMainEmpMapper.delete(new QueryWrapper<YgglMainEmp>().lambda()
				.eq(YgglMainEmp::getEmpNum, empNum)
				.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
1435

tangzhaoqian committed
1436
		YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date())
tangzhaoqian committed
1437 1438 1439
				.build().update(new UpdateWrapper<YgglMainLzb>().lambda()
						.eq(YgglMainLzb::getEmpNum, empNum)
						.eq(YgglMainLzb::getOrgCode, userBean.getOrgCode()));
1440

1441
		LambdaQueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<QyzxEmpEntAsso>().lambda()
tangzhaoqian committed
1442
				.eq(QyzxEmpEntAsso::getEmpNum, empNum)
1443
				.eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode());
1444

tangzhaoqian committed
1445
		// 确认离职 删除员工关联表
1446
		qyzxEmpEntAssoMapper.delete(queryWrapper);
tangzhaoqian committed
1447 1448 1449

		// 初始化 部门主管
		zzglBmgwMMapper.update(ZzglBmgwM.builder().leader(null).build(),
tangzhaoqian committed
1450 1451 1452
				new UpdateWrapper<ZzglBmgwM>().lambda()
				.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode())
				.eq(ZzglBmgwM::getLeader, empNum));
1453

1454
		// 更新当前企业
1455 1456
		List<QyzxEmpEntAsso> listEEA = qyzxEmpEntAssoMapper.selectList(new QueryWrapper<QyzxEmpEntAsso>().lambda()
				.eq(QyzxEmpEntAsso::getEmpNum, empNum));
1457 1458 1459
		if (listEEA != null && listEEA.size() > 0) {
			QyzxEmpLogin.builder().id(empNum).orgId(CollUtil.getFirst(listEEA).getOrgCode()).build().updateById();
		}
ilal committed
1460
		
ilal committed
1461
		QyzxEmpLogin.builder().build().delete(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()).eq(QyzxEmpLogin::getId, empNum));
ilal committed
1462 1463 1464 1465 1466
		
		KqglAssoYhkqz.builder().build().delete(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getUserid, empNum).eq(KqglAssoYhkqz::getQyid, userBean.getOrgCode()));
		
		try {
			realtimeupdate.AttendanceTask(userBean.getOrgCode(), empNum, 2,null);
1467 1468

			redisUtil.set("BlockUser"+empNum,"BlockUser",session_timeout);
ilal committed
1469 1470 1471 1472
		} catch (ParseException e) {
			e.printStackTrace();
		}
		
tangzhaoqian committed
1473 1474 1475 1476
		return ResultUtil.success("确认离职员工成功");
	}

	/**
邓实川 committed
1477
	 * 放弃离职 type 2-1
tangzhaoqian committed
1478 1479 1480 1481 1482
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/fqlz")
1483 1484
	@ApiOperation(value = "57.放弃离职", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 57)
tangzhaoqian committed
1485
	public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
1486 1487 1488 1489 1490 1491 1492

		YgglMainEmp ygglMainEmp = ygglMainEmpMapper
				.selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum())
						.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));

		YgglMainEmp.builder().jobStatus(ygglMainEmp.getBeforeLeavingSts()).build()
				.update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, lzygQueryDto.getEmpNum()));
tangzhaoqian committed
1493
		// 删除离职表
1494 1495
		YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build()
				.delete(new QueryWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, lzygQueryDto.getEmpNum()));
tangzhaoqian committed
1496 1497 1498 1499 1500

		return ResultUtil.success("放弃成功");
	}

	@PostMapping(value = "/tzlzyy")
1501 1502
	@ApiOperation(value = "58.调整离职", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 58)
tangzhaoqian committed
1503 1504 1505
	public Result<YgglMainLzb> tzlzyy(@CurrentUser UserBean userBean, @RequestBody YgglMainLzb ygglMainLzb) {

		if (ygglMainLzb.getEmpNum() != null) {
1506 1507 1508
			ygglMainLzb
					.update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getOrgCode, userBean.getOrgCode())
							.eq(YgglMainLzb::getEmpNum, ygglMainLzb.getEmpNum()));
tangzhaoqian committed
1509 1510
			return ResultUtil.data(ygglMainLzb, "修改成功");
		}
1511
		return ResultUtil.error("请确认该员工是否存在!");
tangzhaoqian committed
1512 1513 1514 1515 1516 1517 1518 1519 1520 1521

	}

	/**
	 * 查询离职员工列表
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/querylzyg")
1522 1523
	@ApiOperation(value = "59.查询离职员工列表", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 59)
tangzhaoqian committed
1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540
	public Result<Object> querylzyg(@CurrentUser UserBean userBean, @RequestBody LzbQueryDto lzygQueryDto) {
		lzygQueryDto.setOrgCode(userBean.getOrgCode());

		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, "离职员工搜索成功");
	}

	/**
	 * 展示民族/展示所有民族
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/mz/{id}")
1541 1542
	@ApiOperation(value = "60.展示民族/展示所有民族", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 60)
tangzhaoqian committed
1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555
	public Result<List<YgmzDto>> selectmzs(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		if (id == null || id == 0) {
			List<YgmzDto> allmz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).list();
			return ResultUtil.data(allmz, "展示所有民族");
		}
		List<YgmzDto> mz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).eq(YgmzDto::getNumber, id).list();
		return ResultUtil.data(mz, "展示该民族");
	}

	@Autowired
	CommonAreaMapper commonAreaMapper;

	/**
1556
	 * 籍贯树
tangzhaoqian committed
1557 1558 1559 1560 1561
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/native_place")
1562 1563
	@ApiOperation(value = "61.籍贯树", httpMethod = "GET", notes = "籍贯树")
	@ApiOperationSupport(order = 61)
tangzhaoqian committed
1564 1565 1566
	public Result<List<CommonArea>> selectNativePlace() {

		List<CommonArea> listCommonArea = commonAreaMapper.AllAreaForTree();
1567
		return ResultUtil.data(listCommonArea);
tangzhaoqian committed
1568 1569 1570 1571 1572 1573 1574 1575 1576 1577

	}

	/**
	 * 查询员工列表
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/queryemp")
1578
	@ApiOperation(value = "62.查询员工列表", httpMethod = "GET", notes = "接口发布说明")
tangzhaoqian committed
1579 1580 1581 1582 1583 1584 1585 1586
	@ApiOperationSupport(order = 62)
	public Result<List<YgQueryDto>> queryEmpMessage(@CurrentUser UserBean userBean) {
		List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode());
		for (YgQueryDto yg : ygQueryDto) {
			if (StringUtil.isEmpty(yg.getHeadUrl())) {
				yg.setHeadUrl("");
			}
		}
1587
		return ResultUtil.data(ygQueryDto);
tangzhaoqian committed
1588 1589 1590 1591 1592 1593 1594 1595 1596
	}

	/*************** 统计图 ***************/
	/**
	 * 查询统计图
	 * 
	 * @return 成功信息
	 */
	@GetMapping("/yggl")
1597
	@ApiOperation(value = "63.获取员工管理统计图信息", httpMethod = "GET", notes = "接口发布说明")
tangzhaoqian committed
1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630
	@ApiOperationSupport(order = 63)
	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());
		if (ygglCartogramDto2 != null) {
			map.put("avgAge", ygglCartogramDto2.getAvgAge());
		}
		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);

1631
		return ResultUtil.data(map);
tangzhaoqian committed
1632 1633 1634 1635 1636 1637 1638 1639
	}

	/**
	 * 员工信息统计图
	 * 
	 * @return 成功信息(weng)
	 */
	@GetMapping("/Cartogram")
1640 1641
	@ApiOperation(value = "64.获取员工管理统计图信息", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 64)
tangzhaoqian committed
1642 1643 1644
	public Result<YgCartogramDto> ygCartogram(@CurrentUser UserBean userBean) {
		Integer orgCode = userBean.getOrgCode();
		List<YgbintuDto> bintu = ygglMainEmpMapper.rsybp(orgCode);
1645

tangzhaoqian committed
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708
		Map<String, Long> gw = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getGw, Collectors.counting()));
		List<YgKVDto> gwList = new ArrayList<YgKVDto>();
		for (Map.Entry<String, Long> entry : gw.entrySet()) {
			gwList.add(new YgKVDto(entry.getKey(), entry.getValue().toString()));
		}
		Map<String, Long> bm = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getBm, Collectors.counting()));
		List<YgKVDto> bmList = new ArrayList<YgKVDto>();
		for (Map.Entry<String, Long> entry : bm.entrySet()) {
			bmList.add(new YgKVDto(entry.getKey(), entry.getValue().toString()));
		}
		Map<String, Long> edu = bintu.stream()
				.collect(Collectors.groupingBy(YgbintuDto::getEduname, Collectors.counting()));
		List<YgKVDto> eduList = new ArrayList<YgKVDto>();
		for (Map.Entry<String, Long> entry : edu.entrySet()) {
			eduList.add(new YgKVDto(entry.getKey(), entry.getValue().toString()));
		}
		Map<Integer, Long> jobStatus = bintu.stream()
				.collect(Collectors.groupingBy(YgbintuDto::getJobStatus, Collectors.counting()));
		List<YgKVDto> jobStatusList = new ArrayList<YgKVDto>();
		for (Entry<Integer, Long> entry : jobStatus.entrySet()) {
			jobStatusList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
		}
		Map<String, Long> proname = bintu.stream()
				.collect(Collectors.groupingBy(YgbintuDto::getProname, Collectors.counting()));
		List<YgKVDto> pronameList = new ArrayList<YgKVDto>();
		for (Entry<String, Long> entry : proname.entrySet()) {
			pronameList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
		}
		Map<String, Integer> workage = YgEnumInterface.workage.choose(bintu);
		List<YgKVDto> workageList = new ArrayList<YgKVDto>();
		for (Entry<String, Integer> entry : workage.entrySet()) {
			workageList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
		}
		Map<String, Integer> age = YgEnumInterface.age.choose(bintu);
		List<YgKVDto> ageList = new ArrayList<YgKVDto>();
		for (Entry<String, Integer> entry : age.entrySet()) {
			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 xinruzhi = workage.get("本月新入职").intValue();
		// 本月离职
		Integer lizhi = ygglMainEmpMapper.benyueLz(orgCode);
		// 本月转正
		Integer zhuanzhen = ygglMainEmpMapper.benyueZz(orgCode);
		// 平均年龄
		Integer nianlin = age.get("平均年龄").intValue();
		YgCartogramDto ybp = new YgCartogramDto();
		ybp.setOnTheJob(zaizhi);
		ybp.setNewRecruits(xinruzhi);
		ybp.setDimission(lizhi);
		ybp.setRegularization(zhuanzhen);
		ybp.setAverageAge(nianlin);

		ybp.setDepartment(bmList);
		ybp.setPosition(gwList);
		ybp.setEdu(eduList);
		ybp.setJobStatus(jobStatusList);
		ybp.setProname(pronameList);
		ybp.setWorkage(workageList);
		ybp.setAge(ageList);
1709
		return ResultUtil.data(ybp);
tangzhaoqian committed
1710 1711 1712 1713 1714 1715 1716 1717 1718
	}

	/**
	 * 获取员工社保公积金
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygsbgjj")
1719 1720
	@ApiOperation(value = "65.获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 65)
邓实川 committed
1721 1722
	public Result<YgglAttaSbgjj> selectygsbgjj(@CurrentUser UserBean userBean) {
		YgglAttaSbgjj ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectOne(
1723 1724
				new QueryWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getOrgCode, userBean.getOrgCode())
						.eq(YgglAttaSbgjj::getEmpNum, userBean.getEmpNum()));
1725
		return ResultUtil.data(ygglAttaSbgjj);
tangzhaoqian committed
1726 1727 1728 1729 1730 1731 1732 1733 1734
	}

	/**
	 * 获取员工社保公积金
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/ygsbgjj/{empNum}")
1735 1736
	@ApiOperation(value = "66.获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 66)
tangzhaoqian committed
1737 1738 1739
	public Result<YgglAttaSbgjj> selectygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {

		YgglAttaSbgjj ygglAttaSbgjj = YgglAttaSbgjj.builder().build()
1740
				.selectOne(new QueryWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getEmpNum, empNum));
tangzhaoqian committed
1741

1742
		return ResultUtil.data(ygglAttaSbgjj);
tangzhaoqian committed
1743 1744 1745 1746 1747 1748 1749 1750 1751
	}

	/**
	 * 添加/修改员工社保公积金
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/ygsbgjj")
1752 1753
	@ApiOperation(value = "67.添加/修改员工社保公积金", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 67)
tangzhaoqian committed
1754 1755 1756 1757 1758 1759
	public Result<YgglAttaSbgjj> addygsbgjj(@CurrentUser UserBean userBean, @RequestBody YgglAttaSbgjj ygglAttaSbgjj) {
		Integer empNum = ygglAttaSbgjj.getEmpNum();
		if (empNum == null) {
			return ResultUtil.error();
		}
		YgglAttaSbgjj AttaSbgjj = YgglAttaSbgjj.builder().build()
1760
				.selectOne(new QueryWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getEmpNum, empNum));
tangzhaoqian committed
1761
		if (AttaSbgjj != null) {
1762
			ygglAttaSbgjj.update(new UpdateWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getEmpNum, empNum));
tangzhaoqian committed
1763 1764 1765 1766
		} else {
			ygglAttaSbgjj.insert();
		}

1767
		return ResultUtil.data(ygglAttaSbgjj);
tangzhaoqian committed
1768 1769 1770 1771 1772 1773 1774 1775 1776
	}

	/**
	 * 删除员工社保公积金
	 * 
	 * @param
	 * @return
	 */
	@DeleteMapping(value = "/ygsbgjj/{id}")
1777 1778
	@ApiOperation(value = "68.删除员工社保公积金", httpMethod = "DELETE", notes = "接口发布说明")
	@ApiOperationSupport(order = 68)
tangzhaoqian committed
1779 1780
	public Result<Boolean> delygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer id) {
		Integer orgCode = userBean.getOrgCode();
1781 1782
		return ResultUtil.data(YgglAttaSbgjj.builder().build().delete(new QueryWrapper<YgglAttaSbgjj>().lambda()
				.eq(YgglAttaSbgjj::getOrgCode, orgCode).eq(YgglAttaSbgjj::getId, id)));
tangzhaoqian committed
1783 1784 1785 1786 1787 1788 1789
	}

	@GetMapping(value = "/sysRegion")
	@ApiOperation(value = "省市区字典(贼全)", httpMethod = "GET", notes = "接口发布说明")
	public Result<List<Tree<String>>> sysRegion() {
		List<SysRegion> nodeList = SysRegion.builder().build()
				.selectList(new LambdaQueryWrapper<SysRegion>().select(SysRegion::getKeyId, SysRegion::getRegionCode,
1790
						SysRegion::getRegionName, SysRegion::getMerName, SysRegion::getLevel, SysRegion::getZipCode));
tangzhaoqian committed
1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801

		// 配置
		TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
		// 自定义属性名 都要默认值的
		treeNodeConfig.setIdKey("key_id");
		treeNodeConfig.setParentIdKey("region_code");
		// 最大递归深度
		treeNodeConfig.setDeep(4);

		List<Tree<String>> treeNodes = TreeUtil.build(nodeList, "0", treeNodeConfig, (treeNode, tree) -> {
			tree.setId(treeNode.getKeyId().toString());
1802
			tree.setParentId(treeNode.getRegionCode().toString());
tangzhaoqian committed
1803 1804 1805
			tree.setName(treeNode.getRegionName());
			// 扩展属性 ...
			tree.putExtra("mer_name", treeNode.getMerName());
1806
			tree.putExtra("zip_code", treeNode.getZipCode());
tangzhaoqian committed
1807 1808
		});

1809
		return ResultUtil.data(treeNodes);
tangzhaoqian committed
1810
	}
1811

1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825
	/**
	 * 获取登录人的相关信息
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/loginmessage")
	@ApiOperation(value = "69.获取登录人的相关信息", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 69)
	public Result<LoginInfoDto> loginmessage(@CurrentUser UserBean userBean) {
		Integer empNum = userBean.getEmpNum();
		Integer orgCode = userBean.getOrgCode();
		LoginInfoDto loginInfo = LoginInfoDto.builder().build();
		YgglMainEmp ygglMainEmp = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
1826
				.select(YgglMainEmp::getBmgwId, YgglMainEmp::getName, YgglMainEmp::getRzTime, YgglMainEmp::getZzTime,YgglMainEmp::getSyq,
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848
						YgglMainEmp::getEmpNum)
				.eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
		if (ygglMainEmp != null) {
			Integer gw = ygglMainEmp.getBmgwId();

			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);
			}

			loginInfo.setEmpNum(ygglMainEmp.getEmpNum());
			loginInfo.setName(ygglMainEmp.getName());
			loginInfo.setGwId(gw);
			loginInfo.setGwName(gwObj != null ? gwObj.getName() : "");
			loginInfo.setEntryTime(ygglMainEmp.getRzTime());
yuquan.zhu committed
1849 1850
			
			if(ygglMainEmp.getSyq()!=null) {
ilal committed
1851
//				System.out.println(ygglMainEmp.getSyq());
yuquan.zhu committed
1852 1853 1854 1855 1856 1857
				Date expireDate = DateUtil.offsetMonth(ygglMainEmp.getRzTime(), ygglMainEmp.getSyq()); // 时间偏移
				loginInfo.setRegularTime(expireDate);	
			}else {
				loginInfo.setRegularTime(new Date());	
			}
			
1858
		}
1859
		return ResultUtil.data(loginInfo);
1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871
	}

	/**
	 * 获取登录人和上级主管的empNum和名称
	 * 
	 * @param
	 * @return
	 */
	@GetMapping(value = "/loginerChargers")
	@ApiOperation(value = "70.获取登录人和上级主管的empNum和名称", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 70)
	public Result<List<LoginerChargeDto>> loginerChargers(@CurrentUser UserBean userBean) {
ilal committed
1872 1873 1874
		
		List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
		
1875 1876 1877 1878
		Integer orgCode = userBean.getOrgCode();
		ArrayList<Integer> list = new ArrayList<Integer>();
		Integer empNum = userBean.getEmpNum();
		Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
ilal committed
1879
		if(gw != null && gw > 0) {
ilal committed
1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892
			ZzglBmgwM buid = ZzglBmgwM.builder().id(gw).build().selectById();
			
			List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
					.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).list();
			// 获取该员工的上级部门id 的数组list
			ZzglBmgwM.getUpDepts(list, buid.getUpId(), zzglBmgwMs);
			List<Integer> leaderList = new ArrayList<Integer>();
			for (Integer zzglId : list) {
				for (ZzglBmgwM zzglBmgwM : zzglBmgwMs) {
					if (zzglId.equals(zzglBmgwM.getId()) && zzglBmgwM.getLeader() != null) {

						leaderList.add(zzglBmgwM.getLeader());
					}
1893 1894
				}
			}
ilal committed
1895 1896
			List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList);
//			List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
ilal committed
1897 1898 1899
			
			for (Integer leaderId : leaderList) {
				for (YgglMainEmp m : ygglMainEmps) {
ilal committed
1900
					if(leaderId.equals(m.getEmpNum())) {
ilal committed
1901 1902 1903 1904 1905
						if (m.getHeadUrl() == null) {
							m.setHeadUrl(CommonEnum.NULL_STR.getDesc());
						}
						loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(), m.getName(), m.getHeadUrl()));
					}
ilal committed
1906
				}
ilal committed
1907
				
1908
			}
ilal committed
1909 1910
			
			
ilal committed
1911
			Collections.reverse(loginerChargeDtos);
ilal committed
1912 1913 1914 1915 1916
			if(loginerChargeDtos.size()>0) {
				if((userBean.getEmpNum()).equals(loginerChargeDtos.get(loginerChargeDtos.size()-1).getLeaderEmpNum())) {
					loginerChargeDtos.remove(loginerChargeDtos.size()-1);
				}
			}
ilal committed
1917
			return ResultUtil.data(loginerChargeDtos);
1918
		}
1919
		return ResultUtil.data(loginerChargeDtos);
ilal committed
1920
		
1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957
	}

	// 根据传来的empNum获取该人员信息,没有则传全部
	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>();
		if (empNumList.size() != 0) {
			for (Integer empNum : empNumList) {
				all.stream().filter(item -> empNum.equals(item.getEmpNum())).forEach(action -> {
					ygglMainEmps.add(action);
				});
			}
		} else {
			ygglMainEmps.addAll(all);
		}

		return ygglMainEmps;
	}

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

	/**
	 * 获取用户头像
	 * 
	 * @param
	 * @return
	 */
	@PostMapping(value = "/headphotos")
	@ApiOperation(value = "71.获取用户头像", httpMethod = "POST", notes = "接口发布说明")
	@ApiOperationSupport(order = 71)
	public Result<List<YgglMainEmp>> headphotos(@CurrentUser UserBean userBean, @RequestBody List<Integer> empNumList) {
tangzhaoqian committed
1958
		if (empNumList == null || empNumList.size() == 0) {
ilal committed
1959
			return ResultUtil.error("存在未设置的审批人");
1960 1961 1962 1963
		}
		List<YgglMainEmp> yglList = YgglMainEmp.builder().build()
				.selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
						.in(YgglMainEmp::getEmpNum, empNumList)
ilal committed
1964
						.select(YgglMainEmp::getId,YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getHeadUrl).orderByDesc(YgglMainEmp::getId));
1965 1966
		for (YgglMainEmp yg : yglList) {
			if (StringUtil.isEmpty(yg.getHeadUrl())) {
1967
				yg.setHeadUrl(CommonEnum.NULL_STR.getDesc());
1968 1969
			}
		}
1970
		return ResultUtil.data(yglList);
1971
	}
lal committed
1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986
	
	
	@Autowired
	private KqglAssoLeaveBalanceMapper kqglassoleavebalancemapper;
	
	@GetMapping(value = "/address_book")
	@ApiOperation(value = "APP 获取通讯录", httpMethod = "GET", notes = "接口发布说明")
	@ApiOperationSupport(order = 70)
	public Result<Object> Getaddressbook(@CurrentUser UserBean userBean) {
		
		List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(userBean.getOrgCode());
		
		return ResultUtil.data(userlist);
	}
	
ilal committed
1987 1988 1989 1990 1991 1992 1993 1994
	
	@PostMapping(value = "/modify_avatar")
	@ApiOperation(value = "APP_修改头像", httpMethod = "POST", notes = "接口发布说明")
	public Result<YgglAttaSbgjj> Modify_Avatar(@CurrentUser UserBean userBean, @RequestBody ModifyAvatarDto modifyavatardto) {
		
		YgglMainEmp.builder().headUrl(modifyavatardto.getAvatar_path()).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
				.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum()));
		
ilal committed
1995 1996 1997
		QyzxEmpLogin.builder().headUrl(modifyavatardto.getAvatar_path()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode())
				.eq(QyzxEmpLogin::getPhone, userBean.getQyzxEmpLogin().getPhone()));
		
ilal committed
1998 1999 2000
		return ResultUtil.success("上传成功");
	}
	
ilal committed
2001 2002 2003 2004
	@PostMapping(value = "/new_account")
	@ApiOperation(value = "修改账号", httpMethod = "POST", notes = "接口发布说明")
	public Result<Object> New_account(@CurrentUser UserBean userBean, @RequestBody UserInfo userinfo) {
		
lal committed
2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
		YgglMainEmp sjhpd = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getPhone, userinfo.getPhone())
				.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
		if(sjhpd == null) {
			YgglMainEmp.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, userinfo.getName()).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
			
			QyzxEmpLogin.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId,userinfo.getName()).eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()));
			
			return ResultUtil.success("修改成功");
		}else {
			return ResultUtil.error("该号码已存在");
		}
ilal committed
2016 2017
		
	}
ilal committed
2018 2019
	
	
tangzhaoqian committed
2020
}