| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | //import com.stylefeng.guns.modular.system.util.bank.BankUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.DeleteStafNodeRequest; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.QYTUserInfo; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.SaveStaffNode; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.SaveStaffNodeRequest; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private AccountChangeDetailMapper accountChangeDetailMapper; |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | @Autowired |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService companyService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | @RequestMapping(value = "/auditSubmit") |
| | | @ResponseBody |
| | | public Object auditSubmit(Integer id,Integer approvalStatus,String approvalNotes) { |
| | | ShiroUser user1 = shiroExtUtil.getUser(); |
| | | User user2 = userService.selectById(user1.getId()); |
| | | TDriver tDriver = tDriverService.selectById(id); |
| | | |
| | | |
| | | |
| | | tDriver.setApprovalStatus(approvalStatus); |
| | | tDriver.setApprovalNotes(approvalNotes); |
| | | // 审核用户id |
| | |
| | | tDriver.setApprovalUserId(shiroUser.getId()); |
| | | tDriver.setApprovalTime(new Date()); |
| | | if (approvalStatus==2){ |
| | | // T21000001Response t21000001Response = BankUtil.addAccount(tDriver); |
| | | // tDriver.setMerchantNumber(t21000001Response.getDATA().getUSER_ID()); |
| | | //审核通过,在中台添加司机账号 |
| | | Integer objectId = tDriver.getBranchOfficeId(); |
| | | TCompany tCompany = companyService.selectById(objectId); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(user2.getPhone()); |
| | | request.setEntercode(tCompany.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.setEmpId(empId); |
| | | tDriver.setEntercode(tCompany.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany.getEnterCode())); |
| | | tDriver.setEmpnew(empnew); |
| | | } |
| | | tDriverService.updateById(tDriver); |
| | | |
| | |
| | | accountChangeDetailMapper.insert(accountChangeDetail); |
| | | tDriverService.updateById(tDriver1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | if(count>0){ |
| | | return new SuccessTip(500,"该司机已存在!"); |
| | | } |
| | | if(ToolUtil.isEmpty(tDriver.getIdcard())){ |
| | | return "身份证号不能为空"; |
| | | } |
| | | Boolean b = UserUtil.idCardAuth(tDriver.getName(), tDriver.getIdcard()); |
| | | if(!b){ |
| | | return "司机姓名和身份证号不匹配"; |
| | | } |
| | | Object o = tDriverService.addOrUpdate(tDriver); |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | |
| | | 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(); |
| | | TCompany tCompany = companyService.selectById(objectId); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(user2.getPhone()); |
| | | request.setEntercode(tCompany.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; |
| | | } |
| | | |
| | | TCompany tCompany1 = companyService.selectById(tDriver.getBranchOfficeId()); |
| | | tDriver.setEmpId(empId); |
| | | tDriver.setEntercode(tCompany1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | tDriver.setEmpnew(empnew); |
| | | } |
| | | |
| | | |
| | | tDriverService.insert(tDriver); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tDriverId) { |
| | | TDriver driver = tDriverService.selectById(tDriverId); |
| | | |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | TCompany tCompany = companyService.selectById(user.getObjectId()); |
| | | if (null != driver.getEmpId() && 1 == driver.getEmpnew()) { |
| | | //中台先删除司机 |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), tCompany.getEnterCode()); |
| | | if (null != userInfoByPhone && 0 < userInfoByPhone.size() && 1 == driver.getEmpnew()) { |
| | | DeleteStafNodeRequest deleteStafNodeRequest = new DeleteStafNodeRequest(); |
| | | deleteStafNodeRequest.setEmpId(driver.getEmpId()); |
| | | deleteStafNodeRequest.setEntercode(tCompany.getEnterCode()); |
| | | deleteStafNodeRequest.setMobile(tCompany.getPrincipalPhone()); |
| | | ResultUtil resultUtil = EmployeeUtil.ecrmDeleteStafNode(deleteStafNodeRequest); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | } |
| | | } |
| | | tDriverService.deleteById(tDriverId); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | if(Objects.nonNull(driver) && !tDriver.getId().equals(driver.getId())){ |
| | | return new SuccessTip(500,"该司机已存在!"); |
| | | } |
| | | // Object ocr = ocr("E:\\071bf986db0b00355c0ed190bbd3b16.png"); |
| | | // System.err.println(ocr); |
| | | if(ToolUtil.isEmpty(tDriver.getIdcard())){ |
| | | return "身份证号不能为空"; |
| | | } |
| | | Boolean b = UserUtil.idCardAuth(tDriver.getName(), tDriver.getIdcard()); |
| | | if(!b){ |
| | | return "司机姓名和身份证号不匹配"; |
| | | } |
| | | Object o = tDriverService.addOrUpdate(tDriver); |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "导出司机佣金列表",notes="导出司机佣金列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |