| | |
| | | tDriver.setBalance(BigDecimal.ZERO); |
| | | tDriver.setBackgroundBalance(BigDecimal.ZERO); |
| | | tDriver.setCommission(BigDecimal.ZERO); |
| | | if(2 == tDriver.getApprovalStatus()){ |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | User user2 = userService.selectById(user.getId()); |
| | | Integer objectId = user.getObjectId(); |
| | | TBranchOffice tBranchOffice = branchOfficeService.selectById(objectId); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tBranchOffice.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(user2.getPhone()); |
| | | request.setEntercode(tBranchOffice.getEnterCode()); |
| | | request.setEmpName(tDriver.getName()); |
| | | request.setEmpNickname(tDriver.getName()); |
| | | request.setLoginNo(tDriver.getPhone()); |
| | | request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); |
| | | request.setMphone(tDriver.getPhone()); |
| | | request.setEmail(tDriver.getPhone() + "@qyt.com"); |
| | | request.setDeptId(0); |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | ResultUtil<SaveStaffNode> resultUtil = EmployeeUtil.saveStaffNode(request); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | SaveStaffNode saveStaffNode = resultUtil.getData(); |
| | | empId = saveStaffNode.getEmpId(); |
| | | empnew = 1; |
| | | }else{ |
| | | empId = userInfoByPhone.get(0).getEmpId(); |
| | | empnew = 0; |
| | | } |
| | | tDriver.setApprovalStatus(2); |
| | | |
| | | TBranchOffice tBranchOffice1 = branchOfficeService.selectById(tDriver.getBranchOfficeId()); |
| | | tDriver.setEmpId(empId); |
| | | tDriver.setEntercode(tBranchOffice1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tBranchOffice1.getEnterCode())); |
| | | tDriver.setEmpnew(empnew); |
| | | TBranchOffice tBranchOffice = branchOfficeService.selectById(tDriver.getBranchOfficeId()); |
| | | User user2 = userService.selectById(tBranchOffice.getSysUserId()); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tBranchOffice.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(user2.getPhone()); |
| | | request.setEntercode(tBranchOffice.getEnterCode()); |
| | | request.setEmpName(tDriver.getName()); |
| | | request.setEmpNickname(tDriver.getName()); |
| | | request.setLoginNo(tDriver.getPhone()); |
| | | request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); |
| | | request.setMphone(tDriver.getPhone()); |
| | | request.setEmail(tDriver.getPhone() + "@qyt.com"); |
| | | request.setDeptId(0); |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | ResultUtil<SaveStaffNode> resultUtil = EmployeeUtil.saveStaffNode(request); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | SaveStaffNode saveStaffNode = resultUtil.getData(); |
| | | empId = saveStaffNode.getEmpId(); |
| | | empnew = 1; |
| | | }else{ |
| | | empId = userInfoByPhone.get(0).getEmpId(); |
| | | empnew = 0; |
| | | } |
| | | |
| | | TBranchOffice tBranchOffice1 = branchOfficeService.selectById(tDriver.getBranchOfficeId()); |
| | | tDriver.setEmpId(empId); |
| | | tDriver.setEntercode(tBranchOffice1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tBranchOffice1.getEnterCode())); |
| | | tDriver.setEmpnew(empnew); |
| | | |
| | | tDriverService.insert(tDriver); |
| | | return SUCCESS_TIP; |
| | |
| | | if(!b){ |
| | | return "司机姓名和身份证号不匹配"; |
| | | } |
| | | Object o = tDriverService.addOrUpdate(tDriver); |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | | } |
| | | // Object o = tDriverService.addOrUpdate(tDriver); |
| | | // if(Objects.nonNull(o)){ |
| | | // return o; |
| | | // } |
| | | tDriver.setName(tDriver.getName().replace(" ","")); |
| | | tDriver.setEmergencyContact(tDriver.getEmergencyContact().replace(" ","")); |
| | | tDriverService.updateById(tDriver); |