| | |
| | | |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springblade.common.utils.DesensitizedUtil; |
| | | import org.springblade.common.utils.InvestigateUtil; |
| | | import org.springblade.modules.experience.entity.Experience; |
| | | import org.springblade.modules.experience.service.IExperienceService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private IDeptService iDeptService; |
| | | |
| | | @Autowired |
| | | private IExperienceService experienceService; |
| | | |
| | | /** |
| | | * FTP |
| | |
| | | */ |
| | | @Async |
| | | public void checkUserExamineByCardNo(User user0){ |
| | | User byId = userService.getById(user0.getId()); |
| | | //如果是保安员 |
| | | if (user0.getRoleId().equals("1412226235153731586")){ |
| | | //读取身份证号 |
| | | String cardid = user0.getCardid(); |
| | | //创建用户对象 |
| | | User user = new User(); |
| | | user.setId(user.getId()); |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 异步新增用户从业记录 |
| | | * @param user |
| | | */ |
| | | @Async |
| | | public void insertExperience(User user) { |
| | | //根据公司名查询单位 |
| | | Dept dept = iDeptService.getById(user.getDeptId()); |
| | | Experience experience = new Experience(); |
| | | experience.setCompanyname(dept.getDeptName()); |
| | | //新增 |
| | | if (null != user.getRtime()) { |
| | | experience.setEntrytime(user.getRtime()); |
| | | } else { |
| | | experience.setEntrytime(new Date()); |
| | | } |
| | | experience.setDeparturetime(new Date()); |
| | | experience.setName(user.getRealName()); |
| | | if (null != user.getReasonForLeav() && !user.getReasonForLeav().equals("")) { |
| | | experience.setLeaving(user.getReasonForLeav()); |
| | | } |
| | | experience.setCardid(user.getCardid()); |
| | | experience.setSecurityid(user.getId().toString()); |
| | | //新增 |
| | | experienceService.save(experience); |
| | | |
| | | // 身份证号脱敏 |
| | | String cardid = DesensitizedUtil.desensitizedIdNumberBy4(user.getCardid()); |
| | | //内网同步 |
| | | String s = "insert into sys_experience(id,name,entryTime,departureTime,leaving,cardId,companyname,securityId) " + |
| | | "values(" + "'" + experience.getId() + "'" + |
| | | "," + "'" + experience.getName() + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getDeparturetime()) + "'" + |
| | | "," + "'" + experience.getLeaving() + "'" + |
| | | "," + "'" + cardid + "'" + |
| | | "," + "'" + experience.getCompanyname() + "'" + |
| | | "," + "'" + experience.getSecurityid() + "'" |
| | | + ")"; |
| | | //向外网推送 |
| | | FTP(s); |
| | | } |
| | | } |