| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.core.util.WoUtil; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.system.controller.util.Base64Util; |
| | | import com.stylefeng.guns.modular.system.dao.DriverPunishMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverTrainMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.ExcelExportUtil; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.poi.hdf.extractor.TC; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ITLineService itLineService; |
| | | |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | |
| | | @Resource |
| | | private DriverTrainMapper driverTrainMapper; |
| | | |
| | | |
| | | @Resource |
| | | private DriverPunishMapper driverPunishMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | @Autowired |
| | | private ITDriverServiceService itDriverServiceService; |
| | | |
| | | @Autowired |
| | | private ITComplaintService tComplaintService; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | /** |
| | | * 跳转投诉页面 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("complaint") |
| | | public String complaint(Model model,Integer driverId) { |
| | | |
| | | model.addAttribute("id",driverId); |
| | | public String complaint(Model model, Integer driverId) { |
| | | |
| | | model.addAttribute("id", driverId); |
| | | return PREFIX + "tComplaint.html"; |
| | | } |
| | | |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tComplaintService.getComplaintList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,userName,userPhone,driverPhone,isHandle,driverId)); |
| | | page.setRecords(tComplaintService.getComplaintList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, userName, userPhone, driverPhone, isHandle, driverId)); |
| | | return super.packForBT(page); |
| | | } |
| | | /** |
| | |
| | | @RequestMapping("/tDriver_add") |
| | | public String tDriverAdd(Model model) { |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); |
| | | model.addAttribute("companyList",companyList); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | if (2 == roleType){ |
| | | model.addAttribute("companyList", companyList); |
| | | |
| | | Integer roleType = ShiroExtUtil.getUser().getRoleType(); |
| | | model.addAttribute("roleType", roleType); |
| | | if (2 == roleType) { |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>() |
| | | .eq("type", 3) |
| | | .eq("superiorId",ShiroKit.getUser().getObjectId()) |
| | | .notIn("state",1) |
| | | .notIn("flag",3)); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else{ |
| | | model.addAttribute("franchiseeList",null); |
| | | .eq("superiorId", ShiroExtUtil.getUser().getObjectId()) |
| | | .notIn("state", 1) |
| | | .notIn("flag", 3)); |
| | | model.addAttribute("franchiseeList", franchiseeList); |
| | | } else { |
| | | model.addAttribute("franchiseeList", null); |
| | | } |
| | | //查询当前用户所属分公司/加盟商 |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); |
| | | |
| | | //查询线路列表 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); |
| | |
| | | @RequestMapping("/tDriver_update/{tDriverId}") |
| | | public String tDriverUpdate(@PathVariable Integer tDriverId, Model model) { |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | model.addAttribute("item", tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | if (1 == roleType){ |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).ne("flag",3)); |
| | | model.addAttribute("companyList",companyList); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",tDriver.getCompanyId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else if (2 == roleType){ |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | |
| | | Integer roleType = ShiroExtUtil.getUser().getRoleType(); |
| | | model.addAttribute("roleType", roleType); |
| | | model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); |
| | | |
| | | if (1 == roleType) { |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).ne("flag", 3)); |
| | | model.addAttribute("companyList", companyList); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", tDriver.getCompanyId())); |
| | | model.addAttribute("franchiseeList", franchiseeList); |
| | | } else if (2 == roleType) { |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", ShiroExtUtil.getUser().getObjectId())); |
| | | model.addAttribute("franchiseeList", franchiseeList); |
| | | } |
| | | |
| | | //查询平台ID |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | if (ShiroExtUtil.getUser().getRoleType() != 1) { |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tDriverService.getAuthDriverList(page,beginTime,endTime,companyName,phone,account,addType,authState)); |
| | | } else { |
| | | page.setRecords(tDriverService.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tDriverService.getDriverList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,companyName,phone,name,addType,authState)); |
| | | page.setRecords(tDriverService.getDriverList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, companyName, phone, name, addType, authState)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | }*/ |
| | | //2020-08-21:新需求,已被绑定的车辆可以被继续绑定 |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tDriverService.getCanSelectCarList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),null,carLicensePlate,brandName,modelName,color,serverStr)); |
| | | page.setRecords(tDriverService.getCanSelectCarList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), null, carLicensePlate, brandName, modelName, color, serverStr)); |
| | | return super.packForBT(page); |
| | | |
| | | } |
| | |
| | | if (1 == authState){ |
| | | type = 5; |
| | | tDriver.setAuthState(2); |
| | | |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | if (pushMinistryOfTransport) {//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(id); |
| | | pushMinistryOfTransportUtil.baseInfoDriverApp(id); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | } else { |
| | | type = 6; |
| | | tDriver.setAuthState(4); |
| | | } |
| | | |
| | | Map<String,String> map = new HashMap<>(); |
| | | |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("uid", String.valueOf(tDriver.getId())); |
| | | map.put("type", String.valueOf(type)); |
| | | String result = HttpRequestUtil.postRequest(PushURL.driver_auth_url, map); |
| | | System.out.println("司机注册审核发送短信 :【driverId="+tDriver.getId().toString()+"】,调用接口:"+result); |
| | | |
| | | System.out.println("司机注册审核发送短信 :【driverId=" + tDriver.getId().toString() + "】,调用接口:" + result); |
| | | //审核通过,在中台添加司机账号 |
| | | if (2 == tDriver.getAuthState()) { |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | Integer objectId = user.getObjectId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | User user1 = userService.selectById(user.getId()); |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(user1.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("qyt@qyt.com"); |
| | | request.setDeptId(0); |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); |
| | | TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); |
| | | tDriver.setEmpId(saveStaffNode.getEmpId()); |
| | | tDriver.setEntercode(tCompany1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | } |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | |
| | | tDriver.setAddType(2); |
| | | tDriver.setIsPlatCar(1); |
| | | tDriver.setAuthState(2); |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | }else if (2 == roleType) { //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tDriver.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | if (SinataUtil.isNotEmpty(franchiseeId)) { |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | tDriver.setAddType(3); |
| | | tDriver.setIsPlatCar(2); |
| | | tDriver.setAuthState(1); |
| | | tDriver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tDriver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | }else if (3 == roleType) { //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)) { |
| | | tDriver.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tDriver.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | tDriver.setAddType(4); |
| | | tDriver.setIsPlatCar(2); |
| | | tDriver.setAuthState(1); |
| | | tDriver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | tDriver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | tDriver.setInsertTime(new Date()); |
| | | tDriver.setInsertUser(ShiroKit.getUser().getId()); |
| | | tDriver.setInsertUser(ShiroExtUtil.getUser().getId()); |
| | | // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); |
| | | |
| | | |
| | | tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); |
| | | |
| | | //审核通过,在中台添加司机账号 |
| | | if (2 == tDriver.getAuthState()) { |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | Integer objectId = user.getObjectId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | User user1 = userService.selectById(user.getId()); |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(user1.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("qyt@qyt.com"); |
| | | request.setDeptId(0); |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); |
| | | TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); |
| | | tDriver.setEmpId(saveStaffNode.getEmpId()); |
| | | tDriver.setEntercode(tCompany1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | } |
| | | tDriverService.insert(tDriver); |
| | | |
| | | |
| | | //添加经营业务 |
| | | String[] serverArray = serverBox.split(","); |
| | | for (int i=0;i<serverArray.length;i++){ |
| | | for (int i = 0; i < serverArray.length; i++) { |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(tDriver.getId()); |
| | | service.setType(Integer.valueOf(serverArray[i])); |
| | | tDriverServiceService.insert(service); |
| | | |
| | | if (3 == Integer.valueOf(serverArray[i])){ |
| | | |
| | | if (3 == Integer.valueOf(serverArray[i])) { |
| | | //添加线路 |
| | | if (SinataUtil.isNotEmpty(lineStr)){ |
| | | addLine(lineStr,tDriver.getId()); |
| | | if (SinataUtil.isNotEmpty(lineStr)) { |
| | | addLine(lineStr, tDriver.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | public Object delete(@RequestParam Integer tDriverId) { |
| | | TDriver driver = tDriverService.selectById(tDriverId); |
| | | driver.setFlag("3"); |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | User user1 = userService.selectById(user.getId()); |
| | | TCompany tCompany = itCompanyService.selectById(user.getObjectId()); |
| | | //中台先删除司机 |
| | | GetStaffNodeRequest request = new GetStaffNodeRequest(); |
| | | request.setEmpId(driver.getEmpId()); |
| | | request.setMobile(user1.getPhone()); |
| | | request.setEntercode(tCompany.getEnterCode()); |
| | | StaffNodeInfo staffNode = EmployeeUtil.getStaffNode(request); |
| | | if ("1".equals(staffNode.getIsValid())) { |
| | | DeleteStafNodeRequest deleteStafNodeRequest = new DeleteStafNodeRequest(); |
| | | deleteStafNodeRequest.setEmpId(driver.getEmpId()); |
| | | deleteStafNodeRequest.setEntercode(tCompany.getEnterCode()); |
| | | deleteStafNodeRequest.setMobile(user1.getPhone()); |
| | | EmployeeUtil.ecrmDeleteStafNode(deleteStafNodeRequest); |
| | | } |
| | | tDriverService.updateById(driver); |
| | | String value = redisUtil.getValue("DRIVER_" + driver.getPhone()); |
| | | redisUtil.remove(value); |
| | | redisUtil.remove("DRIVER_" + driver.getId()); |
| | | redisUtil.remove("DRIVER_" + driver.getPhone()); |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER_" + driver.getPhone()); |
| | | redisTemplate.delete(value); |
| | | redisTemplate.delete("DRIVER_" + driver.getId()); |
| | | redisTemplate.delete("DRIVER_" + driver.getPhone()); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | if (pushMinistryOfTransport) {//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(driverId); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | String value = redisUtil.getValue("DRIVER_" + tDriver.getPhone()); |
| | | redisUtil.remove(value); |
| | | redisUtil.remove("DRIVER_" + tDriver.getId()); |
| | | redisUtil.remove("DRIVER_" + tDriver.getPhone()); |
| | | |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER_" + tDriver.getPhone()); |
| | | redisTemplate.delete(value); |
| | | redisTemplate.delete("DRIVER_" + tDriver.getId()); |
| | | redisTemplate.delete("DRIVER_" + tDriver.getPhone()); |
| | | } |
| | | tDriver.setRemark(remark); |
| | | //审核通过,在中台添加司机账号 |
| | | if (2 == tDriver.getAuthState()) { |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | Integer objectId = user.getObjectId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | User user1 = userService.selectById(user.getId()); |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(user1.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("qyt@qyt.com"); |
| | | request.setDeptId(0); |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); |
| | | TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); |
| | | tDriver.setEmpId(saveStaffNode.getEmpId()); |
| | | tDriver.setEntercode(tCompany1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | } |
| | | |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | |
| | | tDriver.setCompanyId(company.getId()); |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | }else if (2 == roleType) { //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tDriver.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | if (SinataUtil.isNotEmpty(franchiseeId)) { |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | }else if (3 == roleType) { //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)) { |
| | | tDriver.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tDriver.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | } |
| | | tDriver.setUpdateTime(new Date()); |
| | | tDriver.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tDriver.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); |
| | | if(ToolUtil.isEmpty(tDriver.getPassword())){ |
| | | tDriver.setPassword(obj.getPassword()); |
| | |
| | | obj.setEmergencyContactPhone(tDriver.getEmergencyContactPhone()); |
| | | obj.setEmergencyContactAddress(tDriver.getEmergencyContactAddress()); |
| | | obj.setUpdateTime(new Date()); |
| | | obj.setUpdateUser(ShiroKit.getUser().getId()); |
| | | obj.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | tDriverService.updateAllColumnById(obj); |
| | | |
| | | //删除业务 |
| | |
| | | |
| | | // 首行【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | if (ShiroExtUtil.getUser().getRoleType() == 1) { |
| | | title = "平台导入司机模板"; |
| | | |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("所属机构[平台司机/加盟司机]"); |
| | | shellList.add("所属分公司[提示:加盟司机选填]"); |
| | |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 2) { |
| | | title = "分公司导入司机模板"; |
| | | |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("所属加盟商[选填]"); |
| | | shellList.add("性别[男/女]"); |
| | |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 3) { |
| | | title = "加盟商导入司机模板"; |
| | | |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("驾驶证号码"); |
| | |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | try { |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | if (ShiroExtUtil.getUser().getRoleType() == 1) { |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | if (SinataUtil.isNotEmpty(cell0)) { |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | |
| | | driver.setState(2); |
| | | driver.setAuthState(2); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertUser(ShiroExtUtil.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(2); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if(SinataUtil.isNotEmpty(eight)){ |
| | | driver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(eight)) { |
| | | driver.setDriverAddress(eight); |
| | | } |
| | | |
| | | //审核通过,在中台添加司机账号 |
| | | if (2 == driver.getAuthState()) { |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | Integer objectId = user.getObjectId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | User user1 = userService.selectById(user.getId()); |
| | | SaveStaffNodeRequest saveStaffNodeRequest = new SaveStaffNodeRequest(); |
| | | saveStaffNodeRequest.setMobile(user1.getPhone()); |
| | | saveStaffNodeRequest.setEntercode(tCompany.getEnterCode()); |
| | | saveStaffNodeRequest.setEmpName(driver.getName()); |
| | | saveStaffNodeRequest.setEmpNickname(driver.getName()); |
| | | saveStaffNodeRequest.setLoginNo(driver.getPhone()); |
| | | saveStaffNodeRequest.setEmpSex(driver.getSex() == 1 ? "男" : "女"); |
| | | saveStaffNodeRequest.setMphone(driver.getPhone()); |
| | | saveStaffNodeRequest.setEmail("qyt@qyt.com"); |
| | | saveStaffNodeRequest.setDeptId(0); |
| | | saveStaffNodeRequest.setPositionId(1); |
| | | saveStaffNodeRequest.setSuperLevel(0); |
| | | saveStaffNodeRequest.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(saveStaffNodeRequest); |
| | | TCompany tCompany1 = itCompanyService.selectById(driver.getCompanyId()); |
| | | driver.setEmpId(saveStaffNode.getEmpId()); |
| | | driver.setEntercode(tCompany1.getEnterCode()); |
| | | driver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | |
| | | |
| | | |
| | | //添加快车服务模式 |
| | | if ("是".equals(eleven)){ |
| | | if ("是".equals(eleven)) { |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(sixteen)){ |
| | | if ("是".equals(sixteen)) { |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | |
| | | } |
| | | } |
| | | } |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 2) { |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | if (SinataUtil.isNotEmpty(cell0)) { |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //查找平台公司 |
| | | Integer companyId = ShiroKit.getUser().getObjectId(); |
| | | Integer companyId = ShiroExtUtil.getUser().getObjectId(); |
| | | Integer franchiseeId = 0; |
| | | //判断所属分公司是否存在 |
| | | if (SinataUtil.isNotEmpty(one)){ |
| | |
| | | driver.setState(1); |
| | | driver.setAuthState(1); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertUser(ShiroExtUtil.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(3); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | driver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(six)){ |
| | | driver.setDriverAddress(six); |
| | | } |
| | |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(fourteen)){ |
| | | if ("是".equals(fourteen)) { |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 3) { |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | if (SinataUtil.isNotEmpty(cell0)) { |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | |
| | | //查找平台公司 |
| | | Integer companyId = 0; |
| | | Integer franchiseeId = 0; |
| | | TCompany franchisee = itCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | TCompany franchisee = itCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | companyId = franchisee.getSuperiorId(); |
| | | franchiseeId = franchisee.getId(); |
| | |
| | | driver.setState(1); |
| | | driver.setAuthState(1); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertUser(ShiroExtUtil.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(4); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | driver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(five)){ |
| | | driver.setDriverAddress(five); |
| | | } |
| | |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | @Autowired |
| | | private ITDriverServiceService itDriverServiceService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 验证是否可以字符转为整数 |
| | | * @param str |
| | |
| | | */ |
| | | @RequestMapping(value = "/outDriver") |
| | | public void outDriver(HttpServletRequest request, HttpServletResponse response) { |
| | | List<Map<String,Object>> listMap = tDriverService.getDriverListNoPage(ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId()); |
| | | List<Map<String, Object>> listMap = tDriverService.getDriverListNoPage(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId()); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |
| | |
| | | income.setInsertTime(new Date()); |
| | | incomeService.insert(income); |
| | | |
| | | String allocationReq = createAllocationReq(1, tDriver.getId(), 2, complaintDeductmoney.getMoney().doubleValue()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ITEnterpriseWithdrawalService tEnterpriseWithdrawalService; |
| | | @Autowired |
| | | private IUserWithdrawalService userWithdrawalService; |
| | | |
| | | public String createAllocationReq(Integer companyId,Integer userId,int type,double money){ |
| | | List<TEnterpriseWithdrawal> tEnterpriseWithdrawals = tEnterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", companyId)); |
| | | TDriver tUser = tDriverService.selectById(userId); |
| | | List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("phone", tUser.getPhone())); |
| | | if(userWithdrawals.size()==0){ |
| | | return "error"; |
| | | } |
| | | |
| | | AllocationReq allocationReq= new AllocationReq(); |
| | | allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | if(type==1){ |
| | | |
| | | allocationReq.setPayBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setRecvBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | |
| | | allocationReq.setPassword(Base64Util.decode(tEnterpriseWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | }else { |
| | | allocationReq.setRecvBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setPayBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setPassword(Base64Util.decode(userWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | } |
| | | money=money*100; |
| | | allocationReq.setAmount((int)money); |
| | | allocationReq.setProductName("分账"); |
| | | allocationReq.setProductCount(1); |
| | | allocationReq.setOrderNo(ToolUtil.getRandomString(32)); |
| | | allocationReq.setOrderAmount(1l); |
| | | try { |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.out.println(allocationResp); |
| | | return "ok"; |
| | | } catch (UpyztException e) { |
| | | e.printStackTrace(); |
| | | return e.getMessage(); |
| | | } |
| | | |
| | | } |
| | | } |